:root {
  --bg: #07070c;
  --bg-2: #0d0d16;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-2: rgba(255, 255, 255, 0.075);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f3f2f8;
  --muted: #9b99ad;
  --faint: #6b697c;
  --violet: #7c5cff;
  --teal: #00d4c7;
  --pink: #ff5c9a;
  --ok: #3ddc97;
  --no: #ff6b6b;
  --grad: linear-gradient(120deg, var(--violet), var(--teal));
  --radius: 18px;
  --shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
  --serif: "Instrument Serif", ui-serif, Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; }
code { font-size: 0.85em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
em { font-family: var(--serif); font-style: italic; font-weight: 400; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.06em; }

/* ---------- background ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.aurora::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at top, transparent 0%, var(--bg) 70%); }
.aurora span { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: 0.22; animation: drift 26s ease-in-out infinite alternate; }
.aurora span:nth-child(1) { background: var(--violet); top: -30vmax; left: -10vmax; }
.aurora span:nth-child(2) { background: var(--teal); top: -35vmax; right: -20vmax; animation-delay: -8s; opacity: 0.14; }
.aurora span:nth-child(3) { background: var(--pink); top: 10vmax; left: 30vmax; animation-delay: -16s; opacity: 0.07; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.1); } }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 14px clamp(16px, 4vw, 40px);
  background: rgba(7, 7, 12, 0.6);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: -0.02em; font-size: 18px; }
.brand-mark { width: 28px; height: 28px; border-radius: 9px; background: var(--grad); position: relative; box-shadow: 0 0 24px -4px var(--violet); }
.brand-mark::after { content: ""; position: absolute; inset: 8px; border: 2.4px solid #fff; border-radius: 50%; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.tab { appearance: none; border: 0; background: none; color: var(--muted); font: 500 14px var(--sans); padding: 8px 16px; border-radius: 999px; cursor: pointer; white-space: nowrap; display: flex; align-items: center; gap: 6px; transition: color .2s, background .2s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.badge { background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; display: inline-grid; place-items: center; }
.index-pill { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 2px; white-space: nowrap; }
.index-pill i { font-style: normal; }
.index-pill span:not(.dot) { color: var(--text); font-variant-numeric: tabular-nums; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); margin-right: 8px; box-shadow: 0 0 0 4px rgba(61, 220, 151, .15); }
.dot.busy { background: var(--teal); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(0, 212, 199, 0); } }

main { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 120px; }
.view { display: none; animation: rise .5s cubic-bezier(.2, .8, .2, 1); }
.view.active { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- typography ---------- */
.hero { text-align: center; padding: clamp(48px, 9vw, 96px) 0 36px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 600; color: var(--teal); margin: 0 0 14px; }
h1 { font-size: clamp(38px, 6.4vw, 72px); line-height: 1.02; letter-spacing: -0.035em; margin: 0 auto 20px; max-width: 14ch; font-weight: 700; }
h2 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -0.03em; line-height: 1.1; margin: 0 0 10px; }
h3 { margin: 0 0 6px; letter-spacing: -0.01em; }
h4 { margin: 0 0 6px; font-size: 15px; }
.lede { color: var(--muted); font-size: 17px; max-width: 58ch; margin: 0 auto; }
.lede.small { font-size: 15px; margin: 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; padding: 56px 0 28px; }
.sub-title { margin-top: 44px; font-size: 18px; }

