/* Instant Crawl console. One accent, neutral surfaces, 4px spacing grid. */
:root {
  --bg: #f7f7f8; --surface: #ffffff; --surface-2: #f3f4f6; --hover: #f0f1f3;
  --border: #e4e5e9; --border-strong: #d2d4da;
  --text: #16181d; --text-2: #4b5160; --text-3: #7c8291;
  --accent: #2f5bea; --accent-hover: #2449c7; --accent-soft: #edf1fe; --accent-text: #2449c7;
  --ok: #18794e; --ok-soft: #e8f5ee; --warn: #9a5b00; --warn-soft: #fdf3e1; --bad: #c4321f; --bad-soft: #fdecea;
  --run: #2f5bea; --run-soft: #edf1fe;
  --code-bg: #f6f7f9;
  --radius: 10px; --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --primary-bg: var(--accent); --primary-hover: var(--accent-hover); --primary-text: #fff;
  color-scheme: light;
}
:root[data-theme="dark"] {
  /* neutral graphite: no blue cast in the greys; surfaces step up in small, even increments */
  --bg: #111111; --surface: #181818; --surface-2: #202020; --hover: #232323;
  --border: #2a2a2a; --border-strong: #383838;
  --text: #ececea; --text-2: #a8a8a4; --text-3: #75756f;
  --accent: #7aa7ff; --accent-hover: #9dbdff; --accent-soft: #1d2533; --accent-text: #a4c2ff;
  --ok: #5fbf8f; --ok-soft: #17241d; --warn: #d9a557; --warn-soft: #2a2216; --bad: #ec7f73; --bad-soft: #2c1a18;
  --run: #9dbdff; --run-soft: #1d2533;
  --code-bg: #141414;
  --shadow: none; --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  --primary-bg: #ececea; --primary-hover: #ffffff; --primary-text: #111111;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- shell ---- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 16px 12px;
  background: var(--surface); border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px; min-width: 0; color: var(--text); font-weight: 650; font-size: 15px; }
.brand:hover { text-decoration: none; }
.mark { width: 26px; height: 26px; color: var(--surface); }
.mark rect { fill: var(--accent); stroke: none; }
.mark path { fill: #fff; stroke: #fff; stroke-width: 1; stroke-linejoin: round; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--radius-sm);
  background: none; color: var(--text-2); font: 500 14px var(--font); text-align: left; cursor: pointer; }
.nav a:hover, .nav button:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-text); }
.nav-sep { height: 1px; background: var(--border); margin: 10px 4px; }
.key-state { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); }
.key-state.on { background: var(--ok); }
.side-foot { margin-top: auto; }
.totals { padding: 4px 10px; color: var(--text-3); font-size: 12px; }

