/* App shell: sidebar, character bar, Today screen, docked coach, first-run
   welcome, Coach sheet and locks, phone tab bar. Loaded after app.css and
   armory.css, so it sets the look. Dark is the default theme; light is a
   choice in Settings (html[data-theme="light"]). */

@font-face { font-family: "Inter"; src: url("fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/manrope.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  /* Midnight and gold, the icon's own colors. */
  --bg: #0b0e14;
  --side: #0f131b;
  --surface: #151a24;
  --surface-2: #1c2230;
  --raise: #222a3b;
  --border: #262e3f;
  --border-2: #333c52;
  --text: #ece9e2;
  --muted: #98a0ae;
  --faint: #6b7384;
  --gold: #e8a823;
  --gold-hi: #ffd76a;
  --gold-text: #f2c14e;
  --gold-ink: #1a1204;
  --xp: #9b7bff;
  --green: #5fd38d;
  --red: #ff7a7a;
  --blue: #7cb7ff;
  --radius: 14px;
  --f-display: "Manrope", "Inter", system-ui, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --lift: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 12px 32px -18px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f2ed;
  --side: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f2efe8;
  --raise: #ebe7de;
  --border: #e0dbd0;
  --border-2: #cfc8b8;
  --text: #1b1d22;
  --muted: #5d6370;
  --faint: #868c98;
  --gold: #c38a0e;
  --gold-hi: #e8a823;
  --gold-text: #8a5d00;
  --gold-ink: #1a1204;
  --xp: #6f4fe0;
  --lift: 0 1px 2px rgba(60, 45, 10, .06), 0 12px 28px -20px rgba(60, 45, 10, .35);
  color-scheme: light;
}

html, body { height: 100%; }
body { font: 14.5px/1.55 var(--f-body); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; }
h2 { font-size: 16px; font-weight: 700; letter-spacing: -.005em; }
.small { font-size: 13px; }
.eyebrow { font: 700 11px/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold-text); }
kbd { font: 600 10.5px var(--f-body); }

