/* Em · ARCEmpire. Mobile-first. */
:root {
  --bg: #FBFAF5; --surface: #FFFFFF; --ink: #2B4659; --head: #3F6F8F; --muted: #5E7686; --faint: #8C9DA8;
  --line: #E4E8E2; --line-2: #F0F2EC;
  --brand: #3F6F8F; --accent: #3D8272; --accent-ink: #FFFFFF; --accent-soft: #E3F2EC; --accent-line: #B7DBCD;
  --mint: #B7DBCD; --gold: #E2B97A;
  --danger: #B42318; --danger-soft: #FDECEA; --warn: #9A5B0B; --warn-soft: #FDF3E1; --ok: #18794E; --ok-soft: #E6F4EC;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(43, 70, 89, .05), 0 4px 16px rgba(43, 70, 89, .05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --tabbar-h: 64px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font: 750 26px/1.15 var(--sans); letter-spacing: -.02em; color: var(--head); }
h2 { font-size: 17px; font-weight: 700; color: var(--head); }
h3 { font-size: 15px; font-weight: 700; color: var(--head); }
p { margin: 0; }
small, .small { font-size: 13px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* layout */
.shell { min-height: 100vh; }
.side { display: none; }
.main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(251, 250, 245, .92); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
#view { padding: 18px 16px 24px; max-width: 920px; margin: 0 auto; outline: none; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.mark { width: 36px; height: 36px; border-radius: 10px; flex: none; display: block; border: 1px solid var(--accent-line); background: #FBFAF5; object-fit: cover; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b { font: 800 17px/1.1 var(--sans); color: var(--head); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.top .brand { flex: none; }
.brand-text small { color: var(--muted); font-size: 12px; }

.acct-pill { display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 56vw; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 13px; cursor: pointer; }
.acct-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.acct-pill .dot.off { background: var(--faint); }
.acct-pill span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tabbar { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 550; text-decoration: none; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--head); }
.tabbar a.on svg { color: var(--accent); }

.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-weight: 550; text-decoration: none; }
.nav a svg { width: 20px; height: 20px; color: var(--muted); }
.nav a:hover { background: var(--line-2); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav a.on svg { color: var(--accent); }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 248px 1fr; }
  .side { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; padding: 22px 14px; border-right: 1px solid var(--line); background: var(--surface); }
  .side .brand { padding: 0 6px; }
  .side-foot { margin-top: auto; padding: 0 8px; color: var(--muted); font-size: 12px; display: grid; gap: 8px; }
  .side-foot .by { color: var(--faint); letter-spacing: .04em; text-transform: uppercase; font-size: 11px; }
  .tabbar { display: none; }
  .main { padding-bottom: 32px; }
  .top { justify-content: flex-end; background: transparent; border-bottom: 0; backdrop-filter: none; -webkit-backdrop-filter: none; position: static; padding: 18px 28px 0; }
  .brand-sm { display: none; }
  #view { padding: 8px 28px 40px; }
  h1 { font-size: 30px; }
}