.main { min-width: 0; padding: 0 32px 48px; }
.topbar { display: flex; align-items: center; gap: 8px; height: 56px; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--text-3); font-size: 13px; min-width: 0; }
.crumbs a { color: var(--text-2); }
.crumbs .sep { color: var(--border-strong); }
.crumbs .cur { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view { max-width: 1240px; }
.page-head { margin: 8px 0 20px; }
.page-head h1 { font-size: 24px; font-weight: 650; }
.sub { margin: 6px 0 0; color: var(--text-2); max-width: 680px; }

/* ---- controls ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: 500 14px var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-text); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn svg.fill { fill: currentColor; stroke: none; }
.btn.small { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.ghost { border-color: transparent; background: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--bad); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); cursor: pointer; }
.input, .select, .form input:not([type=checkbox]), .form select, .form textarea {
  width: 100%; min-height: 36px; padding: 7px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: 14px var(--font); }
.form textarea, textarea.input { resize: vertical; line-height: 1.45; }
.input.code, .form textarea[placeholder="JSON"] { font-family: var(--mono); font-size: 12.5px; }
.input.mono { font-family: var(--mono); font-size: 12.5px; }
.input:focus, .select:focus, .form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.select { width: auto; padding-right: 30px; appearance: none; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8291' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
.form select { appearance: none; padding-right: 30px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8291' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center; }
kbd { padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; color: var(--text-3); background: var(--surface-2); font-size: 11px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.flush { padding: 0; overflow: hidden; }
.card h2 { font-size: 15px; font-weight: 600; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.seg-btn { height: 26px; padding: 0 12px; border: 0; border-radius: 5px; background: none; color: var(--text-2); font: 500 13px var(--font); cursor: pointer; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

.notice { margin: 0 0 16px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 13.5px; border: 1px solid transparent; }
.notice.error { background: var(--bad-soft); color: var(--bad); white-space: pre-wrap; }
.notice.inset { margin: 0; border-radius: 0; border-width: 1px 0 0; }
.faint { color: var(--text-3); }
.spacer { flex: 1; }

/* ---- store ---- */
.store-tools { display: flex; gap: 10px; margin-bottom: 14px; }
.search-box { flex: 1; display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface); color: var(--text-3); cursor: text; }
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search-box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: none; color: var(--text); font: 14.5px var(--font); }
.search-box input::-webkit-search-cancel-button { cursor: pointer; }
.store-tools .select { height: 42px; border-radius: var(--radius); min-width: 170px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font: 500 13px var(--font); cursor: pointer; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--text); border-color: var(--text); color: var(--surface); }
.chip .n { color: var(--text-3); font-size: 12px; }
.chip.active .n { color: inherit; opacity: .7; }
.count { margin: 0 0 12px; color: var(--text-3); font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tile { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); color: var(--text); cursor: pointer; transition: border-color .12s, box-shadow .12s; min-height: 150px; }
.tile:hover { border-color: var(--border-strong); box-shadow: 0 4px 14px rgba(16, 24, 40, .07); text-decoration: none; }
.tile-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tile-name { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.tile-plat { color: var(--text-3); font-size: 12.5px; }
.tile-desc { margin: 0; color: var(--text-2); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile-foot { margin-top: auto; display: flex; flex-wrap: wrap; gap: 6px; }
.logo { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 10px; background: #fff;
  border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(16, 24, 40, .06); overflow: hidden; }
.logo img { width: 26px; height: 26px; object-fit: contain; border-radius: 5px; }
.logo.lg { width: 60px; height: 60px; border-radius: 15px; }
.logo.lg img { width: 38px; height: 38px; border-radius: 8px; }
.logo.mono { background: var(--surface-2); color: var(--text-2); font-weight: 650; font-size: 14px; letter-spacing: -.02em; }
.logo.lg.mono { font-size: 21px; }
.logo.glyph { background: var(--accent-soft); color: var(--accent-text); border-color: transparent; }
.logo.glyph svg { width: 21px; height: 21px; }
.logo.lg.glyph svg { width: 30px; height: 30px; }
.chip svg { width: 15px; height: 15px; stroke-width: 1.75; }
.tag svg { width: 13px; height: 13px; margin-right: 5px; stroke-width: 1.75; }
.tile-kind { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--text-3); font-size: 12px; }
.tile-kind svg { width: 14px; height: 14px; stroke-width: 1.75; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); color: var(--text-2); font-size: 12px; font-weight: 500; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag:empty { display: none; }
.store-empty { grid-column: 1 / -1; padding: 48px 0; text-align: center; color: var(--text-2); }

/* ---- scraper page ---- */
.actor-head { display: flex; align-items: flex-start; gap: 16px; margin: 8px 0 18px; }
.actor-meta { flex: 1; min-width: 0; }
.actor-meta h1 { font-size: 22px; font-weight: 650; }
.actor-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 4px; color: var(--text-2); font-size: 13px; }
.actor-sub code { color: var(--text-3); }
.desc { margin: 10px 0 0; color: var(--text-2); max-width: 760px; }
.actor-actions { display: flex; gap: 8px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; background: none;
  color: var(--text-2); font: 500 14px var(--font); cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); }
.tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }
.count-badge { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; line-height: 18px; text-align: center; }
.count-badge.run { background: var(--run-soft); color: var(--run); }
.count-badge.bad { background: var(--bad-soft); color: var(--bad); }

