/* The public site's frame and the panel's recipes under the panel's class names. Everything looks
   like the panel: grey ground, the header directly on it, one rounded surface for the page, white
   cards with a hairline and a 14px radius. Values come from tokens.css. Rules: MINIAPPS-DESIGN.md.
   Loaded after style.css on every public page. */
html { background: var(--app); }
body { background: var(--app); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; font-feature-settings: var(--font-features); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: var(--w-strong); line-height: 1.2; }
h1 { font-weight: var(--w-title); letter-spacing: var(--ls-title); }

/* The frame: grey behind, the header on it, one rounded surface for the page, the footer back on the grey */
body > main { display: block; min-width: 0; min-height: 62vh; margin-inline: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-card); overflow: clip; }

/* Header: the sidebar's look, laid out in a row */
.header { height: var(--header-h); background: var(--app); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; }
.header-inner { gap: 20px; }
.logo { gap: 8px; }
.logo-mark { width: 22px; height: 22px; border-radius: 6px; }
.logo-word { font-size: 14.5px; font-weight: 600; letter-spacing: -.02em; color: var(--text); }
.logo-word span { color: var(--muted); font-weight: 400; }
.hd-search { flex: 1; max-width: 300px; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; background: var(--soft-fill); border: 1px solid transparent; border-radius: 9px; transition: border-color .12s, background .12s; }
.hd-search:focus-within { background: var(--panel); border-color: var(--border-2); }
.hd-search svg { flex: none; color: var(--muted); stroke-width: 1.75; }
.hd-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; font-size: var(--t-ui); color: var(--text); }
.hd-search input::placeholder { color: var(--muted); }
.nav { gap: 1px; }
.nav a { height: 32px; padding: 0 10px; font-size: var(--t-ui); font-weight: 400; letter-spacing: 0; color: var(--muted); border: 1px solid transparent; border-radius: var(--r); transition: background .12s, color .12s, border-color .12s; }
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.on { background: var(--panel); border-color: var(--border-2); color: var(--text); font-weight: var(--w-strong); }
.nav .nav-submit { margin-left: 8px; height: 32px !important; padding: 0 11px !important; font-size: var(--t-ui) !important; font-weight: var(--w-strong) !important; background: var(--panel); color: var(--text) !important; border-color: var(--border-2) !important; border-radius: var(--r) !important; transition: background .12s, border-color .12s, color .12s !important; }
.nav .nav-submit:hover { background: var(--field); border-color: var(--border-2) !important; }
.nav .nav-cta { margin-left: 8px; height: 32px !important; padding: 0 11px !important; font-size: var(--t-ui) !important; font-weight: var(--w-strong) !important; letter-spacing: 0 !important; background: var(--text) !important; color: var(--ink) !important; border: 1px solid var(--text); border-radius: var(--r) !important; transition: background .12s, border-color .12s, color .12s !important; }
.nav .nav-cta:hover { background: var(--text-hover) !important; border-color: var(--text-hover); color: var(--ink) !important; }
.nav-toggle { width: 44px; height: 44px; background: transparent; border-color: transparent; border-radius: var(--r); }
.nav-toggle:hover { background: var(--hover); border-color: transparent; }
.nav-toggle-bar { background: var(--text); }
.nav-avatar { width: 28px; height: 28px; border-color: var(--border-2); }
.nav-avatar-mono { background: var(--field); color: var(--muted); border-color: var(--border); font-size: 12px; font-weight: 500; }
.nav-user-btn:hover .nav-avatar { border-color: var(--dim); }
/* The account menu: the panel's user card and menu, same names and values as panel.css */
.nav-user-menu { top: calc(100% + 6px); width: 240px; padding: 4px; background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--r-sm); }
.av { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--field); border: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 500; object-fit: cover; }
.who-head { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 5px 8px; }
.sw-text { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.sw-text b { font-size: var(--t-ui); font-weight: var(--w-strong); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-text small { font-size: var(--t-micro); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-sep { height: 1px; background: var(--border); margin: 4px; }
.nav .sw-item, .sw-item { display: flex; align-items: center; gap: 9px; width: 100%; height: auto; min-height: 34px; padding: 3px 8px; background: none; border: 0; border-radius: 7px; font: inherit; font-size: var(--t-ui); font-weight: 400; text-align: left; color: var(--text); cursor: pointer; transition: background .12s, color .12s; }
.nav .sw-item:hover, .sw-item:hover { background: var(--field); color: var(--text); }
.sw-item .ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; color: var(--muted); }
.who-menu form { margin: 0; }
/* The first thing in the account menu, and the way into the panel */
.nav .sw-item-lead, .sw-item-lead { padding-block: 6px; background: var(--accent-soft); }
.nav .sw-item-lead:hover, .sw-item-lead:hover { background: var(--accent-soft); color: var(--accent-text); }
.sw-item-lead .ic, .mobile-nav-lead .nv-ic { color: var(--accent-text); }
.sw-item .sw-text small { white-space: normal; }
/* Icons in the user menu, the mobile menu and the toast, from the sprite in _home_icons.html */
.nv-ic { flex: none; display: block; stroke-width: 1.75; color: var(--muted); }
.mobile-nav a:hover .nv-ic { color: inherit; }
.toast-check .nv-ic { color: inherit; }
.mobile-nav { position: relative; z-index: 2; background: var(--app); border-bottom: 1px solid var(--border-2); padding: 6px 14px 14px; gap: 1px; }
.mobile-nav a, .mobile-nav-form button { min-height: 44px; padding: 8px; font-size: 14px; font-weight: 400; color: var(--muted); border-radius: var(--r); }
.mobile-nav a:hover, .mobile-nav-form button:hover { color: var(--text); background: var(--hover); }
.mobile-nav .mobile-nav-cta { margin-top: 8px; padding: 8px !important; background: var(--text); color: var(--ink) !important; font-weight: var(--w-strong); }
.mobile-nav .mobile-nav-cta:hover { background: var(--text-hover); opacity: 1; }
.mobile-nav .sw-sep { background: var(--border-2); margin: 8px 8px 4px; }
.mobile-nav .who-head { padding-inline: 8px; }
.mobile-nav .mobile-nav-lead, .mobile-nav .mobile-nav-lead:hover { background: var(--accent-soft); color: var(--text); }
.mobile-nav-form { margin: 0; }
.mobile-nav-form button { display: flex; align-items: center; gap: 11px; width: 100%; background: none; border: 0; cursor: pointer; text-align: left; font-family: inherit; transition: color .12s, background .12s; }
.mobile-nav .hd-search { flex: none; max-width: none; height: 44px; margin-bottom: 6px; }
@media (max-width: 980px) { .header-inner > .hd-search { display: none; } }

/* Footer: back on the grey, grouped like the sidebar */
.footer { background: transparent; border-top: 0; padding-top: 36px; }
.footer-inner { grid-template-columns: 1.4fr 1fr 1fr 1fr; padding-bottom: 32px; }
.footer-col { gap: 7px; }
.footer-col a, .footer-tagline, .footer-bottom p, .footer-bottom-links a { font-size: var(--t-ui); color: var(--muted); transition: color .12s; }
.footer-bottom p, .footer-bottom-links a { font-size: var(--t-small); }
.footer-col a:hover, .footer-bottom-links a:hover { color: var(--text); }
.footer-col-title { margin-bottom: 3px; font-size: var(--t-ui); font-weight: var(--w-strong); letter-spacing: 0; text-transform: none; color: var(--text); }
.footer-bottom { border-color: var(--border-2); width: calc(100% - 2 * var(--pad-x)); max-width: calc(var(--max-w) - 2 * var(--pad-x)); margin-inline: auto; padding: 14px 0 18px; padding-inline: 0; }
.ft-tool { display: inline-flex; align-items: center; gap: 9px; color: var(--text); }
.ft-tool-ic { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border: 1px solid var(--border-2); border-radius: var(--r); background: var(--panel); transition: border-color .12s; }
.ft-tool:hover .ft-tool-ic { border-color: var(--dim); }
.ft-tool-text { display: grid; line-height: 1.3; font-size: var(--t-small); color: var(--muted); }
.ft-tool-text b { font-size: var(--t-ui); font-weight: var(--w-strong); color: var(--text); }
.social-link { width: 32px; height: 32px; background: var(--panel); border-color: var(--border-2); border-radius: var(--r); color: var(--muted); }
.social-link:hover { border-color: var(--dim); color: var(--text); }
@media (max-width: 1024px) { .footer-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); } .footer-brand { grid-column: 1 / -1; } }
@media (max-width: 640px) {
  :root { --pad-x: 14px; }
  body > main { margin-inline: 6px; }
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}

