@import url("https://fonts.googleapis.com/css2?family=Niconne&display=swap");
@import url("https://cdn.jsdelivr.net/gh/sunn-us/SUIT/fonts/variable/woff2/SUIT-Variable.css");

:root {
  --bg: #eafff9;
  --bg-soft: #f7fffc;
  --glass: rgba(255, 255, 255, 0.34);
  --glass-strong: rgba(255, 255, 255, 0.52);
  --ink: #10221f;
  --muted: #5f7671;
  --line: rgba(16, 34, 31, 0.12);
  --line-soft: rgba(16, 34, 31, 0.07);
  --primary: #00c9a7;
  --primary-deep: #008d79;
  --mint: #c4fcef;
  --pink: #fbeaff;
  --violet: #8a63d2;
  --coral: #e774c7;
  --amber: #b87524;
  --green: #13795b;
  --red: #9d3d3d;
  --blue: #2d5c88;
  --shadow: 0 16px 44px rgba(0, 201, 167, 0.12);
  --shadow-soft: 0 8px 28px rgba(16, 34, 31, 0.07);
  --font-display: "Niconne", "Georgia", serif;
  --font-ui: "SUIT Variable", "SUIT", "Noto Sans KR", "Malgun Gothic", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, var(--mint) 0%, rgba(196, 252, 239, 0.92) 30%, rgba(247, 255, 252, 0.96) 54%, rgba(247, 255, 252, 0.94) 78%, rgba(251, 234, 255, 0.92) 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.58;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.hub-shell {
  min-height: 100vh;
}

.hub-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, auto) auto;
  gap: 14px;
  align-items: center;
  min-height: 62px;
  padding: 12px clamp(18px, 4vw, 44px);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(234, 255, 249, 0.72);
  backdrop-filter: blur(22px);
}

.hub-brand {
  display: inline-grid;
  grid-template-columns: 36px minmax(0, auto);
  gap: 10px;
  align-items: center;
  color: #0b4d43;
  text-decoration: none;
}

.hub-brand__mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(0, 201, 167, 0.32);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--mint));
  color: #08342d;
  font-size: 11px;
  font-weight: 760;
  box-shadow: var(--shadow-soft);
}

.hub-brand__name {
  font-family: var(--font-display);
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
}

.hub-nav {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: center;
}

.hub-nav a,
.editor-button,
.plain-button,
.editor-form button,
.section-link,
.save-button,
.surface-link {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  color: #31514b;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
}

.hub-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  font-size: 13px;
  font-weight: 720;
  white-space: nowrap;
}

.hub-nav a.is-active,
.hub-nav a:hover,
.editor-button.is-unlocked,
.section-link:hover,
.surface-link:hover {
  border-color: rgba(0, 201, 167, 0.34);
  background: rgba(255, 255, 255, 0.72);
  color: #0b4d43;
}

.editor-button {
  padding: 0 11px;
  font-size: 12px;
  font-weight: 720;
}

.hub-main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 46px;
}

.hub-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 22px;
  align-items: end;
  padding: 4px 0 10px;
}

.hub-intro h1,
.section-head h1,
.state-panel h1,
.editor-panel h2 {
  margin: 0;
  color: #0b4d43;
  font-size: 28px;
  font-weight: 780;
  line-height: 1.2;
  letter-spacing: 0;
}

.intro-copy {
  max-width: 720px;
  margin: 8px 0 0;
  color: #31514b;
  font-size: 15px;
  line-height: 1.65;
}

.hero-summary {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(18px);
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  color: #31514b;
  font-size: 12px;
}

.metric-row strong {
  color: #294b46;
  font-size: 13px;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--primary-deep);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.section-band {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

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

.decision-card,
.ref-card,
.event-card,
.tier-card,
.source-card {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.46);
  backdrop-filter: blur(18px);
}

