:root {
  color-scheme: light;
  --bg: #f5f4ef;
  --panel: #ffffff;
  --panel-soft: #f9faf7;
  --ink: #1d2523;
  --muted: #66736f;
  --line: #dfe5df;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-soft: #d9f2ec;
  --accent: #c2410c;
  --blue: #2563eb;
  --gold: #b7791f;
  --radius: 8px;
  --shadow: 0 18px 45px rgba(31, 41, 36, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

.hidden {
  display: none !important;
}

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

button {
  cursor: pointer;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 264px;
  background: #102522;
  color: #eef8f5;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.auth-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(16, 37, 34, 0.78), rgba(16, 37, 34, 0.78)),
    url("https://images.unsplash.com/photo-1542051841857-5f90071e7989?auto=format&fit=crop&w=1800&q=80") center/cover;
}

.auth-card {
  width: min(430px, 100%);
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 18px;
}

.auth-brand .brand-sub {
  color: var(--muted);
}

.auth-tabs {
  width: 100%;
  grid-auto-columns: 1fr;
}

.auth-form {
  display: grid;
  gap: 13px;
}

.auth-message {
  min-height: 20px;
  margin: 0;
  color: var(--accent);
  font-size: 13px;
}

.auth-doc-links {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: -4px;
}

.auth-doc-links a {
  min-height: auto;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
}

.auth-doc-links a + a {
  position: relative;
}

.auth-doc-links a + a::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 50%;
  width: 1px;
  height: 12px;
  background: var(--line);
  transform: translateY(-50%);
}

.auth-doc-links a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-doc-links svg {
  width: 14px;
  height: 14px;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #f5efe2;
  color: #102522;
  font-weight: 800;
  font-size: 22px;
}

.brand-name {
  font-weight: 800;
  font-size: 18px;
}

.brand-sub {
  color: #a9c1bb;
  font-size: 12px;
  margin-top: 2px;
}

.nav {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  color: #cfe2dc;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item svg,
button svg,
.map-card svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.sidebar-card {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-card p {
  margin: 8px 0 0;
  line-height: 1.55;
  color: #d7e8e3;
  font-size: 13px;
}

.label,
.eyebrow {
  margin: 0;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-card .label {
  color: #9ed9cf;
}

.shell {
  margin-left: 264px;
  padding: 28px;
  min-height: 100vh;
}

.creator-app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 244px 1fr;
}

.creator-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.creator-sidebar {
  background: #102522;
  color: #eef8f5;
  min-height: 100vh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.creator-sidebar .secondary-button {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.16);
}

.language-toggle {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  cursor: pointer;
}

.auth-card .language-toggle {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.language-toggle svg {
  width: 18px;
  height: 18px;
}

.creator-main {
  padding: 28px;
  display: grid;
  gap: 18px;
  align-content: start;
  grid-auto-rows: max-content;
}

.creator-view {
  display: none;
  gap: 18px;
  align-content: start;
  grid-auto-rows: max-content;
}

.creator-view.active {
  display: grid;
}

.material-grid,
.material-picker,
.competitor-grid,
.official-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.material-card,
.competitor-card,
.official-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  display: grid;
}

.material-card img,
.competitor-card > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #e9eee9;
}

.material-body,
.competitor-body,
.official-body {
  padding: 12px;
  display: grid;
  gap: 8px;
}

.material-body p,
.competitor-body p,
.official-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.competitor-card.selected,
.official-card.selected {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  border-color: var(--brand);
}

.competitor-body a {
  color: var(--brand);
  font-weight: 800;
  text-decoration: none;
  font-size: 13px;
}

.library-grid {
  max-height: min(68vh, 760px);
  overflow: auto;
  padding-right: 4px;
}

.creator-scoreboard {
  display: grid;
  gap: 16px;
}

.score-hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #083c36 0%, #0f766e 48%, #f2c94c 140%);
  color: #fff;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

.score-hero::after {
  content: "";
  position: absolute;
  inset: auto -20px -80px 35%;
  height: 150px;
  background: rgba(255, 255, 255, 0.16);
  transform: rotate(-7deg);
}

.score-kicker {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  opacity: 0.76;
}

.score-hero h2 {
  margin: 6px 0;
  font-size: 58px;
  line-height: 0.95;
}

.score-hero p {
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 800;
}

.score-ring {
  width: 116px;
  height: 116px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: conic-gradient(#fff var(--score-progress), rgba(255, 255, 255, 0.22) 0);
  z-index: 1;
}

.score-ring::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: #0f766e;
}

.score-ring strong,
.score-ring span {
  position: relative;
  z-index: 1;
}

.score-ring strong {
  font-size: 24px;
}

.score-ring span {
  font-size: 12px;
  opacity: 0.82;
}

.score-progress {
  grid-column: 1 / -1;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.24);
  z-index: 1;
}

.score-progress div {
  height: 100%;
  border-radius: inherit;
  background: #fff;
}

.creator-guide {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #083c36 0%, #0f766e 52%, #f2c94c 145%);
  color: #fff;
  padding: 14px 18px;
  height: 118px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.creator-guide::after {
  content: "";
  position: absolute;
  inset: auto -20px -82px 32%;
  height: 150px;
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(-7deg);
}

.creator-guide > * {
  position: relative;
  z-index: 1;
}

.creator-guide h2 {
  margin: 4px 0 6px;
  font-size: 20px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.creator-guide p {
  margin: 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 800;
  line-height: 1.5;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.score-source-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.score-source-card svg {
  width: 22px;
  height: 22px;
  color: var(--brand);
}

.score-source-card span {
  color: var(--muted);
  font-weight: 800;
}

.score-source-card strong {
  font-size: 30px;
  line-height: 1;
}

.score-source-card small {
  color: var(--muted);
}

.score-feed-list {
  display: grid;
  gap: 10px;
}

.score-feed-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.score-feed-item span {
  color: var(--muted);
  font-weight: 700;
}

.score-feed-item strong {
  color: var(--brand);
  font-size: 18px;
}

.material-select {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.draft-output {
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 16px;
  white-space: pre-wrap;
  line-height: 1.65;
  color: var(--ink);
}

.compact-head {
  margin-top: 4px;
}

.selected-materials {
  min-height: 48px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.selected-materials img {
  width: 54px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 32px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #e5f5ef;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.material-dialog {
  width: min(1040px, calc(100vw - 28px));
}

.material-masonry {
  column-count: 4;
  column-gap: 12px;
  max-height: min(68vh, 760px);
  overflow: auto;
  padding-right: 4px;
}

.masonry-item {
  break-inside: avoid;
  display: grid;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.masonry-item.selected {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  border-color: var(--brand);
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  background: #e9eee9;
}

.masonry-caption {
  padding: 9px;
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
  margin-bottom: 0;
}

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.top-actions,
.panel-head,
menu,
.question-toolbar,
.building-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.primary-button,
.secondary-button,
.text-button,
.icon-button {
  border: 0;
  border-radius: var(--radius);
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  white-space: nowrap;
}

.primary-button {
  background: var(--brand);
  color: #fff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}

.text-button {
  background: transparent;
  color: var(--brand);
  padding: 0 6px;
}

.icon-button {
  width: 38px;
  padding: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
}

.view {
  display: none;
}

.view.active {
  display: grid;
  gap: 18px;
}

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

.metric,
.panel,
.question-card,
.task-card,
.channel-card,
.building-card,
.leader-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.metric {
  padding: 18px;
}

.metric span,
.metric small {
  display: block;
  color: var(--muted);
}

.metric strong {
  display: block;
  font-size: 34px;
  line-height: 1.1;
  margin: 10px 0 4px;
}

.panel {
  padding: 20px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
}

.topic-list,
.funnel,
.leaderboard {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.topic-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.topic-item span {
  color: var(--muted);
  font-size: 13px;
}

.status-pill,
.tag,
.score-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
}

.tag.orange {
  background: #ffedd5;
  color: #9a3412;
}

.tag.blue {
  background: #dbeafe;
  color: #1d4ed8;
}

.tag.gold {
  background: #fef3c7;
  color: #92400e;
}

.tag.green {
  background: #dcfce7;
  color: #166534;
}

.tag.pink {
  background: #fce7f3;
  color: #9d174d;
}

.funnel-row {
  display: grid;
  grid-template-columns: 82px 1fr 34px;
  gap: 10px;
  align-items: center;
}

.bar-track {
  height: 10px;
  background: #e9eee9;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--brand);
}

.geo-map {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 40px 1fr 40px 1fr 40px 1fr;
  align-items: center;
}

.map-card {
  min-height: 128px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff, #f7fbf7);
  border-radius: var(--radius);
  padding: 18px;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 8px;
}

.map-card svg {
  color: var(--brand);
}

.map-card span {
  color: var(--muted);
  font-size: 13px;
}

.map-line {
  height: 2px;
  background: var(--line);
}

.generator {
  display: grid;
  grid-template-columns: 0.9fr 1.4fr;
  gap: 18px;
  align-items: end;
}

.generator p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.form-grid .primary-button {
  align-self: end;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  color: var(--ink);
}

.check-row input {
  width: 18px;
  height: 18px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: 0;
  font-size: 16px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 2px;
  padding: 3px;
  border-radius: var(--radius);
  background: #e9eee9;
}

.segmented button {
  border: 0;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.question-grid,
.channel-grid,
.building-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.question-card,
.channel-card,
.task-card,
.building-card,
.leader-card {
  padding: 16px;
}

.question-card,
.building-card {
  display: grid;
  gap: 12px;
}

.question-card.selected,
.building-card.selected {
  outline: 3px solid rgba(15, 118, 110, 0.22);
  border-color: var(--brand);
}

.question-card p,
.task-card p,
.channel-card p,
.building-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.building-address {
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.building-facts,
.link-grid,
.building-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.link-button {
  min-height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 9px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.link-button.disabled {
  color: var(--muted);
  background: #f3f5f2;
  pointer-events: none;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.check {
  width: 22px;
  height: 22px;
  accent-color: var(--brand);
}

.kanban {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 14px;
}

.kanban-column {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 520px;
}

.column-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-weight: 800;
}

.task-stack {
  display: grid;
  gap: 10px;
}

.review-metrics {
  margin-bottom: 16px;
}

.panel-note {
  margin-top: 6px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.55;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-wrap table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.table-wrap th,
.table-wrap td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table-wrap th {
  color: var(--muted);
  font-size: 0.82rem;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.task-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.task-translation {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: var(--radius);
  background: rgba(220, 252, 231, 0.38);
}

.task-translation h3 {
  margin: 0;
}

.task-translation p {
  margin: 0;
  color: var(--muted);
}

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

.claim-task-card {
  display: grid;
  gap: 12px;
}

.claim-users {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.claim-users > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  min-height: 30px;
  padding: 0 9px;
  color: var(--muted);
}

.danger-button {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff7f7;
}

.channel-card {
  display: grid;
  gap: 12px;
  min-height: 180px;
}

.channel-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.monitor-table-wrap {
  margin-top: 16px;
  overflow: auto;
}

.monitor-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
}

.monitor-table th,
.monitor-table td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.monitor-table th {
  color: var(--muted);
  font-size: 12px;
}

.leader-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
}

.leader-card.clickable {
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.leader-card.clickable:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.38);
  box-shadow: 0 18px 44px rgba(15, 118, 110, 0.12);
}

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

.avatar-button {
  border: 0;
  padding: 0;
}

.leader-card small {
  color: var(--muted);
}

dialog {
  border: 0;
  padding: 0;
  border-radius: var(--radius);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
}

dialog::backdrop {
  background: rgba(13, 31, 28, 0.45);
}

.dialog-card {
  width: min(560px, calc(100vw - 28px));
  padding: 20px;
  display: grid;
  gap: 16px;
  background: #fff;
}

.creator-detail-dialog {
  width: min(1040px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  overflow: auto;
}

.compact-score-hero {
  min-height: 128px;
  margin-bottom: 14px;
}

.compact-source-grid {
  margin-bottom: 14px;
}

.detail-section {
  margin-top: 14px;
}

.building-dialog {
  width: min(860px, calc(100vw - 28px));
}

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

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

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

menu {
  margin: 0;
  padding: 0;
  justify-content: end;
}

@media (max-width: 1080px) {
  .metric-grid,
  .question-grid,
  .building-grid,
  .material-grid,
  .material-picker,
  .competitor-grid,
  .official-grid,
  .score-source-grid,
  .channel-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .generator {
    grid-template-columns: 1fr;
  }

  .geo-map {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .map-line {
    width: 2px;
    height: 22px;
    justify-self: center;
  }

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

@media (max-width: 760px) {
  .sidebar {
    position: static;
    width: auto;
    min-height: auto;
  }

  .creator-app {
    display: block;
    min-height: auto;
  }

  .creator-sidebar {
    min-height: 0;
    height: auto;
    max-height: none;
    padding: 10px 12px 12px;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 10;
    overflow: hidden;
  }

  .creator-sidebar .brand {
    display: none;
  }

  .creator-sidebar .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .creator-sidebar .nav::-webkit-scrollbar {
    display: none;
  }

  .creator-sidebar .nav-item {
    width: 74px;
    min-width: 74px;
    min-height: 54px;
    justify-content: center;
    padding: 7px 4px;
    flex-direction: column;
    gap: 4px;
    font-size: 10px;
    line-height: 1.15;
  }

  .creator-sidebar .nav-item span {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
  }

  .creator-sidebar .nav-item svg {
    width: 20px;
    height: 20px;
  }

  .creator-sidebar .secondary-button {
    display: none;
  }

  .creator-sidebar .language-toggle {
    min-height: 36px;
  }

  .creator-main {
    padding: 14px 16px 18px;
    gap: 14px;
  }

  .creator-header {
    align-items: flex-start;
    gap: 8px;
  }

  .creator-header h1 {
    font-size: 26px;
    line-height: 1.05;
  }

  .creator-header .status-pill {
    flex: 0 0 auto;
  }

  .shell {
    margin-left: 0;
    padding: 18px;
  }

  .topbar,
  .question-toolbar,
  .building-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions {
    justify-content: stretch;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
    min-height: 46px;
  }

  .icon-button {
    width: 46px;
    height: 46px;
  }

  .metric-grid,
  .question-grid,
  .building-grid,
  .material-grid,
  .material-picker,
  .competitor-grid,
  .official-grid,
  .score-source-grid,
  .channel-grid,
  .form-grid,
  .kanban,
  .dialog-grid {
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-auto-flow: row;
  }

  .auth-tabs {
    grid-auto-flow: column;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel {
    padding: 16px;
  }

  .metric {
    padding: 14px;
  }

  .metric strong {
    font-size: 28px;
  }

  .question-card,
  .building-card,
  .task-card,
  .channel-card,
  .leader-card {
    padding: 14px;
  }

  .material-card img {
    max-height: 260px;
  }

  .creator-guide {
    grid-template-columns: 1fr;
    padding: 12px 14px;
    height: 96px;
  }

  .creator-guide h2 {
    font-size: 17px;
    margin: 2px 0 4px;
  }

  .creator-guide p {
    font-size: 12px;
    line-height: 1.4;
  }

  .score-hero {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 14px 16px;
    gap: 10px;
  }

  .score-hero h2 {
    font-size: 42px;
  }

  .score-hero p {
    font-size: 12px;
    line-height: 1.4;
  }

  .score-ring {
    width: 74px;
    height: 74px;
  }

  .score-ring::before {
    inset: 8px;
  }

  .score-ring strong {
    font-size: 20px;
  }

  .score-ring span {
    font-size: 11px;
  }

  .score-progress {
    display: none;
  }

  .dialog-card,
  .building-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    overflow: auto;
  }

  .material-dialog {
    width: calc(100vw - 12px);
  }

  .material-masonry {
    column-count: 2;
    max-height: 70vh;
  }

  input[type="file"] {
    min-height: 48px;
    padding: 12px;
  }

  h1 {
    font-size: 25px;
  }
}