/* components */
.page-head { display: grid; gap: 6px; margin: 4px 0 18px; }
.page-head p { color: var(--muted); max-width: 60ch; }
.eyebrow { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.grid2 { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hr { height: 1px; background: var(--line); margin: 14px 0; border: 0; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.input, select.input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; font-size: 16px; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235C6B66' stroke-width='1.6' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.pw { position: relative; }
.pw .input { padding-right: 64px; }
.pw button { position: absolute; right: 6px; top: 6px; height: 32px; border: 0; background: transparent; color: var(--accent); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0 8px; }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--line-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; min-height: 34px; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg.full { display: grid; width: 100%; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn:hover { background: var(--line-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #336F61; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #9A1E14; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 550; cursor: pointer; min-height: 34px; }
.chip.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--muted); letter-spacing: .01em; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { padding: 12px 0; border-top: 1px solid var(--line-2); }
.list > li:first-child { border-top: 0; }
.li-main { min-width: 0; flex: 1; }
.li-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-sub.wrap { white-space: normal; }
.li-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-row { display: flex; align-items: center; gap: 12px; }
.li-actions { display: flex; gap: 6px; flex: none; }
.avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--line-2); color: var(--muted); display: grid; place-items: center; font-weight: 650; font-size: 14px; flex: none; text-transform: uppercase; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.stat b { display: block; font: 750 24px/1.1 var(--sans); color: var(--head); }
.stat span { font-size: 12px; color: var(--muted); }
.stat.alert b { color: var(--danger); }

.progress { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width .25s ease; }
.progress.danger > i { background: var(--danger); }
.prog-box { display: grid; gap: 8px; }

.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: #2C5F53; font-size: 13px; }
.note svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.danger { background: var(--danger-soft); color: var(--danger); }
.err { color: var(--danger); font-size: 13px; }

.empty { text-align: center; padding: 26px 12px; color: var(--muted); }
.empty h3 { color: var(--ink); margin-bottom: 4px; }

.hero { padding: 6px 0 4px; display: grid; gap: 14px; }
.hero-top { display: flex; align-items: center; gap: 14px; }
.hero-mascot { width: 112px; height: auto; flex: none; -webkit-mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%); mask-image: radial-gradient(ellipse 50% 50% at 50% 50%, #000 70%, transparent 100%); }
.hero h1 { font-size: 32px; }
.sparkle { color: var(--gold); width: 16px; height: 16px; vertical-align: -2px; }
.eyebrow .sparkle { margin-right: 4px; }
.hero .lede { font-size: 17px; color: var(--muted); max-width: 46ch; }
.features { display: grid; gap: 12px; margin-top: 18px; }
@media (min-width: 700px) { .features { grid-template-columns: repeat(3, 1fr); } .hero h1 { font-size: 40px; } .hero-mascot { width: 150px; } }
.feature { padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; }
.feature .ic { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.feature .ic svg { width: 20px; height: 20px; }
.feature p { font-size: 14px; color: var(--muted); }

.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.provider-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.provider-grid button { min-height: 44px; border: 1px solid var(--line); background: #fff; border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; }
.provider-grid button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.sample { font-size: 13px; }
.sample li { padding: 8px 0; }

.plan { display: grid; gap: 10px; align-content: start; }
.plan ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; display: grid; gap: 4px; }
.plans { display: grid; gap: 12px; }
@media (min-width: 760px) { .plans { grid-template-columns: repeat(3, 1fr); } }

.svc-actions { display: grid; gap: 10px; margin-top: 10px; padding: 12px; background: var(--line-2); border-radius: var(--radius-sm); }
.diff-e { background: var(--ok-soft); color: var(--ok); }
.diff-m { background: var(--warn-soft); color: var(--warn); }
.diff-h, .diff-i { background: var(--danger-soft); color: var(--danger); }
.diff-l { background: var(--line-2); color: var(--muted); }

/* modal */
.modal-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(30, 50, 64, .45); display: flex; align-items: flex-end; justify-content: center; padding: 12px; }
.modal-wrap[hidden] { display: none; }
.modal { width: 100%; max-width: 460px; background: #fff; border-radius: 18px; padding: 20px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); display: grid; gap: 12px; margin-bottom: env(safe-area-inset-bottom); max-height: 88vh; overflow: auto; }
.modal h2 { font: 750 21px/1.25 var(--sans); }
.modal .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
@media (min-width: 640px) { .modal-wrap { align-items: center; } }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); z-index: 60; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 92vw; box-shadow: var(--shadow); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.radio-card + .radio-card { margin-top: 8px; }
.radio-card input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; }
.radio-card.on { border-color: var(--accent); background: var(--accent-soft); }
.radio-card.on.dz { border-color: var(--danger); background: var(--danger-soft); }
.radio-card b { display: block; font-size: 14px; }
.radio-card span { font-size: 13px; color: var(--muted); }

.foot-note { margin-top: 26px; font-size: 12px; color: var(--faint); text-align: center; }
.hide-desk { }
@media (min-width: 900px) { .hide-desk { display: none; } }
.tabular { font-variant-numeric: tabular-nums; }
.wrap-anywhere { overflow-wrap: anywhere; }
