/* The panel's look: one stylesheet, no build step, nothing fetched from elsewhere.
   Tokens first; every colour, radius and shadow below comes from them. */
:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --ink: #101828;
  --ink-2: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --brand: #3b5bdb;
  --brand-hover: #2f4ac0;
  --brand-ink: #ffffff;
  --brand-soft: #eef2ff;
  --ok: #067647;
  --ok-soft: #ecfdf3;
  --warn: #b54708;
  --warn-soft: #fffaeb;
  --bad: #b42318;
  --bad-soft: #fef3f2;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, .14), 0 4px 8px -4px rgba(16, 24, 40, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* The overview's series: articles, posts, clicks, visitors, speed, AI. */
  --c0: #3b5bdb; --c0-soft: #eef2ff;
  --c1: #0e9f9a; --c1-soft: #e6f7f6;
  --c2: #7a4fe0; --c2-soft: #f3efff;
  --c3: #e08a00; --c3-soft: #fff6e5;
  --c4: #15a046; --c4-soft: #eafaf0;
  --c5: #e0336b; --c5-soft: #fdecf2;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 650; }
h2 { font-size: 17px; font-weight: 620; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 12px; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-2); border: 1px solid var(--line);
       border-radius: 5px; padding: 1px 5px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* -- forms ----------------------------------------------------------------- */
.field { margin-bottom: 16px; }
.field > label, .label { display: block; font-size: 13.5px; font-weight: 560; color: var(--ink-2); margin-bottom: 6px; }
.field .help { font-size: 13px; color: var(--muted); margin-top: 6px; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number],
select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft);
}
textarea { min-height: 96px; resize: vertical; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 46px; }
.password-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 34px;
                display: grid; place-items: center; padding: 0; border: 0; border-radius: 6px; background: transparent;
                color: var(--muted); cursor: pointer; }
.password-eye:hover { color: var(--ink); background: var(--surface-2); }
.password-eye:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.password-eye svg { width: 18px; height: 18px; }

/* -- buttons --------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px;
       padding: 10px 16px; font: inherit; font-weight: 600; font-size: 14.5px; line-height: 1.2;
       border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer;
       text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-secondary { background: var(--surface); color: var(--ink-2); border-color: var(--line-strong); box-shadow: var(--shadow); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-danger { background: var(--surface); color: var(--bad); border-color: #fda29b; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* -- messages -------------------------------------------------------------- */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 18px;
         border: 1px solid transparent; }
