/* ============================================================================================================
   App skin (body.app): the logged-in panel and the client report use the same palette as the public pages.
   White cards on a warm off-white page, one indigo accent, an ink-dark sidebar. This is the default theme ("Brand");
   the other themes of style.css stay selectable from the picker in the side menu and only borrow the shared rules below.
   Loaded after style.css; every rule is scoped to body.app (or is a new class), so public pages are not touched.
   ============================================================================================================ */
[hidden] { display: none !important; }
.ico { flex: none; vertical-align: middle; }
/* other themes: the shared rules read accent and radius from the theme's own variables */
body.app { --accent: var(--brand); --accent-hover: var(--brand); --radius: 10px; --r-btn: 10px; --r-card: 12px; }
/* default theme "Brand": the palette of the public pages */
:is(html:not([data-theme]), html[data-theme="brand"]) body.app {
  --bg: #ffffff; --bg-alt: #f6f5f2; --bg-soft: #f6f5f2; --card: #ffffff; --card2: #f6f5f2; --line: #e6e3dc; --line2: #cfcbc2;
  --ink: #15171c; --ink-muted: #5b6170; --text: #15171c; --text2: #2c303a; --muted: #5b6170; --strong: #15171c;
  --accent: #3730a3; --accent-hover: #2c2585; --brand: #3730a3; --brand-ink: #ffffff; --accent2: #3730a3; --glow: transparent;
  --ok: #15803d; --ok-bg: rgba(21, 128, 61, .1); --bad: #dc2626; --bad-bg: rgba(220, 38, 38, .09); --lost: #dc2626;
  --warn: #b45309; --warn-bg: rgba(180, 83, 9, .11); --info: #475569; --info-bg: rgba(71, 85, 105, .1);
  --input: #ffffff; --hover: rgba(21, 23, 28, .06); --hover-soft: rgba(21, 23, 28, .03); --strip: #e6e3dc; --switch: #cfcbc2;
  --side-bg: var(--ink); --side-strong: #ffffff; --side-text: #d3d5dc; --side-muted: #8e93a3; --side-active: rgba(255, 255, 255, .09);
  --header: rgba(255, 255, 255, .94); --bg-glow: none;
  --radius: 10px; --r-btn: 10px; --r-card: 12px;
  background: var(--bg-alt); color-scheme: light;
}
body.app .btn, body.app button, body.app input[type=text], body.app input[type=email], body.app input[type=password], body.app input[type=url],
body.app select, body.app textarea { border-radius: var(--radius); }
body.app .btn.primary, body.app button.primary { background: var(--accent); border-color: var(--accent); color: var(--brand-ink); font-weight: 650; box-shadow: none; }
body.app .btn.primary:hover, body.app button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: none; text-decoration: none; }
body.app a { color: var(--accent); }
body.app .btn, body.app .tabs a, body.app .side-nav a { color: inherit; }
body.app .btn.primary, body.app a.btn.primary { color: var(--brand-ink); }
:is(html:not([data-theme]), html[data-theme="brand"]) body.app input:focus, :is(html:not([data-theme]), html[data-theme="brand"]) body.app select:focus, :is(html:not([data-theme]), html[data-theme="brand"]) body.app textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(55, 48, 163, .16); }
body.app input[type=checkbox] { accent-color: var(--accent); }
body.app .card { box-shadow: none; border-radius: var(--r-card); }
body.app h1, body.app h2, body.app h3 { letter-spacing: -.01em; }
body.app .brand-badge, body.app .logo-mark, body.app .avatar, body.app .site-dot { background: var(--accent); color: var(--brand-ink); box-shadow: none; }
body.app .meter i { background: var(--accent); }
body.app .plan-now { background: var(--card); border-color: var(--line2); }
body.app .plan.current, body.app .order-box { border-color: var(--accent); box-shadow: none; }
:is(html:not([data-theme]), html[data-theme="brand"]) body.app .connect-box { border-color: var(--accent); background: rgba(55, 48, 163, .05); }
:is(html:not([data-theme]), html[data-theme="brand"]) body.app .msg.staff { border-color: rgba(55, 48, 163, .35); background: rgba(55, 48, 163, .04); }
body.app label.switch input:checked + i { background: var(--accent); }
body.app .period-switch a.on, body.app .wizard li.now i { background: var(--accent); border-color: var(--accent); color: var(--brand-ink); }
body.app .steps.how li::before { background: var(--accent); color: var(--brand-ink); }
body.app .steps li.done::before { color: var(--accent); }
body.app .tabs a { border-radius: 8px; }
:is(html:not([data-theme]), html[data-theme="brand"]) body.app .tabs a.on { background: rgba(55, 48, 163, .09); border-color: var(--accent); color: var(--accent); }
body.app .chip { border-radius: 6px; }
body.app .domain-pick { border-radius: var(--radius); }
body.app .side { border-right: 0; }
body.app .side-nav a { border-radius: var(--radius); }
body.app .side-nav a:hover { background: rgba(127, 127, 127, .14); }
body.app .side-nav a.active { background: var(--side-active); color: var(--side-strong); box-shadow: none; }
body.app .side-nav a.active::before { left: -12px; width: 3px; background: var(--accent); }
body.app .side-nav i { display: inline-grid; place-items: center; width: 20px; font-size: 0; }
body.app .side-nav em { background: var(--bad); color: #fff; }
body.app .side-nav em.ok { background: var(--accent); color: var(--brand-ink); }
:is(html:not([data-theme]), html[data-theme="brand"]) body.app .side-card { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .12); }
:is(html:not([data-theme]), html[data-theme="brand"]) body.app .side-card .running i { background: #4ade80; box-shadow: none; }
:is(html:not([data-theme]), html[data-theme="brand"]) body.app .side-user button.link { color: #c9c6f5; }
:is(html:not([data-theme]), html[data-theme="brand"]) body.app .mobile-bar { background: var(--ink); color: #fff; border-bottom: 0; }
:is(html:not([data-theme]), html[data-theme="brand"]) body.app .mobile-bar button { background: transparent; border-color: rgba(255, 255, 255, .25); color: #fff; display: inline-grid; place-items: center; padding: 6px 10px; }
body.app .flash { border-radius: var(--radius); }
.chip.result { display: inline-block; min-width: 96px; text-align: center; white-space: nowrap; margin: 0; padding: 1px 10px; border-radius: 999px; font-weight: 600; }
.ch-ico svg { color: var(--accent); }

/* ---- dashboard: six tiles in one row ---- */
.tiles6 { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.tile6 { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: 12px 14px; color: var(--text); }
a.tile6 { text-decoration: none; } a.tile6:hover { border-color: var(--line2); text-decoration: none; }
.tile6 b { display: block; white-space: nowrap; font-size: clamp(22px, 2.1vw, 28px); line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.tile6 .lbl { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.tile6.ok b { color: var(--ok); } .tile6.bad b { color: var(--bad); } .tile6.warn b { color: var(--warn); }
.tiles6.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tile6.locked b { font-size: 17px; line-height: 32px; }
.tile6 .from { font-size: 13px; color: var(--muted); text-decoration: underline; }
@media (max-width: 1100px) { .tiles6, .tiles6.five { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .tiles6, .tiles6.five { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .tile6 b { font-size: 24px; } }

/* ---- dashboard: one filter row, left aligned ---- */
body.app .listbar { margin: 4px 0 14px; justify-content: flex-start; }
body.app .find { margin: 0; }
body.app .find input[type=text] { width: 260px; flex: 0 1 260px; }
body.app .find select { width: auto; max-width: 240px; }
/* bulk bar: only while rows are selected */
body.app .bulkbar { display: none; opacity: 1; min-height: 0; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--accent); border-radius: var(--r-card); }
body.app .bulkbar.active { display: flex; animation: bulk-in .18s ease-out; }
@keyframes bulk-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes bulk-up { from { transform: translateY(100%); } to { transform: none; } }

/* link book rows */
.linkbook td { padding: 9px 8px; }
.linkbook th { padding: 10px 8px; }
.linkbook .strip { gap: 1px; }
.linkbook .strip i { width: 3px; }
.linkbook { font-size: 14px; }
.linkbook td.acts { display: table-cell; }
.linkbook td.acts a { display: block; margin-top: 4px; }
.linkbook .cell-host { display: block; font-size: 14.5px; font-weight: 650; }
.linkbook .cell-path { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); }
.linkbook .cell-path:hover { color: var(--accent); }
.linkbook td.c-anchor .cell-path { max-width: 150px; }
.linkbook button.detail-toggle { margin-top: 4px; padding: 0 10px; font-size: 12px; min-height: 0; background: none; color: var(--muted); }
.linkbook .anchor { font-weight: 600; font-size: 14px; }
.linkbook .days-pct { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.linkbook td.c-resp .code { font-weight: 650; }
.gi .badge { max-width: 132px; white-space: normal; align-items: flex-start; line-height: 1.35; }
.gi .badge::before { flex: none; margin-top: 5px; }
.gi .gi-sub { margin-top: 3px; font-size: 12px; color: var(--muted); }
.gi-free { font-size: 13px; color: var(--muted); text-decoration: underline; }
.badge.s-waiting { background: rgba(71, 105, 160, .13); color: #3f5f95; }
tr.demo-detail td { background: var(--bg-alt); padding: 10px 14px 12px; }
.detail-grid { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--muted); align-items: center; }
.detail-grid b { color: var(--text); font-weight: 600; }
.detail-grid .why { color: var(--bad); }

/* ---- link page ---- */
.lp-block { padding: 14px 0; border-top: 1px solid var(--line); }
.lp-block.first { border-top: 0; padding-top: 0; }
.lp-block h3 { margin: 0 0 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.lp-pillrow { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.badge.xl { font-size: 15px; padding: 5px 16px 5px 13px; }
.lp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 22px; }
.lp-facts .k { display: block; font-size: 12.5px; color: var(--muted); }
.index-hist { width: 100%; min-width: 0; margin-top: 10px; }
.index-hist td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.index-hist tr.pair-top td { border-bottom: 0; padding-bottom: 2px; }
.index-hist tr.pair-bottom td { background: var(--hover-soft); }
.index-hist tr.pair-bottom td:first-child { box-shadow: inset 3px 0 0 var(--line2); }
.lp-free { margin: 0; color: var(--muted); }

/* ---- client report ---- */
.rep-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 14px 0 16px; }
.rep-tiles.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 760px) { .rep-tiles, .rep-tiles.four { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

/* ---- phones ---- */
@media (max-width: 760px) {
  body.app .linkbook table.stack tr { display: flex; flex-direction: column; }
  body.app .linkbook table.stack td { order: 20; }
  body.app .linkbook table.stack td.c-host { order: 1; } body.app .linkbook table.stack td.c-status { order: 2; }
  body.app .linkbook table.stack td.c-gi { order: 3; display: block; width: 100%; } body.app .linkbook table.stack td.c-anchor { order: 4; }
  body.app .linkbook table.stack td.c-days { order: 5; } body.app .linkbook table.stack td.acts { order: 30; }
  body.app .linkbook table.stack tr.demo-detail { display: block; padding: 0; }
  .linkbook .cell-path { max-width: 100%; }
  body.app .bulkbar.active { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; border-radius: 12px 12px 0 0;
    box-shadow: 0 -10px 28px -14px rgba(0, 0, 0, .45); animation: bulk-up .18s ease-out; }
  body.app .bulkbar.active input[type=text] { width: 100% !important; }
  body.app .find input[type=text], body.app .find select { width: 100%; max-width: none; flex: 1 1 100%; }
  body.app .listbar > *, body.app .find > * { width: 100%; }
  .lp-facts { grid-template-columns: 1fr 1fr; }
  .chip.result { min-width: 0; }
}

/* ---- phone header: the links fold into a menu button; the main button stays in the first row ---- */
.menu-toggle { display: none; }
@media (max-width: 760px) {
  header.top .wrap { position: relative; gap: 4px; padding-top: 12px; padding-bottom: 10px; }
  header.top .menu-toggle { display: inline-grid; place-items: center; position: absolute; top: 11px; right: 16px; width: 40px; min-height: 36px; height: 36px; padding: 0;
    background: transparent; color: var(--text); border: 1px solid var(--line2); border-radius: 10px; }
  header.top nav { gap: 0; }
  header.top nav a:not(.btn) { display: none; }
  header.top.open nav { flex-direction: column; align-items: stretch; }
  header.top.open nav a:not(.btn) { display: block; padding: 11px 2px; font-size: 16px; border-top: 1px solid var(--line); }
  header.top nav a.btn, .mk header.top nav a.btn.primary { position: absolute; top: 11px; right: 64px; margin: 0; padding: 6px 16px; min-height: 36px; font-size: 14px; }
}

/* the billing period switch sits in the middle, above the plans */
body.app #period.period-switch { display: flex; width: fit-content; margin: 10px auto 20px; }

/* phones: the cookie bar sits flush on the bottom edge, no gap under it */
@media (max-width: 760px) {
  .consent-bar { left: 0; right: 0; bottom: 0; max-width: none; margin: 0; border-radius: 14px 14px 0 0; border-bottom: 0;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); box-shadow: 0 -8px 28px -12px rgba(0, 0, 0, .35); }
}


/* ---- public status page (/status) ---- */
.status-page { max-width: 880px; margin: 0 auto; padding: 8px 0 40px; }
.status-banner { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-radius: 12px; font-size: 20px; font-weight: 700; color: #fff; background: #6b7280; }
.status-banner.ok { background: var(--ok); } .status-banner.partial { background: #d97706; } .status-banner.major { background: var(--bad); }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: #fff; flex: none; }
.status-list { padding: 4px 20px; }
.status-row { padding: 18px 0; border-top: 1px solid var(--line); }
.status-row:first-child { border-top: 0; }
.status-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.status-state { font-size: 13.5px; font-weight: 650; }
.status-state.up { color: var(--ok); } .status-state.down { color: var(--bad); } .status-state.unknown { color: var(--muted); }
.sbars { display: flex; gap: 2px; height: 34px; }
.sbars i { flex: 1 1 0; min-width: 2px; border-radius: 2px; background: var(--strip); }
.sbars i.d-ok { background: var(--ok); } .sbars i.d-warn { background: #d97706; } .sbars i.d-bad { background: var(--bad); }
.status-foot { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.status-foot .mid { color: var(--text); font-weight: 600; }
.incident { padding: 12px 0; border-top: 1px solid var(--line); }
.incident:first-child { border-top: 0; padding-top: 0; } .incident:last-child { padding-bottom: 0; }
@media (max-width: 760px) { .status-banner { font-size: 17px; padding: 14px 16px; } .sbars { gap: 1px; height: 28px; } .status-list { padding: 2px 14px; } }

/* sortable dashboard columns */
th.sortable a { color: inherit; text-decoration: none; white-space: nowrap; }
th.sortable a:hover, th.sorted a { color: var(--ink, inherit); }
th.sorted { color: var(--ink, inherit); }

/* a linking page that now redirects to another domain */
.moved { color: var(--bad, #b42318); font-weight: 600; }

/* "Last seen" date range next to the dashboard search */
.seen-range { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.seen-range input[type=date] { width: auto; min-width: 140px; }

/* Outreach: an address that answered stands out in green */
tr.out-replied td { background: rgba(34, 160, 90, .13); }
tr.out-replied td:first-child { box-shadow: inset 4px 0 0 #22a05a; }

/* Outreach: a site that became a paying customer is bright yellow (it wins over the green of a reply) */
tr.out-order td { background: rgba(255, 214, 0, .5) !important; }
tr.out-order td:first-child { box-shadow: inset 5px 0 0 #e0a800; }
.out-order-badge { background: #ffd600; color: #3b2f00; }

/* every link status as a chip under the filter bar */
body.app .status-tabs { margin: -6px 0 14px; }
body.app .status-tabs a { padding: 4px 11px; font-size: 13px; }
body.app .status-tabs a.group { font-weight: 600; }
body.app .status-tabs .sep { align-self: stretch; width: 1px; background: var(--line); margin: 2px 4px; }
