/* Makryden Systems — parent portal. © Makryden Systems LLC
   Warm, calm, grown-up. Two families, one scale (28/20/16/14/13), one elevation. */

@font-face { font-family: 'Nunito'; font-weight: 700; font-style: normal; font-display: swap; src: url('/account/assets/fonts/nunito-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-style: normal; font-display: swap; src: url('/account/assets/fonts/nunito-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-style: normal; font-display: swap; src: url('/account/assets/fonts/source-sans-3-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-style: normal; font-display: swap; src: url('/account/assets/fonts/source-sans-3-latin-600-normal.woff2') format('woff2'); }

:root {
  --ink: #1a2332;
  --ink-2: #4a5568;
  --ink-3: #6b7484;
  --page: #f8f5ef;
  --card: #fffdf9;
  --line: #e8e1d4;
  --line-2: #d9d0bf;
  --brand: #2c4bb8;          /* StarBrook night blue */
  --brand-ink: #ffffff;
  --brand-soft: #e9edfa;
  --star: #e2ad3f;           /* StarBrook gold */
  --star-soft: #fbf1da;
  --ok: #2e7d55;
  --ok-soft: #e4f2ea;
  --warn: #a96a12;
  --warn-soft: #fbefd9;
  --bad: #b2402f;
  --bad-soft: #f8e5e1;
  --focus: 0 0 0 3px rgba(44, 75, 184, .28);
  --shadow: 0 1px 2px rgba(26, 35, 50, .04), 0 6px 20px -8px rgba(26, 35, 50, .10);
  --r: 18px;
  --r-sm: 12px;
  --head: 'Nunito', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --body: 'Source Sans 3', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 16px/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
[hidden] { display: none !important; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 8px; }

/* ---------------------------------------------------------------- frame ---- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 960px; width: 100%; margin: 0 auto; padding: 20px 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand img { width: 30px; height: 30px; }
.brand b { font: 800 16px/1 var(--head); letter-spacing: .01em; }
.brand span { font: 400 13px/1 var(--body); color: var(--ink-3); margin-left: 2px; }
.top .who { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ink-2); }
.top .who .email { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 8px 24px 56px; }
main.narrow { max-width: 440px; padding-top: 24px; }

footer.foot {
  max-width: 720px; width: 100%; margin: 0 auto; padding: 20px 24px 40px;
  color: var(--ink-3); font-size: 13px; text-align: center;
}
footer.foot a { color: var(--ink-2); }

/* ----------------------------------------------------------- typography ---- */
h1, h2, h3 { font-family: var(--head); color: var(--ink); margin: 0; letter-spacing: -.005em; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 800; }
h2 { font-size: 20px; line-height: 1.3; font-weight: 800; }
h3 { font-size: 16px; line-height: 1.35; font-weight: 700; }
.lede { font-size: 16px; color: var(--ink-2); margin: 8px 0 0; }
.small { font-size: 14px; color: var(--ink-2); }
.tiny { font-size: 13px; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

/* ---------------------------------------------------------------- cards ---- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 24px; margin-top: 16px;
  transition: opacity .18s ease;
}
.card.loading { opacity: .55; }
.card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card > header p { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.card .divider { height: 1px; background: var(--line); margin: 20px -24px; }
.card.disabled .body { opacity: .5; pointer-events: none; }

.auth-card { padding: 32px 28px; margin-top: 0; }
.auth-card h1 { margin-bottom: 4px; }

/* ---------------------------------------------------------------- forms ---- */
form { margin: 0; }
.field { display: block; margin-top: 18px; }
.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.field small { display: block; font-size: 13px; color: var(--ink-3); margin-top: 6px; }
input[type=email], input[type=password], input[type=text], input[inputmode=numeric] {
  width: 100%; height: 48px; padding: 0 14px;
  font: 400 16px/1 var(--body); color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: #9aa1ad; }
input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
input.pin { letter-spacing: .4em; font-variant-numeric: tabular-nums; text-align: center; font-size: 20px; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); margin: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  font: 600 16px/1 var(--body); text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink);
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { border-color: #c6bba6; background: #fffaf2; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #253f9d; border-color: #253f9d; }
.btn.danger { color: var(--bad); border-color: #e6c3bc; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--brand); padding: 0 10px; }
.btn.quiet:hover { background: var(--brand-soft); }
.btn.block { width: 100%; margin-top: 24px; }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

.msg { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--r-sm); font-size: 14px; line-height: 1.45; }
.msg[data-kind=error] { background: var(--bad-soft); color: #7d2a1e; }
.msg[data-kind=ok] { background: var(--ok-soft); color: #1f5a3c; }
.msg[data-kind=info] { background: var(--brand-soft); color: #22397f; }
.alt { margin-top: 20px; text-align: center; font-size: 14px; color: var(--ink-2); }

/* ------------------------------------------------------------ dashboard ---- */
.hello { padding: 16px 0 4px; }
.hello h1 { font-size: 28px; }

.status-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #b9b2a5; margin-right: 8px; vertical-align: 1px; }
.on .status-dot { background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.state-line { margin: 6px 0 0; font-size: 16px; color: var(--ink-2); }
.on .state-line b { color: var(--ok); }

/* the big switch */
.switch {
  position: relative; flex: none; width: 76px; height: 44px; border-radius: 999px;
  background: #d8d1c4; border: 0; cursor: pointer; padding: 0;
  transition: background-color .18s ease;
}
.switch::after {
  content: ''; position: absolute; top: 4px; left: 4px; width: 36px; height: 36px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(26, 35, 50, .25);
  transition: transform .18s ease;
}
.switch[aria-checked=true] { background: var(--ok); }
.switch[aria-checked=true]::after { transform: translateX(32px); }
.switch[disabled] { opacity: .55; cursor: default; }

.pin-state { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--ok-soft); color: var(--ok); }
.pin-state.none { background: var(--warn-soft); color: var(--warn); }

/* presets: three-way segmented control */
.presets { list-style: none; margin: 16px 0 0; padding: 0; }
.presets li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.presets li:first-child { border-top: 0; }
.presets .name { font-weight: 600; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: #f1ece2; border: 1px solid var(--line); }
.seg button {
  min-height: 40px; min-width: 64px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent;
  font: 600 14px/1 var(--body); color: var(--ink-2); cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.seg button[aria-pressed=true] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(26, 35, 50, .12); }
.seg button[data-v=block][aria-pressed=true] { color: var(--bad); }
.seg button[data-v=allow][aria-pressed=true] { color: var(--ok); }

.add-rule { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; margin-top: 16px; }
.add-rule .seg button { min-width: 56px; }
.rules { list-style: none; margin: 12px 0 0; padding: 0; }
.rules li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 16px; }
.rules li:first-child { border-top: 0; }
.tag { font-size: 13px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.tag.block { background: var(--bad-soft); color: var(--bad); }
.tag.allow { background: var(--ok-soft); color: var(--ok); }
.x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 20px; line-height: 1; }
.x:hover { background: #f1ece2; color: var(--ink); }
.rule-right { display: flex; align-items: center; gap: 6px; }

.precedence { margin: 16px 0 0; padding: 14px 16px 14px 36px; border-radius: var(--r-sm); background: #f6f2ea; font-size: 14px; color: var(--ink-2); }
.precedence li { margin: 2px 0; }

/* stats */
.stats { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: rank; }
.stats li { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); counter-increment: rank; }
.stats li:first-child { border-top: 0; }
.stats li::before { content: counter(rank); font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.stats .d { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats .n { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.card.blocked { border-color: #eedcb8; }
.card.blocked .n { color: var(--warn); }
.card.blocked h2::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--star); margin-right: 10px; vertical-align: 4px; }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 8px 4px; color: var(--ink-2); font-size: 14px; }
.empty svg { width: 56px; height: 56px; color: #d2c6ad; }
.empty p { margin: 0; max-width: 40ch; }

.privacy-note { margin: 20px 0 0; font-size: 13px; color: var(--ink-3); text-align: center; }

/* dialog */
dialog {
  border: 1px solid var(--line); border-radius: var(--r); padding: 28px; width: min(420px, calc(100vw - 32px));
  background: var(--card); color: var(--ink); box-shadow: 0 24px 60px -20px rgba(26, 35, 50, .35);
}
dialog::backdrop { background: rgba(26, 35, 50, .32); }
dialog h2 { margin-bottom: 4px; }
dialog .row-btns { justify-content: flex-end; margin-top: 24px; }
dialog[open] { animation: rise .18s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.skeleton { height: 14px; border-radius: 7px; background: linear-gradient(90deg, #efe9de, #f6f2ea, #efe9de); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; margin: 10px 0; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 720px) {
  .top { padding: 16px; }
  .top .who .email { display: none; }
  main { padding: 4px 16px 40px; }
  main.narrow { padding-top: 8px; }
  .card { padding: 20px; }
  .card .divider { margin: 18px -20px; }
  .auth-card { padding: 26px 20px; }
  .presets li { flex-wrap: wrap; }
  .presets .seg { width: 100%; }
  .presets .seg button { flex: 1; }
  .add-rule { grid-template-columns: 1fr 1fr; }
  .add-rule input { grid-column: 1 / -1; }
  .add-rule .seg { width: 100%; }
  .add-rule .seg button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

.gap-top { margin: 14px 0 0; }
.gap-sm { margin: 6px 0 0; }
.brand b, .top .btn, .pin-state { white-space: nowrap; }
.seg .short { display: none; }
@media (max-width: 720px) {
  .brand span { display: none; }
  .seg .long { display: none; }
  .seg .short { display: inline; }
}

/* --------------------------------------- polish: brand life (2026-10-16) ----
   Gold crown rule, hero moment, richer cards, vivid status. No DOM hooks
   changed — dashboard.js contract untouched. */

/* slim gold crown at the very top of the page */
body::before {
  content: ""; display: block; height: 3px; flex: none;
  background: linear-gradient(90deg, #b98a2e, #e2ad3f 35%, #f6dd9a 50%, #e2ad3f 65%, #b98a2e);
}

/* hero moment: gold star badge + roomier greeting */
.hello { padding: 26px 0 10px; }
.hello-star {
  display: inline-grid; place-items: center;
  width: 48px; height: 48px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f8e5b0, #e2ad3f 78%);
  box-shadow: 0 8px 20px -6px rgba(226,173,63,.6), inset 0 1px 0 rgba(255,255,255,.5);
  margin-bottom: 14px;
}
.hello-star svg { width: 25px; height: 25px; display: block; }
.hello h1 { font-size: 32px; letter-spacing: -.01em; }
.hello .lede { font-size: 17px; }

/* richer cards: warm lift, refined header rhythm */
.card {
  background: linear-gradient(180deg, #fffefb 0%, var(--card) 90px);
  border-top: 2px solid rgba(226,173,63,.35);
}
.card > header { margin-bottom: 2px; }
.card > header h2 { letter-spacing: -.008em; }

/* status card: vivid on/off states */
.card.on { border-color: rgba(46,125,85,.4); border-top-color: var(--ok); }
.card.on > header h2 { color: #1f5a3c; }
.state-line { font-size: 16px; }
.on .state-line { font-weight: 600; }
.status-dot { width: 12px; height: 12px; }
.on .status-dot { box-shadow: 0 0 0 5px var(--ok-soft), 0 0 12px rgba(46,125,85,.55); }

/* PIN pill: a touch more presence */
.pin-state { padding: 8px 14px; box-shadow: inset 0 0 0 1px rgba(46,125,85,.18); }
.pin-state.none { box-shadow: inset 0 0 0 1px rgba(169,106,18,.2); }

/* stats: gold ranks for the top three */
.stats li:nth-child(-n+3)::before { color: var(--star); font-weight: 700; }
.stats .n { color: var(--ink); }

/* blocked card: warmer warning header */
.card.blocked { border-top-color: rgba(226,173,63,.55); }

/* rule rows: calmer separators, clearer tags */
.rules li, .presets li, .stats li { border-top-color: #ece5d5; }

/* footer credit */
footer.foot .credit {
  margin-top: 12px; font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: #b39654; font-weight: 600;
}

@media (max-width: 720px) {
  .hello { padding-top: 20px; }
  .hello h1 { font-size: 29px; }
}

/* ================================================================ Concept A ====
   2026-10-19: the portal joins the new Makryden look — midnight #0E0A1A, gold
   #E8C266, Marcellus headlines, Manrope body. Overrides only; every class and
   DOM hook above (and dashboard.js) is untouched. Fonts are self-hosted because
   this page's security policy only allows its own files. */
@font-face { font-family: 'Marcellus'; font-weight: 400; font-style: normal; font-display: swap; src: url('/account/assets/fonts/marcellus-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 400; font-style: normal; font-display: swap; src: url('/account/assets/fonts/manrope-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 600; font-style: normal; font-display: swap; src: url('/account/assets/fonts/manrope-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 700; font-style: normal; font-display: swap; src: url('/account/assets/fonts/manrope-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Manrope'; font-weight: 800; font-style: normal; font-display: swap; src: url('/account/assets/fonts/manrope-latin-800-normal.woff2') format('woff2'); }

:root {
  --ink: #f4f0e6;
  --ink-2: #c9c2da;
  --ink-3: #9a92b4;
  --page: #0e0a1a;
  --card: #171126;
  --line: #2a2145;
  --line-2: #3a2f5c;
  --brand: #e8c266;
  --brand-ink: #171126;
  --brand-soft: rgba(232, 194, 102, .12);
  --star: #e8c266;
  --star-soft: rgba(232, 194, 102, .14);
  --ok: #6fd39b;
  --ok-soft: rgba(111, 211, 155, .14);
  --warn: #f0b860;
  --warn-soft: rgba(240, 184, 96, .14);
  --bad: #f08a7a;
  --bad-soft: rgba(240, 138, 122, .14);
  --focus: 0 0 0 3px rgba(232, 194, 102, .35);
  --shadow: none;
  --r: 14px;
  --r-sm: 10px;
  --head: 'Marcellus', 'Times New Roman', serif;
  --body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
body { font: 400 16px/1.6 var(--body); }
body::before { height: 0; background: none; }
::selection { background: var(--gold, #e8c266); color: #171126; }
a { color: var(--brand); }

.top { max-width: 1140px; border-bottom: 1px solid var(--line); }
.brand b { font: 400 16px/1 var(--head); letter-spacing: .14em; text-transform: uppercase; }
.brand span { font-family: var(--body); color: var(--ink-3); }

h1, h2, h3 { font-family: var(--head); font-weight: 400; letter-spacing: .01em; }
h1 { font-size: 32px; line-height: 1.15; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
.hello h1 { font-size: 36px; }
.hello-star { background: radial-gradient(circle at 35% 30%, #f6dd9a, #e8c266 78%); box-shadow: 0 8px 22px -8px rgba(232,194,102,.55); }

.card, .card.on, .card.blocked {
  background: var(--card); border: 1px solid var(--line); border-top: 1px solid var(--line);
  box-shadow: none;
}
.card.on { border-color: rgba(111, 211, 155, .45); }
.card.on > header h2 { color: var(--ink); }
.card.blocked { border-color: rgba(232, 194, 102, .4); }

input[type=email], input[type=password], input[type=text], input[inputmode=numeric] {
  background: #0e0a1a; border-color: var(--line-2); color: var(--ink); border-radius: var(--r-sm);
}
input::placeholder { color: #6f6890; }

.btn { background: transparent; border-color: var(--line-2); color: var(--ink); border-radius: 8px; font-weight: 700; }
.btn:hover { background: rgba(232, 194, 102, .08); border-color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #171126; font-weight: 800; }
.btn.primary:hover { background: #c9a24a; border-color: #c9a24a; }
.btn.danger { color: var(--bad); border-color: rgba(240, 138, 122, .45); }
.btn.quiet { color: var(--brand); }

.msg[data-kind=error] { color: #ffb4a8; }
.msg[data-kind=ok] { color: #a8ecc5; }
.msg[data-kind=info] { color: #f3dca0; }

.switch { background: #3a2f5c; }
.switch::after { background: #f4f0e6; }
.seg { background: #0e0a1a; border-color: var(--line); }
.seg button[aria-pressed=true] { background: #2a2145; color: var(--ink); box-shadow: none; }
.x:hover { background: #2a2145; }
.precedence { background: #120d22; }
.rules li, .presets li, .stats li { border-top-color: var(--line); }
.empty svg { color: #5d5385; }
.skeleton { background: linear-gradient(90deg, #1e1733, #2a2145, #1e1733); background-size: 200% 100%; }
dialog { background: var(--card); border-color: var(--line); }
dialog::backdrop { background: rgba(5, 3, 12, .7); }
footer.foot { max-width: 1140px; border-top: 1px solid var(--line); }
footer.foot .credit { color: #c9a24a; }