.alert-ok { background: var(--ok-soft); color: var(--ok); border-color: #abefc6; }
.alert-err { background: var(--bad-soft); color: var(--bad); border-color: #fecdca; }
.alert-info { background: var(--brand-soft); color: #3538cd; border-color: #c7d7fe; }

/* -- signed-out pages: one centred card ------------------------------------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center;
        justify-content: center; padding: 40px 16px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 650; font-size: 16px;
              color: var(--ink); margin-bottom: 24px; }
.auth-brand:hover { text-decoration: none; }
.mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff;
        display: grid; place-items: center; font-weight: 700; font-size: 15px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
             border-radius: 16px; box-shadow: var(--shadow-lg); padding: 32px; }
.auth-card h1 { margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 24px; }
.auth-foot { margin-top: 20px; font-size: 14px; color: var(--muted); text-align: center; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.big-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--brand-soft); color: var(--brand);
            display: grid; place-items: center; margin-bottom: 18px; }
.big-icon svg { width: 24px; height: 24px; }

@media (max-width: 480px) {
  .auth-card { padding: 24px 20px; border-radius: 14px; }
}

/* -- the signed-in app: a sidebar and a page ---------------------------------- */
.shell { display: grid; grid-template-columns: 256px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px;
           display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh;
           overflow-y: auto; }
.sidebar .auth-brand { margin: 2px 6px 0; font-size: 15px; }
.switcher { position: relative; }
.switcher summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
                    padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
                    background: var(--surface-2); }
.switcher summary::-webkit-details-marker { display: none; }
.switcher summary .name { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; overflow: hidden;
                          text-overflow: ellipsis; white-space: nowrap; }
.switcher summary .chev { color: var(--muted); }
.switcher .menu { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface);
                  border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; }
.switcher .menu a { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 6px;
                    color: var(--ink-2); font-size: 14px; }
.switcher .menu a:hover { background: var(--surface-2); text-decoration: none; }
.switcher .menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; }
.avatar { width: 26px; height: 26px; flex: none; border-radius: 7px; background: var(--brand-soft); color: var(--brand);
          display: grid; place-items: center; font-weight: 700; font-size: 12.5px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
             color: var(--muted); padding: 0 10px; margin: 6px 0 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
         color: var(--ink-2); font-size: 14px; font-weight: 520; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav .count { margin-left: auto; font-size: 12px; font-weight: 600; background: var(--surface-2);
              border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; color: var(--muted); }
.nav a.active .count { background: #fff; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.sidebar-foot .who { font-size: 13px; color: var(--muted); padding: 4px 10px 8px; overflow: hidden; text-overflow: ellipsis; }

.main { padding: 28px 36px 64px; max-width: 1080px; width: 100%; }
.topbar, .scrim { display: none; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; font-size: 14.5px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }

/* -- building blocks ----------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow); padding: 22px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-head h2 svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.card-intro { color: var(--muted); font-size: 14px; margin: 4px 0 18px; max-width: 70ch; }
.card-foot { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 18px;
             padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.card-foot .left { margin-right: auto; color: var(--muted); font-size: 13.5px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow); padding: 16px 18px; }
.stat .k { font-size: 13px; color: var(--muted); font-weight: 520; }
.stat .v { font-size: 26px; font-weight: 650; letter-spacing: -.02em; margin-top: 4px; }
.stat .d { font-size: 13px; color: var(--muted); margin-top: 2px; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
        font-size: 12.5px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: #abefc6; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: #fedf89; }
.pill.bad { background: var(--bad-soft); color: var(--bad); border-color: #fecdca; }
.pill.info { background: var(--brand-soft); color: var(--brand); border-color: #c7d7fe; }
.pill.off { background: var(--surface-2); color: var(--muted); border-color: var(--line); }
.tag { display: inline-block; font-size: 12px; color: var(--muted); background: var(--surface-2);
       border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-weight: 520; }

.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list li:first-child { padding-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .meta { font-size: 13px; color: var(--muted); }
.list .title { font-weight: 560; overflow: hidden; text-overflow: ellipsis; }
.dot { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center;
       background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.dot svg { width: 16px; height: 16px; }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
            color: var(--muted); padding: 0 12px 10px 0; border-bottom: 1px solid var(--line); }
.table td { padding: 12px 12px 12px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }

.progress { height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--brand); border-radius: 999px; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.steps a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
           color: var(--ink-2); font-size: 14px; }
.steps a:hover { background: var(--surface-2); text-decoration: none; }
.steps a.current { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.step-mark { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong);
             display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--muted); background: #fff; }
.step-mark.done { background: var(--ok); border-color: var(--ok); color: #fff; }
.steps .opt { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }

.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .big-icon { margin: 0 auto 14px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }

.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; font-size: 14.5px; cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.check .help { margin-top: 2px; }
.inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.inline > input[type=text], .inline > select { width: auto; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; max-width: 520px; }
.week .day { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted);
             font-weight: 560; text-transform: capitalize; }
.week input[type=number] { text-align: center; padding: 8px 4px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--line-strong);
        border-radius: 999px; font-size: 14px; cursor: pointer; background: #fff; }
.chip:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.chip input { accent-color: var(--brand); }
.subsection { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 18px; }
.subsection:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
details.more { margin: 6px 0 16px; }
details.more > summary { cursor: pointer; color: var(--brand); font-size: 14px; font-weight: 520; }
details.more[open] > summary { margin-bottom: 14px; }
input[type=color] { width: 48px; height: 38px; padding: 3px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
pre.log { background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: var(--radius-sm); overflow-x: auto;
          font: 12.5px/1.55 var(--mono); white-space: pre-wrap; word-break: break-word; max-height: 560px; margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs a { padding: 9px 12px; color: var(--muted); font-weight: 560; font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }
.code-box { font: 600 22px var(--mono); letter-spacing: .12em; background: var(--surface-2); border: 1px dashed var(--line-strong);
            border-radius: var(--radius-sm); padding: 12px 16px; display: inline-block; }
.banner { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--radius);
          border: 1px solid #c7d7fe; background: var(--brand-soft); margin-bottom: 18px; }
.banner.warn { border-color: #fedf89; background: var(--warn-soft); }
.banner .grow { flex: 1; min-width: 0; }
.banner strong { display: block; }
.spinner { width: 18px; height: 18px; border: 2px solid #c7d7fe; border-top-color: var(--brand); border-radius: 50%;
           animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* -- the overview: tiles, numbers and charts -------------------------------------- */
.main.wide { max-width: 1280px; }
.title-row { display: flex; align-items: center; gap: 14px; }
.avatar-lg { width: 48px; height: 48px; border-radius: 13px; font-size: 20px;
             background: linear-gradient(135deg, var(--c0), var(--c2)); color: #fff; box-shadow: var(--shadow-lg); }
.page-head .sub a svg { width: 14px; height: 14px; vertical-align: -2px; }

.hero { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: center;
        background: linear-gradient(120deg, #fff 55%, var(--c0-soft)); }
.hero-main { display: flex; gap: 18px; align-items: center; }
.hero-main h2 { font-size: 18px; margin-bottom: 4px; }
.hero-main p { margin-bottom: 12px; }
.ring-wrap { position: relative; display: grid; place-items: center; flex: none; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.ring-label b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.ring-label small { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.ring circle, .gauge circle, .donut circle { fill: none; stroke-width: 4.2; stroke-linecap: round; }
.ring .track, .gauge .track, .donut .track { stroke: var(--line); stroke-linecap: butt; }
.donut .seg { stroke-width: 6; stroke-linecap: butt; }
.donut .track { stroke-width: 6; }
.tone-brand .val { stroke: var(--brand); } .tone-ok .val { stroke: var(--c4); }
.tone-warn .val { stroke: var(--c3); } .tone-bad .val { stroke: var(--bad); }
.seg.c0 { stroke: var(--c0); } .seg.c1 { stroke: var(--c1); } .seg.c2 { stroke: var(--c2); }
.seg.c3 { stroke: var(--c3); } .seg.c4 { stroke: var(--c4); } .seg.c5 { stroke: var(--c5); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius-sm);
        border: 1px solid var(--line); background: rgba(255, 255, 255, .8); color: var(--ink);
        transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; min-width: 0; }
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.tile-icon { position: relative; width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center;
             background: var(--surface-2); color: var(--muted); }
.tile-icon svg { width: 17px; height: 17px; }
.tile.tone-ok .tile-icon { background: var(--ok-soft); color: var(--ok); }
.tile.tone-warn .tile-icon { background: var(--warn-soft); color: var(--warn); }
.tile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.tile-text b { font-size: 13.5px; font-weight: 600; }
.tile-text small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-state { flex: none; width: 16px; height: 16px; }
.tile-state svg { width: 16px; height: 16px; }
.tile.tone-ok .tile-state { color: var(--ok); } .tile.tone-warn .tile-state { color: var(--warn); }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
       padding: 14px 16px 0; display: flex; flex-direction: column; overflow: hidden;
       transition: transform .15s var(--ease), box-shadow .15s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 560;
           white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-icon { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.kpi-icon svg { width: 15px; height: 15px; }
.kpi .v { font-size: 28px; font-weight: 700; letter-spacing: -.03em; margin-top: 8px; line-height: 1.15;
          display: flex; align-items: center; gap: 8px; }
.kpi .v .of { font-size: 14px; color: var(--muted); font-weight: 560; margin-left: 2px; }
.kpi .d { font-size: 12.5px; color: var(--muted); margin: 2px 0 8px; min-height: 19px; }
.kpi .spark, .kpi .meter { margin: auto -16px 0; }
.kpi .meter { margin: auto 0 14px; }
.delta { margin-left: auto; letter-spacing: 0; display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 650;
         padding: 1px 7px; border-radius: 999px; }
.delta svg { width: 13px; height: 13px; }
.delta.up { background: var(--ok-soft); color: var(--ok); } .delta.down { background: var(--bad-soft); color: var(--bad); }
.kpi-icon.c0, .dot.c0 { background: var(--c0-soft); color: var(--c0); border-color: transparent; }
.kpi-icon.c1, .dot.c1 { background: var(--c1-soft); color: var(--c1); border-color: transparent; }
.kpi-icon.c2 { background: var(--c2-soft); color: var(--c2); } .kpi-icon.c3 { background: var(--c3-soft); color: var(--c3); }
.kpi-icon.c4 { background: var(--c4-soft); color: var(--c4); } .kpi-icon.c5 { background: var(--c5-soft); color: var(--c5); }

.spark { display: block; width: calc(100% + 32px); height: 44px; }
.spark .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .area { stroke: none; opacity: .14; }
.spark.flat .line { stroke: var(--line-strong); stroke-dasharray: 3 4; }
.spark.tone-c0 .line { stroke: var(--c0); } .spark.tone-c0 .area { fill: var(--c0); }
.spark.tone-c1 .line { stroke: var(--c1); } .spark.tone-c1 .area { fill: var(--c1); }
.spark.tone-c2 .line { stroke: var(--c2); } .spark.tone-c2 .area { fill: var(--c2); }
.spark.tone-c3 .line { stroke: var(--c3); } .spark.tone-c3 .area { fill: var(--c3); }
.spark.tone-c5 .line { stroke: var(--c5); } .spark.tone-c5 .area { fill: var(--c5); }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: var(--line-strong); }
.meter.tone-ok > span { background: var(--c4); } .meter.tone-warn > span { background: var(--c3); }
.meter.tone-bad > span { background: var(--bad); }

.split-wide { grid-template-columns: minmax(0, 1fr) 360px; align-items: stretch; }
.split-wide > .card { margin-bottom: 18px; }
.card.fill { display: flex; flex-direction: column; }
.card.fill .bars { flex: 1; min-height: 170px; }
.legend { display: flex; gap: 6px 12px; flex-wrap: wrap; align-items: center; font-size: 12.5px; color: var(--muted); }
.legend i, .facts i, .legend-list i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
i.c0 { background: var(--c0); } i.c1 { background: var(--c1); } i.c2 { background: var(--c2); }
i.c3 { background: var(--c3); } i.c4 { background: var(--c4); } i.c5 { background: var(--c5); }
i.ok { background: var(--c4); border-radius: 50%; } i.bad { background: var(--bad); border-radius: 50%; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 170px; padding-bottom: 12px; position: relative;
        border-bottom: 1px solid var(--line);
        background: repeating-linear-gradient(to top, transparent 0 41px, var(--line) 41px 42px); background-position: 0 -12px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
       position: relative; border-radius: 4px; }
.bar:hover { background: var(--surface-2); }
.bar .stack { width: 100%; max-width: 22px; min-height: 3px; display: flex; flex-direction: column; border-radius: 5px 5px 2px 2px;
              overflow: hidden; background: var(--line); transform-origin: bottom; }
.bar .stack i { display: block; min-height: 3px; }
.bar .stack i.c0 { background: linear-gradient(var(--c0), #5873f0); } .bar .stack i.c1 { background: linear-gradient(var(--c1), #2cc0b9); }
.bar .run { position: absolute; bottom: -9px; width: 6px; height: 6px; border-radius: 50%; }
.bar .run.ok { background: var(--c4); } .bar .run.bad { background: var(--bad); }
.axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 10px; }

[data-tip] { position: relative; }
[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: #101828; color: #fff; font: 500 12px/1.4 var(--font); padding: 6px 9px; border-radius: 7px; white-space: nowrap;
  z-index: 10; pointer-events: none; box-shadow: var(--shadow-lg); }
.bars .bar:nth-last-child(-n+6)[data-tip]:hover::after { left: auto; right: 0; transform: none; }
.bars .bar:nth-child(-n+6)[data-tip]:hover::after { left: 0; transform: none; }

.weekplan { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.weekplan li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid transparent; }
.weekplan li.past { opacity: .72; }
.weekplan li.today { border-color: #c7d7fe; background: var(--brand-soft); opacity: 1; }
.weekplan .when { width: 34px; display: flex; flex-direction: column; align-items: center; line-height: 1.15; flex: none; }
.weekplan .when b { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.weekplan .when small { font-size: 16px; font-weight: 650; }
.weekplan .plan { flex: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.chip-sm { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 560; padding: 3px 9px;
           border-radius: 999px; border: 1px dashed var(--line-strong); color: var(--ink-2); background: #fff; }
.chip-sm svg { width: 13px; height: 13px; }
.chip-sm.c0 { color: var(--c0); } .chip-sm.c1 { color: var(--c1); }
.chip-sm.done { border-style: solid; }
.chip-sm.c0.done { background: var(--c0-soft); border-color: transparent; } .chip-sm.c1.done { background: var(--c1-soft); border-color: transparent; }
.chip-sm.missed { color: var(--muted); text-decoration: line-through; }
p svg { width: 14px; height: 14px; vertical-align: -2px; }

.heat { display: grid; grid-auto-flow: column; grid-template-rows: 16px repeat(7, auto);
        grid-template-columns: 30px repeat(var(--weeks, 26), minmax(0, 1fr)); gap: 4px; }
.heat .wd { font-size: 11px; color: var(--muted); align-self: center; }
.heat small { font-size: 11px; color: var(--muted); white-space: nowrap; line-height: 16px; overflow: visible; }
.heat i, .heat-key i { display: block; border-radius: 4px; background: #eef0f4; }
.heat i { width: 100%; max-width: 28px; aspect-ratio: 1; }
.heat i.l1, .heat-key i.l1 { background: #c9d4fd; } .heat i.l2, .heat-key i.l2 { background: #91a6f6; }
.heat i.l3, .heat-key i.l3 { background: #5d78e8; } .heat i.l4, .heat-key i.l4 { background: var(--c0); }
.heat i.future { background: transparent; border: 1px dashed var(--line); }
.heat i:not(.future):hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.heat-key { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 10px; }
.heat-key i { width: 12px; height: 12px; border-radius: 3px; }

.runs-summary, .site-health, .usage { display: flex; align-items: center; gap: 20px; margin: 10px 0 14px; }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.facts li { display: flex; align-items: center; gap: 4px; }
.facts svg { width: 15px; height: 15px; margin-right: 4px; color: var(--muted); flex: none; }
.facts li.ok svg { color: var(--ok); } .facts li.bad svg { color: var(--bad); }
.list.compact li { padding: 9px 0; }
.gauge-wrap { position: relative; width: 150px; flex: none; }
.gauge { display: block; width: 150px; height: 82px; }
.gauge-label { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; line-height: 1.1; }
.gauge-label b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.gauge-label small { font-size: 11.5px; color: var(--muted); }

.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 56px; gap: 12px; align-items: center; font-size: 13.5px; }
.hbars .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbars .track { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.hbars .track span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--c2), var(--c0)); transform-origin: left; }
.hbars .num { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-list { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.legend-list li { display: flex; align-items: center; gap: 4px; }
.legend-list .grow { flex: 1; }
.empty.small { padding: 18px 8px; }
.empty.small p { font-size: 13.5px; }
.quick { display: flex; flex-direction: column; gap: 8px; }
.quick .btn { justify-content: flex-start; }

.store-card { color: inherit; margin: 0; padding-bottom: 0; overflow: hidden; display: flex; flex-direction: column;
              transition: transform .15s var(--ease), box-shadow .15s; }
.store-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.store-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0 6px; }
.store-stats span { display: flex; flex-direction: column; }
.store-stats b { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.store-stats small { font-size: 12px; color: var(--muted); }
.store-card .spark { margin: 4px -22px 0; width: calc(100% + 44px); }
.store-foot { display: flex; gap: 6px; padding: 12px 0 16px; border-top: 1px solid var(--line); margin-top: -1px; }

.pulse { position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--c4);
         box-shadow: 0 0 0 0 rgba(21, 160, 70, .5); animation: pulse 1.8s infinite; }
.pulse.inline-pulse { position: relative; display: inline-block; top: 0; right: 0; margin-right: 8px; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(21, 160, 70, 0); } 100% { box-shadow: 0 0 0 0 rgba(21, 160, 70, 0); } }

/* Motion: cards rise in turn, charts draw themselves. Off for anyone who asks for less,
   and for a page loaded in a background tab (app.html sets .motion only on one in view):
   paused there, an animation would hold every card at its invisible first frame. */
@media (prefers-reduced-motion: no-preference) {
  .motion .rise { animation: rise .55s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
  .motion .tile { animation: rise .5s var(--ease) both; animation-delay: calc(120ms + var(--i, 0) * 40ms); }
  .motion .bar .stack { animation: grow .7s var(--ease) both; animation-delay: calc(250ms + var(--i, 0) * 16ms); }
  .motion .spark { animation: reveal 1.1s var(--ease) both; animation-delay: .3s; }
  .motion .ring .val, .motion .gauge .val { animation: fill 1.1s var(--ease) both; animation-delay: .2s; }
  .motion .donut { animation: spin-in 1s var(--ease) both; animation-delay: .2s; }
  .motion .heat i { animation: pop .35s var(--ease) both; animation-delay: calc(200ms + var(--i, 0) * 5ms); }
  .motion .hbars .track span, .motion .meter > span { animation: widen .9s var(--ease) both; animation-delay: calc(300ms + var(--i, 0) * 60ms); }
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes grow { from { transform: scaleY(0); } }
@keyframes reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes fill { from { stroke-dasharray: 0 100; } }
@keyframes spin-in { from { transform: rotate(-120deg) scale(.85); opacity: 0; } }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
@keyframes widen { from { transform: scaleX(0); } }
.meter > span { transform-origin: left; }

@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .split-wide { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .v { font-size: 24px; }
  .tiles { gap: 6px; }
  .tile { padding: 8px; gap: 8px; }
  .tile-icon { width: 28px; height: 28px; }
  .tile-state { display: none; }
  .runs-summary, .site-health, .usage { flex-direction: column; align-items: flex-start; }
  .bars { gap: 2px; }
  .hbars li { grid-template-columns: minmax(0, 1fr) 70px 48px; }
}

/* -- the ⓘ beside a field ------------------------------------------------------ */
.field-head { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.field-head label { margin: 0; font-size: 13.5px; font-weight: 560; color: var(--ink-2); }
.hint { font-weight: 400; color: var(--muted); }
.info-btn { margin: 0; padding: 0; width: 18px; height: 18px; flex: none; border-radius: 50%;
            border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted);
            font: italic 700 11px/16px Georgia, "Times New Roman", serif; cursor: pointer; }
.info-btn:hover, .info-btn[aria-expanded="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.info-body { background: var(--brand-soft); border: 1px solid #c7d7fe; border-radius: var(--radius-sm);
             padding: 10px 13px; margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.info-body p { margin: 0 0 6px; }
.info-body p:last-child { margin-bottom: 0; }

/* -- small screens: the sidebar becomes a drawer -------------------------------- */
@media (max-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface);
            border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .topbar .auth-brand { margin: 0; font-size: 15px; }
  .menu-toggle { margin-left: auto; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 40; transform: translateX(-100%);
             transition: transform .18s ease; box-shadow: var(--shadow-lg); }
  #nav-open:checked ~ .shell .sidebar { transform: none; }
  #nav-open:checked ~ .shell .scrim { display: block; }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(16, 24, 40, .35); z-index: 35; }
  .main { padding: 20px 16px 48px; }
  .grid-2, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
