:root {
  --bg: #0b0d12;
  --panel: #171a21;
  --panel-2: #20242d;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f4f5f7;
  --muted: #a8afbd;
  --soft: #6f7887;
  --yellow: #facc15;
  --orange: #fb923c;
  --blue: #38bdf8;
  --green: #22c55e;
  --red: #ef4444;
  --violet: #a78bfa;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(56, 189, 248, 0.13), transparent 24rem),
    radial-gradient(circle at 88% 18%, rgba(250, 204, 21, 0.12), transparent 22rem),
    linear-gradient(145deg, #08090d 0%, #111827 46%, #141019 100%);
  font-family: "Noto Sans KR", system-ui, sans-serif;
  overflow-x: hidden;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
  background: linear-gradient(180deg, rgba(11, 13, 18, 0.92), rgba(11, 13, 18, 0.66));
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  background: transparent;
  border: 0;
  font-family: "Black Han Sans", sans-serif;
  font-size: 20px;
  letter-spacing: 2px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  color: #101010;
  background: var(--yellow);
  border-radius: 7px;
  letter-spacing: 0;
}

.public-nav,
.app-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.public-nav button,
.app-nav button,
.side-panel button,
.logout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 800;
}

.app-nav button.active,
.side-panel button.active {
  color: #08090d;
  background: var(--yellow);
  border-color: transparent;
}

.view {
  min-height: calc(100vh - 76px);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 44px;
  align-items: center;
  padding: 42px 0 40px;
}

.hero-copy {
  padding-left: 8px;
}

.eyebrow,
.page-title span {
  display: inline-flex;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
  font-family: "Black Han Sans", sans-serif;
  font-weight: 400;
  letter-spacing: 0;
}

h1 {
  margin-top: 18px;
  font-size: clamp(54px, 7vw, 92px);
  line-height: 0.95;
}

h1 span {
  display: block;
}

h1 span:last-child {
  color: var(--yellow);
}

.hero-copy p {
  max-width: 650px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.primary-action,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
}

.primary-action {
  color: #090909;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  border: 0;
  box-shadow: 0 10px 34px rgba(250, 204, 21, 0.22);
}

