/* NorgeStart v3.0.0 — Nordic design system */
:root {
  --flag-blue: #00205B;
  --flag-red: #BA0C2F;
  --navy: #0B2545;
  --navy-2: #13315C;
  --accent: #1B5DA8;
  --accent-strong: #134a88;
  --accent-soft: #E4EEF9;
  --ice: #F3F6FA;
  --bg: #EEF3F8;
  --card: #FFFFFF;
  --text: #16233A;
  --muted: #5D6B82;
  --border: #DCE4EE;
  --green: #187944;
  --orange: #B4620B;
  --red: #BA0C2F;
  --tabbar-h: 64px;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(11, 37, 69, 0.05), 0 4px 14px rgba(11, 37, 69, 0.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1220;
    --card: #12203A;
    --ice: #0E1930;
    --text: #E9EEF6;
    --muted: #94A3BB;
    --border: #23334F;
    --navy: #142B4F;
    --navy-2: #0F2240;
    --accent: #5B93D6;
    --accent-strong: #7FACE2;
    --accent-soft: #1A3153;
    --shadow: none;
    /* status colours brightened so text/icons stay readable on dark */
    --green: #34C77B;
    --orange: #E8A04C;
    --red: #F0596F;
  }
}
:root { color-scheme: light dark; }
input, textarea, select, button { color: var(--text); font-family: inherit; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh; min-height: 100dvh;
  font-size: 15.5px; line-height: 1.5;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.center { text-align: center; }
h1 { font-size: 1.65rem; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; letter-spacing: -0.015em; }
h3 { font-size: 1.05rem; letter-spacing: -0.01em; }

/* ---------- icons ---------- */
.ic { display: inline-flex; width: 20px; height: 20px; vertical-align: -4px; }
.ic svg { width: 100%; height: 100%; }
.tool-ic { margin-inline-end: 8px; color: var(--accent); }
.brand-mark { display: inline-flex; width: 30px; height: 30px; border-radius: 8px; overflow: hidden; flex: none; }
.brand-mark svg { width: 100%; height: 100%; }
.brand-lockup { display: flex; align-items: center; justify-content: center; gap: 10px; }
.brand-lockup.small { font-weight: 700; font-size: 1.05rem; gap: 8px; justify-content: flex-start; }
.brand-lockup.small .brand-mark { width: 26px; height: 26px; border-radius: 7px; }

/* ---------- first-run language screen ---------- */
.screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; }
.lang-art { width: 100%; max-height: 270px; overflow: hidden; line-height: 0; }
.lang-art svg { width: 100%; height: auto; display: block; }
.ob-wrap { width: 100%; max-width: 500px; text-align: center; padding: 26px 22px 40px; }
.ob-step { margin-top: 26px; text-align: center; }
.ob-step h3 { margin-bottom: 14px; }
.ob-wrap input[type=text] {
  width: 100%; padding: 13px; font-size: 1rem; border: 1px solid var(--border);
  border-radius: 12px; background: var(--card); color: var(--text); margin-bottom: 14px;
}
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice {
  padding: 14px 10px; border: 1.5px solid var(--border); border-radius: 14px;
  background: var(--card); color: var(--text); font-size: 0.96rem; cursor: pointer;
  transition: border-color .15s, transform .1s, box-shadow .15s; box-shadow: var(--shadow);
}
.choice:hover { border-color: var(--accent); }
.choice:active { transform: scale(0.97); }
.choice .big { display: block; font-size: 24px; margin-bottom: 4px; }
.choice.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 18px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 0.98rem; cursor: pointer;
  font-weight: 500; transition: filter .15s, border-color .15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.18); }
.btn.small { padding: 7px 12px; font-size: 0.85rem; border-radius: 10px; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn.danger { color: var(--red); }
.btn:disabled { opacity: 0.5; }

/* ---------- app frame ---------- */
#topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
  background: var(--navy); color: #fff;
}
#topbar .brand-lockup { color: #fff; }
#topbar button { background: none; border: none; cursor: pointer; color: #fff; width: 24px; height: 24px; }
#topbar button svg { width: 22px; height: 22px; }
#views {
  padding: 16px 14px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 20px);
  max-width: 760px; margin: 0 auto;
}
.view > h2 { margin: 6px 0 14px; }
.row-between { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 12px; }
.row-between h3 { font-size: 1.12rem; }
.view-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.chat-head { justify-content: space-between; }