.input-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.side-card { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.opt-kind { margin: -6px 0 0; color: var(--text-3); font-size: 12.5px; }
.opt-kind:empty { display: none; }
.opts { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 14px; }
.endpoint-box { border-top: 1px solid var(--border); padding-top: 14px; }
.endpoint { display: flex; align-items: center; gap: 8px; margin-top: 6px; min-width: 0; }
.endpoint code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.method { padding: 1px 6px; border-radius: 4px; background: var(--ok-soft); color: var(--ok); font: 600 11px var(--mono); }

.form { display: flex; flex-direction: column; gap: 18px; }
.group { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 18px; }
.group > legend { padding: 0; margin-bottom: 14px; font-weight: 600; font-size: 13px; color: var(--text); }
details.group { gap: 0; border-top: 1px solid var(--border); padding-top: 14px; }
details.group > summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text); }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.7px solid var(--text-3); border-bottom: 1.7px solid var(--text-3); transform: rotate(-45deg); transition: transform .15s; margin-right: 2px; }
details.group[open] > summary::before { transform: rotate(45deg); }
details.group[open] > summary { margin-bottom: 18px; }
details.group > .field + .field { margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lbl { display: flex; align-items: baseline; gap: 8px; font-weight: 500; font-size: 13.5px; color: var(--text); }
.lbl .req { color: var(--bad); font-weight: 600; }
.lbl .key { margin-left: auto; color: var(--text-3); font: 11.5px var(--mono); }
.help { color: var(--text-3); font-size: 12.5px; line-height: 1.45; }
.field-err { color: var(--bad); font-size: 12.5px; }
.field-err:empty { display: none; }
.check { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.form .muted, .muted { color: var(--text-3); }

.runbar { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: 10px; margin: 16px -32px 0; padding: 14px 32px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border); }
.runbar-hint { margin-left: auto; color: var(--text-3); font-size: 12.5px; }

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 64px 16px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.empty svg { width: 28px; height: 28px; color: var(--text-3); }
.empty h3 { font-size: 15px; font-weight: 600; }
.empty p { margin: 0 0 6px; color: var(--text-2); max-width: 380px; }

.run-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.run-stats { display: flex; flex-wrap: wrap; gap: 16px; color: var(--text-2); font-size: 13px; }
.run-stats b { color: var(--text); font-weight: 600; }
.export { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; text-transform: capitalize; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status:empty { display: none; }
.status.succeeded { background: var(--ok-soft); color: var(--ok); }
.status.running, .status.queued { background: var(--run-soft); color: var(--run); }
.status.running::before { animation: pulse 1.2s ease-in-out infinite; }
.status.partial, .status.timed_out { background: var(--warn-soft); color: var(--warn); }
.status.failed, .status.cancelled, .status.rejected { background: var(--bad-soft); color: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }
.pg-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--text-3); font-size: 12.5px; }
.pg-strip b, .pg-strip code { color: var(--text); }
.subtabs { display: flex; align-items: center; gap: 2px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.subtabs.bare { padding: 0; border: 0; }
.stab { height: 30px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--text-2); font: 500 13px var(--font); cursor: pointer; }
.stab:hover { color: var(--text); background: var(--hover); }
.stab.active { background: var(--surface-2); color: var(--text); }
.rpanel { max-height: 64vh; overflow: auto; }
.rpanel.pad { padding: 16px; }

table.res { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.res th { position: sticky; top: 0; z-index: 1; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); color: var(--text-2);
  font-weight: 600; text-align: left; white-space: nowrap; font-size: 12.5px; }
