/* FORTRUST design system — modern, calm, high-contrast. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Sora:wght@600;700;800&display=swap");

:root {
  /* Light theme — clean, high-contrast, aligned to the SinoCloud navy+cyan logo. */
  --bg: #eef3fb;
  --bg-2: #e3ebf7;
  --ink: #0a1626;
  --ink-soft: #33425a;
  --muted: #5d6b82;
  --line: #dde6f3;
  --line-strong: #c4d2e6;
  --surface: #ffffff;
  --surface-2: #f4f8fe;

  --brand: #1668e3;
  --brand-2: #1b53c7;
  --brand-ink: #11337a;
  --accent: #07b6e6;
  --green: #0f9d6b;
  --green-soft: #e3f7ef;
  --amber: #b45309;
  --amber-soft: #fdf0dd;
  --coral: #e11d48;
  --coral-soft: #ffe1ea;
  --blue-soft: #e4eeff;
  --violet-soft: #ebedff;

  --hero-grad-a: #0a2a4f;
  --hero-grad-b: #1668e3;
  --hero-grad-c: #07b6e6;

  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(10, 22, 38, 0.06), 0 1px 3px rgba(10, 22, 38, 0.05);
  --shadow: 0 10px 30px -12px rgba(10, 22, 38, 0.18);
  --shadow-lg: 0 30px 60px -28px rgba(10, 22, 38, 0.30);
  --ring: 0 0 0 3px rgba(22, 104, 227, 0.22);

  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  /* Dark theme — deep navy from the logo, bright cyan accents. */
  --bg: #070e1a;
  --bg-2: #0d182b;
  --ink: #eaf1fb;
  --ink-soft: #b8c6dc;
  --muted: #8595ad;
  --line: #1d2d45;
  --line-strong: #2a3d59;
  --surface: #0f1c30;
  --surface-2: #14233a;

  --brand: #2f86f5;
  --brand-2: #3a73e6;
  --brand-ink: #9cc4ff;
  --accent: #2bd0f0;
  --green: #2ad19a;
  --green-soft: #0e2c25;
  --amber: #f0b35a;
  --amber-soft: #2e2413;
  --coral: #ff6b8a;
  --coral-soft: #331620;
  --blue-soft: #122544;
  --violet-soft: #1a1f3d;

  --hero-grad-a: #04101f;
  --hero-grad-b: #0f3a78;
  --hero-grad-c: #0a8fb8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 12px 34px -14px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 60px -24px rgba(0, 0, 0, 0.7);
  --ring: 0 0 0 3px rgba(47, 134, 245, 0.3);

  color-scheme: dark;
}

.theme-toggle {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-soft); font-size: 1.15rem; line-height: 1; box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, transform .12s;
}
.theme-toggle:hover { border-color: var(--brand); transform: translateY(-1px); }

.lang-toggle {
  display: inline-grid; place-items: center;
  min-width: 44px; height: 40px; flex: 0 0 auto; padding: 0 10px; border-radius: 11px;
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink-soft); font-size: .82rem; font-weight: 800; letter-spacing: .04em;
  box-shadow: var(--shadow-sm); transition: background .15s, border-color .15s, transform .12s;
}
.lang-toggle:hover { border-color: var(--brand); color: var(--brand-ink); transform: translateY(-1px); }

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-2), var(--bg) 42%, var(--bg));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: Sora, Inter, sans-serif; letter-spacing: -0.02em; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.6rem); margin: 0 0 .4rem; }
h2 { font-size: 1.25rem; margin: 0 0 .6rem; }
h3 { font-size: 1.02rem; margin: 0; }
p { line-height: 1.6; color: var(--ink-soft); }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; background: none; }
.muted { color: var(--muted); }
small { color: var(--muted); }

