:root {
  --bg: #f6f7f9; --panel: #fff; --text: #1c2330; --muted: #667085; --line: #dfe3ea;
  --accent: #2456d6; --accent-text: #fff;
  --red: #c62828; --red-bg: #fdecea; --amber: #9a6200; --amber-bg: #fff4d6;
  --green: #1b7a3d; --green-bg: #e3f5e9; --blue: #1d5fa8; --blue-bg: #e4effb;
  --gray: #5b6472; --gray-bg: #eceff3;
  --toast-bg: #1c2330; --toast-text: #f2f4f8; --toast-action: #9db8ff;
  --shadow: 0 6px 20px rgba(16, 24, 40, .22);
  --accent-soft: #e6edfc; --switch-off: #7d8797; --skel: #e8ebf0; --skel-hi: #f4f6f9; --danger: #c62828; --danger-text: #fff;
  /* the sticky tab bar is 45px (44px + its border): notices stick 8px under it, scrolling stops 11px under it */
  --sticky-top: 53px; --sticky-offset: 56px;
  --stale-bg: #f0f2f5; --stale-muted: #566070; --job-min: 232px;
  /* design tokens shared with the sign-in page (login.css reads --radius-* / --control-* / --fs-sm) */
  --radius-lg: 16px; --radius: 14px; --radius-md: 10px; --radius-sm: 8px; --radius-pill: 999px;
  --control-h: 44px; --control-h-lg: 46px; --control-h-sm: 36px;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-lg: 17px; --fs-xl: 22px; --fs-hero: 26px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --page-w: 920px; --detail-w: 440px;
  --line-soft: #eceef3; --seg-bg: #e9edf7; --ring-track: #e6e9f0;
  --great-solid: #14a05a; --good-solid: #e0a100; --great-line: #9ddbb8; --good-line: #ecd48a;
  --seg-skill: #2456d6; --seg-salary: #1b9a55; --seg-region: #7b5cd6; --seg-company: #e0a100;
  --card-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --panel: #1b2029; --text: #e6e9ef; --muted: #98a2b3; --line: #2c3441;
    --accent: #7aa2ff; --accent-text: #0d1220;
    --red: #ff8a80; --red-bg: #3b1a1a; --amber: #ffcf70; --amber-bg: #3a2c0c;
    --green: #7ddc9b; --green-bg: #12301d; --blue: #8cc0ff; --blue-bg: #14283f;
    --gray: #aab3c0; --gray-bg: #262c37;
    --toast-bg: #e6e9ef; --toast-text: #12151b; --toast-action: #1d4ab8;
    --shadow: 0 6px 20px rgba(0, 0, 0, .5);
    --accent-soft: #1f2d52; --switch-off: #6f7b8c; --skel: #262c37; --skel-hi: #323a49; --danger: #ff8a80; --danger-text: #2a0d0b;
    --stale-bg: #232a35; --stale-muted: #98a2b3;
    --line-soft: #242b36; --seg-bg: #232a37; --ring-track: #2c3441;
    --great-solid: #4cc982; --good-solid: #f0b53c; --great-line: #2f6b49; --good-line: #6b5420;
    --seg-skill: #7aa2ff; --seg-salary: #4cc982; --seg-region: #b39cff; --seg-company: #f0b53c;
    --card-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 system-ui, "Microsoft JhengHei", "PingFang TC", sans-serif;
}
.top, main, footer { max-width: var(--page-w); margin: 0 auto; padding: 0 16px; }
/* the 自動蒐集 tab has two columns of cards: a wider page while it shows */
:root:has(#view-watch:not([hidden])), :root.boot-watch { --page-w: 1080px; }
.top { padding-top: 28px; }
h1 { margin: 0 0 10px; font-size: 26px; }
h2 { margin: 0 0 10px; font-size: 15px; }
h3 { margin: 18px 0 6px; font-size: 14px; color: var(--muted); }
.intro, .hint, footer { color: var(--muted); font-size: 13px; }
.intro { margin: 14px 0 18px; }
footer { padding: 24px 16px 40px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.small { font-size: 13px; margin-top: 10px; }
#filters { margin: 4px 2px 0; }
/* Reserve the row before /api/sources fills it in (checkbox row height), so the forms below do not jump. */
#source-toggles { min-height: 21.8px; }
input[type="search"], input[type="text"] {
  flex: 1 1 260px; min-width: 0; padding: 9px 12px; font: inherit; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
button, .button {
  padding: 9px 16px; font: inherit; cursor: pointer; text-decoration: none; display: inline-block;
  border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: var(--accent-text);
}
button.secondary, .button.secondary { background: transparent; color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#results, .job-list { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.job { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--card-shadow); }
.job.risk-high { border-left: 4px solid var(--red); }
.job.risk-caution { border-left: 4px solid var(--amber); }
/* Long text is cut with an ellipsis, never allowed to widen the page: title 2 lines, company and
   location 1 line. Every flex/grid child that holds such text needs min-width: 0. */
.job-title {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
  min-width: 0; overflow: hidden; overflow-wrap: break-word;
  font-size: 16px; font-weight: 600; color: var(--accent); text-decoration: none;
}
.job-title:hover { text-decoration: underline; }
.company { background: none; border: none; padding: 0; color: var(--text); font-weight: 600; text-decoration: underline dotted; }
.company, .meta .loc { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.company { text-align: left; }
.meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 8px; min-width: 0; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.badge {
  font-size: 12.5px; padding: 2px 9px; border-radius: 999px; background: var(--gray-bg); color: var(--gray);
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.btn-sm { padding: 1px 10px; font-size: 12.5px; }
.badge.high, .badge.closed { background: var(--red-bg); color: var(--red); font-weight: 600; }
.badge.caution, .badge.weak { background: var(--amber-bg); color: var(--amber); }
.badge.clear, .badge.strong { background: var(--green-bg); color: var(--green); }
.badge.stable, .badge.normal { background: var(--blue-bg); color: var(--blue); }
.badge.loading::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; animation: pulse 1.2s ease-in-out infinite; }
.badge.src { border: 1px solid var(--line); background: transparent; }
@keyframes pulse { 50% { opacity: .45; } }

/* ---------- tabs ---------- */
.tabbar { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.tablist { position: relative; display: flex; max-width: var(--page-w); margin: 0 auto; padding: 0 16px; }
.tab {
  flex: 0 0 auto; min-height: 44px; padding: 0 20px; border: 0; border-radius: 0; background: transparent;
  color: var(--muted); font-weight: 600; transition: color 100ms;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--accent); }
.tab:focus-visible { outline-offset: -4px; }
/* One bar, slid with transform only: translateX = tab offset, scaleX = tab width / list width. */
.tab-indicator {
  position: absolute; left: 0; bottom: -1px; width: 100%; height: 3px; background: var(--accent);
  transform-origin: 0 0; transform: translateX(var(--tab-x, 0)) scaleX(var(--tab-w, 0)); opacity: 0;
}
.tablist.ready .tab-indicator { opacity: 1; transition: transform 200ms ease; }
.view.entering { animation: view-in 180ms ease-out; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
@media (max-width: 600px) { .tab { flex: 1 1 0; padding: 0 8px; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); z-index: 60;
  display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); padding: 10px 16px;
  border-radius: 10px; background: var(--toast-bg); color: var(--toast-text); box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px);
  transition: opacity 160ms, transform 160ms, visibility 0s 160ms;
}
.toast.show { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.toast-msg { overflow-wrap: anywhere; }
.toast-action { flex: none; white-space: nowrap; min-height: 40px; padding: 0 10px; border: 0; background: transparent; color: var(--toast-action); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0s !important; animation-delay: 0s !important; animation-iteration-count: 1 !important;
    transition-duration: 0s !important; transition-delay: 0s !important; scroll-behavior: auto !important;
  }
  .badge.loading::before { animation: none; }
}

dialog { width: min(680px, calc(100vw - 24px)); max-height: 88vh; border: 1px solid var(--line); border-radius: 12px; padding: 20px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(0, 0, 0, .45); }
.close { float: right; background: transparent; color: var(--muted); border-color: var(--line); padding: 2px 9px; }
#detail-body h2 { font-size: 19px; margin-right: 40px; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.signals { list-style: none; padding: 0; margin: 0; font-size: 14px; display: grid; gap: 6px; }
.signals li { display: grid; grid-template-columns: 46px 1fr; gap: 8px; }
.signals .w { font-variant-numeric: tabular-nums; text-align: right; color: var(--muted); }
.signals .w.up { color: var(--green); } .signals .w.down { color: var(--red); }
.evidence { display: block; color: var(--muted); font-size: 12.5px; overflow-wrap: anywhere; }
.notes { color: var(--muted); font-size: 13px; padding-left: 18px; margin: 0; }
.candidates { display: grid; gap: 6px; }
.candidates button { text-align: left; }

/* ======================================================================
   自動蒐集 tab (status bar, conditions, guide, condition dialog)
   ====================================================================== */

/* ---------- shared bits ---------- */
.btn-md { min-height: 40px; padding: 7px 14px; }
.btn-lg { min-height: 44px; padding: 9px 22px; font-weight: 600; }
button.danger { background: var(--danger); border-color: var(--danger); color: var(--danger-text); }
button.secondary:hover:not([aria-disabled="true"]):not(:disabled) { background: var(--accent-soft); }
button, .tab, .switch, .chip { transition: background-color 100ms, color 100ms, border-color 100ms, opacity 100ms; }
button[aria-disabled="true"] { opacity: .5; cursor: default; }
.linkish {
  min-height: 40px; padding: 0 6px; border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 600;
}
.linkish:hover:not(:disabled) { text-decoration: underline; }
.linkish:disabled { opacity: .5; cursor: default; }
.caret { display: inline-block; transition: transform 180ms; }
[aria-expanded="true"] > .caret, [aria-expanded="true"] .caret { transform: rotate(180deg); }

/* height animation for a block that opens and closes (only grid-template-rows moves) */
.collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 180ms ease, opacity 180ms ease; opacity: 0; }
.collapse.open { grid-template-rows: 1fr; opacity: 1; }
.collapse-inner { min-height: 0; overflow: hidden; }

/* cross-fade between the guide and the main layout */
.fade-out { opacity: 0; transition: opacity 150ms; }
.fade-in { animation: fade-in 150ms ease-out; }
@keyframes fade-in { from { opacity: 0; } }

/* loading placeholders: fixed sizes, a faint sweep (static under reduced motion) */
.skel { position: relative; display: block; overflow: hidden; background: var(--skel); border-radius: 6px; }
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skel-hi), transparent); animation: sweep 1.2s ease-in-out infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }
.skel-line { height: 16px; }
.skel-btn { width: 110px; height: 44px; border-radius: 8px; }
.skel-btn.compact { width: 84px; height: 40px; }
.skel-card { height: 76px; border-radius: 10px; }
.cond-title .skel-line { height: 24px; }
.cond-count .skel-line, .cond-head-summary .skel-line { height: 21px; }
/* widths of the status / condition placeholders (they were inline styles, which the CSP does not allow) */
.skel-status-line { width: min(70%, 380px); }
.skel-status-sub { width: 220px; }
.skel-cond-title { width: 72px; }
.skel-cond-count { width: 110px; }
.skel-cond-summary { width: min(90%, 320px); }

