:root { --blue: #023B8A; --navy-2: #0148A4; --gold: #F1CC36; --green: #1E8E3E; --amber: #E07B00; --red: #D32F2F; --grey: #EEF1F5; --bg: #F7F8FA; --line: #E1E5EB; --text: #14202E; }
/* ponytail: --blue kept as the primary-colour name so JS/inline styles keep working; it now holds SGE royal blue */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); background: var(--bg); font-size: 18px; }
.appbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: linear-gradient(135deg, var(--blue), var(--navy-2)); color: #fff; border-bottom: 3px solid var(--gold); position: sticky; top: 0; z-index: 5; }
.appbar h1 { position: relative; margin: 0 auto 0 4px; padding-bottom: 5px; font: italic 900 1.4rem "Arial Black", "Segoe UI Black", system-ui, sans-serif; text-transform: uppercase; letter-spacing: 1.5px; }
/* SGE-style gold swoosh under the wordmark */
.appbar h1::after { content: ""; position: absolute; left: 2px; right: -14px; bottom: 0; height: 4px; border-radius: 3px; background: linear-gradient(90deg, var(--gold) 55%, transparent); transform: skewX(-25deg); }
.icon { background: none; border: 0; color: #fff; font-size: 1.8rem; line-height: 1; padding: 0 8px; min-width: 44px; min-height: 44px; }
.appbar button { width: auto; margin: 0; }
.pill { border: 1px solid rgba(255,255,255,.7); border-radius: 999px; padding: 4px 10px; background: transparent; color: #fff; font-size: .9rem; white-space: nowrap; }
.pill.off { background: var(--amber); border-color: var(--amber); }
#lang { border-color: var(--gold); color: var(--gold); font-weight: 700; min-height: 44px; padding: 4px 14px; }
main { padding: 12px; padding-bottom: 80px; max-width: 720px; margin: 0 auto; }
/* ponytail: up to 9 role tabs never fit a phone; scroll sideways, router centres the active one */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; overflow-x: auto; scrollbar-width: none; background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 8px rgba(2,59,138,.06); }
.tabs a { flex: 1 0 auto; white-space: nowrap; text-align: center; padding: 14px 8px; text-decoration: none; color: #5B6878; font-size: .85rem; border-top: 3px solid transparent; }
.tabs a.active { color: var(--blue); font-weight: 700; border-top-color: var(--gold); }
button, input, select, textarea { font-family: inherit; }
button, .btn { display: block; width: 100%; padding: 14px 16px; font-size: 1.15rem; text-align: center; text-decoration: none; border-radius: 12px; border: 2px solid var(--blue); background: var(--blue); color: #fff; margin: 8px 0; cursor: pointer; font-weight: 600; box-shadow: 0 2px 6px rgba(2,59,138,.2); }
button:active, .btn:active { transform: translateY(1px); box-shadow: none; }
button.secondary, .btn.secondary { background: #fff; color: var(--blue); border: 2px solid var(--blue); box-shadow: none; }
button.danger { background: var(--red); border-color: var(--red); }
button:disabled { opacity: .5; }
input, select { width: 100%; padding: 14px; font-size: 1.15rem; border: 2px solid #C5CDD8; border-radius: 12px; margin: 6px 0 12px; background: #fff; color: var(--text); }
input:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(241,204,54,.55); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
label { font-weight: 600; font-size: .95rem; }
h2 { margin: 8px 0 14px; color: var(--blue); font-size: 1.4rem; }
/* menu screens: list rows, not a wall of solid buttons */
.menu { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.menu a { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 0 16px; color: var(--text); font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line); }
.menu a:last-child { border-bottom: 0; }
.menu a::after { content: '›'; margin-left: auto; font-size: 1.6rem; color: var(--blue); }
.menu a:active { background: var(--grey); }
.menu kbd { font-size: .75rem; color: #5B6878; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }
.card { background: #fff; box-shadow: 0 1px 3px rgba(2,59,138,.08); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 8px 0; }
.ctx { background: #fff; border-left: 5px solid var(--gold); box-shadow: 0 1px 3px rgba(2,59,138,.08); border-radius: 12px; padding: 12px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.ctx .big { font-size: 1.6rem; font-weight: 800; color: var(--blue); letter-spacing: 1px; }
.flash { border-radius: 12px; padding: 18px; margin: 8px 0; color: #fff; text-align: center; }
.flash .code { font-size: 2.6rem; font-weight: 900; }
.flash.green { background: var(--green); } .flash.amber { background: var(--amber); } .flash.red { background: var(--red); } .flash.repeat { background: #666; }
.counters { display: flex; gap: 8px; flex-wrap: wrap; }
.counter { flex: 1; min-width: 120px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; text-align: center; }
.counter b { display: block; font-size: 1.5rem; color: var(--blue); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); }
.list a.row { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: -12px; padding: 12px; min-height: 48px; color: var(--blue); font-weight: 600; text-decoration: none; }
.badge { background: var(--red); color: #fff; border-radius: 999px; padding: 2px 10px; font-weight: 700; }
.badge.grey { background: #888; }
.empty { text-align: center; color: #666; padding: 40px 0; font-size: 1.2rem; }
.toast { position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%); background: var(--blue); border-left: 4px solid var(--gold); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 9; }
#reader { width: 100%; max-width: 360px; margin: 0 auto; }
.timeline { list-style: none; padding: 0; }
.timeline li { padding: 10px 0 10px 28px; position: relative; border-left: 3px solid #ddd; margin-left: 10px; }
.timeline li.done { border-color: var(--green); }
.timeline li::before { content: ''; position: absolute; left: -9px; top: 14px; width: 14px; height: 14px; border-radius: 50%; background: #ddd; }
.timeline li.done::before { background: var(--green); }
.muted { color: #5B6878; font-size: .9rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* "+ Add new" / "✎ Edit" sheet behind master dropdowns (web/js/addnew.js): bottom sheet on phones, centred on PC */
dialog.sheet { width: min(640px, 100vw); max-width: 100vw; max-height: 92vh; margin: auto auto 0; border: 0; border-radius: 16px 16px 0 0; padding: 12px 16px 20px; background: var(--bg); color: var(--text); }
dialog.sheet::backdrop { background: rgba(2, 20, 50, .45); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sheet-head h2 { margin: 4px 0 10px; }
.sheet-head .icon { color: var(--blue); background: none; border: 0; box-shadow: none; width: auto; margin: 0; }
.with-edit { display: flex; gap: 8px; align-items: flex-start; }
.with-edit > select, .with-edit > input { flex: 1; min-width: 0; }
button.edit { width: auto; min-width: 52px; margin: 6px 0 12px; padding: 12px 14px; }
.list li button.edit { margin: 0 0 0 8px; }
textarea { width: 100%; font-size: 1rem; padding: 10px; border: 2px solid #C5CDD8; border-radius: 12px; }
.appbar a.icon { display: flex; align-items: center; justify-content: center; text-decoration: none; }
@media (min-width: 900px) { dialog.sheet { margin: auto; border-radius: 16px; } }
/* PC: tabs sit under the app bar (nav comes after main in the DOM, so reorder with flex) */
@media (min-width: 900px) { body { font-size: 16px; display: flex; flex-direction: column; min-height: 100vh; } .tabs { position: sticky; top: 63px; z-index: 4; order: -1; justify-content: center; border-top: 0; border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px rgba(2,59,138,.06); } .appbar { order: -2; } .tabs a { flex: 0 0 auto; padding: 12px 18px; font-size: .95rem; border-top: 0; border-bottom: 3px solid transparent; } .tabs a.active { border-bottom-color: var(--gold); } main { width: 100%; padding-bottom: 24px; } }
