/* pro.pi7.org - the whole design system. Pi7 indigo on white, same look as the Pi7+ popup on the free sites.
   Hand-written, no framework. Every colour is a token below. */

@font-face {
  font-family: "Inter";
  src: url("../fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --brand: #4956a5;
  --brand-dark: #343884;
  --brand-soft: #eff0fa;
  --brand-tint: #f6f7fd;
  --on-brand-mute: #d6dbfb;
  --ink: #1d2150;
  --text: #3d4263;
  --mute: #6b7088;
  --line: #e3e6f3;
  --field: #cfd3ea;
  --bg: #f7f8fc;
  --card: #fff;
  --ok: #1f7a4d;
  --ok-soft: #e7f5ee;
  --warn: #7a5200;
  --warn-soft: #fff4dc;
  --bad: #b42318;
  --bad-soft: #fdecea;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(20, 24, 70, .05), 0 10px 30px rgba(20, 24, 70, .07);
  --focus: 0 0 0 4px rgba(73, 86, 165, .18);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --header-h: 68px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--text); font: 16px/1.55 var(--font); }
main { flex: 1; }
h1, h2, h3 { margin: 0 0 .5em; color: var(--ink); line-height: 1.25; }
h1 { font-size: clamp(26px, 4vw, 34px); letter-spacing: -.02em; }
h2 { font-size: 20px; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
ul { margin: 0 0 1em; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }

.container { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 520px; }
.prose { max-width: 760px; }
.page { padding-top: 40px; padding-bottom: 72px; }

/* Header and footer */
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: var(--header-h); padding: 0 28px; background: #fff; box-shadow: 0 1px 0 var(--line); }
.brand { display: flex; align-items: center; }
.brand:hover { text-decoration: none; }
.brand svg { width: 76px; height: 47px; margin-top: -9px; }
.nav { display: flex; align-items: center; gap: 6px; }
.nav .link { padding: 8px 12px; border-radius: 10px; color: var(--text); font-weight: 500; font-size: 15px; white-space: nowrap; }
.nav .link:hover { background: var(--brand-tint); text-decoration: none; }
.nav .btn { white-space: nowrap; }
.site-footer { margin-top: auto; background: #fff; border-top: 1px solid var(--line); padding: 24px 0; font-size: 14px; color: var(--mute); }
.site-footer .container { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--mute); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.card h2 { font-size: 18px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px; border: 1.5px solid transparent; border-radius: var(--radius-sm); background: var(--brand); color: #fff; font: 600 15px/1.2 var(--font); text-align: center; cursor: pointer; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-block { display: flex; width: 100%; }
.btn-lg { min-height: 54px; font-size: 16px; }
.btn-sm { min-height: 38px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { background: var(--brand-tint); border-color: #cdd2ec; }
.btn-danger { background: #fff; color: var(--bad); border-color: #f0c8c3; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-solid-danger { background: var(--bad); }
.btn-solid-danger:hover { background: #8f1c13; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-tint); }
.btn-google { background: #fff; color: #1f1f1f; border-color: #dadce0; }
.btn-google:hover { background: #f8f9fb; }
.btn-google svg { width: 20px; height: 20px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .7; pointer-events: none; }
.spin { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Forms */
.field { display: block; }
.field > span { display: block; margin-bottom: 6px; color: var(--ink); font-size: 14px; font-weight: 600; }
.input { width: 100%; height: 50px; padding: 0 14px; border: 1.5px solid var(--field); border-radius: var(--radius-sm); background: #fff; color: var(--ink); font: 16px var(--font); }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input.is-error { border-color: var(--bad); }
.help { margin-top: 6px; color: var(--mute); font-size: 13px; }
.error { margin-top: 6px; color: var(--bad); font-size: 14px; }
.check { display: flex; align-items: flex-start; gap: 12px; color: var(--text); font-size: 15px; line-height: 1.45; cursor: pointer; }
.check input { flex: 0 0 22px; width: 22px; height: 22px; margin: 0; display: grid; place-content: center; border: 2px solid #b8bedd; border-radius: 6px; background: #fff; cursor: pointer; -webkit-appearance: none; appearance: none; }
.check input[type="radio"] { border-radius: 50%; }
.check input:checked { border-color: var(--brand); background: var(--brand); }
.check input[type="checkbox"]:checked::after { content: ""; width: 10px; height: 6px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.check input[type="radio"]:checked { box-shadow: inset 0 0 0 4px #fff; }
.check input:focus-visible { box-shadow: var(--focus); }
.checks > * + * { margin-top: 14px; }

/* Notices */
.flash { margin-bottom: 16px; padding: 12px 16px; border-radius: var(--radius-sm); font-size: 15px; }
.flash.ok { background: var(--ok-soft); color: var(--ok); }
.flash.warn { background: var(--warn-soft); color: var(--warn); }
.flash.bad { background: var(--bad-soft); color: var(--bad); }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.mute { background: #f0f1f6; color: var(--mute); }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: var(--radius-sm); background: var(--ink); color: #fff; box-shadow: var(--shadow); transform: translateX(-50%); }

/* Sign-in pages */
.auth { max-width: 440px; margin: 0 auto; }
.auth .card { padding: 32px 28px; }
.auth-wide { max-width: 560px; }
.auth-head { margin-bottom: 24px; text-align: center; }
.auth-head svg { width: 88px; height: 56px; margin: 0 auto 14px; }
.auth-head h1 { font-size: 26px; }
.auth-head p { margin: 0; color: var(--mute); }
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--mute); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.legal-note { margin-top: 18px; color: var(--mute); font-size: 13px; text-align: center; }
.idbox { display: grid; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--brand-tint); }
.input[readonly] { border-color: var(--line); background: var(--brand-soft); color: var(--text); text-overflow: ellipsis; }
.input[readonly]:focus { border-color: var(--field); }

/* Popup: a native <dialog> opened by a [data-dialog] link (static/js/app.js) */
.sheet { width: min(520px, calc(100% - 32px)); max-height: calc(100% - 48px); overflow: auto; padding: 0; border: 0; border-radius: var(--radius); background: var(--card); color: var(--text); box-shadow: 0 24px 64px rgba(20, 24, 70, .28); }
.sheet::backdrop { background: rgba(20, 24, 70, .45); }
.sheet-in { padding: 24px 24px 22px; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head h2 { margin: 4px 0 0; font-size: 20px; }
.sheet-x { flex: 0 0 36px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--brand-tint); color: var(--ink); cursor: pointer; }
.sheet-x:hover { background: var(--brand-soft); }
.sheet-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.sheet ul { margin: 0 0 14px; padding-left: 20px; font-size: 15px; line-height: 1.5; }
.sheet li + li { margin-top: 8px; }

/* Pi7+ page */
.hero { padding: 56px 0 64px; margin-bottom: 8px; background: var(--brand); color: #fff; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 48px; }
.hero h1 { color: #fff; font-size: clamp(30px, 4.6vw, 44px); }
.hero .lede { max-width: 560px; color: var(--on-brand-mute); font-size: 18px; }
.perks { display: grid; gap: 14px; margin: 28px 0 0; padding: 0; list-style: none; }
.perks li { display: flex; align-items: flex-start; gap: 12px; }
.perks i { flex: 0 0 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: rgba(255, 255, 255, .14); }
.perks svg, .icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.perks b { display: block; color: #fff; }
.perks span { color: var(--on-brand-mute); font-size: 14px; }
.buy { color: var(--text); }
.buy h2 { margin-bottom: 4px; }
.prices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.price { position: relative; display: block; width: 100%; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
.price:hover { border-color: #b9bfe2; }
.price::after { content: ""; position: absolute; top: 15px; right: 14px; width: 16px; height: 16px; border: 2px solid #c5c9e3; border-radius: 50%; }
.price[aria-checked="true"] { border: 2px solid var(--brand); padding: 13.5px 15.5px; background: var(--brand-tint); }
.price[aria-checked="true"]::after { border-color: var(--brand); background: var(--brand); box-shadow: inset 0 0 0 3px #fff; }
.price b { display: block; color: var(--ink); font-size: 24px; letter-spacing: -.01em; }
.price span { color: var(--mute); font-size: 13.5px; }
.price em { position: absolute; top: -11px; left: 14px; padding: 2px 9px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11.5px; font-style: normal; font-weight: 700; }
.fine { margin: 12px 0 0; color: var(--mute); font-size: 13px; text-align: center; }
.section { padding: 36px 0 0; }
.section h2 { font-size: 24px; }
.faq { border-top: 1px solid var(--line); }
.faq > div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.faq h3 { margin: 0 0 6px; font-size: 17px; }
.faq p { margin: 0; }

/* Account pages */
.page-head { margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-head h2 { margin: 0; font-size: 22px; }
.plan-meta { margin: 6px 0 0; color: var(--mute); font-size: 14px; }
.dash { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.side { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); display: flex; flex-direction: column; justify-content: space-between; gap: 24px; overflow-y: auto; padding: 20px 14px; border-right: 1px solid var(--line); background: #fff; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; color: var(--text); font-weight: 500; }
.side-nav a:hover { background: var(--brand-tint); text-decoration: none; }
.side-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.dock-short { display: none; }
.side-foot { display: grid; gap: 16px; }
.side-help { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--brand-tint); color: var(--text); font-size: 13px; }
.side-help:hover { border-color: var(--brand); text-decoration: none; }
.side-help .icon { flex: none; color: var(--brand); }
.side-help > span { display: grid; min-width: 0; }
.side-help b { color: var(--ink); font-size: 14px; }
.side-help > span > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--brand); font-weight: 500; }
.side-help-phone { margin: 32px 0 0; color: var(--mute); font-size: 14px; text-align: center; }
.side-me { display: grid; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.who { display: grid; font-size: 14px; }
.who b, .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who b { color: var(--ink); }
.who span { color: var(--mute); font-size: 13px; }
.side-links { display: flex; gap: 14px; font-size: 13px; }
.side-links a { color: var(--mute); }
.dash-main { width: 100%; max-width: 920px; padding: 36px 40px 72px; }
.dash-main.dash-wide { max-width: none; }  /* Pi7 Drive: the tile grid takes the whole screen */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.plan-card.featured { border: 2px solid var(--brand); }
.plan-price { margin: 8px 0 0; color: var(--ink); font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.plan-price span { color: var(--mute); font-size: 15px; font-weight: 500; }
.plan-interval { margin-left: 4px; color: var(--mute); font-size: 15px; font-weight: 600; }
.plan-left { margin-top: 18px; padding: 16px 18px; border-radius: var(--radius-sm); background: var(--brand-tint); border: 1px solid var(--line); }
.plan-left.grace { background: var(--warn-soft); border-color: #f3dfb0; }
.plan-left.ending { background: #f4f5f9; }
.plan-days { display: flex; align-items: baseline; gap: 8px; margin: 0; color: var(--ink); }
.plan-days b { font-size: 34px; line-height: 1.05; letter-spacing: -.02em; }
.plan-days span { font-size: 16px; font-weight: 600; }
.plan-when { margin: 6px 0 0; color: var(--text); font-size: 15px; }
.plan-switch { margin: 12px 0 0; }
.plan-switch-btn { margin: 0; padding: 0; border: 0; background: none; color: var(--brand); font: 600 14px var(--font); line-height: 1.4; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.plan-switch-btn:hover { color: var(--brand-dark); }
.plan-carried { margin: 4px 0 0; color: var(--ok); font-size: 14px; font-weight: 600; }
.plan-bar { display: block; width: 100%; height: 8px; margin: 14px 0 0; border: 0; border-radius: 999px; background: #dfe2f3; overflow: hidden; -webkit-appearance: none; appearance: none; }
.plan-bar::-webkit-progress-bar { background: #dfe2f3; border-radius: 999px; }
.plan-bar::-webkit-progress-value { background: var(--brand); border-radius: 999px; }
.plan-bar::-moz-progress-bar { background: var(--brand); border-radius: 999px; }
.plan-left .plan-meta { margin-top: 8px; }
.plan-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.plan-steps li { display: grid; align-content: start; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.plan-steps li.next { border-color: var(--brand); background: var(--brand-tint); }
.plan-steps .step-tag { color: var(--mute); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.plan-steps b { color: var(--ink); font-size: 17px; }
.plan-steps li > span:last-child { color: var(--text); font-size: 14px; line-height: 1.45; }
.plan-facts { margin-top: 12px; }
.plan-facts li { font-size: 15px; }
.plan-facts li > span { white-space: nowrap; }
.plan-facts b { color: var(--ink); text-align: right; }
.plan-facts a { margin-left: 6px; font-weight: 600; }
.feat { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.feat li { position: relative; padding-left: 30px; font-size: 15px; }
.feat li::before { content: ""; position: absolute; top: 1px; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--ok-soft); }
.feat li::after { content: ""; position: absolute; top: 7px; left: 6px; width: 8px; height: 4px; border: 2px solid var(--ok); border-top: 0; border-right: 0; transform: rotate(-45deg); }
.feat li.no { color: var(--mute); }
.feat li.no::before { background: #f0f1f6; }
.feat li.no::after { top: 10px; height: 0; border: 0; border-top: 2px solid #9aa0b8; transform: none; }
.summary { margin: 0; padding: 0; list-style: none; }
.summary li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.summary li:last-child { border-bottom: 0; }
.summary b { color: var(--ink); }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.table th { color: var(--mute); font-size: 13px; font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.danger-zone { border-color: #f3d2ce; }
.status { display: grid; gap: 4px; place-items: center; text-align: center; }
.status .dot { width: 56px; height: 56px; margin-bottom: 12px; display: grid; place-items: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.status .dot.bad { background: var(--bad-soft); color: var(--bad); }
.status .dot svg { width: 28px; height: 28px; }

/* Legal pages */
.prose h2 { margin-top: 32px; }
.prose ul { padding-left: 20px; }
.prose li + li { margin-top: 6px; }

/* Admin */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.tabs a { padding: 8px 12px; border-radius: 10px; color: var(--text); font-weight: 500; }
.tabs a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stats b { display: block; color: var(--ink); font-size: 28px; }
pre.playbook { overflow: auto; padding: 16px; border-radius: var(--radius-sm); background: var(--brand-tint); font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; }

/* Utilities (last, so they win) */
.mute { color: var(--mute); }
.small { font-size: 14px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.mb-16 { margin-bottom: 16px; }
.phone-only { display: none; }

/* Pi7 Drive (templates/account/files.html) */
/* Pi7 Drive: a short top (title and meter on one line, a one-row drop bar) so the files start high on the screen */
.files-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 24px; margin-bottom: 14px; }
.files-meter { display: grid; gap: 5px; width: min(100%, 300px); padding-bottom: 6px; }
.files-meter .bar { display: block; height: 6px; border-radius: 3px; background: var(--brand-soft); overflow: hidden; }
.files-meter .bar i { display: block; height: 100%; min-width: 4px; border-radius: 3px; background: var(--brand); }
.files-meter.is-full .bar i { background: var(--warn); }
.files-meter .plan-meta { margin: 0; font-size: 13px; }
.files-drop { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border: 2px dashed var(--field); border-radius: var(--radius); background: var(--card); transition: border-color .15s, background .15s; }
.files-drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
.files-drop-icon { flex: none; width: 32px; height: 32px; fill: none; stroke: var(--brand); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.files-drop-text { min-width: 0; }
.files-drop-text p { margin: 0; }
.files-drop-text p + p { margin-top: 6px; font-size: 13px; }
.files-drop .btn-sm { min-height: 34px; margin-left: 5px; padding: 0 12px; }
.files-drop + .upload-list { margin: 10px 4px 0; }
@media (max-width: 600px) { .files-drop-icon { display: none; } .files-drop { padding: 12px 14px; } }
.upload-list { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 14px; }
.upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-state { font-size: 13px; color: var(--mute); }
.upload-state.ok { color: var(--ok); }
.upload-state.bad { color: var(--bad); }
.upload-row .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--brand-tint); overflow: hidden; }
.upload-row .bar i { display: block; width: 0; height: 100%; background: var(--brand); transition: width .2s; }
.files-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 18px 16px; margin: 0; padding: 0; list-style: none; }
.file-tile { position: relative; display: grid; gap: 5px; min-width: 0; }
.file-tile[hidden] { display: none; } /* a file the search box leaves out */
/* Selecting files (owner, 2026-11-05): a white pill at the picture's top-left with a round checkbox; shown on hover,
   when checked, while any is selected, and always where there is no hover. Hovering it shows a faint tick in the
   circle and slides the word "Select" out, like the pills on the right. */
.file-pick { position: absolute; top: 8px; left: 8px; z-index: 1; display: flex; align-items: center; height: 28px; padding: 0 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .96); box-shadow: 0 1px 4px rgba(20, 24, 70, .12); cursor: pointer; opacity: 0; transition: opacity .15s; }
.file-tile:hover .file-pick, .file-pick:has(input:checked), .files-grid.has-pick .file-pick, .file-pick:has(input:focus-visible) { opacity: 1; }
@media (hover: none) { .file-pick { opacity: 1; } }
.file-pick:hover { border-color: var(--brand); }
.file-pick input { appearance: none; display: grid; place-items: center; width: 20px; height: 20px; margin: 0; border: 1.5px solid #9aa0c3; border-radius: 50%; background: #fff; cursor: pointer; }
.file-pick input::after { content: ""; width: 9px; height: 5px; border: 2px solid transparent; border-top: 0; border-right: 0; transform: translateY(-1px) rotate(-45deg); }
.file-pick:hover input { border-color: var(--brand); }
.file-pick:hover input::after { border-color: #b7bde6; }
.file-pick input:checked { border-color: var(--brand); background: var(--brand); }
.file-pick input:checked::after { border-color: #fff; }
.file-pick span { max-width: 0; overflow: hidden; white-space: nowrap; color: var(--text); font-size: 11px; font-weight: normal; line-height: 1; transition: max-width .18s ease, margin .18s ease; }
.file-pick:hover span, .file-pick:has(input:focus-visible) span { max-width: 80px; margin: 0 6px 0 5px; }
.file-tile:has(.file-pick input:checked) .file-thumb { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }
.files-pickbar { position: fixed; left: 50%; bottom: 24px; z-index: 40; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; width: max-content; max-width: calc(100% - 32px); box-sizing: border-box; padding: 10px 10px 10px 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 12px 32px rgba(20, 24, 70, .18); transform: translateX(-50%); color: var(--ink); }
.has-dock .files-pickbar { bottom: calc(78px + env(safe-area-inset-bottom)); }
.files-pickbar-info { display: grid; gap: 4px; }
.files-pickbar-n { font-size: 14px; font-weight: 700; }
.files-pickbar-kinds { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--mute); font-size: 12.5px; }
.files-pickbar-kinds .file-badge { position: static; padding: 1px 7px; font-size: 10.5px; opacity: 1; } /* the tiles' badge colours, as counts */
.files-pickbar-acts { display: flex; align-items: center; gap: 8px; }
.files-pickbar-link { margin: 0; padding: 0 4px; border: 0; background: none; color: var(--brand); font: 600 13px var(--font); cursor: pointer; }
.files-pickbar-link:hover { text-decoration: underline; }
.files-pickbar-x { display: grid; place-items: center; width: 34px; height: 34px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--brand-tint); color: var(--ink); cursor: pointer; }
.files-pickbar-x:hover { background: var(--brand-soft); }
.files-pickbar-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (max-width: 560px) { .files-pickbar { width: calc(100% - 32px); padding: 10px 12px; } .files-pickbar-acts { width: 100%; justify-content: flex-end; } }
.files-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 20px; }
.files-head h2 { margin: 0; }
/* The file search: a quiet rounded field with a magnifier; focus is a brand border and a 2px soft ring, no big shadow (owner, 2026-11-05). */
.files-search { position: relative; display: block; width: min(100%, 260px); }
.files-search svg { position: absolute; left: 12px; top: 50%; width: 15px; height: 15px; transform: translateY(-50%); fill: none; stroke: var(--mute); stroke-width: 2.2; stroke-linecap: round; pointer-events: none; }
.files-search:focus-within svg { stroke: var(--brand); }
.files-q { box-sizing: border-box; width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); font: 14px var(--font); outline: none; transition: border-color .15s, background .15s; }
.files-q::placeholder { color: var(--mute); }
.files-q:hover { border-color: #cdd2ec; }
.files-q:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 2px var(--brand-soft); }
.files-none { margin: 4px 0 0; color: var(--mute); font-size: 14px; }
.file-thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 12px; background: var(--brand-tint); overflow: hidden; transition: border-color .15s, box-shadow .15s, transform .15s; }
.file-thumb:hover { border-color: var(--brand); box-shadow: var(--shadow); transform: translateY(-1px); }
.file-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.file-ext { padding: 8px 14px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-dark); font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.file-badge { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(29, 33, 80, .82); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .03em; opacity: .5; }
/* one colour a kind (owner, 2026-11-05): red PDF, indigo image, blue Word, green Excel, orange PowerPoint, plum EPUB, slate video; the rest navy */
.file-badge-pdf { background: rgba(215, 55, 43, .9); }
.file-badge-image { background: rgba(73, 86, 165, .9); }
.file-badge-word { background: rgba(43, 95, 179, .9); }
.file-badge-excel { background: rgba(30, 123, 79, .9); }
.file-badge-powerpoint { background: rgba(201, 89, 27, .9); }
.file-badge-epub { background: rgba(107, 63, 160, .9); }
.file-badge-video { background: rgba(51, 65, 85, .9); }
.file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 3px; color: var(--ink); font-size: 13px; }
.file-meta { color: var(--mute); font-size: 12.5px; }
/* On each tile: Download / Rename / Delete as small pills at the picture's top-right corner, icon only until hovered
   (or focused), when the word slides out; "Open in tool" as a tinted button under the details (owner, 2026-11-05). */
.file-ops { position: absolute; top: 8px; right: 8px; z-index: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; } /* a column; a hovered pill grows leftwards */
.file-ops a, .file-ops button { display: flex; align-items: center; height: 28px; margin: 0; padding: 0 7px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .96); color: var(--text); box-shadow: 0 1px 4px rgba(20, 24, 70, .12); cursor: pointer; text-decoration: none; }
.file-ops span { max-width: 0; overflow: hidden; white-space: nowrap; font-size: 11px; font-weight: normal; line-height: 1; transition: max-width .18s ease, margin .18s ease; }
.file-ops a:hover, .file-ops button:hover, .file-ops a:focus-visible, .file-ops button:focus-visible { border-color: var(--brand); background: #fff; color: var(--brand); text-decoration: none; }
.file-ops a:hover span, .file-ops button:hover span, .file-ops a:focus-visible span, .file-ops button:focus-visible span { max-width: 110px; margin-left: 5px; }
.file-ops .danger:hover, .file-ops .danger:focus-visible { border-color: #f0c8c3; color: var(--bad); }
.file-ops svg { flex: none; width: 14px; height: 14px; }
.file-actions { margin-top: 3px; }
.file-open { display: flex; width: 100%; align-items: center; justify-content: center; gap: 6px; height: 32px; margin: 0; padding: 0 10px; border: 0; border-radius: 8px; background: var(--brand-soft); color: var(--brand-dark); font: 600 13px var(--font); cursor: pointer; }
.file-open:hover { background: var(--brand); color: #fff; }
.file-open svg { flex: none; width: 15px; height: 15px; }
.file-ops svg, .file-open svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.files-empty { display: grid; justify-items: center; gap: 8px; padding: 22px 16px; border: 1px dashed var(--line); border-radius: var(--radius-sm); text-align: center; }
.files-empty svg { width: 34px; height: 34px; fill: none; stroke: var(--field); stroke-width: 1.6; stroke-linejoin: round; }
/* The viewer fits the screen: head (~48px) + foot (~50px) + paddings (~34px) + the dialog's own 48px margin leave
   calc(100vh - 190px) for the picture or the PDF, so the dialog never scrolls. */
.files-view { width: min(960px, calc(100% - 32px)); overflow: hidden; }
.files-view .sheet-in { padding: 18px 20px 16px; }
.files-view .sheet-head { margin-bottom: 12px; }
.files-view .sheet-head h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; }
.files-view-body { display: flex; align-items: center; justify-content: center; min-height: 160px; max-height: calc(100vh - 190px); border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; }
.files-view-body img { display: block; max-width: 100%; max-height: calc(100vh - 190px); object-fit: contain; }
.files-view-body iframe { display: block; width: 100%; height: calc(100vh - 190px); border: 0; background: #fff; }
.files-view-none { margin: 0; padding: 40px 20px; color: var(--mute); font-size: 15px; text-align: center; }
.files-view-foot { display: flex; justify-content: flex-end; gap: 10px; margin: 12px 0 0; }
/* "Open in tool" sheet: the file's name, then the tools that take it, two a row */
.file-open-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: -6px 0 14px; color: var(--mute); font-size: 14px; }
.file-open-q { height: 44px; margin-bottom: 12px; font-size: 15px; }
.file-open-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.file-open-none { margin: 4px 0 0; color: var(--mute); font-size: 14px; }
.file-open-tool { display: grid; gap: 2px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.file-open-tool:hover { border-color: var(--brand); background: var(--brand-tint); text-decoration: none; }
.file-open-site { width: max-content; margin-top: 3px; padding: 1px 8px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: .03em; }
.file-open-site-pdf { background: #fdecea; color: #c4372b; }

/* Admin (owner only, templates/admin/) */
.container.admin { max-width: 1280px; }
.admin-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.admin-head h1 { margin: 0; }
.admin-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; margin-bottom: 16px; }
.admin-bar form { display: flex; flex: 1 1 360px; gap: 8px; max-width: 620px; }
.admin-bar form.admin-action { flex: none; }
.admin-bar .input { height: 42px; font-size: 15px; }
.admin-bar h2 { font-size: 22px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { display: grid; align-content: start; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); color: var(--text); }
a.stat:hover { border-color: var(--brand); text-decoration: none; }
.stat span { color: var(--mute); font-size: 13px; font-weight: 600; }
.stat b { color: var(--ink); font-size: 26px; font-weight: 700; line-height: 1.15; }
.stat small { color: var(--mute); font-size: 12.5px; }
.stat.is-bad { border-color: var(--bad); }
.stat.is-bad b { color: var(--bad); }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.admin-grid.mt-0 { margin-top: 0; }
.admin .card { padding: 18px 20px; }
.admin .card h2 { margin: 0 0 10px; }
.table-wrap { overflow-x: auto; }
.table.compact th, .table.compact td { padding: 8px 6px; font-size: 13.5px; vertical-align: top; }
.nowrap { white-space: nowrap; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--text); font-size: 13.5px; }
.pills a:hover { border-color: var(--brand); text-decoration: none; }
.pills a[aria-current] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin: 12px 0 0; font-size: 14px; }
.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 0; font-size: 14.5px; }
.facts dt { color: var(--mute); }
.facts dd { margin: 0; color: var(--ink); }
.watch { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 980px) {
  .plans { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  :root { --header-h: 56px; }
  .hero { padding: 36px 0 44px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  /* The dashboard on phones: the sidebar's nav becomes a dock along the bottom of the screen (icon over a short
     label, the current page in brand colour); the rest of the sidebar is hidden and the header scrolls away. */
  .has-dock .site-header { position: static; }
  .dash { display: block; min-height: 0; }
  .side { position: static; height: auto; display: block; padding: 0; border: 0; overflow: visible; }
  .side-foot { display: none; }
  .side-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(20, 24, 70, .06); }
  .side-nav a { flex: 1; flex-direction: column; gap: 3px; min-width: 0; padding: 4px 2px; color: var(--mute); font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: center; }
  .side-nav a:hover { background: none; }
  .side-nav .icon { width: 22px; height: 22px; padding: 3px 16px; border-radius: 999px; box-sizing: content-box; }
  .side-nav a[aria-current="page"] { background: none; color: var(--brand-dark); }
  .side-nav a[aria-current="page"] .icon { background: var(--brand-soft); }
  .dock-long { display: none; }
  .dock-short { display: inline; }
  .phone-only { display: block; }
  .hide-phone { display: none; }
  .dash-main { padding: 18px 16px calc(84px + env(safe-area-inset-bottom)); }
  .has-dock .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
}
@media (max-width: 520px) {
  .site-header { padding: 0 14px; }
  .brand svg { width: 62px; height: 39px; margin-top: -6px; }
  .nav { gap: 0; }
  .nav .link { padding: 8px 6px; font-size: 13.5px; }
  .nav .btn-sm { padding: 0 10px; font-size: 13.5px; }
  .page { padding-top: 24px; padding-bottom: 56px; }
  .card { padding: 20px; }
  .auth .card { padding: 24px 20px; }
  .idbox { padding: 14px; }
  .sheet-in { padding: 20px 18px 18px; }
  .prices { gap: 10px; }
  .price b { font-size: 21px; }
  .plan-steps { grid-template-columns: 1fr; }
  .file-open-list { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