.secondary-action {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.full {
  width: 100%;
}

.auth-panel,
.side-panel,
.workspace,
.landing-band article,
.flow-section li,
.metric-grid article,
.clue-card,
.permission-card,
.create-form,
.profile-form {
  background: rgba(23, 26, 33, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.auth-panel {
  padding: 20px;
}

.panel-head {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.panel-head span {
  color: var(--yellow);
  font-family: "Black Han Sans", sans-serif;
  font-size: 22px;
  letter-spacing: 3px;
}

.panel-head strong {
  font-size: 24px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tab {
  height: 38px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-weight: 900;
}

.tab.active {
  color: #08090d;
  background: var(--yellow);
}

.auth-form,
.create-form,
.profile-form {
  display: grid;
  gap: 14px;
}

.create-form,
.profile-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 18px;
}

.field {
  display: grid;
  gap: 7px;
}

.field span:first-child {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  outline: 0;
  padding: 0 13px;
}

.field input,
.field select {
  height: 48px;
}

.field textarea {
  min-height: 128px;
  padding-top: 12px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: rgba(250, 204, 21, 0.62);
}

.wide {
  grid-column: 1 / -1;
}

.signup-only {
  display: none;
}

.signup-mode .signup-only {
  display: grid;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 58px;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 12px;
  font-weight: 800;
}

.auth-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0;
}

.auth-links button {
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 13px;
}

.auth-links span {
  width: 1px;
  height: 12px;
  background: var(--line);
}

.social-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.social-row button {
  height: 44px;
  border: 0;
  border-radius: 8px;
  font-weight: 900;
}

.social-row button:nth-child(1) {
  color: #111;
  background: #fae100;
}

.social-row button:nth-child(2) {
  color: #fff;
  background: #03c75a;
}

.social-row button:nth-child(3) {
  color: #111;
  background: #fff;
}

.auth-note,
.auth-message {
  color: var(--soft);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.auth-message {
  min-height: 20px;
}

.auth-message.success {
  color: var(--green);
}

.auth-message.error {
  color: var(--red);
}

.landing-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 10px 0 56px;
}

.landing-band article {
  display: grid;
  gap: 8px;
  padding: 18px;
}

.landing-band strong {
  color: var(--yellow);
  font-size: 18px;
}

.landing-band span,
.flow-section em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.55;
}

.flow-section {
  padding: 28px 0 70px;
}

.flow-section h2 {
  margin-bottom: 18px;
  font-size: clamp(32px, 5vw, 52px);
}

.flow-section ol {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.flow-section li {
  display: grid;
  grid-template-columns: 48px 160px 1fr;
  align-items: center;
  min-height: 64px;
  padding: 12px 16px;
}

.flow-section li span {
  color: var(--yellow);
  font-family: "Black Han Sans", sans-serif;
  font-size: 18px;
}

.dashboard-view {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 16px;
  padding: 12px 0 40px;
}

.side-panel {
  align-self: start;
  position: sticky;
  top: 82px;
  display: grid;
  gap: 8px;
  padding: 14px;
}

.profile-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-bottom: 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #101010;
  background: var(--yellow);
  border-radius: 50%;
  font-weight: 900;
}

.profile-summary div {
  display: grid;
  min-width: 0;
}

.profile-summary small {
  overflow: hidden;
  color: var(--soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.logout-button {
  margin-top: 6px;
  color: #fecaca;
}

.workspace {
  min-height: 720px;
  padding: 22px;
}

.page-title {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.page-title h2 {
  font-size: clamp(34px, 4vw, 54px);
}

.page-title p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.metric-grid article {
  display: grid;
  gap: 3px;
  padding: 16px;
}

.metric-grid strong {
  color: var(--yellow);
  font-family: "Black Han Sans", sans-serif;
  font-size: 34px;
  font-weight: 400;
}

.metric-grid span {
  color: var(--muted);
}

.map-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  margin-bottom: 16px;
  background: rgba(23, 26, 33, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.map-panel-head,
.location-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.map-panel-head div {
  display: grid;
  gap: 4px;
}

.map-panel-head strong {
  font-size: 17px;
}

.map-panel-head span,
.location-tools span,
.location-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.web-map {
  width: 100%;
  height: 300px;
  overflow: hidden;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    #111827;
  background-size: 24px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.create-map {
  height: 260px;
}

.location-picker {
  display: grid;
  gap: 10px;
}

.map-ghost-button {
  flex: 0 0 auto;
  min-height: 34px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.leaflet-container {
  color: #111827;
  background: #111827;
  font-family: "Noto Sans KR", system-ui, sans-serif;
}

.leaflet-control-attribution {
  color: rgba(255, 255, 255, 0.64);
  background: rgba(11, 13, 18, 0.72) !important;
}

.clue-map-popup {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.clue-map-popup strong {
  color: #111827;
  font-size: 13px;
}

.clue-map-popup span {
  color: #4b5563;
  font-size: 12px;
}

.clue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.clue-list {
  display: grid;
  gap: 12px;
}

.clue-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.clue-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.clue-card h3 {
  margin: 0;
  font-size: 20px;
}

.clue-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.location-meta {
  display: flex;
  align-items: center;
  gap: 7px;
}

.location-meta::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.16);
}

.status {
  align-self: start;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
}

.status.approved,
.status.active {
  color: #052e16;
  background: #86efac;
}

.status.pending,
.status.pending_approval,
.status.draft {
  color: #422006;
  background: #fde68a;
}

.status.rejected {
  color: #450a0a;
  background: #fca5a5;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions button {
  min-height: 38px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 900;
}

.approve {
  color: #052e16;
  background: #86efac;
  border: 0;
}

.reject {
  color: #450a0a;
  background: #fca5a5;
  border: 0;
}

.join {
  color: #07111f;
  background: var(--blue);
  border: 0;
}

.ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}

.permission-card {
  display: grid;
  gap: 8px;
  padding: 20px;
}

.permission-card strong {
  font-size: 20px;
}

.permission-card span {
  color: var(--muted);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  transform: translateX(-50%) translateY(18px);
  max-width: min(520px, calc(100% - 28px));
  padding: 12px 16px;
  color: #101010;
  background: var(--yellow);
  border-radius: 8px;
  font-weight: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  .hero,
  .dashboard-view {
    grid-template-columns: 1fr;
  }

  .auth-panel,
  .side-panel {
    position: static;
  }

  .landing-band {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .public-nav,
  .app-nav {
    justify-content: flex-start;
  }

  h1 {
    font-size: 58px;
  }

  .landing-band,
  .metric-grid,
  .clue-grid,
  .create-form,
  .profile-form {
    grid-template-columns: 1fr;
  }

  .flow-section li {
    grid-template-columns: 42px 1fr;
    gap: 4px 8px;
  }

  .flow-section em {
    grid-column: 2;
  }

  .workspace {
    padding: 16px;
  }
}