#sideBrand { display: none; }
#tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--border);
}
.tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; background: none; border: none; color: var(--muted); cursor: pointer; border-radius: 12px;
}
.tab .ic { width: 22px; height: 22px; }
.tab label { font-size: 0.66rem; pointer-events: none; font-weight: 500; }
.tab.active { color: var(--accent-strong); }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}

/* ---------- hero with mountain art ---------- */
.hero {
  position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 18px;
  background: linear-gradient(165deg, #0B2545 0%, #123A6B 55%, #1B5DA8 100%);
  box-shadow: var(--shadow);
}
.hero-art { line-height: 0; }
.hero-art svg { width: 100%; height: auto; display: block; }
.hero-body { position: absolute; inset: 0; padding: 22px 24px; color: #fff; display: flex; flex-direction: column; justify-content: flex-start; }
.hero-body h1 { font-size: 1.8rem; margin-bottom: 6px; text-shadow: 0 1px 8px rgba(4, 16, 34, 0.35); }
.hero-body p { max-width: 34em; color: #D8E4F5; font-size: 0.95rem; line-height: 1.45; text-shadow: 0 1px 6px rgba(4, 16, 34, 0.45); }
.hero-mini {
  background: linear-gradient(150deg, var(--navy), var(--navy-2)); color: #fff; border: none;
}
.hero-mini .muted, .hero-mini .small { color: #C3D3EA; }

/* ---------- quick actions ---------- */
.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.qa {
  display: flex; flex-direction: column; gap: 8px; text-align: start;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 15px 13px; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, transform .12s; color: var(--text);
}
.qa:hover { border-color: var(--accent); transform: translateY(-2px); }
.qa .qa-ic {
  width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-strong);
}
.qa .qa-ic svg { width: 21px; height: 21px; }
.qa b { font-size: 0.98rem; }
.qa span.sub { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }

/* ---------- plan card & emergency strip ---------- */
.plan-card { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.plan-card .pc-head { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.plan-card .pc-head .qa-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); display: flex; align-items: center; justify-content: center; }
.plan-card .pc-head .qa-ic svg { width: 19px; height: 19px; }
.plan-card p { color: var(--muted); font-size: 0.9rem; }
.plan-card .progress-outer { margin: 2px 0; }
.em-strip {
  display: flex; gap: 8px; justify-content: space-between; margin-top: 18px;
  background: var(--navy); border-radius: var(--radius); padding: 14px 16px;
}
.em-strip a { display: flex; flex-direction: column; align-items: center; text-decoration: none; color: #fff; flex: 1; }
.em-strip b { font-size: 1.15rem; }
.em-strip span { font-size: 0.68rem; color: #B9C9E2; }
.em-strip a + a { border-inline-start: 1px solid rgba(255,255,255,0.14); }

/* ---------- progress ---------- */
.progress-outer { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.25); margin: 12px 0 6px; overflow: hidden; }
.card:not(.hero-mini) .progress-outer { background: var(--border); }
.progress-inner { height: 100%; width: 0; border-radius: 4px; background: #4ade80; transition: width .4s; }

/* ---------- timeline / plan ---------- */
.tl-phase-head { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; }
.tl-phase-head b { font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); white-space: nowrap; }
.tl-phase-head .ph-line { flex: 1; height: 1px; background: var(--border); }
.tl-phase-head .ph-count { font-size: 0.72rem; font-weight: 700; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 2px 9px; }
.tl-phase-head.ph-done .ph-count { color: #fff; background: var(--green); border-color: var(--green); }
.tl-item {
  display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 13px 14px; margin-bottom: 8px; box-shadow: var(--shadow);
}
.tl-item.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.tl-check {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border);
  background: transparent; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: transparent; margin-top: 1px; cursor: pointer; transition: background .15s, border-color .15s;
}
.tl-check:hover { border-color: var(--green); color: var(--green); }
.tl-item.done .tl-check { background: var(--green); border-color: var(--green); color: #fff; }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-weight: 650; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-item.done .tl-title { text-decoration: line-through; color: var(--muted); }
.next-chip { font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: #fff; background: var(--accent); border-radius: 20px; padding: 2px 8px; }
.tl-desc { font-size: 0.88rem; color: var(--muted); line-height: 1.5; }
.tl-item.done .tl-desc { display: none; }
.tl-link {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 0.8rem; font-weight: 600;
  text-decoration: none; color: var(--accent-strong); background: var(--accent-soft); border-radius: 20px; padding: 5px 12px;
}

.hist-item {
  display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
}
.hist-item:hover { border-color: var(--accent); }
.hist-dot { flex: none; width: 12px; height: 12px; border-radius: 50%; }
.hist-title { font-weight: 600; }
.hist-date { font-size: 0.8rem; color: var(--muted); }

/* ---------- scan ---------- */
.kind-toggle { display: flex; gap: 8px; margin: 12px 0; }
.kt { flex: 1; padding: 9px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--card); color: var(--muted); cursor: pointer; font-size: 0.9rem; }
.kt.active { border-color: var(--accent); color: var(--accent-strong); font-weight: 600; background: var(--accent-soft); }
.scan-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.file-btn { flex: 1; min-width: 140px; }
textarea {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--ice); color: var(--text); font-size: 1rem; font-family: inherit; resize: vertical;
}
.spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-card { border-inline-start: 5px solid var(--muted); }
.result-card.red { border-inline-start-color: var(--red); }
.result-card.orange { border-inline-start-color: var(--orange); }
.result-card.green { border-inline-start-color: var(--green); }
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 0.73rem; font-weight: 700; color: #fff; margin-inline-end: 6px; letter-spacing: 0.3px; }
.badge.red { background: var(--red); } .badge.orange { background: var(--orange); } .badge.green { background: var(--green); }
.badge.cat { background: var(--accent); }
.result-section { margin-top: 14px; }
.result-section > h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 6px; }
.result-section p, .result-section li { font-size: 0.95rem; line-height: 1.55; }
.result-section ul { padding-inline-start: 20px; }
.result-section a { color: var(--accent-strong); word-break: break-all; }
.expl-block { background: var(--ice); border-radius: 12px; padding: 11px 13px; margin-bottom: 8px; }
.expl-block h5 { font-size: 0.9rem; margin-bottom: 3px; color: var(--accent-strong); }
.expl-block p { font-size: 0.92rem; }
.orig-toggle { font-size: 0.85rem; color: var(--accent-strong); background: none; border: none; cursor: pointer; padding: 0; }
.deadline-box { background: color-mix(in srgb, var(--red) 11%, transparent); border-radius: 10px; padding: 10px 12px; margin-top: 10px; font-weight: 600; }
.extracted-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.extracted-table td { padding: 8px 8px; border-bottom: 1px solid var(--border); font-size: 0.9rem; vertical-align: top; }
.extracted-table td:last-child { text-align: end; font-weight: 650; white-space: nowrap; }
.extracted-table .term { font-weight: 600; }
.extracted-table .meaning { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 400; margin-top: 1px; }

/* ---------- guides ---------- */
.guide-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.guide-tile {
  display: flex; align-items: center; gap: 11px; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 13px; cursor: pointer; box-shadow: var(--shadow);
  transition: border-color .15s, transform .12s; text-align: start;
}
.guide-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.guide-tile .gi {
  flex: none; width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-strong);
}
.guide-tile .gi svg { width: 20px; height: 20px; }
.guide-tile b { font-size: 0.9rem; line-height: 1.25; }
#guideDetail .gd-head { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
#guideDetail .gd-head .gi { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-strong); display: flex; align-items: center; justify-content: center; }
#guideDetail .gd-head .gi svg { width: 22px; height: 22px; }
.gd-section { margin-bottom: 7px; background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.gd-section summary { font-weight: 600; padding: 14px 15px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.gd-section summary::-webkit-details-marker { display: none; }
.gd-section summary::after { content: "▾"; color: var(--muted); }
.gd-section[open] summary::after { content: "▴"; }
.gd-body { padding: 0 15px 15px; font-size: 0.94rem; line-height: 1.58; }
.gd-body ul { padding-inline-start: 20px; margin: 6px 0; }
.gd-body li { margin-bottom: 5px; }
.gd-body a { color: var(--accent-strong); }
.gd-warn { background: color-mix(in srgb, var(--orange) 13%, transparent); border-radius: 10px; padding: 11px 13px; margin: 8px 0; font-size: 0.9rem; }
.gd-sources { margin-top: 14px; }
.gd-sources h4 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 8px; }
.gd-sources a {
  display: inline-flex; align-items: center; gap: 5px; margin: 0 6px 6px 0; font-size: 0.8rem; font-weight: 600;
  text-decoration: none; color: var(--accent-strong); background: var(--accent-soft); border-radius: 20px; padding: 5px 12px;
}

/* ---------- tools ---------- */
.tools-grid { display: block; }
label { display: block; font-size: 0.9rem; margin: 10px 0 5px; color: var(--muted); }
input[type=number] { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--ice); color: var(--text); font-size: 1.05rem; }
.check-label { display: flex; align-items: center; gap: 8px; margin: 10px 0; color: var(--text); font-size: 0.92rem; }
.check-label input { width: 18px; height: 18px; }
#calcBtn, #hpBtn { margin-top: 8px; }
.calc-result { margin-top: 14px; }
.calc-result table { width: 100%; border-collapse: collapse; }
.calc-result td { padding: 7px 4px; border-bottom: 1px solid var(--border); font-size: 0.93rem; }
.calc-result td:last-child { text-align: end; font-weight: 600; }
.calc-result tr.total td { font-weight: 800; font-size: 1.05rem; border-bottom: none; color: var(--green); }
.emergency .em-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.em-item { display: flex; flex-direction: column; align-items: center; padding: 14px; border-radius: 14px; text-decoration: none; color: #fff; font-size: 0.85rem; }
.em-item b { font-size: 1.5rem; }
.em-item.red { background: var(--red); } .em-item.blue { background: #1d4ed8; }
.em-item.orange { background: #d97706; } .em-item.green { background: var(--green); }

/* ---------- chat ---------- */
#view-chat { display: flex; flex-direction: column; min-height: calc(100dvh - var(--tabbar-h) - 130px); }
#chatLog { flex: 1; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; margin-bottom: 10px; font-size: 0.95rem; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { background: var(--navy); color: #fff; margin-inline-start: auto; border-end-end-radius: 4px; }
.msg.ai { background: var(--card); border: 1px solid var(--border); border-end-start-radius: 4px; box-shadow: var(--shadow); }
.msg.ai a { color: var(--accent-strong); }
.msg.typing { color: var(--muted); font-style: italic; }
#chatSuggestions { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.sug { padding: 8px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--card); color: var(--accent-strong); font-size: 0.82rem; cursor: pointer; }
.sug:hover { border-color: var(--accent); }
.chat-input-row { display: flex; gap: 8px; align-items: flex-end; position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); }
.chat-input-row textarea { flex: 1; max-height: 120px; background: var(--card); }
.chat-input-row .btn { padding: 12px 14px; }
.chat-input-row .ic { width: 18px; height: 18px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(5, 15, 30, 0.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--card); border-radius: 18px; padding: 20px; width: 100%; max-width: 380px; }
.modal-box h3 { margin-bottom: 8px; }
.modal-box select { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--ice); color: var(--text); font-size: 1rem; margin-bottom: 6px; }
.modal-box .muted { margin-top: 12px; }

/* ---------- desktop layout ---------- */
@media (min-width: 900px) {
  #app { padding-inline-start: 236px; }
  #tabbar {
    inset-inline-start: 0; inset-inline-end: auto; top: 0; bottom: 0; width: 236px; height: auto;
    flex-direction: column; justify-content: flex-start; gap: 4px; padding: 20px 14px;
    border-top: none; border-inline-end: 1px solid var(--border);
  }
  #sideBrand { display: flex; align-items: center; gap: 9px; font-size: 1.12rem; padding: 4px 10px 20px; color: var(--text); }
  .tab { flex: none; width: 100%; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 11px 14px; }
  .tab label { font-size: 0.95rem; cursor: pointer; }
  .tab:hover, .tab.active { background: var(--accent-soft); }
  #topbar { display: none; }
  #views { max-width: 940px; padding: 30px 40px 60px; }
  .hero-body { padding: 34px 38px; }
  .hero-body h1 { font-size: 2.3rem; }
  .hero-body p { font-size: 1.05rem; }
  .qa-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .choice-grid { grid-template-columns: repeat(3, 1fr); }
  .guide-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .guide-grid.big { grid-template-columns: repeat(3, 1fr); }
  .tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .tools-grid .card { margin-bottom: 0; }
  .tools-grid .emergency { grid-column: 1 / -1; }
  .emergency .em-grid { grid-template-columns: repeat(4, 1fr); }
  .card { padding: 22px; }
  #view-chat { min-height: calc(100vh - 170px); max-width: 780px; }
  .msg { max-width: 75%; }
  .chat-input-row { bottom: 12px; }
  .em-strip { padding: 16px 24px; }
  .em-strip b { font-size: 1.3rem; }
  .em-strip span { font-size: 0.75rem; }
}

/* ===================== v3.1 additions ===================== */

/* top bar actions & language button */
.top-actions { display: flex; align-items: center; gap: 6px; }
#langBtn {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.14) !important; border: none; border-radius: 20px;
  padding: 5px 11px !important; width: auto !important; height: auto !important;
  font-size: 0.85rem; color: #fff !important; cursor: pointer; font-weight: 600;
}
.side-lang {
  display: none; margin-top: auto; width: 100%; align-items: center; gap: 12px;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: none; color: var(--muted); cursor: pointer;
}
.side-lang .ic { width: 20px; height: 20px; }
.side-lang label { font-size: 0.9rem; cursor: pointer; }
.side-lang:hover { background: var(--accent-soft); color: var(--text); }
@media (min-width: 900px) {
  .side-lang { display: flex; }
  #topbar { display: none; }
}

/* settings plan block */
.st-plan { display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  background: var(--ice); border-radius: 12px; padding: 12px 14px; margin: 10px 0; }
.st-plan span { color: var(--muted); font-size: 0.85rem; }

/* paywall */
.pay-box { text-align: center; }
.pay-crown { width: 46px; height: 46px; margin: 0 auto 8px; color: #E5A93D; }
.pay-crown svg { width: 100%; height: 100%; fill: #E5A93D; stroke: #E5A93D; }
.pay-feats { list-style: none; text-align: start; margin: 14px 0; }
.pay-feats li { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 8px; font-size: 0.93rem; }
.pay-feats .ic { color: var(--green); flex: none; margin-top: 1px; }
.pay-box input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--ice); font-size: 0.95rem; text-align: center; letter-spacing: 1px; margin-top: 8px; }
.pay-box .btn.primary { margin-top: 10px; }

/* deadlines */
.dl-item { display: flex; gap: 12px; align-items: center; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; box-shadow: var(--shadow); }
.dl-date { flex: none; width: 48px; text-align: center; background: var(--accent-soft);
  border-radius: 10px; padding: 6px 0; color: var(--accent-strong); }
.dl-date b { display: block; font-size: 1.15rem; line-height: 1.1; }
.dl-date span { font-size: 0.68rem; text-transform: uppercase; font-weight: 700; }
.dl-body { flex: 1; min-width: 0; }
.dl-title { font-weight: 600; margin-bottom: 4px; }
.dl-chip { display: inline-block; font-size: 0.72rem; font-weight: 700; border-radius: 20px;
  padding: 2px 9px; background: var(--border); color: var(--muted); }
.dl-chip.red { background: var(--red); color: #fff; }
.dl-chip.orange { background: var(--orange); color: #fff; }
.dl-del { flex: none; width: 32px; height: 32px; padding: 6px; background: none; border: none;
  color: var(--muted); cursor: pointer; border-radius: 8px; }
.dl-del:hover { color: var(--red); background: var(--ice); }
.dl-del svg { width: 100%; height: 100%; }
.dl-save { margin-inline-start: 8px; vertical-align: middle; }
.dl-save .ic, .dl-save svg { width: 14px; height: 14px; vertical-align: -2px; }
.dl-saved { color: var(--green); font-weight: 600; font-size: 0.85rem; margin-inline-start: 8px; }
input[type=date] { width: 100%; padding: 11px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--ice); color: var(--text); font-size: 1rem; }
#dlExport { margin-top: 4px; }

/* ===================== landing ===================== */
#landing { min-height: 100vh; background: var(--bg); }
.ld-nav { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 18px; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.ld-nav .brand-lockup { color: var(--text); }
.ld-nav-right { display: flex; align-items: center; gap: 12px; }
.ld-langs { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.ld-lang { background: none; border: 1.5px solid transparent; border-radius: 8px; font-size: 17px;
  padding: 3px 5px; cursor: pointer; line-height: 1; }
.ld-lang.sel { border-color: var(--accent); background: var(--accent-soft); }
.ld-hero { position: relative; overflow: hidden; background: linear-gradient(165deg, #081A36, #123A6B); }
.ld-hero-art svg { width: 100%; height: auto; min-height: 320px; display: block; }
.ld-hero-inner { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center;
  align-items: flex-start; padding: 24px; max-width: 1000px; margin: 0 auto; }
.ld-hero-inner h1 { color: #fff; font-size: clamp(1.7rem, 4.5vw, 3rem); max-width: 15em;
  text-shadow: 0 2px 14px rgba(3, 12, 26, 0.5); }
.ld-hero-inner p { color: #D8E4F5; max-width: 36em; margin: 12px 0 20px; font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  text-shadow: 0 1px 8px rgba(3, 12, 26, 0.55); }
.btn.big { padding: 15px 28px; font-size: 1.08rem; border-radius: 14px; }
.ld-cta-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ld-nosign { color: #B9CDE8; font-size: 0.88rem; }
.ld-section { max-width: 1000px; margin: 0 auto; padding: 54px 22px 30px; }
.ld-section h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin-bottom: 24px; text-align: center; }
.ld-alt { max-width: none; background: var(--ice); }
.ld-alt > * { max-width: 1000px; margin-left: auto; margin-right: auto; }
.ld-alt h2 { margin-bottom: 24px; }
.ld-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ld-use { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; padding-bottom: 24px; }
.ld-feat { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px;
  box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.ld-feat .qa-ic { width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft);
  color: var(--accent-strong); display: flex; align-items: center; justify-content: center; }
.ld-feat .qa-ic svg { width: 22px; height: 22px; }
.ld-feat b { font-size: 1.05rem; }
.ld-feat p { color: var(--muted); font-size: 0.9rem; line-height: 1.55; }
.ld-price { overflow-x: auto; }
.ld-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card);
  border: 1px solid var(--border); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.ld-table th, .ld-table td { padding: 13px 16px; text-align: center; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.ld-table td:first-child, .ld-table th:first-child { text-align: start; }
.ld-table thead th { font-size: 1rem; background: var(--ice); }
.ld-table thead th small { display: block; font-weight: 500; color: var(--muted); font-size: 0.75rem; }
.ld-table .prem { background: color-mix(in srgb, var(--accent) 8%, var(--card)); font-weight: 600; }
.ld-table thead th.prem { color: var(--accent-strong); background: color-mix(in srgb, var(--accent) 14%, var(--card)); }
.ld-table .ok { color: var(--green); font-weight: 650; }
.ld-table tbody tr:last-child td { border-bottom: none; }
.ld-foot { position: relative; text-align: center; padding: 60px 22px 70px; overflow: hidden;
  background: linear-gradient(180deg, var(--bg), #0F3059); }
.ld-foot-art { position: absolute; inset: 0; opacity: 0.25; pointer-events: none; }
.ld-foot-art svg { width: 100%; height: 100%; }
.ld-foot p { position: relative; color: var(--text); font-size: 1.15rem; max-width: 30em; margin: 0 auto 20px; }
.ld-foot .btn { position: relative; }
.ld-foot .muted { color: var(--muted); }

/* landing motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
.ld-anim .aurora.a1 { animation: aur 9s ease-in-out infinite alternate; }
.ld-anim .aurora.a2 { animation: aur 12s ease-in-out infinite alternate-reverse; }
@keyframes aur { from { opacity: 0.05; } to { opacity: 0.16; } }
.ld-anim .tw { animation: tw 3.2s ease-in-out infinite alternate; }
.ld-anim .tw.t2 { animation-duration: 4.4s; animation-delay: 1s; }
.ld-anim .tw.t3 { animation-duration: 5.1s; animation-delay: 2s; }
@keyframes tw { from { opacity: 0.15; } to { opacity: 0.8; } }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .ld-anim .aurora, .ld-anim .tw { animation: none; }
}

.ld-foot .muted { color: #C9D6EA; position: relative; }


/* ===== v3.2: interpreter actions, draft, deadline links, banner ===== */
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.prem-star { color: #E5A93D; font-weight: 800; }
.draft-box { max-width: 560px; max-height: 88vh; overflow-y: auto; }
.draft-kinds { flex-wrap: wrap; }
.draft-kinds .kt { flex: 1 1 45%; }
.draft-box input { width: 100%; padding: 11px; border: 1px solid var(--border); border-radius: 12px; background: var(--ice); margin: 8px 0 2px; }
.draft-letter { background: var(--ice); border: 1px solid var(--border); border-radius: 12px; padding: 13px; white-space: pre-wrap; font-family: inherit; font-size: 0.9rem; line-height: 1.55; max-height: 300px; overflow-y: auto; }
.dl-src { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.dl-open { margin-top: 6px; border: none; cursor: pointer; }
.due-banner {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: start;
  background: color-mix(in srgb, var(--red) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--red) 40%, var(--border));
  border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; cursor: pointer; color: var(--text); font-size: 0.92rem;
}
.due-banner svg { width: 19px; height: 19px; color: var(--red); flex: none; }
.doc-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--accent-soft); color: var(--accent-strong);
  border-radius: 20px; padding: 6px 12px; font-size: 0.82rem; font-weight: 600; margin: 6px 0; }
.doc-chip svg { width: 15px; height: 15px; }
.doc-chip button { background: none; border: none; color: var(--accent-strong); cursor: pointer; font-size: 0.85rem; padding: 0 2px; }

/* sidebar premium button */
.side-prem { margin-top: auto !important; color: #B8860B; border-color: color-mix(in srgb, #E5A93D 45%, var(--border)); }
.side-prem .ic { color: #E5A93D; }
.side-prem:hover { background: color-mix(in srgb, #E5A93D 12%, var(--card)); color: var(--text); }
.side-lang { margin-top: 6px; }
#sideBrand, #topbar .brand-lockup { cursor: pointer; }
@media (prefers-color-scheme: dark) { .side-prem { color: #E8C06A; } }

/* ===== static SEO pages ===== */
.seo-body { background: var(--bg); }
.seo-nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px;
  background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.seo-brand { text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; font-weight: 700; }
.seo-brand img { border-radius: 7px; }
.seo-nav nav { display: flex; gap: 14px; align-items: center; }
.seo-nav nav a { color: var(--accent-strong); text-decoration: none; font-size: 0.92rem; }
.seo-main { max-width: 780px; margin: 0 auto; padding: 24px 18px 40px; }
.seo-crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 14px; }
.seo-crumbs a { color: var(--accent-strong); text-decoration: none; }
.seo-main h1 { font-size: 1.9rem; margin-bottom: 10px; }
.seo-intro { color: var(--muted); font-size: 1.02rem; line-height: 1.6; margin-bottom: 6px; }
.seo-main article section { background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 6px 18px 16px; margin: 14px 0; box-shadow: var(--shadow); }
.seo-main article h2 { font-size: 1.15rem; margin: 14px 0 4px; }
.seo-cta { text-align: center; background: linear-gradient(150deg, var(--navy), var(--navy-2)); color: #fff;
  border-radius: 16px; padding: 26px 20px; margin: 22px 0; }
.seo-cta h3 { margin-bottom: 6px; }
.seo-cta p { color: #C3D3EA; margin-bottom: 14px; font-size: 0.95rem; }
.seo-related ul, .seo-hub-list { list-style: none; padding: 0; }
.seo-related li, .seo-hub-list li { background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px; }
.seo-related a, .seo-hub-list a { color: var(--accent-strong); text-decoration: none; }
.seo-foot { text-align: center; padding: 26px 16px 40px; border-top: 1px solid var(--border); }
.seo-foot a { color: var(--accent-strong); text-decoration: none; }
.seo-langs { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; font-size: 0.85rem; }
.ld-guide-links { max-width: 1000px; margin: 0 auto; padding: 0 22px 40px; }
.ld-guide-links h2 { font-size: 1.1rem; margin-bottom: 10px; }
.ld-guide-links ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.ld-guide-links a { color: var(--accent-strong); text-decoration: none; font-size: 0.9rem; }