/* ---------- Shell ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

main {
  width: min(1180px, 100% - 40px);
  margin: 26px auto 64px;
  display: block;
}

.reviewer-main { width: min(1180px, 100% - 40px); margin: 24px auto 64px; display: grid; gap: 22px; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px clamp(16px, 4vw, 36px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  backdrop-filter: saturate(160%) blur(14px);
}

.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-family: Sora, sans-serif; color: var(--ink); }
.brand-logo {
  width: 42px; height: 42px; border-radius: 11px; object-fit: cover; background: #fff;
  box-shadow: 0 6px 16px -6px rgba(7, 182, 230, 0.6);
  border: 1px solid var(--line);
}
.brand small { display: block; font-weight: 600; font-family: Inter; font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.nav { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-left: auto; }
.nav a {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 38px; padding: 8px 14px;
  border-radius: 10px; font-weight: 600; font-size: .92rem; color: var(--ink-soft);
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.nav a:hover { background: var(--surface-2); border-color: var(--line); }
.nav a.active { background: var(--ink); color: #fff; }
[data-theme="dark"] .nav a.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.nav .nav-user { display: inline-flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .86rem; font-weight: 600; }
.nav .nav-user .avatar { width: 26px; height: 26px; }

/* ---------- Buttons ---------- */
.button, .ghost-button, .danger-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 10px 18px;
  border-radius: 11px; font-weight: 700; font-size: .94rem;
  transition: transform .12s ease, box-shadow .15s ease, background .15s, border-color .15s;
  white-space: nowrap;
}
.button {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 24px -10px rgba(37, 99, 235, 0.7);
}
.button:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -12px rgba(37, 99, 235, 0.75); }
.button:active { transform: translateY(0); }
.button.block { width: 100%; }
.ghost-button {
  color: var(--ink-soft); background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.ghost-button:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand-ink); }