table.res td { padding: 9px 12px; border-bottom: 1px solid var(--border); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: top; }
table.res tr.row { cursor: pointer; }
table.res tr.row:hover td { background: var(--hover); }
table.res td.idx, table.res th:first-child { width: 48px; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
table.res tr.detail td { max-width: none; white-space: normal; background: var(--code-bg); }
table.res tr.detail pre { margin: 0; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.table-empty { padding: 14px 16px; color: var(--text-3); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.codeview { margin: 0; padding: 16px 18px; background: var(--code-bg); color: var(--text); white-space: pre; overflow: auto; line-height: 1.6; max-height: 64vh; }
.codeview.log { min-height: 240px; white-space: pre-wrap; word-break: break-word; }
.api-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.api-note { margin: 12px 2px 0; color: var(--text-3); font-size: 13px; }
.files { display: flex; flex-direction: column; gap: 6px; }
.files a { cursor: pointer; font-family: var(--mono); font-size: 12.5px; }

.runs { display: flex; flex-direction: column; }
.run-row { display: grid; grid-template-columns: 112px minmax(0, 1.6fr) minmax(0, 1fr) 90px 90px; align-items: center; gap: 14px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.run-row:last-child { border-bottom: 0; }
.run-row:hover { background: var(--hover); }
.run-row.head { cursor: default; background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 600; padding-top: 9px; padding-bottom: 9px; }
.run-row.head:hover { background: var(--surface-2); }
.run-row .name { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.runs-empty { padding: 40px 16px; text-align: center; color: var(--text-3); }

.md { line-height: 1.65; max-width: 900px; overflow-wrap: anywhere; }
.md h1 { font-size: 20px; margin: 0 0 12px; } .md h2 { font-size: 16px; margin: 24px 0 8px; } .md h3 { font-size: 14.5px; margin: 20px 0 6px; }
.md p, .md ul, .md ol { margin: 0 0 12px; color: var(--text-2); }
.md code { padding: 1px 5px; border-radius: 4px; background: var(--surface-2); }
.md pre { padding: 14px; border-radius: var(--radius-sm); background: var(--code-bg); overflow: auto; }
.md pre code { padding: 0; background: none; }
.md table { border-collapse: collapse; margin: 0 0 14px; font-size: 13px; display: block; overflow-x: auto; }
.md th, .md td { padding: 7px 10px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); }

.dialog { width: min(440px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(10, 12, 16, .45); }
.dialog h3 { font-size: 17px; font-weight: 650; }
.dialog p { margin: 6px 0 16px; color: var(--text-2); font-size: 13.5px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; padding: 9px 16px; border-radius: 8px; background: var(--text); color: var(--surface); font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); }

.mobile-only { display: none; }
@media (max-width: 1080px) {
  .input-layout { grid-template-columns: 1fr; }
  .side-card { position: static; }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .mobile-only { display: inline-grid; }
  .main { padding: 0 16px 40px; }
  .runbar { margin: 16px -16px 0; padding: 12px 16px; }
  .runbar-hint { display: none; }
  .store-tools { flex-direction: column; }
  .store-tools .select { width: 100%; }
  .actor-head { flex-wrap: wrap; }
  .actor-actions { width: 100%; }
  .actor-actions .btn { flex: 1; }
  .run-row { grid-template-columns: 96px minmax(0, 1fr) 70px; }
  .run-row > :nth-child(3), .run-row > :nth-child(4) { display: none; }
  .search-box kbd { display: none; }
}
.help code { padding: 0 4px; border-radius: 4px; background: var(--surface-2); color: var(--text-2); font-size: 11.5px; }

/* theme switch */
.theme-switch { display: flex; padding: 3px; gap: 2px; margin: 0 4px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.theme-switch button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; border: 0; border-radius: 6px;
  background: none; color: var(--text-3); font: 500 12.5px var(--font); cursor: pointer; }
.theme-switch button svg { width: 15px; height: 15px; }
.theme-switch button:hover { color: var(--text); }
.theme-switch button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* provide -> get summary */
.io { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px 14px; margin-top: 14px; }
.io:empty { display: none; }
.io-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.io-lbl { color: var(--text-3); font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.io-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.io-tag { height: 24px; padding: 0 9px; display: inline-flex; align-items: center; border-radius: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-size: 12.5px; }
.io-tag.out { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.io-arrow { align-self: flex-end; height: 24px; display: inline-flex; align-items: center; color: var(--text-3); }

/* ---- collapsible sidebar ---- */
.app, .side { transition: grid-template-columns .2s ease, width .2s ease; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-bottom: 14px; }
.brand .t { white-space: nowrap; letter-spacing: -.015em; }
.collapse-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border: 0; border-radius: 7px; background: none; color: var(--text-3); cursor: pointer; }
.collapse-btn:hover { background: var(--hover); color: var(--text); }
.collapse-btn .chev { transition: transform .2s ease; transform-origin: 14.5px 12px; }
.nav .t { white-space: nowrap; overflow: hidden; }
:root[data-side="collapsed"] .app { grid-template-columns: 68px minmax(0, 1fr); }
:root[data-side="collapsed"] .side { padding: 16px 10px; align-items: center; }
:root[data-side="collapsed"] .side .t { display: none; }
:root[data-side="collapsed"] .brand-row { flex-direction: column; gap: 10px; }
:root[data-side="collapsed"] .brand { padding: 6px 0; }
:root[data-side="collapsed"] .collapse-btn .chev { transform: scaleX(-1); }
:root[data-side="collapsed"] .nav { align-items: center; }
:root[data-side="collapsed"] .nav a, :root[data-side="collapsed"] .nav button { width: 44px; height: 40px; justify-content: center; padding: 0; position: relative; }
:root[data-side="collapsed"] .nav .key-state { position: absolute; top: 9px; right: 9px; margin: 0; }
:root[data-side="collapsed"] .nav-sep { width: 32px; }
:root[data-side="collapsed"] .theme-switch { flex-direction: column; margin: 0 0 6px; width: 44px; }
:root[data-side="collapsed"] .theme-switch button { height: 30px; }
@media (max-width: 820px) {
  .collapse-btn { display: none; }
  :root[data-side="collapsed"] .app { grid-template-columns: 1fr; }
  :root[data-side="collapsed"] .side { align-items: stretch; padding: 16px 12px; }
  :root[data-side="collapsed"] .side .t { display: revert; }
  :root[data-side="collapsed"] .brand-row { flex-direction: row; }
  :root[data-side="collapsed"] .nav { align-items: stretch; }
  :root[data-side="collapsed"] .nav a, :root[data-side="collapsed"] .nav button { width: 100%; height: auto; justify-content: flex-start; padding: 8px 10px; }
  :root[data-side="collapsed"] .theme-switch { flex-direction: row; width: auto; margin: 0 4px 10px; }
}

:root[data-theme="dark"] .tile:hover { border-color: #444; box-shadow: none; background: #1c1c1c; }
:root[data-theme="dark"] .logo { border-color: #2a2a2a; box-shadow: none; }
:root[data-theme="dark"] .seg-btn.active, :root[data-theme="dark"] .theme-switch button[aria-pressed="true"] { background: #2c2c2c; box-shadow: none; }
:root[data-theme="dark"] .mark rect { fill: #ececea; }
:root[data-theme="dark"] .mark path { fill: #111; stroke: #111; }

/* ---- dark: neutral active states ---- */
:root[data-theme="dark"] .nav a.active { background: #232323; color: var(--text); }
:root[data-theme="dark"] .chip.active { background: var(--text); color: #111; border-color: var(--text); }

/* ---- schedules ---- */
.page-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sched-list { display: flex; flex-direction: column; }
.sched-row { display: grid; grid-template-columns: 44px minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1fr) 120px auto; align-items: center; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.sched-row:last-child { border-bottom: 0; }
.sched-row.head { padding-top: 9px; padding-bottom: 9px; background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 600; }
.sched-row.off .sched-main, .sched-row.off .sched-when { opacity: .55; }
.sched-main { display: flex; align-items: center; gap: 12px; min-width: 0; cursor: pointer; }
.sched-main .logo { width: 34px; height: 34px; border-radius: 9px; }
.sched-main .logo img { width: 22px; height: 22px; }
.sched-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-sub { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-when { font-size: 13px; color: var(--text); }
.sched-when small { display: block; color: var(--text-3); font-size: 12px; }
.sched-next { font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.sched-actions { display: flex; justify-content: flex-end; gap: 4px; }
.icon-act { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 7px; background: none; color: var(--text-3); cursor: pointer; }
.icon-act:hover { background: var(--hover); color: var(--text); }
.icon-act.danger:hover { color: var(--bad); background: var(--bad-soft); }
.icon-act svg { width: 17px; height: 17px; }
.confirm-del { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2); }
.switch { position: relative; width: 36px; height: 20px; flex: none; border: 0; border-radius: 999px; background: var(--border-strong); cursor: pointer; transition: background .15s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch[aria-checked="true"] { background: var(--ok); }
.switch[aria-checked="true"]::after { transform: translateX(16px); }
.sched-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 56px 16px; text-align: center; }
.sched-empty svg { width: 30px; height: 30px; color: var(--text-3); }
.sched-empty h3 { font-size: 15px; font-weight: 600; }
.sched-empty p { margin: 0 0 8px; color: var(--text-2); max-width: 420px; }

/* ---- editor dialog ---- */
.dialog.wide { width: min(640px, calc(100vw - 32px)); padding: 0; }
.dialog.wide form { display: flex; flex-direction: column; max-height: min(86vh, 860px); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.icon-x { width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--text-3); font-size: 20px; line-height: 1; cursor: pointer; }
.icon-x:hover { background: var(--hover); color: var(--text); }
.dlg-body { display: flex; flex-direction: column; gap: 18px; padding: 20px 22px; overflow: auto; }
.dialog.wide .dialog-actions { margin: 0; padding: 14px 22px; border-top: 1px solid var(--border); }
.select.full { width: 100%; }
.seg.wide { display: flex; width: 100%; }
.seg.wide .seg-btn { flex: 1; height: 30px; }
.freq-row { display: flex; flex-wrap: wrap; gap: 10px 12px; margin-top: 10px; }
.mini { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 13px; }
.mini.grow { flex: 1; min-width: 200px; }
.mini.grow .input { flex: 1; }
.mini .input { width: auto; }
.input.num { width: 76px; }
.input.num-w { max-width: 200px; }
.opt { margin-left: 6px; color: var(--text-3); font-weight: 400; font-size: 12px; }
.preview { margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); font-size: 12.5px; line-height: 1.6; }
.preview b { color: var(--text); font-weight: 600; }
.preview.bad { background: var(--bad-soft); color: var(--bad); }
.preview:empty { display: none; }
@media (max-width: 820px) {
  .sched-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .sched-row > :nth-child(3), .sched-row > :nth-child(4), .sched-row > :nth-child(5) { display: none; }
}
#sc-err { white-space: pre-wrap; }

/* ---- my scrapers ---- */
.section-title { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-size: 13px; font-weight: 600; color: var(--text-2); }
.section-title svg { width: 16px; height: 16px; }
#my-pinned:not(:empty) { margin-bottom: 28px; }
.pin { position: absolute; top: 12px; right: 12px; display: inline-grid; place-items: center; width: 28px; height: 28px; border: 0; border-radius: 7px; background: none; color: var(--text-3); cursor: pointer; opacity: 0; transition: opacity .12s; }
.tile { position: relative; }
.tile:hover .pin, .pin.on, .pin:focus-visible { opacity: 1; }
.pin:hover { background: var(--hover); color: var(--text); }
.pin svg { width: 16px; height: 16px; }
.pin.on { color: #e3a008; }
.pin.on svg { fill: currentColor; }
.tile-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--text-3); font-size: 12.5px; }
.tile-stats b { color: var(--text); font-weight: 600; }

/* ---- storage ---- */
.head-actions { display: flex; gap: 8px; }
.tabs a.tab { text-decoration: none; }
.files-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.search-box.sm { flex: 0 1 360px; height: 36px; border-radius: var(--radius-sm); }
.usage { margin-left: auto; font-size: 12.5px; }
.dropzone { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 18px; margin-bottom: 12px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-3); font-size: 13px; background: var(--surface); transition: border-color .12s, background .12s; }
.dropzone svg { width: 20px; height: 20px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.linkish { border: 0; padding: 0; background: none; color: var(--accent-text); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.uploads { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.uploads:empty { display: none; }
.up-row { display: grid; grid-template-columns: minmax(0, 1fr) 160px 60px; align-items: center; gap: 12px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }
.up-row .bar { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.up-row .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.up-row.done .bar i { background: var(--ok); }
.up-row.err .bar i { background: var(--bad); }
.up-row .pct { text-align: right; color: var(--text-3); font-variant-numeric: tabular-nums; }
.files-list { display: flex; flex-direction: column; }
.file-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 90px 130px 150px auto; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.file-row:last-child { border-bottom: 0; }
.file-row.head { padding-top: 9px; padding-bottom: 9px; background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 600; }
.ftype { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); overflow: hidden; cursor: pointer; border: 1px solid var(--border); }
.ftype img { width: 100%; height: 100%; object-fit: cover; }
.ftype svg { width: 19px; height: 19px; }
.ftype.video { color: #c2255c; } .ftype.audio { color: #7048e8; } .ftype.pdf { color: #c92a2a; } .ftype.image { color: #2b8a3e; } .ftype.link { color: var(--accent-text); }
:root[data-theme="dark"] .ftype.video { color: #f783ac; } :root[data-theme="dark"] .ftype.audio { color: #b197fc; } :root[data-theme="dark"] .ftype.pdf { color: #ff8787; } :root[data-theme="dark"] .ftype.image { color: #8ce99a; }
.fname { min-width: 0; }
.fname b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.fname small { display: block; color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsize, .fdate { color: var(--text-2); font-variant-numeric: tabular-nums; }
.fshare { display: flex; align-items: center; gap: 8px; }
.fshare .lab { color: var(--text-3); font-size: 12px; }
.empty-inline { padding: 44px 16px; text-align: center; color: var(--text-3); }
.run-files { padding: 4px 16px 14px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.run-file { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.run-file:last-child { border-bottom: 0; }
.run-file .p { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-row .tog { color: var(--text-3); font-size: 12px; }
.ds-actions { display: flex; justify-content: flex-end; gap: 6px; }
.run-row.ds { grid-template-columns: 112px minmax(0, 1.6fr) minmax(0, 1fr) 90px 200px; }

/* ---- viewer ---- */
.dialog.viewer { width: min(980px, calc(100vw - 32px)); padding: 0; }
.viewer-actions { display: flex; align-items: center; gap: 6px; }
.viewer-body { display: grid; place-items: center; min-height: 240px; max-height: 78vh; padding: 16px; background: var(--surface-2); overflow: auto; }
.viewer-body img, .viewer-body video { max-width: 100%; max-height: 72vh; border-radius: 8px; }
.viewer-body audio { width: min(560px, 100%); }
.viewer-body iframe { width: 100%; height: 72vh; border: 0; border-radius: 8px; background: #fff; }
.viewer-body pre { width: 100%; margin: 0; white-space: pre-wrap; }
@media (max-width: 820px) {
  .file-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .file-row > :nth-child(3), .file-row > :nth-child(4), .file-row > :nth-child(5) { display: none; }
  .run-row.ds { grid-template-columns: 96px minmax(0, 1fr) auto; }
  .head-actions { width: 100%; }
}

/* ---- my scrapers: rows ---- */
.my-row { display: grid; grid-template-columns: 32px minmax(0, 2.6fr) 110px 70px 80px 90px 120px 70px; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; }
.my-row:last-child { border-bottom: 0; }
.my-row:not(.head):hover { background: var(--hover); }
.my-row.head { padding-top: 9px; padding-bottom: 9px; background: var(--surface-2); color: var(--text-3); font-size: 12px; font-weight: 600; }
.my-row .num { text-align: right; font-variant-numeric: tabular-nums; }
.my-main { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--text); text-decoration: none; }
.my-main:hover { text-decoration: none; }
.my-main:hover .sched-name { color: var(--accent-text); }
.my-main .logo { width: 34px; height: 34px; border-radius: 9px; }
.my-main .logo img { width: 22px; height: 22px; }
.my-cell { color: var(--text-2); }
.pin.inline { position: static; opacity: 1; }
.pin.inline:not(.on) { color: var(--border-strong); }
.pin.inline:not(.on):hover { color: var(--text-2); }
@media (max-width: 1000px) {
  .my-row { grid-template-columns: 32px minmax(0, 1fr) 90px 120px 70px; }
  .my-row > :nth-child(4), .my-row > :nth-child(5), .my-row > :nth-child(6) { display: none; }
}
@media (max-width: 640px) {
  .my-row { grid-template-columns: 32px minmax(0, 1fr) 70px; }
  .my-row > :nth-child(3), .my-row > :nth-child(7) { display: none; }
}
