/* ==========================================================================
   Restore Britain · Sites dashboard
   Same brand as the branch theme: navy #061D3F, royal blue #2A4EEF, TT Tricks (Montserrat fallback).
   Compact and calm; motion is short and respects prefers-reduced-motion.
   ========================================================================== */
@font-face { font-family: "TT Tricks"; font-weight: 400; font-display: swap; src: local("TT Tricks Regular"), local("TTTricks-Regular"); }
@font-face { font-family: "TT Tricks"; font-weight: 700; font-display: swap; src: local("TT Tricks Bold"), local("TTTricks-Bold"); }

:root {
  --navy: #061D3F; --navy-800: #0A2550; --navy-700: #0B2B57; --navy-600: #143A70;
  --blue: #2A4EEF; --blue-600: #1032CF; --blue-50: #EEF2FF; --blue-100: #E2E8FE;
  --ink: #141414; --text: #1E2633; --muted: #687385; --line: #E6E9EF; --line-2: #D6DBE4;
  --bg: #F5F6F9; --card: #FFFFFF;
  --green: #12805C; --green-bg: #E5F5EE; --amber: #A15C07; --amber-bg: #FDF2DF; --red: #C62828; --red-bg: #FDECEC;
  --font: "TT Tricks", "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r-sm: 7px; --r: 10px; --r-lg: 14px;
  --sh-sm: 0 1px 2px rgb(6 29 63 / .05), 0 1px 3px rgb(6 29 63 / .05);
  --sh: 0 8px 24px -10px rgb(6 29 63 / .18), 0 2px 6px rgb(6 29 63 / .05);
  --sh-lg: 0 24px 60px -20px rgb(6 29 63 / .35);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --sidebar: 236px; --topbar: 56px;
}
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 14px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-weight: 700; color: var(--navy); line-height: 1.25; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.05rem; } h3 { font-size: .95rem; }
p { margin: 0; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
code, .mono { font-family: var(--mono); font-size: .86em; }
code { background: var(--bg); border: 1px solid var(--line); border-radius: 5px; padding: .05em .35em; }
hr { border: 0; border-top: 1px solid var(--line); margin: .25rem 0; }
small { font-size: .8rem; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.i { flex-shrink: 0; display: block; }
.muted { color: var(--muted); } .small { font-size: .82rem; } .strong { font-weight: 600; color: var(--navy); }
.nowrap { white-space: nowrap; } .text-red { color: var(--red); } .pad { padding: 1rem 1.1rem; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 1rem; top: 1rem; z-index: 99; background: #fff; padding: .5rem 1rem; border-radius: 8px; }

/* ---------- Motion ---------- */
.fade-up { animation: fadeUp .45s var(--ease) both; animation-delay: var(--d, 0ms); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 30%, 70% { transform: translateX(-4px); } 50% { transform: translateX(4px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; } }

/* ---------- Layout ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--navy); color: #C9D3E6; display: flex; flex-direction: column; padding: 1rem .75rem; z-index: 40; overflow-y: auto; }
.sidebar::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 50% at 0% 0%, rgb(42 78 239 / .22), transparent 60%); pointer-events: none; }
.sidebar > * { position: relative; }
.sidebar__brand { display: flex; align-items: center; gap: .6rem; padding: .25rem .5rem 1.1rem; color: #fff; text-decoration: none !important; }
.sidebar__brand span { font-weight: 700; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; padding-left: .6rem; border-left: 1px solid rgb(255 255 255 / .25); }
.sidebar__nav { display: grid; gap: 2px; }
.navlink, .sitelink { position: relative; display: flex; align-items: center; gap: .65rem; padding: .5rem .65rem; border-radius: 8px; color: #C9D3E6; font-weight: 500; text-decoration: none !important; transition: background .15s, color .15s; }
.navlink:hover, .sitelink:hover { background: rgb(255 255 255 / .06); color: #fff; }
.navlink.is-active { background: rgb(255 255 255 / .1); color: #fff; }
.navlink.is-active::before { content: ""; position: absolute; left: -.75rem; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--blue); animation: fadeUp .3s var(--ease); }
.sidebar__label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #7F8DA8; margin: 1.4rem .65rem .4rem; }
.sidebar__sites { display: grid; gap: 1px; }
.sitelink { font-size: .86rem; padding: .38rem .65rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sitelink.is-active { color: #fff; background: rgb(255 255 255 / .06); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #7F8DA8; flex-shrink: 0; }
.dot--live { background: #3DDC97; box-shadow: 0 0 0 3px rgb(61 220 151 / .15); } .dot--suspended { background: #FF6B6B; }
.sidebar__me { margin-top: auto; display: flex; align-items: center; gap: .4rem; padding-top: 1rem; border-top: 1px solid rgb(255 255 255 / .08); }
.me { flex: 1; display: flex; align-items: center; gap: .6rem; padding: .35rem; border-radius: 8px; color: #fff; text-decoration: none !important; min-width: 0; }
.me:hover { background: rgb(255 255 255 / .06); }
.me__text { display: grid; line-height: 1.25; min-width: 0; } .me__text strong { font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .me__text small { color: #9AA7BF; }
.sidebar .iconbtn { color: #C9D3E6; } .sidebar .iconbtn:hover { background: rgb(255 255 255 / .08); color: #fff; }
.scrim { display: none; }

.shell { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar); display: flex; align-items: center; gap: .75rem; padding: 0 1.75rem; background: rgb(245 246 249 / .82); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.is-scrolled { border-bottom-color: var(--line); }
.topbar__title { font-weight: 600; color: var(--navy); opacity: 0; transform: translateY(4px); transition: .2s var(--ease); }
.topbar.is-scrolled .topbar__title { opacity: 1; transform: none; }
.topbar__right { margin-left: auto; display: flex; gap: .5rem; }
.topbar__menu { display: none; }
.content { padding: .5rem 1.75rem 4rem; max-width: 1240px; display: grid; gap: 1.1rem; align-content: start; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .28s var(--ease); box-shadow: var(--sh-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgb(6 29 63 / .4); z-index: 35; animation: fadeUp .2s; }
  .shell { margin-left: 0; }
  .topbar { padding: 0 1rem; } .topbar__menu { display: grid; } .topbar__title { opacity: 1; transform: none; }
  .content { padding: .5rem 1rem 4rem; }
}

/* ---------- Bits ---------- */
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--blue), var(--navy-600)); color: #fff; font-size: .74rem; font-weight: 700; flex-shrink: 0; letter-spacing: .02em; }
.avatar--sm { width: 28px; height: 28px; font-size: .68rem; }
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .12rem .5rem; border-radius: 99px; font-size: .72rem; font-weight: 600; line-height: 1.5; white-space: nowrap; vertical-align: middle; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge--green { background: var(--green-bg); color: var(--green); } .badge--amber { background: var(--amber-bg); color: var(--amber); }
.badge--red { background: var(--red-bg); color: var(--red); } .badge--grey { background: #EEF0F4; color: #566173; }
.badge--blue { background: var(--blue-50); color: var(--blue-600); } .badge--navy { background: var(--navy); color: #fff; }
.badge--navy::before, .badge.mono::before { display: none; }
.pill { display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .7rem; border-radius: 99px; font-size: .76rem; font-weight: 600; text-decoration: none !important; }
.pill--amber { background: var(--amber-bg); color: var(--amber); }
.chips { display: inline-flex; flex-wrap: wrap; gap: .3rem; } .chip { padding: .1rem .5rem; border-radius: 6px; background: #EEF0F4; color: #445066; font-size: .76rem; }
.link { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; font-size: .84rem; }
.back { display: inline-flex; align-items: center; gap: .3rem; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }
.back:hover { color: var(--blue-600); text-decoration: none; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; height: 36px; padding: 0 .95rem; border-radius: 8px; border: 1px solid transparent; font-weight: 600; font-size: .86rem; cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .15s, border-color .15s, color .15s, transform .15s var(--ease), box-shadow .15s; position: relative; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn--sm { height: 30px; padding: 0 .7rem; font-size: .8rem; border-radius: 7px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--navy); color: #fff; box-shadow: 0 1px 0 rgb(255 255 255 / .1) inset, var(--sh-sm); }
.btn--primary:hover { background: var(--navy-700); box-shadow: 0 6px 18px -8px rgb(6 29 63 / .6); }
.btn--ghost { background: #fff; border-color: var(--line-2); color: var(--navy); }
.btn--ghost:hover { border-color: #B9C2D3; background: #FBFCFE; }
.btn--danger { background: var(--red); color: #fff; } .btn--danger:hover { background: #A61F1F; }
.btn--danger-ghost { background: #fff; color: var(--red); border-color: #F3C4C4; } .btn--danger-ghost:hover { background: var(--red-bg); }
.btn--link-danger { background: none; color: var(--red); padding: 0; height: auto; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.is-loading { color: transparent !important; pointer-events: none; }
.btn.is-loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: #fff #fff transparent transparent; animation: spin .7s linear infinite; }
.btn--ghost.is-loading::after { border-color: var(--navy) var(--navy) transparent transparent; }
.iconbtn { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; text-decoration: none !important; }
.iconbtn:hover { background: #E9ECF2; color: var(--navy); }
.iconbtn--danger:hover { background: var(--red-bg); color: var(--red); }
.inline-form { display: inline-flex; margin: 0; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); padding: 1.15rem 1.2rem; }
.card--flush { padding: 0; overflow: hidden; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); }
.card__title { font-size: .95rem; display: flex; align-items: center; gap: .5rem; }
.stack { display: grid; gap: .9rem; align-content: start; }
.row { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; } .row--between { justify-content: space-between; flex-wrap: nowrap; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; align-items: start; }
.cols--wide { grid-template-columns: 1.5fr 1fr; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.grid4 { display: grid; grid-template-columns: 120px 1fr 2fr; gap: .9rem; } .span2 { grid-column: span 1; }
.narrow { max-width: 620px; }
@media (max-width: 1050px) { .cols, .cols--wide { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid2, .grid4 { grid-template-columns: 1fr; } }

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: .25rem; }
.pagehead p { margin-top: .2rem; }
.pagehead__actions { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.sectionhead { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: -.25rem; }
.sectionhead h2 { font-size: 1rem; }
.subhead { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: .4rem; }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: .95rem 1rem; display: grid; grid-template-columns: auto 1fr; column-gap: .75rem; align-items: center; box-shadow: var(--sh-sm); color: inherit; text-decoration: none !important; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.stat--link:hover { transform: translateY(-2px); box-shadow: var(--sh); border-color: var(--line-2); }
.stat__icon { grid-row: span 3; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); }
.stat__value { font-size: 1.45rem; font-weight: 700; color: var(--navy); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__label { color: var(--muted); font-size: .8rem; font-weight: 500; }

/* Setup checklist */
.setup { display: grid; gap: .7rem; background: linear-gradient(135deg, #fff 60%, var(--blue-50)); }
.setup__head { display: flex; justify-content: space-between; align-items: baseline; }
.progress { height: 6px; border-radius: 99px; background: #E7EBF3; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--navy)); border-radius: inherit; animation: grow 1s var(--ease) .3s both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.setup__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .4rem .9rem; }
.setup__list li { display: flex; align-items: center; gap: .55rem; font-size: .88rem; }
.setup__list li.is-done span:last-child { color: var(--muted); text-decoration: line-through; }
.tick { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; }
.is-done .tick { background: var(--green); border-color: var(--green); color: #fff; }

/* Site cards */
.sitegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; margin-top: .75rem; }
.sitecard { display: grid; gap: .3rem; padding: 1rem; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); color: inherit; text-decoration: none !important; box-shadow: var(--sh-sm); transition: transform .2s var(--ease), box-shadow .2s; animation: pop .45s var(--ease) both; animation-delay: var(--d, 0ms); }
.sitecard:hover { transform: translateY(-3px); box-shadow: var(--sh); }
.sitecard__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.sitecard__mark, .sitehead__badge { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--navy); color: #fff; font-weight: 700; font-size: .8rem; letter-spacing: .03em; }
.sitecard__host { color: var(--muted); font-size: .8rem; font-family: var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sitecard__meta { display: flex; gap: .8rem; color: var(--muted); font-size: .8rem; margin-top: .35rem; }
.sitecard__meta span { display: inline-flex; align-items: center; gap: .3rem; }
.sitecard__meta .unread { color: var(--blue-600); font-weight: 600; }

/* Feed / rows */
.feed { list-style: none; margin: 0; padding: .3rem 0; }
.feed li { display: flex; gap: .7rem; padding: .6rem 1.1rem; align-items: flex-start; }
.feed li + li { border-top: 1px solid #F0F2F6; }
.feed p { font-size: .86rem; } .feed small { color: var(--muted); }
.feed__target { color: var(--navy); font-weight: 600; }
.rows { list-style: none; margin: 0; padding: .25rem 0; }
.rows li > a, .rows .rowline { display: flex; align-items: center; gap: .65rem; padding: .6rem 1.1rem; color: inherit; text-decoration: none !important; transition: background .12s; }
.rows li > a:hover { background: #F8F9FC; }
.rows li + li { border-top: 1px solid #F0F2F6; }
.rows__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; color: var(--navy); }
.rows .i { color: var(--muted); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .7rem 1rem; background: #FAFBFC; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .65rem 1rem; border-bottom: 1px solid #F0F2F6; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; animation: fadeUp .35s var(--ease) both; }
.table tbody tr:nth-child(-n+12) { animation-delay: calc(var(--row, 0) * 18ms); }
.table tbody tr[data-href] { cursor: pointer; } .table tbody tr:hover { background: #F8F9FC; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; } .table .actions { text-align: right; white-space: nowrap; width: 1%; }
.table .clip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card--flush > .table { margin: 0; }
@media (max-width: 760px) { .card--flush:has(.table) { overflow-x: auto; } .table { min-width: 640px; } }
.person { display: flex; align-items: center; gap: .6rem; } .person > span:last-child { display: grid; line-height: 1.3; } .person small { color: var(--muted); }

/* Search / filters */
.search { display: inline-flex; align-items: center; gap: .45rem; height: 36px; padding: 0 .7rem; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(42 78 239 / .12); }
.search input { border: 0; outline: 0; background: none; width: 180px; height: 100%; padding: 0; color: var(--text); }
.segmented { display: inline-flex; padding: 3px; border-radius: 9px; background: #E9ECF2; gap: 2px; }
.segmented a, .segmented label span { display: block; padding: .3rem .8rem; border-radius: 7px; font-size: .82rem; font-weight: 600; color: #566173; text-decoration: none !important; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; text-align: center; }
.segmented a.is-active, .segmented input:checked + span { background: #fff; color: var(--navy); box-shadow: var(--sh-sm); }
.segmented label { flex: 1; } .segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input:focus-visible + span { outline: 2px solid var(--blue); }
.segmented--block { display: flex; }
.pager { display: flex; justify-content: center; align-items: center; gap: 1rem; }

/* Forms */
.field { display: grid; gap: .3rem; min-width: 0; }
.field > label { font-size: .8rem; font-weight: 600; color: var(--navy); }
.field > label small { font-weight: 500; color: var(--muted); }
.field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea, .searchrow input, .rep__field input, .rep__field select, .rep__field textarea, select[data-autosubmit] {
  width: 100%; min-height: 38px; padding: .5rem .7rem; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s; outline: 0; }
.field textarea, .rep__field textarea { resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus, .searchrow input:focus, .rep__field :is(input, select, textarea):focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(42 78 239 / .12); }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--red); box-shadow: 0 0 0 3px rgb(198 40 40 / .1); }
.field.has-error { animation: shake .35s; }
.field--title input { font-size: 1.15rem !important; font-weight: 700; color: var(--navy); min-height: 46px !important; }
.field--code textarea { font-family: var(--mono); font-size: .8rem; }
.field--small { max-width: 140px; }
.hint { font-size: .78rem; color: var(--muted); }
.err { font-size: .78rem; color: var(--red); font-weight: 500; min-height: 0; }
.err:empty { display: none; }
.affix { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: #fff; transition: border-color .15s, box-shadow .15s; }
.affix:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(42 78 239 / .12); }
.affix span { display: grid; place-items: center; padding: 0 .65rem; background: #F6F7FA; color: var(--muted); font-size: .8rem; font-family: var(--mono); white-space: nowrap; }
.affix input { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: .86rem; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch__track { width: 34px; height: 20px; border-radius: 99px; background: #CBD2DE; position: relative; transition: background .2s; flex-shrink: 0; }
.switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .2); transition: transform .25s var(--ease); }
.switch input:checked + .switch__track { background: var(--blue); }
.switch input:checked + .switch__track::after { transform: translateX(14px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--blue); outline-offset: 2px; }
.choice { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
.choice legend, .sitepick legend { font-size: .8rem; font-weight: 600; color: var(--navy); margin-bottom: .4rem; padding: 0; }
.choice__opt { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.choice__opt:hover { border-color: #B9C2D3; }
.choice__opt:has(input:checked) { border-color: var(--blue); background: var(--blue-50); box-shadow: 0 0 0 3px rgb(42 78 239 / .08); }
.choice__opt input { margin-top: .2rem; accent-color: var(--blue); }
.choice__opt span { display: grid; } .choice__opt small { color: var(--muted); }
.sitepick { border: 0; padding: 0; margin: 0; transition: opacity .2s; }
.sitepick.is-disabled { opacity: .45; pointer-events: none; }
.sitepick__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .4rem; }
.check { display: flex; gap: .55rem; align-items: center; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: .86rem; transition: border-color .15s, background .15s; }
.check:has(input:checked) { border-color: var(--blue); background: var(--blue-50); }
.check input { accent-color: var(--blue); }
.formfoot { display: flex; justify-content: flex-end; gap: .6rem; padding-top: .3rem; }
.searchrow { display: flex; gap: .5rem; } .searchrow input { flex: 1; }
.codeline { display: flex; align-items: center; gap: .5rem; padding: .45rem .5rem .45rem .8rem; background: var(--navy); color: #E3E9F7; border-radius: 9px; }
.codeline code { flex: 1; background: none; border: 0; color: inherit; padding: 0; word-break: break-all; }
.codeline .iconbtn { color: #C9D3E6; } .codeline .iconbtn:hover { background: rgb(255 255 255 / .1); color: #fff; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.checks li { display: flex; align-items: center; gap: .5rem; font-size: .85rem; }
.checks li small { margin-left: auto; color: var(--muted); font-family: var(--mono); max-width: 50%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checks .ok .i { color: var(--green); } .checks .bad .i { color: var(--red); } .checks .bad span { color: var(--red); }
.dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem 1rem; margin: 0; font-size: .86rem; } .dl dt { color: var(--muted); } .dl dd { margin: 0; }
details.help summary, details.mini summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--blue-600); }
details.help { font-size: .84rem; } details.help ul { margin: .3rem 0; padding-left: 1.1rem; } details.help p { margin: .4rem 0; }
details.mini summary { font-weight: 500; color: var(--muted); font-size: .74rem; display: inline; margin-left: .3rem; }
details.mini pre { margin: .4rem 0 0; font-size: .74rem; background: var(--bg); padding: .5rem; border-radius: 6px; max-width: 520px; overflow: auto; }

/* Notices */
.notice { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--r); font-size: .86rem; border: 1px solid; }
.notice--amber { background: var(--amber-bg); border-color: #F5D9AA; color: #6B3E05; }
.notice--red { background: var(--red-bg); border-color: #F3C4C4; color: #7E1717; }
.notice--blue { background: var(--blue-50); border-color: #CBD6FD; color: var(--navy); }
.notice .i { margin-top: .1rem; } .notice > div { flex: 1; min-width: 0; } .notice a { font-weight: 600; }

/* Empty states */
.empty { text-align: center; padding: 2.5rem 1.5rem; display: grid; justify-items: center; gap: .55rem; }
.empty p { color: var(--muted); max-width: 26rem; }
.empty__icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); margin-bottom: .3rem; animation: pop .5s var(--ease) .1s both; }
.empty .btn { margin-top: .5rem; }

/* Site header & tabs */
.sitehead { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.sitehead__main { display: flex; gap: .85rem; align-items: center; }
.sitehead__badge { width: 44px; height: 44px; border-radius: 12px; font-size: .95rem; background: linear-gradient(135deg, var(--navy), var(--navy-600)); }
.sitehead__title { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.sitehead__host { display: inline-flex; align-items: center; gap: .3rem; font-family: var(--mono); font-size: .8rem; color: var(--muted); }
.sitehead__actions { display: flex; gap: .5rem; }
.tabs { display: flex; gap: .15rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; margin-bottom: .2rem; }
.tab { position: relative; display: inline-flex; align-items: center; gap: .4rem; padding: .6rem .8rem; color: var(--muted); font-weight: 600; font-size: .85rem; white-space: nowrap; text-decoration: none !important; transition: color .15s; }
.tab:hover { color: var(--navy); }
.tab.is-active { color: var(--navy); }
.tab.is-active::after { content: ""; position: absolute; left: .6rem; right: .6rem; bottom: -1px; height: 2px; border-radius: 2px; background: var(--blue); animation: grow .35s var(--ease); }
.quick { display: flex; gap: .5rem; flex-wrap: wrap; }
.quick__btn { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .85rem; border-radius: 99px; background: #fff; border: 1px dashed var(--line-2); color: var(--navy); font-weight: 600; font-size: .82rem; text-decoration: none !important; transition: border-color .15s, background .15s, transform .15s var(--ease); }
.quick__btn:hover { border-style: solid; border-color: var(--blue); background: var(--blue-50); transform: translateY(-1px); }
.danger { border: 1px solid #F3C4C4; border-radius: var(--r-lg); background: #fff; }
.danger summary { padding: .8rem 1.1rem; cursor: pointer; font-weight: 600; color: var(--red); font-size: .88rem; }
.danger__body { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1.1rem; border-top: 1px solid #FBE3E3; }

/* Domains */
.domains { list-style: none; margin: 0; padding: 0; }
.domain { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .9rem 1.1rem; flex-wrap: wrap; }
.domain + .domain { border-top: 1px solid #F0F2F6; }
.domain__main { display: flex; gap: .75rem; align-items: flex-start; min-width: 0; }
.domain__icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--blue-50); color: var(--blue-600); flex-shrink: 0; }
.domain__host { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; font-weight: 600; } .domain__host a { color: var(--navy); font-family: var(--mono); font-size: .9rem; }
.domain__msg { margin-top: .3rem; font-size: .8rem; color: var(--amber); }
.domain__actions { display: flex; gap: .3rem; align-items: center; }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.results li { display: flex; align-items: center; gap: .75rem; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 10px; animation: pop .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.results .r__name { font-family: var(--mono); font-weight: 600; color: var(--navy); flex: 1; }
.results .r__price { font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.results .r__no { color: var(--muted); font-size: .8rem; }

/* Settings page */
.settings { display: grid; grid-template-columns: 180px 1fr; gap: 1.2rem; align-items: start; }
.settings__nav { position: sticky; top: calc(var(--topbar) + 1rem); display: grid; gap: 2px; }
.settings__nav a { padding: .4rem .7rem; border-radius: 7px; color: var(--muted); font-weight: 600; font-size: .84rem; text-decoration: none !important; transition: background .15s, color .15s; }
.settings__nav a:hover, .settings__nav a.is-active { background: #E9ECF2; color: var(--navy); }
.settings__body { display: grid; gap: 1rem; min-width: 0; }
.settings__body section { scroll-margin-top: calc(var(--topbar) + 1rem); }
@media (max-width: 900px) { .settings { grid-template-columns: 1fr; } .settings__nav { display: none; } }
.savebar { position: sticky; bottom: 1rem; display: flex; justify-content: flex-end; align-items: center; gap: 1rem; padding: .6rem .6rem .6rem 1rem; background: rgb(255 255 255 / .9); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh); z-index: 5; }
.savebar__msg { font-size: .8rem; color: var(--muted); margin-right: auto; }
.is-dirty .savebar__msg, .savebar__msg.is-dirty { color: var(--amber); font-weight: 600; }
.hero-upload { display: grid; grid-template-columns: 220px 1fr; gap: 1rem; align-items: center; }
.hero-upload__preview { aspect-ratio: 16/9; border-radius: 10px; background: linear-gradient(135deg, var(--navy), var(--navy-600)) center/cover; display: grid; place-items: center; text-align: center; padding: 1rem; color: #C9D3E6; font-size: .76rem; overflow: hidden; }
@media (max-width: 640px) { .hero-upload { grid-template-columns: 1fr; } }

/* Repeater */
.rep { display: grid; gap: .6rem; }
.rep__rows { display: grid; gap: .5rem; }
.rep__row { display: flex; gap: .6rem; padding: .7rem; border: 1px solid var(--line); border-radius: 10px; background: #FBFCFD; animation: pop .3s var(--ease) both; }
.rep__row.is-removing { animation: none; opacity: 0; transform: scale(.97); transition: .2s; }
.rep__handle { color: #B5BDCB; font-size: .7rem; letter-spacing: -2px; padding-top: 1.6rem; user-select: none; }
.rep__fields { flex: 1; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; }
.rep__field { display: grid; gap: .2rem; } .rep__field > span { font-size: .72rem; font-weight: 600; color: var(--muted); }
.rep__field--textarea { grid-column: 1 / -1; }
.rep__field--select { max-width: 160px; }
.rep__tools { display: grid; align-content: start; gap: .2rem; padding-top: 1.2rem; }
.rep > .btn { justify-self: start; }

/* Content editor */
.editorhead h1 { margin-top: .1rem; }
.editgrid { display: grid; grid-template-columns: 1fr 290px; gap: 1.1rem; align-items: start; }
.editgrid__form { display: grid; gap: 1rem; min-width: 0; }
.editgrid__side { display: grid; gap: 1rem; position: sticky; top: calc(var(--topbar) + .75rem); }
@media (max-width: 1000px) { .editgrid { grid-template-columns: 1fr; } .editgrid__side { position: static; } }
.publish .btn--block { height: 40px; }
.publish-delete { text-align: center; }
.swatches { display: flex; gap: .5rem; }
.swatch { flex: 1; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; }
.swatch span { display: grid; place-items: end start; height: 48px; padding: .3rem .45rem; border-radius: 8px; color: #fff; font-size: .72rem; font-weight: 600; transition: transform .15s var(--ease), box-shadow .15s; }
.swatch--navy span { background: linear-gradient(135deg, #061D3F, #0A2B5A); } .swatch--blue span { background: linear-gradient(135deg, #2A4EEF, #1032CF); } .swatch--ink span { background: linear-gradient(160deg, #141414, #061D3F); }
.swatch input:checked + span { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--blue); transform: translateY(-1px); }
.swatch input:focus-visible + span { outline: 2px solid var(--blue); }
.editor { border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; transition: border-color .15s, box-shadow .15s; }
.editor:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgb(42 78 239 / .12); }
.editor__bar { display: flex; flex-wrap: wrap; gap: 2px; padding: .35rem; border-bottom: 1px solid var(--line); background: #FAFBFC; position: sticky; top: var(--topbar); z-index: 2; }
.editor__bar button { height: 28px; min-width: 30px; padding: 0 .5rem; border: 0; border-radius: 6px; background: none; color: #445066; font-size: .78rem; font-weight: 600; cursor: pointer; transition: background .12s, color .12s; }
.editor__bar button:hover, .editor__bar button.is-on { background: #E9ECF2; color: var(--navy); }
.editor__sep { width: 1px; background: var(--line); margin: 4px 3px; }
.editor__html { margin-left: auto; font-family: var(--mono); }
.editor__area { min-height: 260px; padding: 1rem 1.1rem; outline: 0; }
.editor__src { width: 100%; min-height: 260px; border: 0; padding: 1rem; font-family: var(--mono); font-size: .8rem; outline: 0; resize: vertical; }
.editor.is-html .editor__area { display: none; } .editor.is-html .editor__src { display: block !important; }
.prose { font-size: .95rem; line-height: 1.7; }
.prose > * + * { margin-top: .8em; }
.prose h2 { font-size: 1.2rem; margin-top: 1.2em; } .prose h3 { font-size: 1.02rem; margin-top: 1em; }
.prose blockquote { margin-left: 0; padding-left: 1rem; border-left: 3px solid var(--blue); color: #445066; }
.prose ul, .prose ol { padding-left: 1.3rem; } .prose p { margin: 0; }
.prose:empty::before { content: "Start writing…"; color: #A6AEBD; }

/* Inbox */
.inbox { display: grid; gap: .6rem; }
.msg { display: grid; gap: .5rem; padding: .9rem 1rem; }
.msg--new { border-left: 3px solid var(--blue); }
.msg__head { display: flex; gap: .7rem; align-items: center; }
.msg__head > div { flex: 1; display: flex; flex-wrap: wrap; gap: 0 .5rem; align-items: baseline; } .msg__head small { width: 100%; }
.msg__topic { font-weight: 600; color: var(--navy); font-size: .88rem; }
.msg__body { color: #384254; font-size: .88rem; white-space: pre-line; }

/* Users */
.roles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.role { padding: .75rem .9rem; background: #fff; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: .35rem; justify-items: start; font-size: .82rem; color: var(--muted); }
@media (max-width: 760px) { .roles { grid-template-columns: 1fr; } }
.invite { animation: pop .5s var(--ease) both; }

/* ---------- Toasts & dialogs ---------- */
.toasts { position: fixed; right: 1.2rem; bottom: 1.2rem; display: grid; gap: .5rem; z-index: 100; width: min(380px, calc(100vw - 2.4rem)); }
.toast { display: flex; gap: .65rem; align-items: flex-start; padding: .75rem .9rem; border-radius: 12px; background: var(--navy); color: #fff; box-shadow: var(--sh-lg); font-size: .86rem; animation: toastIn .4s var(--ease) both; }
.toast.is-leaving { animation: toastOut .25s ease-in forwards; }
.toast__icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: #3DDC97; color: var(--navy); }
.toast--error .toast__icon { background: #FF6B6B; color: #fff; } .toast--info .toast__icon { background: #8FA6FF; }
.toast__msg { flex: 1; } .toast__close { background: none; border: 0; color: #9AA7BF; cursor: pointer; padding: 0; font-size: 1.1rem; line-height: 1; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(24px); } }
.dialog { border: 0; padding: 0; border-radius: 16px; box-shadow: var(--sh-lg); width: min(430px, calc(100vw - 2rem)); background: #fff; }
.dialog[open] { animation: pop .25s var(--ease); }
.dialog::backdrop { background: rgb(6 29 63 / .45); backdrop-filter: blur(2px); animation: fadeUp .2s; }
.dialog__panel { padding: 1.3rem 1.4rem 1.1rem; display: grid; gap: .8rem; }
.dialog__text { color: #445066; font-size: .9rem; }
.dialog__actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .3rem; }

/* ---------- Bare pages: sign in & installer ---------- */
.bare { min-height: 100vh; background: var(--navy); color: #fff; overflow-x: hidden; }
.bare__bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: float 16s ease-in-out infinite alternate; }
.orb--1 { width: 520px; height: 520px; background: #2A4EEF; top: -180px; right: -120px; }
.orb--2 { width: 420px; height: 420px; background: #1B3FA8; bottom: -160px; left: -120px; animation-delay: -6s; }
@keyframes float { to { transform: translate(-40px, 30px) scale(1.08); } }
.gridlines { position: absolute; inset: 0; background-image: linear-gradient(rgb(255 255 255 / .04) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .04) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 40%, #000, transparent 70%); }
.bare__main { position: relative; min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 1.6rem; padding: 2rem 1rem; }
.bare__logo { animation: fadeUp .5s var(--ease) both; }
.bare__foot { color: #7F8DA8; font-size: .78rem; }
.authcard { width: min(400px, 100%); background: #fff; color: var(--text); border-radius: 18px; padding: 1.7rem 1.6rem; box-shadow: var(--sh-lg); display: grid; gap: 1rem; animation-delay: 80ms; }
.authcard--wide { width: min(540px, 100%); }
.authcard h1 { font-size: 1.3rem; }
.authcard .muted { margin-top: -.6rem; }
.authcard__note { display: flex; gap: .4rem; align-items: center; color: var(--muted); font-size: .78rem; justify-content: center; }
.authcard .btn--block { height: 42px; }
.stepper { list-style: none; margin: 0 0 .3rem; padding: 0; display: flex; gap: .3rem; counter-reset: s; }
.stepper li { flex: 1; display: grid; justify-items: center; gap: .3rem; font-size: .7rem; font-weight: 600; color: var(--muted); text-align: center; position: relative; }
.stepper li::before { content: ""; position: absolute; top: 13px; right: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.stepper li:first-child::before { display: none; }
.stepper li.is-done::before, .stepper li.is-current::before { background: var(--blue); }
.stepper span { position: relative; z-index: 1; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: #EEF0F4; color: var(--muted); font-size: .78rem; transition: .3s var(--ease); }
.stepper .is-current span { background: var(--navy); color: #fff; box-shadow: 0 0 0 4px rgb(42 78 239 / .18); }
.stepper .is-done span { background: var(--blue); color: #fff; }
.stepper .is-current { color: var(--navy); }
.strength { height: 4px; border-radius: 99px; background: #EEF0F4; overflow: hidden; margin-top: .2rem; }
.strength span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .3s var(--ease), background .3s; }