.ghost-button.active-chip, .ghost-button.active {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
[data-theme="dark"] .ghost-button.active-chip,
[data-theme="dark"] .ghost-button.active {
  background: var(--brand); color: #fff; border-color: var(--brand);
}
.danger-button { color: #fff; background: linear-gradient(135deg, #f43f5e, var(--coral)); }
.danger-button:hover { transform: translateY(-1px); }

button:disabled, .button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Panels / cards ---------- */
.panel, .review-card, .metric, .map-list-item, .modal-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.panel {
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 16px; }

.layout { display: grid; grid-template-columns: 360px 1fr; gap: 22px; align-items: start; }
.layout aside { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.single-layout { display: flex; flex-direction: column; gap: 22px; }
.two-col { display: grid; grid-template-columns: 1.3fr .9fr; gap: 22px; align-items: start; }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 26px 0 6px; flex-wrap: wrap; }
.section-title h2 { margin: 0; }

.admin-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.overview-card {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-sm);
  display: grid;
  gap: 4px;
}
.overview-card small { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.overview-card strong { font-family: Sora, sans-serif; font-size: 1.6rem; color: var(--ink); }

.reviewer-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 26px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(10, 42, 79, 0.96), rgba(22, 104, 227, 0.94) 55%, rgba(7, 182, 230, 0.88)),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  color: #fff;
  box-shadow: var(--shadow);
}
.reviewer-hero h1 { color: #fff; margin-bottom: 8px; }
.reviewer-hero p { color: rgba(255,255,255,.88); max-width: 58ch; margin: 0; }
.reviewer-hero-tools { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.reviewer-hero-tools .ghost-button { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.22); }
.reviewer-hero-tools .ghost-button:hover { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }

/* ---------- Metrics ---------- */
.metrics { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.metric { padding: 16px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 4px; }
.metric small { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 600; }
.metric strong { font-family: Sora, sans-serif; font-size: 1.5rem; color: var(--ink); }

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; line-height: 1;
  background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--line);
}
.pill.blue { background: var(--blue-soft); color: var(--brand-ink); border-color: #cfe0ff; }
.pill.green { background: var(--green-soft); color: #0a6b49; border-color: #bfeedc; }
.pill.coral { background: var(--coral-soft); color: #a30f37; border-color: #ffc9d8; }
.pill.amber { background: var(--amber-soft); color: var(--amber); border-color: #f6dcb4; }
.pill.violet { background: var(--violet-soft); color: #4338ca; border-color: #d8dcff; }
.pill.ai { background: linear-gradient(135deg, #eef2ff, #e0f2fe); color: #4338ca; border-color: #d6def8; }

[data-theme="dark"] .pill.blue { color: #b9d5ff; border-color: #284a78; }
[data-theme="dark"] .pill.green { color: #8cf0c6; border-color: #235e4b; }
[data-theme="dark"] .pill.coral { color: #ffadc0; border-color: #703044; }
[data-theme="dark"] .pill.amber { color: #ffd08a; border-color: #73542a; }
[data-theme="dark"] .pill.violet { color: #c8ccff; border-color: #373d72; }
[data-theme="dark"] .pill.ai { background: linear-gradient(135deg, #182548, #123447); color: #cbd8ff; border-color: #334a78; }

.tier-badge {
  display: inline-grid; place-items: center; width: 30px; height: 30px;
  border-radius: 9px; font-weight: 900; font-family: Sora; color: #fff; font-size: .82rem;
}
.tier-A { background: linear-gradient(135deg, #0f9d6b, #06b6d4); }
.tier-B { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.tier-C { background: linear-gradient(135deg, #f59e0b, #ef7a1a); }
.tier-Base { background: linear-gradient(135deg, #94a3b8, #64748b); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--ink-soft); }
input, select, textarea {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
textarea { min-height: 130px; resize: vertical; line-height: 1.55; }
input[type="file"] { padding: 9px; background: var(--surface-2); }

.choice-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rating-row { display: flex; gap: 8px; }
.rating-row button {
  width: 46px; height: 46px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface);
  font-weight: 800; font-size: 1.05rem; color: var(--muted);
  transition: all .12s;
}
.rating-row button:hover { border-color: var(--brand); color: var(--brand); }
.rating-row button.active { background: linear-gradient(135deg, #f59e0b, #f97316); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -8px rgba(249,115,22,.7); }

.trust-explain {
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: linear-gradient(120deg, var(--blue-soft), var(--violet-soft));
  border: 1px solid #dbe4ff; color: var(--brand-ink); font-size: .9rem; line-height: 1.5;
  margin-bottom: 16px;
}
[data-theme="dark"] .trust-explain { border-color: var(--line-strong); color: var(--ink-soft); }

.status-box { display: none; }
.status-box.show { display: inline-flex; margin-top: 10px; }

/* ---------- Avatars / media ---------- */
.avatar { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); background: var(--bg-2); }
.review-media { width: 100%; max-height: 340px; object-fit: cover; border-radius: var(--radius-sm); margin: 4px 0 12px; border: 1px solid var(--line); }

/* ---------- Review cards / feed ---------- */
.social-feed { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
.review-card { padding: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 6px; transition: box-shadow .18s, transform .18s; }
.review-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.review-card.critical-review { border-color: #f7c6d4; background: linear-gradient(180deg, #fff, #fff7f9); }
[data-theme="dark"] .review-card.critical-review { border-color: #703044; background: linear-gradient(180deg, var(--surface), #221722); }
.review-head { display: flex; align-items: center; gap: 12px; }
.review-head > div { flex: 1; min-width: 0; }
.review-head h3 { font-size: .98rem; overflow-wrap: anywhere; }
.review-head .muted { font-size: .8rem; }
.review-card p { margin: 4px 0 8px; color: var(--ink-soft); }
.social-signals { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.post-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 12px; margin-top: 8px; border-top: 1px dashed var(--line); }
.post-actions label { flex-direction: row; align-items: center; gap: 6px; font-size: .82rem; }
.post-actions select { width: auto; padding: 7px 9px; }
.like-button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 13px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 700; font-size: .85rem; color: var(--ink-soft); transition: all .12s; }
.like-button:hover { border-color: var(--coral); color: var(--coral); }
.like-button.liked { background: var(--coral-soft); border-color: #ffc9d8; color: #a30f37; }

.structure-response {
  margin-top: 10px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--line); border-left: 3px solid var(--brand);
}
.structure-response .resp-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .85rem; color: var(--brand-ink); margin-bottom: 4px; }
.structure-response p { margin: 0; font-size: .88rem; }

/* ---------- AI predictor widget ---------- */
.ai-widget {
  display: grid; gap: 10px; padding: 16px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f4f7ff, #eef9ff);
  border: 1px solid #dde7fb;
}
[data-theme="dark"] .ai-widget { background: linear-gradient(135deg, #121f35, #102b39); border-color: var(--line-strong); }
.ai-widget .ai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ai-gauge { height: 9px; border-radius: 999px; background: #dbe4f5; overflow: hidden; }
[data-theme="dark"] .ai-gauge { background: #223650; }
.ai-gauge > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--accent)); transition: width .3s ease; }
.ai-stars { font-size: 1.05rem; letter-spacing: 2px; color: #f59e0b; }

/* ---------- Map (real OpenStreetMap via Leaflet) ---------- */
.map-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.structure-map {
  position: relative; height: 380px; min-height: 380px; border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden; z-index: 0; background: var(--surface-2);
}
.structure-map .leaflet-control-attribution { font-size: 10px; }
.map-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); z-index: 1; }

/* Google-Maps-style teardrop marker */
.gmap-pin {
  width: 38px; height: 48px; position: relative; cursor: pointer;
  transition: transform .12s ease; transform-origin: bottom center;
}
.gmap-pin::before {
  content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  width: 34px; height: 34px; border-radius: 50% 50% 50% 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 14px -4px rgba(22,104,227,.65); border: 2px solid #fff;
}
.gmap-pin::after {
  content: ""; position: absolute; left: 50%; top: 28px; transform: translateX(-50%) rotate(45deg);
  width: 14px; height: 14px; background: var(--brand-2); border-radius: 0 0 3px 0;
}
.gmap-pin span {
  position: absolute; left: 50%; top: 17px; transform: translate(-50%, -50%);
  font-size: 17px; line-height: 1; z-index: 2; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25));
}
.gmap-pin:hover { transform: scale(1.12) translateY(-2px); }
.gmap-pin.active { transform: scale(1.18) translateY(-2px); }
.gmap-pin.active::before { background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 10px 18px -5px rgba(249,115,22,.7); }
.gmap-pin.active::after { background: #f97316; }
.gmap-popup { display: grid; gap: 2px; min-width: 150px; }
.gmap-popup strong { font-family: Sora, sans-serif; font-size: .95rem; color: var(--ink); }
.gmap-popup span { font-size: .8rem; color: var(--muted); }
.gmap-popup small { color: #f59e0b; font-weight: 700; }
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--shadow); }
.map-list { display: flex; flex-direction: column; gap: 10px; max-height: 360px; overflow: auto; padding-right: 4px; }
.map-list-item { padding: 12px 14px; text-align: left; display: grid; gap: 2px; box-shadow: var(--shadow-sm); transition: border-color .12s, transform .12s; }
.map-list-item:hover { border-color: var(--brand); transform: translateX(2px); }
.map-list-item.active { border-color: var(--brand); background: var(--blue-soft); }
.map-list-item strong { font-size: .92rem; } .map-list-item span { font-size: .8rem; color: var(--muted); } .map-list-item small { color: var(--brand-ink); font-weight: 600; }

/* ---------- Steps ---------- */
.simple-steps { display: grid; gap: 12px; }
.simple-steps.compact { gap: 8px; }
.simple-steps > div { display: flex; gap: 12px; align-items: flex-start; }
.simple-steps strong {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; color: #fff; font-family: Sora; font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.simple-steps span { font-size: .9rem; color: var(--ink-soft); line-height: 1.45; }

/* ---------- Public hero ---------- */
.public-hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 22px; box-shadow: var(--shadow); }
.public-photo {
  position: absolute; inset: 0;
  background-image: linear-gradient(120deg, rgba(13,27,42,.82), rgba(37,99,235,.35)), var(--public-photo, linear-gradient(120deg, #1e293b, #2563eb));
  background-size: cover; background-position: center;
}
.public-hero .grid { position: relative; padding: clamp(20px, 4vw, 40px); grid-template-columns: 1.4fr 1fr; align-items: center; }
.public-hero h1, .public-hero p { color: #fff; }
.public-hero .panel { background: rgba(255,255,255,.96); }
.public-hero .metrics .metric { background: rgba(255,255,255,.94); }
[data-theme="dark"] .public-photo { background-image: linear-gradient(120deg, rgba(3,10,22,.88), rgba(18,77,137,.48)), var(--public-photo, linear-gradient(120deg, #06111f, #0f3a78)); }
[data-theme="dark"] .public-hero .panel { background: rgba(15,28,48,.96); }
[data-theme="dark"] .public-hero .metrics .metric { background: rgba(15,28,48,.92); }

/* ---------- Gateway (landing) ---------- */
.hero-gateway { width: min(1180px, 100% - 40px); margin: 40px auto 60px; display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
.gateway-visual {
  min-height: 440px; border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.25), transparent 40%),
    linear-gradient(150deg, var(--brand-ink), var(--brand) 50%, var(--accent));
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.gateway-visual::after {
  content: "FT"; position: absolute; inset: 0; display: grid; place-items: center;
  font-family: Sora; font-weight: 900; font-size: 9rem; color: rgba(255,255,255,.14);
}
.gateway-copy h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); }
.gateway-copy > p { font-size: 1.05rem; max-width: 46ch; }
.gateway-actions { display: grid; gap: 12px; margin-top: 22px; }
.portal-card {
  display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, border-color .15s; position: relative;
}
.portal-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand); }
.portal-card strong { font-family: Sora; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.portal-card .portal-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 1.05rem; }
.gateway-copy .metrics { margin: 18px 0 0; max-width: 360px; }

/* ---------- Auth pages ---------- */
.auth-wrap { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card {
  width: min(480px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 38px); box-shadow: var(--shadow-lg);
}
.auth-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.auth-card h1 { font-size: 1.7rem; }
.auth-tabs { display: flex; gap: 6px; padding: 5px; background: var(--surface-2); border-radius: 12px; margin: 14px 0 20px; }
.auth-tabs button { flex: 1; padding: 9px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.auth-tabs button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-foot { margin-top: 18px; font-size: .9rem; text-align: center; color: var(--muted); }
.auth-foot a { color: var(--brand); font-weight: 700; }
.error { color: #a30f37; background: var(--coral-soft); border: 1px solid #ffc9d8; padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: .9rem; }
.notice { color: var(--brand-ink); background: var(--blue-soft); border: 1px solid #cfe0ff; padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
[data-theme="dark"] .error { color: #ffbdca; border-color: #703044; }
[data-theme="dark"] .notice { color: #c4d8ff; border-color: #284a78; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; display: none;
  background: rgba(13, 27, 42, 0.55); backdrop-filter: blur(4px);
  padding: 24px; place-items: center;
}
.modal-backdrop.show { display: grid; }
.modal-card { width: min(640px, 100%); max-height: 86vh; overflow: auto; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px 22px; display: grid; gap: 16px; }
.schema-code { background: #0d1b2a; color: #d7e3f7; border-radius: var(--radius-sm); padding: 16px; overflow: auto; font-size: .8rem; }
.schema-code code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* ---------- Profile header ---------- */
.profile-header { display: flex; gap: 14px; align-items: center; }
.profile-header .avatar { width: 60px; height: 60px; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tbody tr:hover { background: var(--surface-2); }

/* ---------- Admin console ---------- */
.admin-main { width: min(1320px, 100% - 40px); margin: 24px auto 64px; }
.admin-command {
  display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between;
  padding: 22px clamp(18px, 3vw, 28px); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand-ink), var(--brand) 60%, var(--accent));
  color: #fff; box-shadow: var(--shadow); margin-bottom: 22px;
}
.admin-command h1 { color: #fff; margin: 8px 0 4px; }
.admin-command p { color: rgba(255,255,255,.85); margin: 0; }
.admin-command .pill { background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.3); }
.admin-command-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.admin-command-tools label { color: rgba(255,255,255,.9); }
.admin-command-tools select { min-width: 220px; }

.admin-layout { grid-template-columns: 360px 1fr; align-items: start; }
.admin-rail { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: auto; padding-right: 4px; }
.admin-content { display: block; }
.compact-title { margin: 0 0 12px; }
.security-panel { border-top: 3px solid var(--brand); }

.admin-user-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.admin-user-row {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
}
.admin-user-row strong { font-size: .94rem; }
.admin-user-row .choice-row { justify-content: flex-end; }

.credential-box, .audit-box { margin-top: 12px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: .88rem; }
.credential-box code, .audit-box code { font-family: ui-monospace, Menlo, monospace; color: var(--brand-ink); overflow-wrap: anywhere; }
.credential-box div { display: flex; gap: 8px; justify-content: space-between; padding: 3px 0; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }

.bars { display: grid; gap: 8px; }
.bars .bar-row { display: grid; grid-template-columns: 38px 1fr 36px; align-items: center; gap: 10px; font-size: .85rem; }
.bars .bar-track { height: 10px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.bars .bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--accent)); }

@media (max-width: 940px) { .admin-layout { grid-template-columns: 1fr; } .admin-rail { position: static; max-height: none; } }

/* ---------- Admin cockpit ---------- */
.cockpit-body-bg { background: var(--bg); }
.cockpit { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }

.cockpit-rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  gap: 10px; padding: 18px 14px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  overflow-y: auto;
}
.cockpit-brand { display: flex; align-items: center; gap: 11px; font-weight: 800; font-family: Sora, sans-serif; color: var(--ink); padding: 6px 8px 14px; }
.cockpit-brand small { display: block; font-weight: 600; font-size: .64rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.cockpit-nav { display: flex; flex-direction: column; gap: 4px; }
.cockpit-nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 11px 13px; border-radius: 11px; font-weight: 600; font-size: .92rem;
  color: var(--ink-soft); text-align: left; border: 1px solid transparent;
  transition: background .14s, color .14s, border-color .14s;
}
.cockpit-nav-item .ci { font-size: 1.1rem; width: 22px; text-align: center; }
.cockpit-nav-item:hover { background: var(--surface-2); border-color: var(--line); }
.cockpit-nav-item.active { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 10px 22px -12px rgba(22,104,227,.8); }
.cockpit-rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.cockpit-rail-foot .nav { flex-direction: column; align-items: stretch; gap: 4px; margin: 0; }
.cockpit-rail-foot .nav a { justify-content: flex-start; }
.cockpit-rail-foot .nav .nav-user { justify-content: flex-start; }
.cockpit-rail-tools { display: flex; gap: 8px; }

.cockpit-main { display: flex; flex-direction: column; min-width: 0; }
.cockpit-topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 16px;
  padding: 14px clamp(16px, 3vw, 30px); border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px); flex-wrap: wrap;
}
.cockpit-title { display: flex; flex-direction: column; gap: 4px; margin-right: auto; }
.cockpit-title h1 { font-size: 1.4rem; margin: 0; }
.cockpit-topbar-tools { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.cockpit-field { font-size: .8rem; }
.cockpit-field select { min-width: 200px; }
.cockpit-burger { display: none; font-size: 1.3rem; color: var(--ink); width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface); }

.cockpit-kpis {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px;
  padding: 18px clamp(16px, 3vw, 30px) 0;
}
.cockpit-content { padding: 18px clamp(16px, 3vw, 30px) 60px; }
.cockpit-panel-group[hidden] { display: none; }
.cockpit-panel-group { animation: cockpit-fade .2s ease; }
@keyframes cockpit-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .cockpit { grid-template-columns: 1fr; }
  .cockpit-rail {
    position: fixed; left: 0; top: 0; z-index: 80; width: 264px; height: 100vh;
    transform: translateX(-110%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  .cockpit-rail.open { transform: none; }
  .cockpit-burger { display: inline-grid; place-items: center; }
}

/* ---------- AI console (admin) ---------- */
.ai-panel { border-top: 3px solid var(--accent); }
.ai-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 4px 0 14px; }
.ai-status-grid .metric { padding: 12px 14px; }
.ai-status-grid .metric strong { font-size: 1.2rem; }
.ai-block { display: grid; gap: 10px; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); margin-top: 14px; }
.ai-block h3 { font-size: .98rem; }
.ai-result {
  display: none; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #f4f7ff, #eef9ff); border: 1px solid #dde7fb;
}
.ai-result.show { display: flex; }
[data-theme="dark"] .ai-result { background: linear-gradient(135deg, #121f35, #102b39); border-color: var(--line-strong); }
.ai-result .ai-big-star { font-size: 1.9rem; font-weight: 900; font-family: Sora; color: #f59e0b; white-space: nowrap; }
.ai-result .ai-result-meta { display: grid; gap: 3px; font-size: .85rem; color: var(--ink-soft); }
.ai-spinner { width: 18px; height: 18px; border: 3px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; display: inline-block; animation: ai-spin .7s linear infinite; }
@keyframes ai-spin { to { transform: rotate(360deg); } }

/* ---------- Service ratings ---------- */
.service-block { display: grid; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.service-block-head { display: flex; flex-direction: column; gap: 2px; }
.service-block-head strong { font-size: .95rem; }
.service-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.service-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 11px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.service-row .service-name { font-size: .88rem; font-weight: 600; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.service-row select { width: auto; min-width: 72px; padding: 6px 8px; }
.service-add { display: flex; gap: 8px; flex-wrap: wrap; }
.service-add input { flex: 1; min-width: 180px; }

/* Read-only service averages (public / structure) */
.service-scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.service-score { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.service-score small { font-size: .82rem; color: var(--ink-soft); font-weight: 600; }
.service-score .sv { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.service-score .sv b { font-family: Sora, sans-serif; color: var(--ink); }
.service-score .sv-bar { width: 46px; height: 6px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.service-score .sv-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); }
.service-score.added { border-color: #d6def8; background: linear-gradient(135deg, #f4f7ff, #eef9ff); }
[data-theme="dark"] .service-score.added { background: linear-gradient(135deg, #121f35, #102b39); border-color: var(--line-strong); }

/* ---------- Toast notifications ---------- */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 90; display: flex; flex-direction: column; gap: 10px; max-width: min(360px, calc(100% - 36px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 15px;
  border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: .9rem; font-weight: 600; color: var(--ink);
  animation: toast-in .25s ease; border-left: 4px solid var(--brand);
}
.toast.green { border-left-color: var(--green); }
.toast.coral { border-left-color: var(--coral); }
.toast.amber { border-left-color: var(--amber); }
.toast .toast-icon { font-size: 1.05rem; line-height: 1.2; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Responsive ---------- */
@media (max-width: 940px) {
  .layout, .two-col, .public-hero .grid, .hero-gateway, .map-layout, .reviewer-layout { grid-template-columns: 1fr; }
  .layout aside { position: static; }
  .form-grid.two { grid-template-columns: 1fr; }
  .nav { gap: 5px; }
  .nav a { padding: 7px 10px; font-size: .85rem; }
  .admin-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reviewer-hero { flex-direction: column; align-items: start; }
  .reviewer-hero-tools { justify-content: flex-start; }
}

@media (max-width: 620px) {
  main, .admin-main, .hero-gateway { width: min(100% - 24px, 1180px); }
  .reviewer-main { width: min(100% - 24px, 1180px); }
  .topbar { flex-wrap: wrap; gap: 10px 12px; }
  .brand { flex: 1 1 calc(100% - 56px); min-width: 0; }
  .brand > span { min-width: 0; }
  .theme-toggle { order: 2; }
  .nav { order: 3; width: 100%; margin-left: 0; justify-content: flex-start; }
  .nav a, .nav .button, .nav .ghost-button { min-height: 36px; }
  .public-hero .grid { padding: 20px; }
  .social-feed { grid-template-columns: 1fr; }
  .auth-wrap { padding: 14px; }
  .admin-overview { grid-template-columns: 1fr; }
}