/* ---------- buttons & fields ---------- */
.btn { appearance: none; border: 0; cursor: pointer; font: 600 14px var(--sans); padding: 11px 20px; border-radius: 12px; color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; transition: transform .15s, background .2s, box-shadow .2s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 10px 30px -10px var(--violet); }
.btn.primary:hover { box-shadow: 0 14px 36px -8px var(--violet); }
.btn.ghost { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn.danger:hover { color: var(--no); }

input, textarea { width: 100%; font: 14px var(--sans); color: var(--text); background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(124, 92, 255, .18); }
textarea { resize: vertical; font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.field { display: flex; flex-direction: column; gap: 7px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field small { font-weight: 400; color: var(--faint); margin-left: 6px; }
.check { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--violet); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- dropzone ---------- */
.dropzone { position: relative; max-width: 760px; margin: 0 auto; border-radius: 26px; padding: 2px; cursor: pointer; outline: none; background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box, conic-gradient(from var(--angle, 0deg), var(--violet), var(--teal), var(--pink), var(--violet)) border-box; border: 1.5px solid transparent; animation: spin 8s linear infinite; transition: transform .25s; }
@property --angle { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --angle: 360deg; } }
.dropzone:hover, .dropzone.drag, .dropzone:focus-visible { transform: translateY(-2px) scale(1.005); }
.dropzone.drag { animation-duration: 2s; }
.dz-idle { text-align: center; padding: 56px 24px; }
.dz-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2); color: var(--teal); box-shadow: inset 0 0 0 1px var(--line-2); }
.dz-icon svg { width: 30px; height: 30px; }
.dz-title { font-size: 19px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.dz-sub { color: var(--muted); margin: 0; font-size: 14px; }
.dz-sub u { color: var(--text); text-decoration-color: var(--violet); text-underline-offset: 3px; }
.dz-preview { display: flex; align-items: center; gap: 28px; padding: 22px; }
.dz-preview[hidden], .dz-idle[hidden] { display: none; }
.dz-status { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.dz-status .btn { margin-top: 12px; }
.scan { position: relative; width: 148px; height: 148px; flex: none; border-radius: 18px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); }
.scan img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanline { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0, 212, 199, .5) 50%, transparent 60%); background-size: 100% 220%; animation: scan 1.6s ease-in-out infinite; opacity: 0; }
.scanning .scanline { opacity: 1; }
@keyframes scan { from { background-position: 0 120%; } to { background-position: 0 -20%; } }

.controls { max-width: 760px; margin: 22px auto 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.slider { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--muted); }
.slider b { color: var(--text); font-weight: 600; }
.slider input { width: 160px; padding: 0; accent-color: var(--teal); background: none; border: 0; box-shadow: none; }
.privacy-note { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--faint); }
.privacy-note svg { width: 16px; height: 16px; color: var(--ok); flex: none; }