/* Buttons: one gold primary per area, grey secondary, text links. */
button { border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); padding: 8px 14px; font-weight: 600; font-size: 13.5px; transition: background .15s, border-color .15s, transform .05s; }
button:hover:not(:disabled) { border-color: var(--border-2); background: var(--raise); }
button:active:not(:disabled) { transform: translateY(1px); }
button.primary { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: var(--gold-ink); border-color: transparent; box-shadow: 0 6px 18px -10px var(--gold); }
button.primary:hover:not(:disabled) { background: linear-gradient(180deg, #ffe08a, var(--gold-hi)); border-color: transparent; }
button.link { color: var(--gold-text); font-weight: 600; }
button.link:hover:not(:disabled) { background: none; text-decoration: underline; }
select, input[type=text], input[type=password], input[type=email], input[type=number], textarea { border-radius: 10px; border-color: var(--border-2); background: var(--bg); padding: 8px 11px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }

/* ---- Shell ---- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); height: 100%; }
.side { background: var(--side); border-right: 1px solid var(--border); padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 4px; min-height: 0; overflow-y: auto; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; font: 800 17px var(--f-display); letter-spacing: -.01em; }
.side .grow { flex: 1; }
.nav { display: grid; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font-weight: 500; font-size: 14px; text-align: left; }
.nav button:hover:not(:disabled) { background: var(--surface); color: var(--text); }
.nav button.active { background: var(--surface-2); color: var(--text); font-weight: 600; }
.nav svg, .tabbar svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav button.active svg { stroke: var(--gold); }
.nav .tag { margin-left: auto; font-size: 10.5px; font-weight: 600; color: var(--faint); border: 1px solid var(--border-2); border-radius: 6px; padding: 1px 6px; background: none; }
#nav-route-tag { color: var(--gold-text); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }

.setup-chip { display: flex; align-items: center; gap: 10px; margin: 6px 0; padding: 10px; border-radius: 12px; border: 1px dashed var(--border-2); background: none; color: var(--text); text-align: left; }
.setup-chip .ring { font: 700 11px var(--f-body); color: var(--gold-text); border: 2px solid var(--gold); border-radius: 999px; padding: 2px 6px; }

.member { display: grid; gap: 2px; text-align: left; margin-top: 8px; padding: 12px; border-radius: 14px; font-weight: 400;
  background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 16%, var(--surface)), var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent); }
.member:hover:not(:disabled) { border-color: var(--gold); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 22%, var(--surface)), var(--surface) 70%); }
.member b { font: 700 13.5px var(--f-display); color: var(--gold-text); }
.member span { font-size: 12px; color: var(--muted); line-height: 1.4; }
.member.active { background: var(--surface); border-color: var(--border); }

.sync { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 12px 10px 2px; min-width: 0; }
.sync span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.versions { font-size: 11px; color: var(--faint); padding: 2px 10px 0 26px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.versions:empty { display: none; }
.versions em { display: block; font-style: normal; color: var(--gold-text); }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 22%, transparent); }
.sync.warn .dot { background: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 22%, transparent); }
.sync.err .dot { background: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 22%, transparent); }
.sync.busy .dot { background: var(--gold); animation: pulse 1s ease-in-out infinite; }

.main { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; }
.content { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; }
body.dock-on .content { grid-template-columns: minmax(0, 1fr) 360px; }
.view { overflow-y: auto; min-height: 0; padding: 24px 28px 48px; display: grid; gap: 18px; align-content: start; }
.view > .tab-panel { max-width: 1080px; width: 100%; }
.page-head h1 { margin: 0; font-size: 26px; letter-spacing: -.015em; }
.page-head p { margin: 4px 0 0; }

/* ---- Character bar ---- */
.charbar { display: flex; align-items: center; gap: 16px; padding: 14px 28px; border-bottom: 1px solid var(--border); min-width: 0;
  background: radial-gradient(520px 120px at 0 0, color-mix(in srgb, var(--hero-tint) 18%, transparent), transparent), var(--side); }
.charbar.faction-horde { --hero-tint: #c8362b; }
.charbar.faction-alliance { --hero-tint: #2f6fd6; }
.charbar .crest { width: 48px; height: 48px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 12%, transparent); }
.charbar .crest svg { width: 26px; height: 26px; }
.charbar .lvl-badge { min-width: 24px; height: 22px; font-size: 11.5px; right: -7px; bottom: -5px; border-radius: 11px; font-family: var(--f-display); font-weight: 800; color: var(--gold-ink); }
.charbar .who { min-width: 0; }
.charbar .hero-name { font-size: 19px; color: var(--text); font-weight: 800; letter-spacing: -.01em; }
.charbar .hero-sub { margin: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xpbox { flex: 1 1 260px; max-width: 380px; min-width: 0; margin-left: 12px; }
.charbar .xp { height: 7px; margin: 0; border-radius: 9px; box-shadow: none; background: var(--surface-2); }
.charbar .xp-fill { background: linear-gradient(90deg, #7a5cff, var(--xp)); transition: width .8s cubic-bezier(.2, .7, .2, 1); }
.charbar .xp-label { font-size: 12px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-chips { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.mini { font-size: 12.5px; font-weight: 600; padding: 6px 11px; border-radius: 9px; border: 1px solid var(--border-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.char-pick { max-width: 200px; font-size: 13px; }

/* ---- Cards ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--lift); }
.card-head { margin-bottom: 12px; }
.badge-pro { font: 700 10px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; color: var(--gold-text); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); border-radius: 6px; padding: 4px 6px; margin-left: 8px; vertical-align: 2px; background: none; }
.callout { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); color: var(--muted); font-size: 13.5px; }
.empty-state { display: grid; gap: 12px; color: var(--muted); }
.empty-state p { margin: 0; }
.grid { gap: 18px; }
.col { gap: 18px; }

/* ---- Today ---- */
.next-card { position: relative; overflow: hidden; padding: 22px 24px; border-radius: 18px; border: 1px solid var(--border-2); box-shadow: var(--lift);
  background: radial-gradient(360px 260px at 100% 0, color-mix(in srgb, var(--gold) 16%, transparent), transparent 70%), linear-gradient(135deg, var(--raise), var(--surface)); }
.next-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.kind-pill { font: 700 10.5px/1 var(--f-body); letter-spacing: .1em; text-transform: uppercase; padding: 5px 8px; border-radius: 6px; color: var(--kind, var(--text)); background: color-mix(in srgb, var(--kind, var(--text)) 14%, transparent); }
.next-card h2 { margin: 10px 0 0; font-size: 28px; line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
.next-card .obj { margin: 6px 0 0; color: var(--muted); }
.next-card.empty h2 { font-size: 22px; }
.next-steps { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.next-steps li { min-width: 0; padding: 10px 12px; border-radius: 11px; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--border); font-size: 13px; }
.next-steps small { display: block; font-weight: 700; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--kind, var(--text)); }
.next-steps span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.next-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.next-foot .muted { margin-left: auto; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { padding: 14px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); min-width: 0; box-shadow: var(--lift); }
.tile small { display: block; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile b { display: block; font: 800 26px/1.2 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.tile em { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile em.good { color: var(--green); } .tile em.warn { color: var(--red); } .tile em.gold { color: var(--gold-text); }
#today-note:empty { display: none; }
#today-note { display: grid; gap: 6px; }
#today-note p { margin: 0; font-size: 13px; color: var(--muted); }
#today-note .warn-line { color: var(--muted); padding-left: 22px; position: relative; }
#today-note .warn-line::before { content: "i"; position: absolute; left: 0; top: 1px; width: 15px; height: 15px; border-radius: 50%; border: 1px solid var(--faint); font: 700 10px/13px var(--f-body); text-align: center; color: var(--faint); }
.live-line { color: var(--muted); }
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }

/* Coach lock: a blurred example and one button. */
.coach-lock { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); min-height: 170px; }
.coach-lock .peek { padding: 14px 16px; filter: blur(5px); opacity: .7; user-select: none; pointer-events: none; }
.coach-lock .veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 30%, transparent), color-mix(in srgb, var(--surface) 92%, transparent)); }
.coach-lock .veil p { margin: 0; max-width: 320px; font-size: 13.5px; color: var(--text); }
.coach-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; flex-wrap: wrap;
  border: 1px solid color-mix(in srgb, var(--gold) 38%, transparent); background: linear-gradient(110deg, color-mix(in srgb, var(--gold) 12%, var(--surface)), var(--surface) 60%); }
.coach-banner > div { flex: 1 1 260px; min-width: 0; }
.coach-banner p { margin: 2px 0 0; }
.coach-banner .badge-pro { margin: 0; }
.locked-btn { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.lock { width: 10px; height: 9px; border: 1.6px solid currentColor; border-radius: 2px; position: relative; margin-top: 3px; }
.lock::before { content: ""; position: absolute; left: 1px; top: -6px; width: 4px; height: 5px; border: 1.6px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; }

/* Level 60 before 50 */
.endgame-soon { display: grid; gap: 16px; justify-items: start; }
.soon-head { display: flex; gap: 18px; align-items: center; }
.soon-head h2 { margin: 0; font-size: 20px; }
.soon-head p { margin: 4px 0 0; }
.soon-ring { width: 72px; height: 72px; flex: none; border-radius: 50%; display: grid; place-items: center; align-content: center; border: 3px solid var(--gold); box-shadow: 0 0 0 6px color-mix(in srgb, var(--gold) 12%, transparent); }
.soon-ring b { font: 800 26px/1 var(--f-display); }
.soon-ring small { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.soon-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; width: 100%; }
.soon-list li { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }

/* ---- Coach dock ---- */
.dock { display: none; min-height: 0; border-left: 1px solid var(--border); background: var(--side); }
body.dock-on .dock, body[data-view="coach"] .dock { display: flex; }
body[data-view="coach"] .view { display: none; }
body[data-view="coach"] .dock { border-left: 0; }
body[data-view="coach"] .chat { max-width: 820px; margin: 0 auto; }
.chat { display: flex; flex-direction: column; min-height: 0; width: 100%; padding: 18px 18px 14px; }
.chat-head { display: flex; align-items: baseline; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.chat-head h2 { margin: 0; }
.chat-head .link { margin-left: auto; font-size: 13px; white-space: nowrap; }
.chat-log { flex: 1; max-height: none; overflow-y: auto; padding: 14px 2px; gap: 10px; }
.msg { border-radius: 14px; font-size: 14px; line-height: 1.5; }
.msg.ai { background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg.you { background: color-mix(in srgb, var(--gold) 18%, var(--surface-2)); border-bottom-right-radius: 4px; }
.hint { display: grid; gap: 12px; margin-top: auto; }
.hint p { margin: 0; font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0; }
.chip-btn { font-size: 12.5px; font-weight: 500; padding: 6px 11px; border-radius: 999px; background: none; color: var(--muted); }
.chip-btn:hover:not(:disabled) { color: var(--text); }
.chat-form { padding: 6px 6px 6px 12px; border-radius: 14px; border: 1px solid var(--border-2); background: var(--bg); align-items: center; }
.chat-form:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 18%, transparent); }
.chat-form textarea { border: 0; background: none; padding: 6px 0; resize: none; min-height: 24px; max-height: 160px; box-shadow: none; }
.chat-form textarea:focus { box-shadow: none; }

/* ---- Welcome (first run) ---- */
.welcome { position: fixed; inset: 0; z-index: 20; overflow-y: auto; background: radial-gradient(800px 420px at 50% -10%, color-mix(in srgb, var(--gold) 16%, transparent), transparent 70%), var(--bg); }
body.welcoming .shell, body.welcoming .tabbar { visibility: hidden; }
.welcome-inner { max-width: 820px; margin: 0 auto; padding: max(24px, env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) 48px max(20px, env(safe-area-inset-left, 0px)); display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; }
.welcome-top { align-self: stretch; display: flex; justify-content: space-between; align-items: center; }
.welcome-top .brand { display: flex; align-items: center; gap: 10px; font: 800 17px var(--f-display); }
.welcome .progress { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 28px; }
.welcome .progress i { width: 36px; height: 4px; border-radius: 9px; background: var(--border-2); }
.welcome .progress i.done { background: var(--gold); }
.welcome .progress i.on { background: linear-gradient(90deg, var(--gold), var(--border-2)); }
.welcome .progress span { margin-left: 6px; }
.welcome h1 { margin: 0; font-size: clamp(28px, 4vw, 38px); letter-spacing: -.025em; font-weight: 800; }
.welcome .sub { margin: 0; color: var(--muted); max-width: 560px; font-size: 15.5px; }
.welcome-card { width: 100%; max-width: 640px; text-align: left; padding: 18px 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 10px; box-shadow: var(--lift); }
.welcome-card.waiting { justify-items: center; text-align: center; }
.welcome .checks { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; font-size: 13px; }
.welcome .check { display: flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); }
.welcome .check b { color: var(--green); }
.choice { display: grid; grid-template-columns: 1.25fr 1fr; gap: 14px; width: 100%; text-align: left; }
.opt { padding: 22px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: 10px; align-content: start; justify-items: start; }
.opt.best { border: 1.5px solid var(--gold); background: linear-gradient(160deg, color-mix(in srgb, var(--gold) 14%, var(--surface)), var(--surface) 60%); }
.opt .badge-pro { margin: 0; }
.opt h3 { margin: 0; font-size: 19px; font-weight: 800; }
.opt .price { font: 800 28px/1.1 var(--f-display); letter-spacing: -.02em; }
.opt .price small { font: 500 13px var(--f-body); color: var(--muted); }
.opt ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13.5px; display: grid; gap: 3px; }
.opt p { margin: 0; }
.other-pc { width: 100%; max-width: 640px; text-align: left; font-size: 13.5px; }
.other-pc summary { cursor: pointer; color: var(--gold-text); text-align: center; }
.other-pc > :not(summary) { margin-top: 8px; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--border); }
.seg button { flex: 1; border: 0; background: none; color: var(--muted); }
.seg button.on { background: var(--surface-2); color: var(--text); }

/* ---- Coach sheet ---- */
.sheet-dialog { border: 1px solid var(--border-2); border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 30px 90px -20px rgba(0, 0, 0, .8); }
.sheet-dialog::backdrop { background: rgba(5, 7, 12, .6); backdrop-filter: blur(4px); }
.sheet-inner { padding: 22px 24px 24px; display: grid; gap: 16px; background: radial-gradient(420px 200px at 100% 0, color-mix(in srgb, var(--gold) 14%, transparent), transparent 70%); }
.sheet-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sheet-head h2 { margin: 8px 0 0; font-size: 24px; letter-spacing: -.02em; font-weight: 800; }
.icon-btn { border: 0; background: none; color: var(--muted); padding: 4px 8px; font-size: 14px; }
.perks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.perks li { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 13px; }
.perks span { color: var(--muted); }
.sheet-inner p { margin: 0; }

/* ---- Report a problem ---- */
#issue-sheet { width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.issue-sheet { gap: 14px; }
.issue-field { display: grid; gap: 6px; font-weight: 600; font-size: 13.5px; }
.issue-field select { max-width: none; }
.issue-field textarea { min-height: 110px; resize: vertical; }
.issue-check { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.issue-note { display: grid; gap: 4px; }
.issue-included { font-size: 13px; color: var(--muted); }
.issue-included summary { cursor: pointer; color: var(--text); font-weight: 600; }
.issue-included ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 3px; }
.issue-actions { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* ---- Settings as a screen ---- */
#settings-card { padding: 22px 24px; }
.settings .group { padding-bottom: 20px; }
.settings h3 { font: 700 11.5px var(--f-body); letter-spacing: .12em; color: var(--faint); }
.ai-picker { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.ai-choice { border-radius: 12px; background: var(--bg); }
.ai-choice.on { background: color-mix(in srgb, var(--gold) 8%, var(--bg)); }

/* Recording mode: blur what shouldn't be on video. */
body.recording .private { filter: blur(6px); }
body.recording input.private { color: transparent; text-shadow: 0 0 8px var(--muted); }

/* Banners match the cards. */
.banner { border-radius: 14px; }
.warn-line { color: var(--gold-text); }

/* ---- Phone tab bar ---- */
.tabbar { display: none; }
.more-menu { position: absolute; right: 8px; bottom: calc(100% + 8px); display: grid; min-width: 180px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border-2); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8); }
.more-menu button { border: 0; background: none; text-align: left; padding: 10px 12px; font-weight: 500; color: var(--text); flex-direction: row; font-size: 14px; }

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-grid { grid-template-columns: minmax(0, 1fr); }
  .bar-chips .mini { display: none; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .view { padding: 16px max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px)); }
  .charbar { padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); gap: 12px; flex-wrap: wrap; }
  .xpbox { order: 5; flex: 1 1 100%; max-width: none; margin-left: 0; }
  .charbar .crest { width: 42px; height: 42px; }
  .next-card { padding: 18px; }
  .next-card h2 { font-size: 22px; }
  .tile b { font-size: 22px; }
  .page-head h1 { font-size: 22px; }
  .chat { padding: 14px max(16px, env(safe-area-inset-right, 0px)) 84px max(16px, env(safe-area-inset-left, 0px)); }
  .choice, .perks { grid-template-columns: minmax(0, 1fr); }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
    padding: 6px max(4px, env(safe-area-inset-right, 0px)) max(10px, env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
    background: color-mix(in srgb, var(--side) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
  .tabbar > button { display: grid; justify-items: center; gap: 3px; border: 0; background: none; padding: 6px 2px; font-size: 10.5px; font-weight: 600; color: var(--faint); }
  .tabbar > button.active { color: var(--gold-text); }
  .tabbar svg { width: 21px; height: 21px; }
}
@media (prefers-reduced-motion: reduce) {
  .charbar .xp-fill { transition: none; }
  .sync.busy .dot { animation: none; }
}

/* With the coach docked, the main column is narrower: stack the sheet. */
body.dock-on .sheet { grid-template-columns: minmax(0, 1fr); }
body.dock-on .sheet > .col { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-items: start; }
.endgame-soon { grid-column: 1 / -1; }
.card-head h2 { white-space: nowrap; }
.card-head button { white-space: nowrap; flex: none; }
button.primary:disabled { opacity: .4; box-shadow: none; filter: saturate(.5); }

/* Mount savings and Worth doing (Today) */
#today-extras[hidden] { display: none; }
.mount-figures { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.mount-figures b { font: 800 28px/1.1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 99px; background: var(--border-2); overflow: hidden; margin: 12px 0 10px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--gold-text)); }
.mount-lines { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 4px; font-size: 13.5px; }
.notable { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.notable li { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.notable li:last-child { border-bottom: 0; padding-bottom: 0; }
.notable p { margin: 4px 0 0; }
.notable-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.notable-top .pill, .mount-card .card-head .pill { font-size: 11.5px; padding: 2px 10px; }
.mount-card .card-head, .notable-card .card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---- Route map (routemap.js): a stylized map, no game artwork ---- */
.today-hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.today-hero.has-map { grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); }
.next-map { display: flex; }
.route-map-mini { flex: 1; display: block; padding: 0; border: 1px solid var(--border-2); border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: var(--lift); cursor: pointer; }
.route-map-mini:hover:not(:disabled) { border-color: var(--gold); }
.route-map-mini svg { display: block; width: 100%; height: 100%; min-height: 200px; }
.route-map-card { padding-bottom: 14px; }
.route-map-wrap { display: grid; gap: 10px; }
.route-map { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border); }
.route-map-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.route-map-foot .legend { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.route-map-foot .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-left: 8px; }
.route-map-foot .legend i:first-child { margin-left: 0; }
.legend .lg-you { background: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 30%, transparent); }
.legend .lg-stop { background: var(--gold); }
.legend .lg-note { background: #c9a0ff; border-radius: 2px; transform: rotate(45deg) scale(.85); }
.route-map-empty { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 38px 16px; border-radius: 12px; border: 1px dashed var(--border-2);
  background: repeating-linear-gradient(0deg, transparent 0 39px, color-mix(in srgb, var(--border) 60%, transparent) 39px 40px),
              repeating-linear-gradient(90deg, transparent 0 39px, color-mix(in srgb, var(--border) 60%, transparent) 39px 40px); }
.route-map-empty svg { width: 34px; height: 34px; fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linecap: round; }
.route-map-empty p { margin: 0; max-width: 440px; }

.route-map .rm-bg-a { stop-color: color-mix(in srgb, var(--raise) 85%, var(--gold) 6%); }
.route-map .rm-bg-b { stop-color: var(--bg); }
.route-map .rm-grid line { stroke: var(--border-2); stroke-width: 1; opacity: .5; }
.route-map .rm-zones text { font: 800 15px var(--f-display); letter-spacing: .28em; fill: var(--text); opacity: .38; }
.route-map .rm-zones text.small { font-size: 11px; letter-spacing: .22em; }
.route-map .rm-casing { stroke: rgba(0, 0, 0, .55); stroke-width: 9; stroke-linecap: round; }
.route-map .rm-leg { stroke: var(--gold-hi); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 2 9; }
.route-map .rm-leg.now { stroke: var(--gold); stroke-width: 5.5; stroke-dasharray: 14 9; animation: rm-march 1.1s linear infinite; }
.route-map.compact .rm-casing { stroke-width: 7; }
.route-map.compact .rm-leg { stroke-width: 3; }
.route-map.compact .rm-leg.now { stroke-width: 4; }
@keyframes rm-march { to { stroke-dashoffset: -23; } }
.route-map .rm-pin .rm-dot { fill: var(--surface); stroke: var(--kind, var(--gold)); stroke-width: 3; }
.route-map .rm-pin.first .rm-dot { fill: var(--gold); stroke: var(--gold-hi); }
.route-map .rm-pin .rm-halo { fill: color-mix(in srgb, var(--gold) 22%, transparent); stroke: none; }
.route-map .rm-pin text { font: 800 13px var(--f-display); fill: var(--text); }
.route-map .rm-pin.first text { fill: var(--gold-ink); font-size: 14px; }
.route-map.compact .rm-pin text { font-size: 10px; }
.route-map .rm-notable rect { fill: #2a2140; stroke: #c9a0ff; stroke-width: 2.5; }
.route-map .rm-notable text { font: 800 11px var(--f-body); fill: #e6d4ff; }
.route-map .rm-notable .rm-note-label { font: 600 12px var(--f-body); fill: #d9c4ff; paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.route-map .rm-you .rm-you-dot { fill: var(--blue); stroke: #fff; stroke-width: 2.5; }
.route-map .rm-you .rm-pulse { fill: color-mix(in srgb, var(--blue) 30%, transparent); transform-box: fill-box; transform-origin: center; animation: rm-pulse 2s ease-out infinite; }
@keyframes rm-pulse { from { transform: scale(.45); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.route-map .rm-compass circle { fill: color-mix(in srgb, var(--bg) 70%, transparent); stroke: var(--border-2); }
.route-map .rm-compass .n { fill: var(--gold); }
.route-map .rm-compass text { font: 700 9px var(--f-body); fill: var(--muted); }
.route-map .rm-scale path { fill: none; stroke: var(--muted); stroke-width: 1.5; }
.route-map .rm-scale text { font: 600 11px var(--f-body); fill: var(--muted); }
:root[data-theme="light"] .route-map .rm-casing { stroke: rgba(255, 255, 255, .85); }
:root[data-theme="light"] .route-map .rm-leg:not(.now) { stroke: var(--gold); }
:root[data-theme="light"] .route-map .rm-notable rect { fill: #f1e8ff; stroke: #6b3fb5; }
:root[data-theme="light"] .route-map .rm-notable text { fill: #4b2a86; }
:root[data-theme="light"] .route-map .rm-notable .rm-note-label { fill: #4b2a86; }
@media (max-width: 1100px) { .today-hero.has-map { grid-template-columns: minmax(0, 1fr); } .route-map-mini svg { max-height: 260px; } }
@media (prefers-reduced-motion: reduce) { .route-map .rm-leg.now, .route-map .rm-you .rm-pulse { animation: none; } }

/* Zone maps: QuestMentor's own drawing (zonemaps.js), dark ground with gold relief. */
.route-map-wrap .rm-view { justify-self: end; width: auto; }
.route-map-wrap .rm-view button { flex: none; padding: 6px 14px; font-size: 12.5px; }
.route-map .rm-grid.faint line { opacity: .18; }
.route-map .rm-land { fill: color-mix(in srgb, var(--surface) 78%, var(--gold) 9%); stroke: color-mix(in srgb, var(--gold) 55%, transparent); stroke-width: 1.6; stroke-linejoin: round; }
/* Neighbouring zones: one solid fill, no outlines (their shapes overlap). */
.route-map .rm-land.other { fill: color-mix(in srgb, var(--surface) 70%, var(--bg)); stroke: none; }
.route-map .rm-land.next { fill: color-mix(in srgb, var(--gold) 5%, transparent); stroke: color-mix(in srgb, var(--gold) 40%, transparent); stroke-width: 1.2; stroke-dasharray: 4 4; }
.route-map .rm-zones text.next { font: 700 10.5px var(--f-body); letter-spacing: .14em; fill: var(--gold-text); opacity: .85; }
.route-map .rm-hi { fill: var(--gold); stroke: color-mix(in srgb, var(--gold) 40%, transparent); stroke-width: .8; }
.route-map .rm-hi.h1 { fill-opacity: .08; }
.route-map .rm-hi.h2 { fill-opacity: .11; }
.route-map .rm-hi.h3 { fill-opacity: .15; }
.route-map .rm-trail { fill: none; stroke: color-mix(in srgb, var(--gold-hi) 45%, transparent); stroke-width: 1.4; stroke-dasharray: 5 5; stroke-linecap: round; }
.route-map .rm-zone-names text { font: 700 12px var(--f-display); letter-spacing: .26em; fill: var(--muted); opacity: .55; }
.route-map .rm-place rect { fill: var(--gold); stroke: var(--bg); stroke-width: 1.5; }
.route-map .rm-place.f-H rect { fill: #e2574c; }
.route-map .rm-place.f-A rect { fill: #4d8fe8; }
.route-map .rm-place.k-city rect { stroke: var(--gold-hi); stroke-width: 2; }
.route-map .rm-place path { fill: #d9776a; stroke: var(--bg); stroke-width: 1; }
.route-map .rm-place circle { fill: var(--muted); }
.route-map .rm-labels text { font: 600 11px var(--f-body); fill: var(--muted); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; stroke-linejoin: round; }
.route-map .rm-labels text.k-town { font-size: 12px; font-weight: 700; fill: var(--text); }
.route-map .rm-labels text.k-city { font: 800 13px var(--f-display); letter-spacing: .06em; fill: var(--gold-hi); }
.route-map .rm-labels text.k-camp, .route-map .rm-labels text.k-mob { fill: #d7b3a6; }
.route-map .rm-labels text.k-place { font-size: 10.5px; font-style: italic; opacity: .85; }
.route-map .rm-labels text.enemy { opacity: .7; }
.route-map .rm-labels .lv { font-weight: 800; fill: var(--muted); }
.route-map .rm-labels .lv-grey .lv { fill: #8a8f99; }
.route-map .rm-labels .lv-green .lv { fill: var(--green); }
.route-map .rm-labels .lv-gold .lv { fill: var(--gold-hi); }
.route-map .rm-labels .lv-orange .lv { fill: #ff9f43; }
.route-map .rm-labels .lv-red .lv { fill: var(--red); }
.route-map .rm-fp circle { fill: var(--bg); stroke: var(--gold-hi); stroke-width: 1.5; }
.route-map .rm-fp path { fill: none; stroke: var(--gold-hi); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.route-map.compact .rm-labels text { font-size: 10px; }
.legend .lg-town { background: var(--gold); border-radius: 2px; transform: rotate(45deg) scale(.8); }
.legend .lg-fp { background: var(--bg); border: 1.5px solid var(--gold-hi); }
.legend .lg-camp { background: #d9776a; clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.rm-credit { margin: 0; }
:root[data-theme="light"] .route-map .rm-land { fill: color-mix(in srgb, #fffaf0 85%, var(--gold) 10%); }
:root[data-theme="light"] .route-map .rm-land.other { fill: color-mix(in srgb, #ffffff 70%, var(--bg)); }
:root[data-theme="light"] .route-map .rm-hi { fill: #9a6a10; }
:root[data-theme="light"] .route-map .rm-labels text.k-camp, :root[data-theme="light"] .route-map .rm-labels text.k-mob { fill: #8a3b2c; }
:root[data-theme="light"] .route-map .rm-labels text.k-city { fill: var(--gold-text); }
:root[data-theme="light"] .route-map .rm-trail { stroke: color-mix(in srgb, var(--gold) 60%, transparent); }

/* Weekly report card (weekly.js), shared with the phone page. */
.weekly { display: grid; gap: 14px; }
.weekly h3 { margin: 4px 0 0; font: 700 13px/1.2 var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wk-head { display: flex; gap: 16px; align-items: center; }
.wk-headline { margin: 6px 0 0; font: 800 20px/1.25 var(--f-display); color: var(--text); }
.wk-badge { flex: none; display: grid; place-items: center; min-width: 92px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.wk-badge b { font: 800 28px/1 var(--f-display); }
.wk-badge small { margin-top: 4px; font-size: 11px; color: var(--muted); }
.wk-badge.up b { color: var(--green); } .wk-badge.down b { color: var(--red); }
.wk-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.wk-tile { display: grid; gap: 3px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.wk-tile small { font-size: 12px; color: var(--muted); }
.wk-tile b { font: 800 22px/1.1 var(--f-display); color: var(--text); }
.wk-tile span { font-size: 12px; color: var(--muted); }
.wk-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; align-items: end; }
.wk-day { display: grid; gap: 4px; justify-items: center; }
.wk-bar { width: 100%; max-width: 34px; height: 64px; display: flex; align-items: flex-end; border-bottom: 1px solid var(--border); }
.wk-bar span { display: block; width: 100%; border-radius: 4px 4px 0 0; background: var(--gold); }
.wk-day:hover .wk-bar span { background: var(--gold-hi); }
.wk-day small { font-size: 11px; color: var(--muted); }
.wk-leaks { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wk-leak-head { display: flex; gap: 8px; align-items: baseline; }
.wk-leak-head b { flex: 1; font-size: 14px; }
.wk-leak-head span { font-weight: 700; font-variant-numeric: tabular-nums; }
.wk-leak-head small { width: 38px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.wk-meter { height: 6px; margin: 5px 0 3px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.wk-meter span { display: block; height: 100%; border-radius: 4px; background: var(--red); opacity: .8; }
.wk-leaks .muted { font-size: 12px; }
.wk-levels { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.wk-levels th { text-align: left; font-weight: 600; color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--border); }
.wk-levels td { padding: 6px; border-bottom: 1px solid var(--border); }
.wk-levels td.good { color: var(--green); font-weight: 700; }
.weekly .improve { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.wk-share { display: grid; gap: 8px; }
.wk-share .share-line { margin: 0; border-left: 3px solid var(--gold); padding-left: 10px; }
.wk-share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.wk-last { margin: -4px 0 0; }
@media (max-width: 520px) {
  .wk-head { align-items: flex-start; }
  .wk-badge { min-width: 74px; padding: 8px; }
  .wk-badge b { font-size: 22px; }
  .wk-headline { font-size: 17px; }
  .wk-levels th:nth-child(3), .wk-levels td:nth-child(3) { display: none; }
}