img:is(.hm-logo, .dir-logo, .dir-app-logo, .ac-logo, .ac-pv-logo, .bz-app-logo, .sub-logo, .lst-logo, .app-hero-logo) { outline: 1px solid var(--logo-edge); outline-offset: -1px; }

/* A row in a list that opens on a click and holds a button too. A button can't sit inside a link, so
   the row is a plain box with one real link, on the app's name, stretched over all of it. The upvote
   sits above that. So does anything with a tooltip, and static/js/upvote.js passes its click on. */
.row-open { position: relative; }
.row-link::after { content: ""; position: absolute; inset: 0; border-radius: var(--row-r, 0); }
.row-link:focus-visible { outline: 0; }
.row-link:focus-visible::after { outline: 2px solid var(--accent); outline-offset: -2px; }
.row-open .uv-form, .row-open [title] { position: relative; z-index: 1; }
.row-open [title]:not(a, button) { cursor: pointer; }

/* Toast and cookie notice */
.toast { background: var(--text); color: var(--ink); border-radius: var(--r-sm); padding: 10px 14px; font-size: var(--t-ui); font-weight: var(--w-strong); }
.toast button { color: var(--ink); }

/* ── The panel's recipes, for any public page. Same names, same values as panel.css. ── */
.btn { height: 32px; padding: 0 11px; gap: 6px; background: var(--panel); color: var(--text); border: 1px solid var(--border-2); border-radius: var(--r); font-size: var(--t-ui); font-weight: var(--w-strong); line-height: 1.2; transition: background .12s, border-color .12s, color .12s; }
.btn:hover { background: var(--field); }
.btn.primary { background: var(--text); color: var(--ink); border-color: var(--text); }
.btn.primary:hover { background: var(--text-hover); border-color: var(--text-hover); }