/* ---------- results ---------- */
.results-head { margin: 64px 0 18px; display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.results-head h3 { font-size: 22px; }
.results-head p { margin: 0; color: var(--muted); font-size: 14px; }
.grid { display: grid; gap: 18px; }
.results { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.result { overflow: hidden; display: flex; flex-direction: column; animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; transition: transform .25s, border-color .25s; }
.result:hover { transform: translateY(-3px); border-color: var(--line-2); }
.thumb { position: relative; display: block; aspect-ratio: 4 / 3; background: repeating-conic-gradient(#14141f 0 25%, #101019 0 50%) 0 0 / 20px 20px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.result:hover .thumb img { transform: scale(1.04); }
.thumb img.broken { opacity: 0; }
.ring { position: absolute; top: 12px; right: 12px; width: 52px; height: 52px; display: grid; place-items: center; background: rgba(7, 7, 12, .72); backdrop-filter: blur(8px); border-radius: 50%; }
.ring svg { position: absolute; inset: 4px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; }
.ring .track { stroke: var(--line-2); }
.ring .meter { stroke: var(--teal); stroke-linecap: round; stroke-dasharray: 97.4; transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.ring b { font-size: 10.5px; letter-spacing: -0.02em; font-weight: 700; font-variant-numeric: tabular-nums; }
.meta { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.host { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.host img { width: 16px; height: 16px; border-radius: 4px; }
.dims { margin: 0; color: var(--faint); font-size: 12.5px; }
.pages { list-style: none; margin: 6px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.pages a { color: var(--muted); font-size: 13.5px; text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pages a:hover { color: var(--text); }
.pages a::before { content: "↗ "; color: var(--teal); }
.actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }
.more { position: relative; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 5; min-width: 180px; padding: 6px; background: #15151f; border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.menu a { padding: 8px 10px; border-radius: 8px; text-decoration: none; font-size: 13.5px; }
.menu a:hover { background: var(--surface-2); }

.empty { text-align: center; padding: 56px 24px; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); grid-column: 1 / -1; }
.empty b { color: var(--text); display: block; font-size: 17px; margin-bottom: 6px; }

/* ---------- watch ---------- */
.watch-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.watch-form input[type="text"] { width: 240px; }
.file-btn { cursor: pointer; }
.watched { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.watched-card { overflow: hidden; cursor: pointer; transition: transform .2s, border-color .2s; position: relative; }
.watched-card:hover, .watched-card.selected { border-color: var(--violet); transform: translateY(-2px); }
.watched-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.watched-card .wc-body { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.watched-card .wc-label { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.watched-card .wc-hits { font-size: 12px; color: var(--muted); }
.watched-card .wc-hits.hot { color: var(--pink); font-weight: 600; }
.watched-card .wc-del { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .2s; background: rgba(7, 7, 12, .75); }
.watched-card:hover .wc-del { opacity: 1; }
.alerts { display: flex; flex-direction: column; gap: 10px; }
.alert { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; align-items: center; padding: 12px; }
.alert.unseen { border-color: rgba(255, 92, 154, .45); background: linear-gradient(90deg, rgba(255, 92, 154, .08), var(--surface)); }
.alert img { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; background: #14141f; }
.alert .a-title { margin: 0; font-weight: 600; }
.alert .a-sub { margin: 2px 0 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert .a-sub a { color: var(--muted); }
.alert .a-actions { display: flex; gap: 8px; }

/* ---------- crawl ---------- */
.crawl-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 24px; align-items: end; }
.crawl-form .wide { grid-column: 1 / -1; }
.crawl-form .btn { justify-self: end; }
.jobs { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.job { padding: 18px 20px; display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; }
.job-title { margin: 0; font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.job-seeds { margin: 2px 0 0; color: var(--muted); font-size: 13px; word-break: break-all; }
.status { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.status.running { color: var(--teal); background: rgba(0, 212, 199, .12); }
.status.done { color: var(--ok); background: rgba(61, 220, 151, .12); }
.status.failed, .status.interrupted { color: var(--no); background: rgba(255, 107, 107, .12); }
.job-stats { grid-column: 1 / -1; display: flex; gap: 22px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.job-stats b { color: var(--text); font-variant-numeric: tabular-nums; font-size: 15px; margin-right: 4px; }
.progress { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--grad); border-radius: 4px; transition: width .6s; }
.job-msg { grid-column: 1 / -1; margin: 0; font-size: 13px; color: #ffb86b; }

/* ---------- letter ---------- */
.letter-layout { display: grid; grid-template-columns: 1fr 1.1fr; gap: 18px; align-items: start; }
.letter-form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.letter-form .btn { align-self: flex-start; }
.segmented { display: flex; gap: 4px; padding: 4px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 12px; flex-wrap: wrap; }
.segmented label { flex: 1; }
.segmented input { display: none; }
.segmented span { display: block; text-align: center; padding: 8px 10px; border-radius: 9px; font-size: 13px; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; white-space: nowrap; }
.segmented input:checked + span { background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.letter-out { padding: 0; overflow: hidden; position: sticky; top: 90px; }
.letter-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted); font-weight: 600; }
#letter-text { margin: 0; padding: 22px; white-space: pre-wrap; font: 14px/1.7 var(--sans); min-height: 420px; max-height: 70vh; overflow: auto; }
#letter-text.placeholder { color: var(--faint); }

/* ---------- policy ---------- */
.policy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rule { padding: 20px; box-shadow: none; }
.rule h4 { display: flex; align-items: center; gap: 10px; }
.rule h4::before { content: ""; width: 20px; height: 20px; border-radius: 50%; flex: none; background: center / 12px no-repeat; }
.rule.ok h4::before { background-color: rgba(61, 220, 151, .16); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233ddc97' stroke-width='3.2'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E"); }
.rule.no h4::before { background-color: rgba(255, 107, 107, .16); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6b6b' stroke-width='3.2'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
.rule p { margin: 0; color: var(--muted); font-size: 14px; }
.optout { margin-top: 28px; padding: 26px; display: flex; flex-direction: column; gap: 18px; }
.optout-form { display: grid; grid-template-columns: 1.3fr 1fr auto; gap: 10px; }
.optouts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.optouts li { font-size: 13px; padding: 6px 12px; background: var(--surface-2); border-radius: 999px; color: var(--muted); }
.optouts li b { color: var(--text); font-weight: 600; }

/* ---------- toast ---------- */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 50; padding: 12px 20px; border-radius: 14px; background: #1a1a26; border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 14px; animation: rise .3s; max-width: calc(100vw - 32px); }
.toast.error { border-color: rgba(255, 107, 107, .5); }

.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); height: 340px; border: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .tabs { order: 3; width: 100%; }
  .letter-layout { grid-template-columns: 1fr; }
  .letter-out { position: static; }
  .optout-form { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .crawl-form { grid-template-columns: 1fr; }
  .crawl-form .btn { justify-self: stretch; justify-content: center; }
  .dz-preview { flex-direction: column; text-align: center; }
  .dz-status { align-items: center; }
  .alert { grid-template-columns: 56px 1fr; }
  .alert img { width: 56px; height: 56px; }
  .alert .a-actions { grid-column: 1 / -1; }
  .watch-form input[type="text"] { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =================================================================== app shell (PWA) */
html { -webkit-tap-highlight-color: transparent; }
body { padding-bottom: env(safe-area-inset-bottom); }
.topbar { padding-top: max(14px, env(safe-area-inset-top)); }
.tab-icon { display: none; }
.tab-icon svg, .icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn { appearance: none; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.install-btn { margin-left: auto; }
.install-btn:not([hidden]) + .index-pill { margin-left: 0; }
select { width: 100%; font: 14px var(--sans); color: var(--text); background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; outline: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239b99ad' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }
select:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(124, 92, 255, .18); }

/* smooth view changes where the browser supports it */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }

/* ---------- login ---------- */
.login { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at top, rgba(124, 92, 255, .18), transparent 60%), var(--bg); }
.login[hidden] { display: none; }
.login-card { width: min(380px, 100%); padding: 32px 28px; display: flex; flex-direction: column; gap: 14px; text-align: center; animation: rise .5s cubic-bezier(.2, .8, .2, 1); }
.login-logo { width: 64px; height: 64px; border-radius: 18px; margin: 0 auto 4px; box-shadow: 0 12px 40px -10px var(--violet); }
.login-card h2 { margin: 0; }
.login-card .btn { justify-content: center; }
.login-error { margin: 0; min-height: 1.4em; color: var(--no); font-size: 14px; }
body.locked main, body.locked .topbar { visibility: hidden; }

/* ---------- notifications ---------- */
.notify { margin-top: 28px; padding: 20px 22px; display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; box-shadow: none; }
.notify-text { flex: 1 1 280px; }
.notify-text h3 { font-size: 16px; }
.notify-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1 1 380px; justify-content: flex-end; }
.notify-controls input[type="email"] { width: 230px; flex: 1 1 200px; }
.notify-status-warn { color: #ffb86b !important; }
.switch { position: relative; width: 46px; height: 28px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); transition: background .2s; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 4px; left: 4px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s cubic-bezier(.2, .8, .2, 1); }
.switch input:checked + span { background: var(--grad); box-shadow: none; }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--violet); outline-offset: 2px; }

/* ---------- schedules ---------- */
.schedules { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.schedule { padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; transition: opacity .2s; }
.schedule.off { opacity: .55; }
.schedule-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.schedule-name { margin: 0; font-weight: 600; }
.schedule-every { margin: 2px 0 0; font-size: 13px; color: var(--teal); }
.schedule-seeds { margin: 0; font-size: 13px; color: var(--muted); word-break: break-all; }
.schedule-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--faint); }
.schedule-meta b { color: var(--muted); font-weight: 500; }
.schedule-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.crawl-form .check { align-self: center; }

/* ---------- phone: native-feeling app shell ---------- */
@media (max-width: 760px) {
  /* backdrop-filter would make the header the containing block of the fixed tab bar */
  .topbar { flex-wrap: nowrap; gap: 10px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .index-pill { font-size: 12px; }
  .install-btn { display: none; }
  .tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; order: 0; width: auto;
    border-radius: 0; border: 0; border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(10, 10, 17, .82); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5);
    justify-content: space-around; gap: 0; overflow: visible;
  }
  .tab { flex: 1; flex-direction: column; gap: 3px; padding: 6px 2px; border-radius: 12px; font-size: 10.5px; font-weight: 600; position: relative; min-width: 0; }
  .tab.active { background: none; box-shadow: none; color: var(--text); }
  .tab.active .tab-icon { color: var(--teal); }
  .tab-icon { display: block; height: 24px; transition: transform .2s; }
  .tab:active .tab-icon { transform: scale(.88); }
  .tab-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tab .badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; }
  main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
  .hero { padding-top: 36px; }
  .section-head { padding-top: 32px; }
  .notify-controls { justify-content: flex-start; }
  .schedules { grid-template-columns: 1fr; }
}
@media (display-mode: standalone) {
  .install-btn { display: none !important; }
}