/* ---------- tab badge ---------- */
.tab-count { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---------- layout ---------- */
.watch-root { min-height: calc(100svh - 150px); padding-top: 14px; }
.status-panel, .cond-panel { margin-bottom: 12px; }

/* ---------- status bar ---------- */
.status-panel { display: grid; gap: 10px; min-height: 74px; align-content: start; padding-block: 12px; }
.status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.status-row.main { min-height: 44px; }
.status-text { flex: 1 1 0; min-width: 0; display: flex; align-items: flex-start; gap: 10px; }
.status-dot { flex: none; width: 10px; height: 10px; margin-top: 7px; border-radius: 50%; background: var(--gray); }
.status-dot.tone-green { background: var(--green); }
.status-dot.tone-amber { background: var(--amber); }
.status-dot.tone-red { background: var(--red); }
.status-dot.tone-accent { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.status-lines { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 16px; }
.status-line { overflow-wrap: anywhere; }
.status-actions { flex: none; display: flex; gap: 8px; }
.status-actions button { min-height: 44px; }
.more-btn-toggle { display: inline-flex; align-items: center; gap: 6px; }
.status-notices { display: grid; gap: 8px; }
.status-notices:empty { display: none; }
.notice { display: flex; flex-wrap: wrap; align-items: center; gap: 0 4px; padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.notice.tone-amber { background: var(--amber-bg); color: var(--amber); }
.notice.tone-red { background: var(--red-bg); color: var(--red); }
.notice.tone-gray { background: var(--gray-bg); color: var(--gray); }
.notice .linkish { color: inherit; text-decoration: underline; min-height: 32px; }
.notice-text { overflow-wrap: anywhere; }
.run-btn.is-busy { display: inline-flex; align-items: center; gap: 8px; }
.spin {
  width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-top-color: transparent;
  animation: spin 1.2s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.status-row.sub { min-height: 40px; color: var(--muted); font-size: 13px; }
.interval { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.stepper.invalid { border-color: var(--red); }
.stepper .step { min-width: 40px; min-height: 38px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--text); font-size: 18px; line-height: 1; }
.stepper .step:hover:not([aria-disabled="true"]):not(:disabled) { background: var(--accent-soft); }
.stepper input {
  width: 3.4em; min-width: 0; padding: 0; border: 0; border-inline: 1px solid var(--line); border-radius: 0; background: transparent;
  color: var(--text); font: inherit; text-align: center; font-variant-numeric: tabular-nums; appearance: textfield; -moz-appearance: textfield;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.stepper input:focus-visible { outline-offset: -2px; }
.interval-saved { color: var(--green); font-weight: 600; }
.interval-error { color: var(--red); font-weight: 600; }
.runs-link { flex: none; }

/* ---------- conditions panel ---------- */
.cond-panel { padding: 0; }
.cond-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 64px; }
.cond-title { flex: none; }
.cond-count { flex: none; color: var(--muted); font-size: 13px; }
.cond-head-summary { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.cond-head-actions { flex: none; display: flex; gap: 8px; }
.cond-body.open .collapse-inner { border-top: 1px solid var(--line); }
.cond-list { list-style: none; margin: 0; padding: 0; }
.cond-item .cond-row { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.cond-item.is-off .cond-name, .cond-item.is-off .cond-summary { color: var(--muted); }
.cond-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "sw main act"; gap: 4px 10px; align-items: center; }
.cond-row .switch { grid-area: sw; }
.cond-main { grid-area: main; min-width: 0; }
.cond-actions, .cond-confirm { grid-area: act; }
.cond-actions { display: flex; gap: 8px; }
.cond-nameline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cond-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.paused-badge { flex: none; }
.cond-summary {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  overflow-wrap: anywhere; color: var(--muted); font-size: 13px;
}
.cond-row.confirming { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "sw main" "act act"; }
.cond-confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 8px 10px; border-radius: 8px; background: var(--red-bg); }
.cond-confirm-text { flex: 1 1 18em; min-width: 0; overflow-wrap: anywhere; color: var(--red); font-size: 13.5px; }
.cond-confirm-buttons { display: flex; gap: 8px; }
.cond-limit { margin: 0; padding: 8px 14px; }
.cond-limit:empty { display: none; }
.cond-error { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 14px; min-height: 64px; color: var(--red); }

.switch { position: relative; flex: none; width: 44px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: none; }
.switch::before {
  content: ""; position: absolute; left: 4px; top: 10px; width: 36px; height: 20px; border-radius: 999px;
  background: var(--switch-off); transition: background-color 120ms;
}
.switch::after {
  content: ""; position: absolute; left: 7px; top: 13px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform 120ms;
}
.switch[aria-checked="true"]::before { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(16px); background: var(--accent-text); }

/* ======================================================================
   自動蒐集 job list (toolbar, cards, notices, filter panel, run log)
   ====================================================================== */
/* (no min-height on .list-area: the placeholder cards are taller than the first screen anyway) */
#watch-conditions { scroll-margin-top: var(--sticky-offset); }

/* ---------- toolbar ---------- */
.list-toolbar { display: grid; gap: 8px; margin: 4px 0 4px; }
.view-chips { display: flex; gap: 8px; }
.view-chip {
  flex: 0 0 auto; min-width: 88px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--text);
}
.view-chip:hover:not(:disabled) { border-color: var(--accent); }
.view-chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
.view-chip:disabled { opacity: 1; cursor: default; }
.vc-count { margin-left: 6px; font-variant-numeric: tabular-nums; }
.list-controls { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.filter-btn { min-width: 96px; }
.sort-field { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.sort-field select {
  min-height: 40px; padding: 0 10px; font: inherit; color: var(--text); background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px;
}
.sort-field select:disabled { opacity: 1; }
.active-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.active-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 13px;
}
.active-chip:hover { background: color-mix(in srgb, var(--accent) 18%, var(--panel)); }
.active-chip .x { font-size: 11px; }
.list-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 40px; color: var(--muted); font-size: 13px; }
.summary-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 4px; }
.info-icon { vertical-align: -3px; }
.help-terms {
  display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0 0 4px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 13px;
}
.help-terms dt { color: var(--text); font-weight: 600; }
.help-terms dd { margin: 0; }

/* ---------- messages above the cards ---------- */
.list-state { margin: 8px 0 0; }
.state-card { padding: 18px 16px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel); text-align: center; }
.state-card p { margin: 0; overflow-wrap: anywhere; }
.state-card.state-empty p, .state-card.state-note p { color: var(--muted); }
.state-card.state-error { border-style: solid; border-color: var(--red); }
.state-card.state-error p { color: var(--red); }
.state-card.state-hint { padding: 8px 12px; text-align: left; border-style: solid; display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.state-card.state-hint p { color: var(--muted); font-size: 13px; }
.state-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.state-hint .state-actions { margin-top: 0; }

/* ---------- floating notices ---------- */
.float-notices {
  position: sticky; top: var(--sticky-top); z-index: 15; height: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  pointer-events: none;
}
.float-notice {
  pointer-events: auto; min-height: 40px; max-width: calc(100vw - 32px); margin-top: 8px; padding: 0 18px; border: 0; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); box-shadow: var(--shadow); font-weight: 600; animation: notice-in 200ms ease-out;
}
.float-notice.leaving { opacity: 0; transition: opacity 150ms; }
@keyframes notice-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- cards (the shared .job card; these are the auto-collect extras) ---------- */
.job.is-collect { min-height: var(--job-min); display: flex; flex-direction: column; }
.job.is-stale { background: var(--stale-bg); --muted: var(--stale-muted); } /* gray ground, not opacity: the small text keeps >= 4.5:1 */
.badge.new { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.job.is-collect .meta { margin: 2px 0 0; align-items: center; }
.job-region { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; max-width: 100%; }
.job-region .loc { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job.is-collect .badges { min-height: 26px; margin-top: 10px; }
.hit-terms { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.badge.new, .badge.stale, .badge.cat, .badge.remote, .badge.region-unknown, .badge.near { font-size: 12.5px; }
.badge.cat { background: var(--accent-soft); color: var(--accent); }
.badge.remote, .badge.near { background: var(--blue-bg); color: var(--blue); }
.badge.region-unknown { background: transparent; color: var(--muted); border: 1px dashed var(--muted); }
.badge.stale { background: var(--panel); color: var(--gray); border: 1px solid var(--line); font-weight: 600; }
.stale-sep {
  display: flex; align-items: center; gap: 12px; margin: 6px 0 -2px; color: var(--muted); font-size: 13px; list-style: none;
}
.stale-sep::before, .stale-sep::after { content: ""; flex: 1 1 0; height: 1px; background: var(--line); }
.job.fresh { animation: fresh 1200ms ease-out; }
@keyframes fresh { from { background: var(--accent-soft); } }
.job.seen-fade .badge.new { opacity: 0; transition: opacity 120ms; }
.job-list.swap-in { animation: swap-in 120ms ease-out; }
.list-area .job-list { margin-top: 4px; }
@keyframes swap-in { from { opacity: .35; } }

/* placeholder cards: same box as a real card */
.job-skel {
  display: flex; flex-direction: column; gap: 10px; height: var(--job-min); min-width: 0; padding: 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
/* The sweep is a moving background on the lines (painted, no compositor layers): six animated
   layers made the first switch to this tab cost ~200 ms more. */
.job-skel { overflow: hidden; }
.sk-line {
  height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--skel) 30%, var(--skel-hi) 50%, var(--skel) 70%);
  background-size: 300% 100%; animation: sk-sweep 1.4s ease-in-out infinite;
}
@keyframes sk-sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk-title { width: 62%; height: 20px; }
.sk-meta { width: 44%; }
.sk-badges { width: 36%; height: 24px; border-radius: 999px; }
.sk-sub { width: 28%; margin-top: auto; height: 12px; }

/* ---------- footer: load more ---------- */
.list-foot { display: grid; justify-items: center; min-height: 64px; padding: 4px 0 24px; }
.more-btn { width: min(100%, 360px); min-height: 44px; }
.foot-done, .foot-error { margin: 0; color: var(--muted); font-size: 13px; }
.foot-error { color: var(--red); }

/* ---------- filter panel contents (the shell is dialog.sheet-menu) ---------- */
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px 0; }
.menu-head h2 { margin: 0; font-size: 16px; }
.fp-body { padding: 0 16px 8px; }
.fp-group h3 { margin: 14px 0 8px; }
.fp-group .chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.fp-checks { display: grid; gap: 0; }
.fp-failed { margin: 0; color: var(--muted); font-size: 13px; }
.sheet-menu .sheet-foot { padding: 10px 16px; }
.menu-head .linkish:disabled { visibility: hidden; }

/* ---------- run log contents (the shell is dialog.sheet-wide) ---------- */
.runs-sub { margin-left: 10px; color: var(--muted); font-size: 13px; font-weight: 400; }
.runs-main { padding: 4px 20px 20px; }
.runs-legend { margin: 0 0 12px; }
.runs-empty, .runs-error { margin: 12px 0; }
.runs-error { color: var(--red); }
.runs-skel { display: grid; gap: 8px; }
.skel-run { height: 56px; border-radius: 10px; }
.run-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.run-item { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.run-head {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 56px; padding: 8px 12px; border: 0; border-radius: 0;
  background: transparent; color: var(--text); text-align: left;
}
.run-head:hover { background: var(--accent-soft); }
.run-head .caret { flex: none; transform: rotate(-90deg); color: var(--gray); }
.run-head[aria-expanded="true"] .caret { transform: none; }
.run-lead { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; }
.run-status { flex: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.run-status.tone-ok { color: var(--green); }
.run-status.tone-partial { color: var(--amber); }
.run-status.tone-failed { color: var(--red); }
.run-status.tone-aborted { color: var(--gray); }
.run-status.tone-running { color: var(--accent); }
.run-detail { padding: 0 12px 12px; border-top: 1px solid var(--line); }
.run-times { margin: 8px 0; color: var(--muted); font-size: 13px; }
.run-source {
  display: grid; grid-template-columns: minmax(0, 1fr) repeat(5, 3.8em); gap: 2px 8px; align-items: baseline;
  padding: 7px 0; border-top: 1px solid var(--line);
}
.run-source.head { border-top: 0; padding: 0 0 4px; color: var(--muted); font-size: 13px; }
.rs-name { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.run-source.head .rs-name { font-weight: 400; }
.rs-stat { text-align: right; font-variant-numeric: tabular-nums; }
.run-note { grid-column: 1 / -1; margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.run-note.error { color: var(--red); }
.run-note.capped { color: var(--amber); }

/* ---------- guide ---------- */
.guide { padding: 28px 22px; display: grid; justify-items: start; gap: 10px; }
.guide h2 { margin: 0; font-size: 20px; }
.guide p { margin: 0; max-width: 40em; }
.guide button.btn-lg { margin-top: 6px; }
.guide-icon { color: var(--accent); }
.guide-script { margin-top: 10px; }
.guide-details h3 { margin: 12px 0 4px; }
.guide-details ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: 13px; }

/* ---------- forms (condition dialog) ---------- */
.field { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.field > label, .field-title, .field > legend { display: block; margin: 0 0 4px; padding: 0; font-weight: 600; font-size: 14px; }
.field-hint { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.field-error { margin: 4px 0 0; color: var(--red); font-size: 13px; font-weight: 600; }
.field-error:empty { display: none; }
.field > input[type="text"] { width: 100%; flex: none; min-height: 44px; }
[aria-invalid="true"], .tag-input.invalid { border-color: var(--red) !important; }
.field-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.field-head-right { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; }

.tag-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; padding: 5px 8px; cursor: text;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
}
.tag-input:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.tag-input input { flex: 1 1 8em; width: auto; min-width: 6em; min-height: 32px; padding: 0 4px; border: 0; background: transparent; color: inherit; font: inherit; outline: none; }
.tag { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; padding-left: 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tag.dup { outline: 2px solid var(--accent); }
.tag-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-x { flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 12px; }
.tag-x:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }

.chips { display: grid; gap: 6px; }
.chip-group { display: grid; grid-template-columns: 4.2em minmax(0, 1fr); gap: 8px; align-items: start; }
.chip-group-label { padding-top: 9px; color: var(--muted); font-size: 13px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.chip { min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }

.checks { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

/* ---------- dialog.sheet: the shared shell of the condition editor, run log and filter panel ----------
   (the evidence dialog stays the plain padded box). Variants: sheet-full, sheet-wide, sheet-menu. */
dialog.sheet { padding: 0; overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet > form:first-child { position: absolute; top: 10px; right: 10px; z-index: 1; margin: 0; }
dialog.sheet .close { float: none; min-width: 40px; min-height: 40px; padding: 0; border-radius: 8px; }
.sheet-root { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.cond-form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.sheet-head { margin: 0; padding: 18px 60px 10px 20px; font-size: 18px; }
.sheet-main { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 4px 20px 8px; overscroll-behavior: contain; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--panel); }
dialog.sheet-full { width: min(560px, calc(100vw - 24px)); }
dialog.sheet-wide { width: min(720px, calc(100vw - 24px)); }
/* a dropdown under its button on a wide screen (opened non-modal), a bottom sheet on a phone (opened modal) */
dialog.sheet-menu {
  position: absolute; inset: calc(100% + 6px) auto auto 0; z-index: 16; /* above the notices (15), under the tab bar (20) */ width: min(480px, 100%); max-height: min(70vh, 640px);
  margin: 0; border-radius: 12px; box-shadow: var(--shadow);
}
.form-banner { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; background: var(--red-bg); color: var(--red); font-weight: 600; overflow-wrap: anywhere; }

/* every dialog fades and grows slightly in (the evidence dialog shares this) */
dialog[open] { animation: dlg-in 160ms ease-out; }
dialog[open]::backdrop { animation: fade-in 160ms ease-out; }
@keyframes dlg-in { from { opacity: 0; transform: scale(.98); } }

/* ---------- phone ---------- */
@media (max-width: 600px) {
  .status-panel { min-height: 0; }
  .status-row.main { flex-direction: column; align-items: stretch; gap: 10px; }
  .status-text { flex: 0 0 auto; min-height: 28px; } /* a column here: the text takes the height it needs (a 0 basis would let it spill over the buttons) */
  .status-lines { flex-direction: column; gap: 0; }
  .status-actions { display: grid; grid-template-columns: 1fr 1fr auto; }
  .status-actions button { padding-inline: 10px; }
  .status-row.sub { flex-wrap: wrap; }
  .runs-link { margin-left: auto; }
  .cond-head {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 10px 14px;
    grid-template-areas: "title title actions" "count summary summary";
  }
  .cond-title { grid-area: title; }
  .cond-count { grid-area: count; }
  .cond-head-summary { grid-area: summary; }
  .cond-head-actions { grid-area: actions; }
  .cond-row { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "sw main" "act act"; }
  .cond-actions { justify-self: end; }
  .skel-btn { width: 100%; }
  .skel-btn.compact { width: 84px; }
  .guide { padding: 22px 16px; }
  .guide button.btn-lg { width: 100%; }
  dialog.sheet-full {
    width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0;
  }
  .sheet-foot { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .sheet-foot button { flex: 1 1 0; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .skel::after, .sk-line, .status-dot.tone-accent, .spin { animation: none; }
  .caret, .collapse, .switch::before, .switch::after { transition: none; }
  dialog::backdrop, dialog[open]::backdrop { animation: none; } /* the global * rule does not reach ::backdrop */
}

/* first paint of a #/watch address: show that view at once (removed by main.js; see index.html) */
html.boot-watch #view-search { display: none !important; }
html.boot-watch #view-watch[hidden] { display: block !important; }
.guide-script .linkish { min-height: 0; padding: 0 4px; }

/* ---------- job list on a phone ---------- */
@media (max-width: 600px) {
  .view-chips { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .view-chip { min-width: 0; padding: 0 4px; }
  .vc-long { display: none; }
  .vc-count { margin-left: 4px; }
  .list-controls { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filter-btn { width: 100%; }
  .sort-field { min-width: 0; }
  .sort-field select { flex: 1 1 0; min-width: 0; }
  .more-btn { width: 100%; }
  .state-actions button { flex: 1 1 40%; }
  /* the filter panel becomes a sheet from the bottom edge (opened modal, so it has a backdrop) */
  dialog.sheet-menu {
    position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 85dvh;
    border-width: 1px 0 0; border-radius: 16px 16px 0 0;
  }
  dialog.sheet-menu[open] { animation: sheet-in 220ms ease-out; }
  .sheet-menu .sheet-foot { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .sheet-menu .sheet-foot button { width: 100%; min-height: 44px; }
  dialog.sheet-wide { width: calc(100vw - 16px); max-height: 92dvh; }
  .runs-main { padding: 4px 14px 16px; }
  /* one DOM, two layouts: the table row turns into "name / 請求 12 · 取得 48 · ..." */
  .run-source { display: flex; flex-wrap: wrap; gap: 0 4px; }
  .run-source.head { display: none; }
  .rs-name { flex: 1 0 100%; }
  .rs-stat { text-align: left; }
  .rs-stat::before { content: attr(data-label) " "; color: var(--muted); }
  .rs-stat:not(:last-of-type)::after { content: " ·"; color: var(--muted); }
  .run-note { flex: 1 0 100%; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }

@media (prefers-reduced-motion: reduce) {
  .job.fresh, .job-list.swap-in, .float-notice { animation: none; }
  dialog.sheet-menu[open] { animation: none; }
}

/* ======================================================================
   R38 new look: greeting, skills, tiers, cards, detail panel
   ====================================================================== */

/* ---------- shared marks (badges.js): tier tag, warning, skill chips, caution strip ---------- */
.tag-mark { display: inline-block; max-width: 100%; padding: 0 10px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 700; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mark-great { background: var(--green-bg); color: var(--green); }
.mark-good { background: var(--amber-bg); color: var(--amber); }
.mark-warn { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber); line-height: 20px; }
.mark-warn::before { content: "! "; font-weight: 800; }
.mark-blocked { background: var(--red-bg); color: var(--red); }
.job-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.job-skills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; min-width: 0; }
.skill-chip { max-width: 100%; padding: 1px 10px; border-radius: var(--radius-sm); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-match { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.skill-match::before { content: "✓ "; }
.skill-missing { border: 1px dashed var(--muted); color: var(--muted); }
.skill-plain { background: var(--gray-bg); color: var(--gray); }
.skill-more, .skill-none { color: var(--muted); font-size: var(--fs-sm); }
.warn-strip { margin: 8px 0 0; padding: 4px 10px; border-radius: var(--radius-md); background: var(--amber-bg); color: var(--amber); font-size: var(--fs-sm); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.warn-red { color: var(--red); }
.warn-strip.warn-red { background: var(--red-bg); }
.ring { --p: 0; flex: none; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%;
  background: conic-gradient(var(--ring-c, var(--gray)) calc(var(--p) * 1%), var(--ring-track) 0); }
.ring span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--panel); color: var(--text); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ring-great { --ring-c: var(--great-solid); }
.ring-good { --ring-c: var(--good-solid); }
.ring-none { --ring-c: var(--gray); }
.ring-slot[hidden] { display: none; }

/* ---------- the card (auto-collect extras) ---------- */
.job-top { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.job-main { flex: 1 1 0; min-width: 0; }
.job.is-collect .job-title {
  display: block; max-width: 100%; margin: 2px 0 0; padding: 0; border: 0; border-radius: 0; background: none; text-align: left;
  font: inherit; font-size: var(--fs-lg); font-weight: 700; line-height: 1.4; color: var(--text); cursor: pointer;
  overflow: hidden; overflow-wrap: anywhere;
}
.job.is-collect .job-title:hover { color: var(--accent); text-decoration: none; }
.job.is-collect .job-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.job.is-collect { cursor: default; }
.job.tier-great { border-color: var(--great-line); }
.job.tier-good { border-color: var(--good-line); }
.job-pay { margin: 10px 0 0; font-size: 16px; font-weight: 700; color: var(--green); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-pay.is-muted { color: var(--muted); font-weight: 600; }
.job-hits { margin-top: 10px; }
.job-hits:empty { display: none; }
.job-warn:empty { display: none; }
.job-sub { margin-top: auto; padding-top: 10px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.act-btn {
  min-height: var(--control-h-sm); padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--panel); color: var(--text); font-size: var(--fs-sm);
}
.act-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.act-btn.star[aria-pressed="true"] { color: var(--amber); border-color: var(--amber); background: var(--amber-bg); }
.job.is-hidden-job .restore { border-color: var(--accent); color: var(--accent); }

/* ---------- greeting ---------- */
.hello { display: grid; gap: 4px; min-height: 160px; padding: 4px 2px 10px; align-content: start; }
.hello-date { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.hello-title { margin: 0; font-size: var(--fs-hero); line-height: 1.3; overflow-wrap: anywhere; }
.hello-lead { margin: 0; color: var(--muted); min-height: 24px; }
.hello-stats { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); min-height: 44px; }
.stat-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line);
  border-radius: var(--radius-pill); background: var(--panel); color: var(--text);
}
.stat-chip b { color: var(--accent); font-size: 18px; font-variant-numeric: tabular-nums; }
.stat-chip:hover { border-color: var(--accent); }
.stat-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.hello-problem { margin: 6px 0 0; color: var(--amber); font-size: var(--fs-sm); }
.hello-problem:empty { display: none; }
.skel-hello-date { width: 120px; }
.skel-hello-title { width: min(80%, 420px); height: 34px; }
.skel-hello-lead { width: min(90%, 520px); height: 24px; }
.skel-stat { width: 128px; height: 44px; border-radius: var(--radius-pill); }

/* ---------- skills ---------- */
.skills { padding: 16px 20px; border-radius: var(--radius-lg); box-shadow: var(--card-shadow); min-height: 190px; }
.skills-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.skills-head .skills-title { margin: 0; }
.skills-edit { flex: none; }
.skills-summary { margin: 8px 0 0; }
.sum-skills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sum-chip { font-size: 14px; padding: 2px 12px; }
.sum-facts { display: flex; flex-wrap: wrap; gap: 2px 18px; margin: 8px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.skills-editor { margin-top: 8px; }
.skills-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 0; }
.skills-feedback:empty { display: none; }
.skills-error { margin: 6px 0 0; color: var(--red); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.skills-error:empty { display: none; }
.skills-title { margin: 0 0 4px; font-size: 18px; }
.skills-lead { margin: 0 0 14px; color: var(--muted); }
.skills .field { margin: 0; }
.skills .field > label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skills .tag-input { min-height: 60px; padding: 8px 12px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--bg); gap: 8px; }
.skills .tag-input:focus-within { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.skills .tag-input input { min-height: 40px; font-size: 17px; }
.skills .tag { padding-left: 14px; background: var(--accent); color: var(--accent-text); font-size: 15px; font-weight: 600; }
.skills .tag-x:hover { background: rgba(255, 255, 255, .25); }
.skills-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; min-height: 36px; }
.skills-suggest[hidden] { display: none; }
.sg-label { color: var(--muted); font-size: var(--fs-sm); }
.sg-chip { min-height: var(--control-h-sm); padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--panel); color: var(--accent); font-size: 14px; }
.sg-chip:hover { background: var(--accent-soft); border-color: var(--accent); }
.skills-unknown { margin: 8px 0 0; }
.skills-unknown[hidden] { display: none; }
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin: 16px 0 0; padding: 0; list-style: none; }
.steps li { padding: 12px 14px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); font-size: 14px; }
.steps b { display: block; color: var(--text); font-size: var(--fs-base); }
.steps em { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 6px; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-style: normal; font-size: var(--fs-sm); }
.steps[hidden] { display: none; }
.skills-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px; margin-top: 16px; }
.opt { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.opt label, .opt-label { color: var(--muted); font-size: 14px; }
.skills .salary-input { flex: none; width: 120px; min-height: 40px; padding: 0 12px; text-align: right; font: inherit; color: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.opt-unit { color: var(--muted); font-size: 14px; }
.region-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--panel); color: var(--text); font-size: 14px; max-width: 100%; }
.region-toggle > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-toggle:hover { border-color: var(--accent); }
.skills-saved { color: var(--green); font-size: var(--fs-sm); font-weight: 600; }
.skills-saved:empty { display: none; }
.skills-saved.is-unsaved { color: var(--amber); }
.skills-saved .retry-btn { min-height: 36px; margin-left: 10px; padding: 0 14px; font-size: var(--fs-sm); }
.region-body .collapse-inner { padding-top: 10px; }
.skel-skills-edit { width: 76px; height: 44px; border-radius: var(--radius-sm); }
.skel-skills-box { height: 56px; margin-top: 8px; border-radius: var(--radius); }

/* ---------- segmented controls (tiers, pay, schedule mode) ---------- */
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius); background: var(--seg-bg); }
.seg button, .seg .mode-btn {
  min-height: 40px; padding: 0 16px; border: 0; border-radius: var(--radius-md); background: none; color: var(--text);
  font-weight: 600; white-space: nowrap;
}
.seg button small { margin-left: 4px; font-weight: 500; font-variant-numeric: tabular-nums; }
.seg button:hover:not(:disabled):not([aria-pressed="true"]) { background: var(--accent-soft); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--accent); box-shadow: 0 1px 4px rgba(16, 24, 40, .18); }
.seg button:disabled { opacity: 1; cursor: default; }
.seg.sm button { min-height: 36px; padding: 0 11px; font-size: 13.5px; font-weight: 500; }
.tier-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin: 8px 0 4px; }
.tier-seg[hidden] { display: none; }
.pay-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: var(--fs-sm); }
.sw { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; color: var(--text); font-size: var(--fs-sm); cursor: pointer; }
.sw input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sw i { position: relative; flex: none; width: 38px; height: 22px; border-radius: var(--radius-pill); background: var(--switch-off); transition: background-color 120ms; }
.sw i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 120ms; }
.sw input:checked + i { background: var(--accent); }
.sw input:checked + i::after { transform: translateX(16px); }
.sw input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw.is-off { color: var(--muted); cursor: default; }
.sw.is-off i { opacity: .5; }
.neg-extra { color: var(--muted); }
.list-sub { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.list-area.is-updating .job-list { opacity: .6; transition: opacity 120ms; }
.list-toolbar { gap: 4px; }
.view-chip { min-width: 0; min-height: 36px; padding: 0 12px; font-size: 13.5px; }

/* ---------- card grid ---------- */
.list-area .job-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 14px; }
.list-area .job-list > .stale-sep { grid-column: 1 / -1; }

/* ---------- status bar: settings block, 104 search, schedule ---------- */
#status-more .schedule-panel { margin-bottom: 12px; }
#status-more .collapse-inner > #watch-conditions { margin-bottom: 12px; }
.status-row.s104 { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 8px 14px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.skills .status-row.s104 { margin-top: 10px; }
.s104-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.skill-pick { min-height: 40px; max-width: 100%; padding: 0 10px; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.s104-text { flex: 1 1 260px; min-width: 0; display: grid; gap: 2px; }
.s104-text p { margin: 0; }
.s104-result:empty { display: none; }
.s104-link { color: var(--accent); margin-left: 6px; }
.skel-s104-note { width: min(60%, 360px); }
.s104-skel { width: 190px; height: 40px; }
.interval { row-gap: 8px; }
.mode-seg button { min-height: 32px; padding: 0 12px; font-size: 13px; }
.daily-group, .interval-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.daily-group[hidden], .interval-group[hidden] { display: none; }
#daily-time { min-height: 38px; padding: 0 8px; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ---------- detail panel (detail-panel.js) ---------- */
.detail {
  position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(var(--detail-w), 100vw); display: flex; flex-direction: column;
  background: var(--panel); color: var(--text); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  animation: detail-in 160ms ease-out;
}
@keyframes detail-in { from { opacity: 0; transform: translateX(24px); } }
@media (min-width: 1100px) {
  html.detail-open body { padding-right: var(--detail-w); }
}
@media (max-width: 1099.98px) {
  .detail { z-index: 50; width: 100vw; height: 100dvh; border-left: 0; box-shadow: none; animation-name: detail-up; }
  .detail-close { display: none; }
}
@keyframes detail-up { from { opacity: 0; transform: translateY(16px); } }
/* a toast that is still up when the full-screen panel opens must not cover the panel's buttons */
@media (max-width: 1099.98px) {
  html.detail-open .toast { bottom: calc(max(16px, env(safe-area-inset-bottom)) + 120px); }
}
.detail-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.detail-back { min-height: 44px; padding: 0 10px; border: 0; background: none; color: var(--accent); font-weight: 600; }
.detail-back:hover { text-decoration: underline; }
.detail-close { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 16px; }
.detail-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px 18px 24px; overscroll-behavior: contain; }
.detail-foot {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--panel);
}
.detail-foot .open-original { flex: 2 1 0; min-width: 0; text-align: center; }
.detail-foot > button { flex: 1 1 0; min-width: 0; padding-inline: 8px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.detail-foot button[aria-pressed="true"] { color: var(--amber); border-color: var(--amber); }
.detail-foot button[aria-pressed="true"] svg { fill: currentColor; }
.d-head { display: grid; gap: 8px; }
.d-title { margin: 0; font-size: 20px; line-height: 1.35; overflow-wrap: anywhere; }
.d-meta { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.d-sec { margin-top: 22px; }
.d-sec h3 { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.d-sub { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.d-note { margin: 0; font-size: 14px; }
.d-score { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; color: var(--muted); }
.d-score strong { color: var(--text); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.seg-bar { display: flex; height: 12px; overflow: hidden; border-radius: 6px; background: var(--ring-track); }
.seg-bar .part { flex: 1 1 0; min-width: 0; }
.seg-bar .part-skill { background: var(--seg-skill); }
.seg-bar .part-salary { background: var(--seg-salary); }
.seg-bar .part-region { background: var(--seg-region); }
.seg-bar .part-company { background: var(--seg-company); }
.seg-bar .part-rest { background: transparent; }
.seg-legend { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 8px; margin: 10px 0 0; padding: 0; list-style: none; text-align: center; }
.seg-legend b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; }
.seg-legend span { color: var(--muted); font-size: var(--fs-sm); }
.seg-legend .lg::before { content: ""; display: block; height: 4px; margin: 0 auto 6px; width: 24px; border-radius: 2px; }
.lg-skill::before { background: var(--seg-skill); }
.lg-salary::before { background: var(--seg-salary); }
.lg-region::before { background: var(--seg-region); }
.lg-company::before { background: var(--seg-company); }
.reasons { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; font-size: 14px; }
.reasons li { display: flex; gap: 8px; }
.reasons li::before { flex: none; width: 1em; font-weight: 800; text-align: center; }
.reasons .ok::before { content: "✓"; color: var(--green); }
.reasons .no::before { content: "✗"; color: var(--red); }
.reasons .na::before { content: "–"; color: var(--muted); }
.d-pay { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--green); overflow-wrap: anywhere; }
.ruler { margin: 30px 8px 0; }
.ruler-track { position: relative; height: 10px; border-radius: 5px; background: var(--ring-track); }
.ruler-range { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: var(--accent); }
.ruler-range.is-open { background: linear-gradient(90deg, var(--accent), transparent); border-radius: 5px 0 0 5px; }
.ruler-marker { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--red); }
.ruler-label { position: absolute; bottom: 100%; transform: translateX(-50%); margin-bottom: 8px; color: var(--red); font-size: var(--fs-xs); font-style: normal; font-weight: 700; white-space: nowrap; }
.ruler-ticks { position: relative; height: 20px; margin-top: 6px; color: var(--muted); font-size: 11.5px; }
.ruler-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.d-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; }
.d-text.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; line-clamp: 6; overflow: hidden; }
.d-source { margin: 22px 0 0; color: var(--muted); font-size: var(--fs-xs); }

/* ---------- 390px ---------- */
@media (max-width: 600px) {
  .hello { min-height: 178px; }
  .hello-title { font-size: 22px; }
  .stat-chip { padding: 0 12px; }
  .skills { padding: 14px; min-height: 230px; }
  .steps { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .tier-bar { align-items: stretch; flex-direction: column; gap: 10px; }
  .tier-seg { display: flex; }
  .tier-seg button { flex: 1 1 0; padding: 0 4px; font-size: 14px; }
  .pay-filter { display: grid; gap: 6px; }
  .pay-filter .seg { display: flex; }
  .pay-filter .seg button { flex: 1 1 0; padding: 0; }
  .list-sub { display: grid; gap: 8px; }
  .list-area .job-list { grid-template-columns: minmax(0, 1fr); }
  .job { padding: 14px; }
  .job-top { gap: 12px; }
  .ring { width: 48px; height: 48px; }
  .ring span { width: 37px; height: 37px; font-size: 14px; }
  .s104-controls { width: 100%; }
  .s104-controls > button { flex: 1 1 auto; }
  .mode-seg { display: flex; }
  .mode-seg button { flex: 1 1 0; }
  .detail-foot .open-original { flex: 1 1 100%; }
  .skills-saved .retry-btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .detail { animation: none; }
  .sw i, .sw i::after { transition: none; }
  .list-area.is-updating .job-list { transition: none; }
}

/* ===== Account chip in the main page's header =====
   The header becomes one row (title left, account right) only when it holds the account area, so a page without it is
   untouched. Heights match the plain header (h1 line + 10px margin), so showing the chip moves nothing. */
.top:has(> .account) { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; }
.top:has(> .account) h1 { margin: 0; }
.account { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--muted); }
.account-email { min-width: 0; max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-link {
  display: inline-flex; align-items: center; flex: 0 1 auto; min-width: 0; min-height: 36px; padding: 0 12px;
  color: var(--accent); text-decoration: none; border: 1px solid var(--line); border-radius: 8px;
}
.account-link:hover, .account-link[aria-current="page"] { background: var(--accent-soft); }
.account-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.account-out {
  flex: none; min-height: 36px; padding: 0 12px; font: inherit; font-size: 13px; cursor: pointer;
  background: transparent; color: var(--accent); border: 1px solid var(--line); border-radius: 8px;
}
.account-out:hover:not(:disabled) { background: var(--accent-soft); }
.account-out:disabled { opacity: .55; cursor: default; }
.account-out:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 480px) {
  .account-email { max-width: 16ch; }
  .account-out, .account-link { min-height: 40px; }
}

/* ===== Account page (#/account): passkey devices =====
   Same tokens, .panel, .badge, .form-banner and the inline delete confirmation (.cond-confirm) as the other pages. */
.acct-head { padding: 8px 0 4px; }
.acct-back { display: inline-flex; align-items: center; min-height: 40px; color: var(--accent); font-size: 14px; text-decoration: none; }
.acct-back:hover { text-decoration: underline; }
.acct-title { margin: 0; font-size: var(--fs-xl); }
.acct-who { min-height: 21px; margin: 4px 0 12px; overflow-wrap: anywhere; }
.pk-panel { padding: 16px; }
.pk-title { margin: 0 0 4px; font-size: 16px; color: var(--text); }
.pk-intro { margin: 0 0 12px; }
.pk-note { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--blue-bg); color: var(--blue); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
#pk-error, #pk-info { margin: 0 0 12px; }
.pk-info { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--green-bg); color: var(--green); font-weight: 600; overflow-wrap: anywhere; }
.pk-only { margin-top: 2px; color: var(--muted); font-size: 13px; }
.pk-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.pk-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.pk-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; min-height: 64px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pk-item:last-child { border-bottom: 0; }
.pk-main { min-width: 0; }
.pk-nameline { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pk-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pk-nameline .badge { flex: none; }
.pk-meta { display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: 2px; color: var(--muted); font-size: 13px; }
.pk-actions { display: flex; gap: 8px; }
.pk-item.confirming .pk-confirm, .pk-item.renaming .pk-rename { grid-column: 1 / -1; }
.pk-item.confirming .pk-main { grid-column: 1 / -1; }
.pk-confirm { grid-area: auto; }
.pk-rename { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pk-rename-input { flex: 1 1 200px; min-width: 0; }
.pk-empty { display: flex; flex-direction: column; gap: 2px; padding: 14px 12px; color: var(--muted); font-size: 14px; }
.pk-empty strong { color: var(--text); }

.pk-add { margin-top: 16px; }
.pk-add-label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.pk-add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pk-add input, .pk-rename-input, .smtp-field input, .smtp-field select {
  min-height: var(--control-h); padding: 9px 12px; font: inherit; font-size: 16px; color: inherit;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.pk-add input { flex: 1 1 220px; min-width: 0; }
.pk-add-row button { min-height: var(--control-h); }

.pk-retry { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-height: 64px; color: var(--red); }
.pk-retry span { flex: 1 1 18em; min-width: 0; overflow-wrap: anywhere; }
.pk-loading { position: relative; }
.pk-skel-row { height: 66px; border-radius: var(--radius-md); }
.pk-skel-add { height: 76px; margin-top: 16px; border-radius: var(--radius-md); }

/* the "check with your passkey" dialog: a small plain dialog */
dialog.pk-dialog { width: min(440px, calc(100vw - 24px)); }
.pk-dialog-title { margin: 0 44px 8px 0; font-size: 18px; }
.pk-dialog-text { margin: 0 0 14px; font-size: 14.5px; line-height: 1.6; }
.pk-dialog .form-banner { margin-bottom: 12px; }
.pk-dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* SMTP settings (same panel, inputs and inline confirmation as the passkey list) */
#acct-amr-note { margin: 0 0 12px; }
#smtp-link-status, #smtp-error, #smtp-info { margin: 0 0 12px; }
.smtp-skel { display: block; height: 442px; border-radius: var(--radius-md); } /* about the height of the form, so the page does not jump when it arrives */
.smtp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.smtp-field { min-width: 0; }
.smtp-wide { grid-column: 1 / -1; }
.smtp-field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.smtp-field input, .smtp-field select { display: block; width: 100%; min-width: 0; }
.smtp-field select { appearance: auto; cursor: pointer; }
.smtp-fhelp { margin: 4px 0 0; font-size: 12.5px; line-height: 1.5; overflow-wrap: anywhere; }
.smtp-help { margin: 8px 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.smtp-confirm-slot:not(:empty) { margin-top: 12px; }
.smtp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.smtp-actions button { min-height: var(--control-h); }
.smtp-clear { margin-left: auto; color: var(--danger); border-color: var(--line); }
.smtp-clear:hover:not(:disabled) { background: var(--red-bg); }

@media (max-width: 600px) {
  .pk-panel { padding: 14px 12px; }
  .pk-item { grid-template-columns: minmax(0, 1fr); }
  .pk-actions { justify-self: stretch; }
  .pk-actions button { flex: 1 1 0; min-height: 44px; }
  .pk-rename button { flex: 1 1 0; min-height: 44px; }
  .pk-add-row button { flex: 1 1 100%; }
  .pk-confirm .cond-confirm-buttons { width: 100%; }
  .pk-confirm .cond-confirm-buttons button { flex: 1 1 0; min-height: 44px; }
  .pk-dialog-actions button { flex: 1 1 100%; }
  .smtp-grid { grid-template-columns: minmax(0, 1fr); }
  .smtp-skel { height: 797px; }
  .smtp-actions button { flex: 1 1 100%; }
  .smtp-clear { margin-left: 0; }
  .smtp-confirm .cond-confirm-buttons { width: 100%; }
  .smtp-confirm .cond-confirm-buttons button { flex: 1 1 0; min-height: 44px; }
}
/* script tokens: the plain text is shown once, so the box is loud (amber, same pair as the .badge.caution) */
#tok-error, #tok-info, #ses-error { margin: 0 0 12px; }
.tok-sub { margin: 20px 0 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.tok-secret { margin: 0 0 16px; padding: 12px; border: 2px solid var(--amber); border-radius: var(--radius-md); background: var(--amber-bg); }
.tok-secret[hidden] { display: none; }
.tok-secret-warn { margin: 0 0 10px; color: var(--amber); font-size: 15px; font-weight: 700; line-height: 1.5; overflow-wrap: anywhere; }
.tok-secret-row { display: flex; flex-wrap: wrap; gap: 8px; }
/* (.tok-secret in front: input[type="text"] above is more specific than one class, and its `font: inherit` would win) */
.tok-secret .tok-secret-input {
  flex: 1 1 260px; min-width: 0; min-height: var(--control-h); padding: 9px 12px; color: var(--text); background: var(--panel);
  font: 16px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; border: 1px solid var(--amber); border-radius: var(--radius-sm);
}
.tok-secret-row button { min-height: var(--control-h); }
.tok-secret-status { min-height: 21px; margin: 8px 0 0; color: var(--text); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.tok-secret-help { margin: 4px 0 0; color: var(--text); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.tok-secret-actions { display: flex; gap: 8px; margin-top: 10px; }
.tok-secret-actions button { min-height: var(--control-h); }

/* signed-in devices */
/* skeletons: about what a typical list is (one token, this device + one more, a few log rows), so the page does not jump when it arrives */
.tok-skel-row { height: 70px; border-radius: var(--radius-md); }
.ses-skel-row { height: 138px; border-radius: var(--radius-md); }
.ses-skel-foot { height: 44px; margin-top: 12px; border-radius: var(--radius-sm); }
.ses-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.ses-foot[hidden] { display: none; }
.ses-confirm-slot { flex: 1 1 100%; }
.ses-confirm-slot:empty { display: none; }
.ses-foot button { min-height: var(--control-h); }
.ses-others-help { flex: 1 1 14em; min-width: 0; margin: 0; overflow-wrap: anywhere; }

/* sign-in log: one row per event; the security-related ones carry an amber bar and ground */
.ev-skel { height: 274px; border-radius: var(--radius-md); }
.ev-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.ev-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 15.5em); gap: 4px 16px; align-items: start; min-height: 56px; padding: 10px 12px 10px 9px; border-left: 3px solid transparent; border-bottom: 1px solid var(--line); }
.ev-item:last-child { border-bottom: 0; }
.ev-item.security { border-left-color: var(--amber); background: var(--amber-bg); }
.ev-main, .ev-meta { min-width: 0; }
.ev-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ev-label { font-weight: 600; overflow-wrap: anywhere; }
.ev-item.security .ev-label { color: var(--amber); }
.ev-item.failed .ev-label { color: var(--red); } /* after the line above: a failed security event is red (it also carries the 失敗 badge, so it is not colour alone) */
.ev-note { margin-top: 2px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ev-item.security .ev-note, .ev-item.security .ev-meta { color: var(--text); }
.ev-meta { display: flex; flex-direction: column; gap: 2px; color: var(--muted); font-size: 13px; }
.ev-time, .ev-where { overflow-wrap: anywhere; }
.ev-more { margin-top: 12px; }
.ev-more[hidden] { display: none; }

@media (max-width: 600px) {
  .tok-secret-row button, .tok-secret-actions button { flex: 1 1 100%; }
  .tok-secret .tok-secret-input { flex-basis: 100%; }
  .ses-foot button { flex: 1 1 100%; }
  .tok-skel-row { height: 142px; }
  .ses-skel-row { height: 190px; }
  .ses-skel-foot { height: 73px; }
  .ev-skel { height: 349px; }
  .ev-item { grid-template-columns: minmax(0, 1fr); }
  .ev-meta { flex-direction: row; flex-wrap: wrap; gap: 0 12px; }
  .ev-more { width: 100%; min-height: 44px; }
}
html.boot-account #view-search { display: none !important; }
html.boot-account #view-account[hidden] { display: block !important; }
/* the footer is about job-listing hints: not shown on the account page */
:root:has(#view-account:not([hidden])) footer, html.boot-account footer { display: none; }