.pill { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--r-pill); padding: 1px 9px; font-size: var(--t-small); font-weight: var(--w-strong); white-space: nowrap; background: var(--field); color: var(--muted); }
.pill.ok { background: var(--good-soft); color: var(--good-text); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--accent-soft); color: var(--accent-text); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.tag { gap: 4px; padding: 1px 9px; font-size: var(--t-small); font-weight: 400; letter-spacing: 0; color: var(--muted); background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--r-pill); }

/* The theme switch: one icon in the header, Light and Dark in the mobile menu. static/js/theme.js */
.theme-switch, .theme-switch *, .theme-switch *::before, .theme-switch *::after { transition: none !important; }
.nav-theme { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin-left: 8px; padding: 0; background: none; border: 1px solid transparent; border-radius: var(--r); color: var(--muted); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.nav-theme:hover { background: var(--hover); color: var(--text); }
.nav-theme svg { display: block; stroke-width: 1.75; }
.nav-theme .t-sun { display: none; }
:root[data-theme="dark"] .nav-theme .t-sun { display: block; }
:root[data-theme="dark"] .nav-theme .t-moon { display: none; }
.nav-theme + .nav-submit { margin-left: 4px; }
.mobile-nav-theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 4px 0 4px 8px; font-size: 14px; color: var(--muted); }
.mobile-nav-theme .seg button { height: 44px; gap: 6px; padding-inline: 12px; }
.mobile-nav-theme .seg svg { flex: none; display: block; stroke-width: 1.75; }
.seg button { height: 26px; display: inline-flex; align-items: center; padding: 0 9px; background: none; border: 1px solid transparent; border-radius: 4px; font: inherit; font-size: var(--t-small); font-weight: var(--w-strong); color: var(--muted); white-space: nowrap; cursor: pointer; transition: color .12s, background .12s, border-color .12s; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--panel); border-color: var(--border); color: var(--text); }
/* A segmented control. Same values as .seg in panel.css. Here it can hold labels for radios too. */
.seg { display: inline-flex; background: var(--field); border: 1px solid var(--border); border-radius: var(--r); padding: 2px; gap: 2px; max-width: 100%; }
.seg label { height: 26px; display: inline-flex; align-items: center; gap: 5px; padding: 0 9px; border: 1px solid transparent; border-radius: 4px; font-size: var(--t-small); font-weight: 500; color: var(--muted); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.seg label:hover { color: var(--text); }

/* A card with a number: small title, big number and a pill, a line of context, a hairline, then content */
.ov-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.oc { display: flex; flex-direction: column; min-width: 0; padding: 14px 16px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-card); }
.oc-title { font-size: var(--t-ui); font-weight: 400; color: var(--muted); line-height: 1.4; }
.oc-num { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 1px; }
.oc-value { font-size: var(--t-num); font-weight: var(--w-num); letter-spacing: var(--ls-num); line-height: 1.25; font-variant-numeric: tabular-nums; color: var(--text); }
.oc-note { font-size: var(--t-small); color: var(--muted); margin-top: 1px; padding-bottom: 12px; border-bottom: 1px solid var(--border); line-height: 1.4; }

