:root{
  --paper:#f7f7f4;
  --ink:#1a1a1a;
  --line:#b9b9b9;
  --line2:#d2d2d2;
  --muted:#5a5a5a;
  --bg:#0b0f14;
  --panel:#111824;
  --panelLine:#1f2a3a;
  --uiText:#e9eef6;
  --radius: 14px;
  --pad: 18px;
  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
body { margin:0; background:var(--bg); color:var(--uiText); font-family:var(--font); }
header { padding:14px 16px; border-bottom:1px solid var(--panelLine); position:sticky; top:0; background:var(--bg); z-index:10; }
.site-header-inner { display:flex; justify-content:space-between; align-items:center; gap:12px; max-width:1440px; margin:0 auto; }
.site-brand { font-weight:800; letter-spacing:.04em; text-transform:uppercase; }
.site-header-actions { display:flex; align-items:center; gap:10px; }
.landing-page { min-height:calc(100vh - 78px); display:grid; place-items:center; padding:28px; }
.landing-image { width:min(100%, 1040px); height:auto; display:block; }
#appWorkspace { display:none; }
.wrap { max-width:1260px; margin:0 auto; padding:14px; gap:14px; grid-template-columns:1fr; }
@media (min-width:1150px){ .wrap { grid-template-columns:470px 1fr; padding:18px; align-items:start; } }
body.logged-in #landingPage { display:none; }
body.logged-in #appWorkspace { display:grid; max-width:none; width:100%; }
@media (min-width:1150px){ body.logged-in .wrap { grid-template-columns:1fr; } }

.panel { background:var(--panel); border:1px solid var(--panelLine); border-radius:var(--radius); padding:14px; }
.btn { background:#2b6cff; border:0; color:#fff; font-weight:800; padding:12px 14px; border-radius:12px; cursor:pointer; }
.btn.secondary { background:#223047; }
.btn.danger { background:#d64545; }
.btn.small { padding:8px 10px; border-radius:10px; font-size:13px; }
.btn:disabled { opacity:.55; cursor:not-allowed; }

.sheet { background:var(--paper); color:var(--ink); border-radius:var(--radius); overflow:hidden; box-shadow:0 14px 50px rgba(0,0,0,.35); }
.sheet-inner { padding:var(--pad); }
.sheet-topline { height:10px; border-top:2px solid var(--line); margin:0 var(--pad); }
.sheet-title { display:flex; align-items:center; gap:10px; margin:8px 0 14px; text-transform:uppercase; letter-spacing:.08em; font-weight:800; font-size:14px; }
.pin { width:11px; height:11px; border:1px solid var(--line); border-radius:3px; position:relative; background:#ecece7; }
.pin:after { content:""; width:5px; height:5px; background:var(--ink); border-radius:50%; position:absolute; left:2px; top:2px; }

.subsheet {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.32);
  padding: 14px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
}

.subsheet-header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
  padding-bottom:10px;
  border-bottom:2px solid var(--line);
}

.subsheet-title {
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:13px;
}

.subsheet-desc {
  font-size:12px;
  color:var(--muted);
}

.grid { display:grid; gap:10px; }
.grid-2 { grid-template-columns:1fr 1fr; }
@media (max-width:720px){ .grid-2 { grid-template-columns:1fr; } }
.field { display:grid; gap:6px; }
.label { font-size:11px; color:var(--muted); }

input.textline, textarea.ruled, select.selectline {
  font-size:16px;
  color:var(--ink);
  background:transparent;
  outline:none;
}

input.textline, select.selectline {
  border:none;
  border-bottom:1px solid var(--line);
  padding:10px 2px 7px;
}

textarea.ruled {
  width:100%;
  box-sizing:border-box;
  border:none;
  resize:vertical;
  padding:6px 2px;
  min-height:120px;
  line-height:27px;
  background: repeating-linear-gradient(to bottom, transparent 0px, transparent 26px, var(--line2) 27px);
}

.section-h {
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  font-size:13px;
  margin:14px 0 8px;
  padding-top:10px;
  border-top:2px solid var(--line);
}

.radio-row, .check-row {
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  align-items:center;
  padding-top:8px;
}

.radio-row label, .check-row label {
  display:flex;
  gap:10px;
  align-items:center;
  font-size:13px;
  color:var(--ink);
}

.rating-row {
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:12px;
  border-top:2px solid var(--line);
  padding-top:12px;
  margin-top:12px;
  flex-wrap:wrap;
}

.scoreline {
  min-width:84px;
  text-align:right;
  border-bottom:1px solid var(--line);
  padding:0 2px 4px;
}

.note {
  border:1px solid var(--panelLine);
  background:#0e141f;
  border-radius:14px;
  padding:12px;
  margin-top:12px;
}

.pill {
  display:inline-block;
  padding:3px 8px;
  border-radius:999px;
  border:1px solid #263247;
  font-size:12px;
  margin:2px 6px 2px 0;
}

.muted-ui { opacity:.75; font-size:12px; }

.timeline-item {
  border:1px solid #263247;
  background:#0b111b;
  border-radius:12px;
  padding:10px;
  margin-top:8px;
}

.timeline-item.active {
  outline:2px solid #3d6fff;
}

.radar-wrap {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255,255,255,.25);
}
.radar-title {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}
.radar-svg {
  width: 100%;
  max-width: 560px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.radar-ring { fill: none; stroke: #9a9a9a; stroke-width: 1.2; stroke-dasharray: 4 4; }
.radar-axis { stroke: #8a8a8a; stroke-width: 1.4; }
.radar-shape { fill: none; stroke: #7d7d7d; stroke-width: 2; }
.radar-shape-point { fill: #bdbdbd; stroke: #777; stroke-width: 1.2; }
.radar-label { font-size: 18px; fill: #666; font-weight: 500; text-anchor: middle; dominant-baseline: middle; }
.radar-level { font-size: 14px; fill: #666; text-anchor: middle; }
.radar-choice { cursor: pointer; }
.radar-choice circle.hit { fill: transparent; }
.radar-choice circle.dot { fill: white; stroke: #888; stroke-width: 1.5; }
.radar-choice.selected circle.dot { fill: #666; stroke: #444; }
.radar-output { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.65); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 1000; }
.modal-backdrop.open { display: flex; }
.modal { width: min(980px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--panelLine); border-radius: 16px; padding: 18px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.auth-modal-backdrop { z-index: 1050; }
.auth-modal { width:min(460px, 100%); }
.auth-modal-header { display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:12px; }
.auth-modal-title { font-weight:800; font-size:18px; }
.account-card { padding:0; border:none; background:transparent; }
.account-card #authBox { display:block; }
.field a { color:#274f9d; }
.account-settings-modal { width:min(720px, 100%); }
.admin-users-modal { width:min(980px, 100%); }
.settings-stack { display:grid; gap:12px; }
.settings-panel { padding:14px; }
.settings-input {
  width:100%;
  box-sizing:border-box;
  padding:12px;
  border-radius:12px;
  border:1px solid #263247;
  background:#0b0f14;
  color:#e9eef6;
  font-size:16px;
}
.danger-panel { border-color:#5b2626; }
.admin-users-list { display:grid; gap:10px; }
.admin-user-card {
  border:1px solid var(--panelLine);
  background:#0e141f;
  border-radius:14px;
  padding:12px;
}
.admin-user-meta {
  display:flex;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  align-items:flex-start;
}
.admin-user-actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:10px;
}
.status-pill {
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 9px;
  border-radius:999px;
  font-size:12px;
  border:1px solid #2a3850;
}
.status-pill.pending { border-color:#806420; color:#ffd87a; }
.status-pill.active { border-color:#1f5a38; color:#93efb8; }
.status-pill.disabled { border-color:#6a3131; color:#ff9c9c; }
.view-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
@media (max-width: 720px) { .view-grid { grid-template-columns: 1fr; } }
.view-block { background: #0e141f; border: 1px solid var(--panelLine); border-radius: 12px; padding: 12px; }
.view-block h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.view-text { white-space: pre-wrap; line-height: 1.5; }
.photo-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:10px; margin-top:12px; }
.photo-card { border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.22); overflow:hidden; }
.photo-card img { width:100%; height:140px; object-fit:cover; display:block; background:#ddd; cursor:pointer; }
.photo-meta { padding:8px; display:grid; gap:6px; font-size:12px; color:var(--muted); }
.photo-pending { padding:10px; font-size:12px; color:var(--muted); border:1px dashed var(--line); border-radius:12px; background:rgba(255,255,255,.18); }
.image-lightbox-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.82); display: none; align-items: center; justify-content: center; padding: 24px; z-index: 1100; }
.image-lightbox-backdrop.open { display: flex; }
.image-lightbox { width: min(1100px, 100%); max-height: 100%; display:grid; gap:10px; justify-items:center; }
.image-lightbox-stage { width:100%; display:grid; grid-template-columns:48px minmax(0, 1fr) 48px; align-items:center; gap:12px; }
.image-lightbox img { max-width: 100%; max-height: min(82vh, 1000px); object-fit: contain; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.45); background:#111; touch-action: pan-y; -webkit-user-drag:none; user-select:none; }
.image-lightbox-caption { color: #f0f3f8; font-size: 13px; text-align: center; }
.lightbox-nav { min-width:48px; min-height:48px; display:inline-flex; align-items:center; justify-content:center; font-size:28px; line-height:1; padding:0; border-radius:999px; }
.lightbox-nav.hidden { visibility:hidden; pointer-events:none; }

.review-section { margin-top:10px; }
.review-section-title { font-weight:800; text-transform:uppercase; letter-spacing:.08em; font-size:11px; color:var(--muted); margin-bottom:4px; }
.review-section-text { white-space:pre-wrap; line-height:1.6; font-size:14px; }
.review-sources a { display:block; font-size:12px; margin-top:3px; color:#274f9d; word-break:break-all; }

@media (max-width: 720px) {
  .landing-page { padding:20px; min-height:calc(100vh - 74px); }
  .site-header-inner { align-items:center; }
}
