:root {
  --navy: #1b2a6b; --navy-2: #24357f; --crimson: #c2183c; --bg: #f3f4f8; --card: #fff; --ink: #141a33;
  --muted: #5b6381; --line: #e1e4ee; --ok: #1e7a46; --ok-bg: #e5f4e4; --warn: #9a5a00; --warn-bg: #fdf1dc;
  --bad: #b3261e; --bad-bg: #fbebeb; --info: #1d4f91; --info-bg: #e7f1fb; --radius: 12px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; font-size: 15px; line-height: 1.45; }
.boot { padding: 40px; text-align: center; color: var(--muted); }
a { color: var(--navy); }
button, input, select, textarea { font: inherit; }

.shell { max-width: 760px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; }
.sticky { position: sticky; top: 0; z-index: 5; }
.top { background: var(--navy); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.top .brand { font-weight: 700; letter-spacing: .2px; }
.top .brand small { display: block; font-weight: 400; opacity: .8; font-size: 12px; }
.top .sp { flex: 1; }
.top button { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 8px; padding: 7px 10px; cursor: pointer; }
.bell { position: relative; }
.bell b { position: absolute; top: -5px; right: -5px; background: var(--crimson); color: #fff; font-size: 11px; border-radius: 10px; padding: 1px 6px; }
.testbar { background: #fff4d6; color: #6b4a00; font-size: 13px; padding: 7px 16px; border-bottom: 1px solid #f0d58f; }
.tabs { display: flex; gap: 4px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); padding: 0 8px; }
.tabs button { border: 0; background: none; padding: 12px 12px; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button.on { color: var(--navy); border-color: var(--crimson); font-weight: 600; }
main { padding: 16px; flex: 1; }
h1 { font-size: 20px; margin: 4px 0 12px; }
h2 { font-size: 16px; margin: 18px 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card.tap { cursor: pointer; }
.card.tap:hover { border-color: #b9c0dc; }
.row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 4px 10px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 20px; background: var(--info-bg); color: var(--info); letter-spacing: .2px; }
.chip.ok { background: var(--ok-bg); color: var(--ok); } .chip.warn { background: var(--warn-bg); color: var(--warn); }
.chip.bad { background: var(--bad-bg); color: var(--bad); } .chip.grey { background: #eef0f4; color: #555d78; }
.chip.p1 { background: var(--crimson); color: #fff; } .chip.p2 { background: #ffe1e7; color: var(--crimson); } .chip.p3 { background: #eef0f4; color: #555d78; }
.banner { border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.banner.info { background: var(--info-bg); color: var(--info); } .banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); } .banner.ok { background: var(--ok-bg); color: var(--ok); }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #cfd4e4; border-radius: 9px; background: #fff; color: var(--ink); }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9fb0ea; border-color: var(--navy); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; color: var(--ink); margin: 12px 0; }
.check input { width: auto; margin-top: 3px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-block; border: 0; border-radius: 9px; padding: 11px 16px; font-weight: 600; cursor: pointer; background: #e9ecf5; color: var(--navy); }
.btn.pri { background: var(--navy); color: #fff; } .btn.dan { background: var(--crimson); color: #fff; }
.btn.sm { padding: 7px 11px; font-size: 13px; } .btn.block { width: 100%; margin-top: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.opts { display: grid; gap: 8px; }
.opt { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; cursor: pointer; background: #fff; }
.opt.on { border-color: var(--navy); background: #f1f4ff; }
.opt input { width: auto; }
.list-empty { color: var(--muted); text-align: center; padding: 18px; }
.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-bottom: 12px; }
.stat div { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 22px; color: var(--navy); }
.timeline { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.timeline li { border-left: 2px solid var(--line); padding: 0 0 10px 12px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--navy); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
.counter { text-align: right; font-size: 12px; color: var(--muted); }
.counter.bad { color: var(--bad); }
.big { font-size: 34px; font-weight: 700; text-align: center; color: var(--navy); font-variant-numeric: tabular-nums; }
.login { max-width: 380px; margin: 10vh auto 0; padding: 0 16px; }
.login .logo { text-align: center; margin-bottom: 18px; }
.login .logo b { font-size: 22px; color: var(--navy); } .login .logo span { display: block; color: var(--crimson); font-weight: 600; }
.secret { font-family: ui-monospace, Menlo, monospace; background: #f6f7fb; border: 1px dashed #b9c0dc; padding: 8px 10px; border-radius: 8px; font-size: 15px; }
#toast { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; z-index: 10; }
#toast.show { opacity: 1; } #toast.err { background: var(--bad); }
.sample { font-size: 11px; color: #6b4a00; background: #fff4d6; border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
@media (max-width: 520px) { .kv { grid-template-columns: 110px 1fr; } .two { grid-template-columns: 1fr; } }

.banner.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn, .tabs button, .opt { min-height: 44px; }
.btn.sm { min-height: 36px; }
html { -webkit-text-size-adjust: 100%; }
/* keep wide tables inside the phone screen */
.card { overflow-x: auto; }
td { overflow-wrap: anywhere; }
@media (max-width: 520px) {
  table, thead, tbody, tr, th, td { font-size: 12.5px; }
  td .btn.sm { display: block; width: 100%; margin: 4px 0; }
}
.chip { white-space: nowrap; } td:first-child { white-space: nowrap; }

/* English Partner branding */
.top { background: #fff; color: var(--navy); border-bottom: 3px solid var(--crimson); }
.top .logo { height: 30px; width: auto; flex: none; }
.top .brand { color: var(--navy); font-size: 15px; line-height: 1.2; }
.top .brand small { color: var(--muted); opacity: 1; }
.top button { background: #eef0f7; color: var(--navy); }
.brandblock { text-align: center; margin-bottom: 18px; }
.brandblock img { max-width: 80%; height: auto; }
.brandblock .tagline { color: var(--crimson); font-weight: 600; letter-spacing: .3px; margin-top: 4px; font-size: 14px; }
.brandblock .appname { color: var(--navy); font-weight: 700; font-size: 20px; margin-top: 10px; }
@media (max-width: 420px) { .top .logo { height: 24px; } .top { gap: 8px; padding: 10px 12px; } .top button { padding: 6px 9px; font-size: 13px; } }

/* View as Counsellor preview bar */
.previewbar { background: var(--crimson); color: #fff; padding: 10px 14px; font-size: 13px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.previewbar .pv-btns { display: flex; gap: 6px; }
.previewbar button { background: #fff; color: var(--crimson); border: 0; border-radius: 8px; padding: 8px 10px; font-weight: 700; min-height: 38px; cursor: pointer; }
.va-item[hidden] { display: none; }

/* password eye (17.46) */
.pw { position: relative; }
.pw input { padding-right: 54px; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); width: 48px; height: 44px; border: 0; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 8px; }
.pw-eye:focus-visible { outline: 2px solid #9fb0ea; }
.pw-eye[aria-pressed="true"] { color: var(--navy); }