.decision-card {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.decision-card:hover {
  border-color: rgba(0, 201, 167, 0.28);
  background: rgba(255, 255, 255, 0.72);
  transform: translateY(-1px);
}

.decision-card h2,
.ref-card h2,
.event-card h2,
.tier-card h2,
.source-card h2 {
  margin: 9px 0 7px;
  color: #173b35;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.decision-card p,
.ref-card p,
.event-card p,
.tier-card p,
.source-card p,
.empty-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.metric-pill,
.priority-pill {
  display: inline-flex;
  width: fit-content;
  min-height: 24px;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.38);
  color: #31514b;
  font-size: 11px;
  font-weight: 760;
  line-height: 1;
}

.priority-p1 {
  border-color: rgba(8, 121, 104, 0.15);
  background: rgba(8, 121, 104, 0.055);
  color: #26615a;
}

.priority-p2 {
  border-color: rgba(108, 93, 211, 0.14);
  background: rgba(108, 93, 211, 0.045);
  color: #615aa0;
}

.priority-p3 {
  border-color: rgba(138, 100, 40, 0.13);
  background: rgba(138, 100, 40, 0.045);
  color: #806640;
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 14px;
}

.section-head--compact {
  margin-bottom: 12px;
}

.section-head p {
  max-width: 660px;
  margin: 7px 0 0;
  color: #31514b;
  font-size: 14px;
  line-height: 1.6;
}

.section-link,
.save-button,
.surface-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 760;
}

.surface-link {
  width: fit-content;
  min-height: 40px;
  margin-top: 14px;
  padding: 0 14px;
  color: #0b4d43;
}

.gateway-panel {
  display: grid;
  gap: 4px;
  min-height: 120px;
  align-content: center;
}

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

.market-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(290px, 0.9fr);
  gap: 14px;
}

.ref-card,
.event-card,
.tier-card,
.source-card {
  overflow: hidden;
  padding: 14px;
}

.media-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  margin: -14px -14px 12px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.32);
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-meta,
.count-row,
.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.count-row {
  margin: 12px 0;
}

.event-list,
.tier-list,
.source-list-column {
  display: grid;
  gap: 10px;
}

.event-card {
  display: grid;
  gap: 10px;
}

.event-card p strong {
  color: #173b35;
}

.event-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tier-card summary {
  cursor: pointer;
  list-style: none;
}

.tier-card summary::-webkit-details-marker {
  display: none;
}

.brand-table {
  width: 100%;
  margin-top: 12px;
  border-collapse: collapse;
  font-size: 13px;
}

.brand-table th,
.brand-table td {
  padding: 9px 8px;
  border-top: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.source-footer {
  margin-top: 26px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.7;
}

.state-panel {
  margin-top: 36px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--glass);
  backdrop-filter: blur(18px);
}

.editor-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 24, 21, 0.42);
  backdrop-filter: blur(18px);
}

.editor-panel[hidden] {
  display: none;
}

.editor-panel__inner {
  width: min(460px, 100%);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.editor-form {
  display: grid;
  gap: 10px;
}

.editor-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.editor-form input {
  min-width: 0;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.58);
}

.editor-form button,
.plain-button {
  padding: 0 12px;
}

.editor-status {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.plain-button {
  margin-top: 14px;
}

@media (max-width: 980px) {
  .hub-topbar {
    grid-template-columns: 1fr auto;
  }

  .hub-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .hub-intro,
  .market-grid {
    grid-template-columns: 1fr;
  }

  .decision-grid,
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .hub-topbar {
    min-height: auto;
    padding: 12px 14px;
  }

  .hub-brand__name {
    font-size: 24px;
  }

  .hub-main {
    width: min(100% - 24px, 1180px);
    padding-top: 20px;
  }

  .hub-intro h1,
  .section-head h1,
  .state-panel h1 {
    font-size: 24px;
  }

  .section-band {
    padding: 14px;
  }

  .decision-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  .section-head {
    grid-template-columns: 1fr;
  }

  .brand-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