/* A soft grey group card holding a white table or body */
.gc { min-width: 0; padding: 6px; background: var(--group); border: 1px solid var(--border); border-radius: var(--r-card); }
.gc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 42px; padding: 2px 6px 6px 8px; }
.gc-title { font-size: var(--t-card); font-weight: var(--w-strong); color: var(--text); letter-spacing: -.004em; }
.gc-count { display: inline-flex; align-items: center; height: 20px; padding-inline: 8px; background: var(--panel); border-radius: var(--r-pill); font-size: var(--t-micro); color: var(--muted); font-variant-numeric: tabular-nums; }
.gc-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gc-link { font-size: var(--t-small); color: var(--muted); transition: color .12s; }
.gc-link:hover { color: var(--text); }
.gc-table, .gc-body { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-inner); min-width: 0; }
.gc-table { overflow: hidden; }
.gc-body { padding: 14px; }

/* Small numbers in a row */
.stat-minis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat-minis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-mini { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 12px 14px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; transition: border-color .12s; }
a.stat-mini:hover { border-color: var(--border-2); }
.stat-mini-l { font-size: var(--t-small); color: var(--muted); }
.stat-mini-v { font-size: 22px; font-weight: var(--w-num); letter-spacing: -.02em; line-height: 1.3; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-mini-n { font-size: var(--t-small); color: var(--muted); }
@media (max-width: 768px) { .ov-grid, .stat-minis, .stat-minis.three { grid-template-columns: minmax(0, 1fr); } }

/* Inside a card: a bar cut into parts, a heatmap, numbers side by side, a progress bar. Same names, same values as panel.css. */
.d-dot { flex: none; display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.d-dot.d1, .segbar i.d1, .abar i.d1 { background: var(--d1); }
.d-dot.d2, .segbar i.d2, .abar i.d2 { background: var(--d2); }
.d-dot.d3, .segbar i.d3, .abar i.d3 { background: var(--d3); }
.d-dot.d4, .segbar i.d4, .abar i.d4 { background: var(--d4); }
.d-dot.area1 { background: var(--area-1); }
.d-dot.area2 { background: var(--area-2); }
.d-dot.d5, .segbar i.d5 { background: var(--d5); }
.d-dot.ramp3 { background: var(--ramp-3); }
.segbar { display: flex; gap: 3px; height: 8px; margin-top: 12px; }
.segbar i { display: block; flex: 1 1 0; min-width: 4px; border-radius: 3px; }
.heat { display: grid; grid-template-columns: 46px repeat(var(--weeks), minmax(0, 1fr)); gap: 2px; align-items: center; margin-top: 12px; }
.heat i { display: block; height: 15px; border-radius: 2px; transition: outline-color .12s; outline: 1px solid transparent; outline-offset: -1px; }
.heat i:hover { outline-color: var(--text); }
.heat i.h-none, .heat i.h-none:hover { background: none; outline: 0; }
.heat .h0 { background: var(--heat-0); }
.heat .hx { background: var(--heat-0); }
.heat .h1 { background: var(--heat-1); }
.heat .h2 { background: var(--heat-2); }
.heat .h3 { background: var(--heat-3); }
.heat .h4 { background: var(--heat-4); }
.heat .h5 { background: var(--heat-5); }
.heat-l { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 15px; }
.heat-x { font-size: 12px; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.ostats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; }
.ostats > div { display: grid; font-size: 13px; color: var(--muted); padding-inline: 12px; border-left: 1px dashed var(--border-2); }
.ostats > div:first-child { padding-left: 0; border-left: 0; }
.ostats b { font-size: 15px; font-weight: var(--w-strong); color: var(--text); font-variant-numeric: tabular-nums; }
.progress { height: 5px; background: var(--raise); border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: background .12s; }

/* Accessibility */
::placeholder { color: var(--dim); opacity: 1; }
.skip-link { position: absolute; top: -60px; left: 16px; z-index: 1100; display: inline-flex; align-items: center; min-height: 44px; padding-inline: 16px; background: var(--text); border-radius: 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.skip-link:focus { top: 8px; }
main:focus { outline: 0; }
.social-link svg { display: block; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Phones: every control gets a 44px target. Lone text links use a negative margin so the page layout does not move. */
@media (max-width: 640px) {
  .header .logo, body .hm-more, body .ct-more, body .dir-more, body .bz-more, body .bz-quiet, body .ac-more, body .ct-back,
  body .dir-crumbs a, body .sc-crumbs a, body .dir-facts-d, body .dir-report, body .dir-app-links a, body .dir-app-tags a,
  body .bz-fact .bz-link, body .ac-link, body .ac-app-name, body .bz-pick-id h3 a, body .ft-tool, .footer-brand .logo {
    display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; margin-block: -9px;
  }
  body .dir-toc summary { min-height: 44px; padding-block: 0; align-items: center; }
  .footer-col { gap: 0; }
  .footer-col a, .footer-bottom-links a { display: flex; align-items: center; min-height: 44px; min-width: 44px; }
  .footer-bottom { padding-block: 8px; }
  .footer-bottom-links { gap: 12px; }
  .social-link { width: 44px; height: 44px; }

  body .btn, body .hm-btn, body .dir-btn, body .dir-rail-item, body .dir-seg a, body .dir-th a, body .dir-open, body .dir-find input, body .sc-tab, body .sc-btn,
  body .ct-tab, body .ct-btn, body .ct-btn-sm, body .bz-btn, body .bz-copy, body .bz-tab, body .bz-sub-a, body .ac-btn, body .ac-add-b,
  body .pm-tab, body .pm-chip, body .pm-input, body .pd-flow button, body .st-step, body .st-type label, body .sc-search .sc-btn, body .dir-toc li a, body .ct .toc li a {
    min-height: 44px; height: auto;
  }
  body .dir-toc li a, body .ct .toc li a { display: flex; align-items: center; }
}
