:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #17202a;
  --muted: #62707f;
  --line: #dce2e8;
  --brand: #0b5b66;
  --brand-dark: #073f47;
  --accent: #dff3f1;
  --danger: #9e2a2b;
  --warning: #7a4e00;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 "Segoe UI", system-ui, sans-serif; }
a { color: var(--brand); }
.site-header { display: flex; justify-content: space-between; align-items: center; padding: 15px max(24px, calc((100vw - 1180px)/2)); background: #102d35; color: white; }
.site-header a, .link-button { color: white; text-decoration: none; }
.brand { font-weight: 750; letter-spacing: .2px; }
nav { display: flex; gap: 22px; align-items: center; }
.container { max-width: 1180px; margin: 0 auto; padding: 32px 24px 64px; }
.feature-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.feature-card { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); text-decoration: none; box-shadow: 0 2px 8px rgba(16,45,53,.04); transition: border-color .16s ease, transform .16s ease; }
.feature-card:hover, .feature-card:focus-visible { border-color: var(--brand); transform: translateY(-1px); }
.feature-card strong, .feature-card small { display: block; }
.feature-card small { margin-top: 4px; color: var(--muted); line-height: 1.35; }
.feature-icon { flex: 0 0 auto; font-size: 1.45rem; line-height: 1; }
.feature-card-disabled { cursor: default; opacity: .72; }
.feature-card-disabled:hover { border-color: var(--line); transform: none; }
.hero { background: linear-gradient(135deg, #0e5360, #123943); color: white; padding: 32px; border-radius: 16px; margin-bottom: 24px; }
.hero.compact { padding: 24px 28px; }
.hero h1 { margin: 0 0 20px; line-height: 1.2; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
input, select, textarea, button { font: inherit; }
input[type="search"], input[type="password"], input[type="text"], select, textarea { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); }
button { border: 0; border-radius: 8px; padding: 11px 17px; background: var(--brand); color: white; cursor: pointer; font-weight: 650; }
button:hover { background: var(--brand-dark); }
.hero button { background: white; color: var(--brand-dark); }
.source-options { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 15px; }
.result-limit { display: flex; align-items: center; gap: 10px; width: max-content; margin-top: 16px; font-weight: 650; }
.result-limit select { width: auto; padding: 7px 30px 7px 10px; }
.result-menu { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 12px 14px; margin-bottom: 18px; background: white; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 3px 12px rgba(16,45,53,.08); }
.result-menu a { padding: 5px 9px; background: var(--accent); border-radius: 999px; text-decoration: none; }
.result-menu a span { font-weight: 750; }
.emcrit-access-bar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 18px; margin: 0 0 24px; background: #e8f0fe; border: 1px solid #bfd2f7; border-radius: 12px; }
.emcrit-access-bar span { color: var(--muted); }
.media-section { scroll-margin-top: 20px; margin: 30px 0; }
.section-heading h2 { margin-bottom: 2px; }
.section-heading p, .form-help { color: var(--muted); }
.media-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.tool-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: 0 4px 14px rgba(16,45,53,.05); }
.tool-card h3 { margin: 12px 0 4px; font-size: 1.3rem; }
.tool-icon { display: inline-grid; place-items: center; min-width: 52px; height: 40px; padding: 0 10px; border-radius: 10px; background: var(--accent); color: var(--brand-dark); font-weight: 800; }
.tool-card label { display: block; margin: 13px 0; font-weight: 650; }
.tool-card label input, .tool-card label textarea, .tool-card label select { display: block; margin-top: 5px; font-weight: 400; }
.tool-card input[type="file"] { width: 100%; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; background: var(--bg); }
.form-row-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-help { margin: -4px 0 14px; font-size: .9rem; }
.recent-jobs { background: #eef3f5; border-radius: 12px; padding: 16px 20px; margin-top: 18px; }
.recent-jobs h3 { margin: 0 0 8px; }
.recent-jobs ul { list-style: none; padding: 0; margin: 0; }
.recent-jobs li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.recent-jobs li:last-child { border: 0; }
.job-page { max-width: 900px; margin: 0 auto; }
.job-header, .result-title-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.job-header h1 { margin: 10px 0 18px; }
.job-status { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #e9edf0; color: var(--muted); font-size: .85rem; font-weight: 700; }
.status-completed { background: #dff4e6; color: #1e6840; }
.status-running, .status-queued { background: #fff1c9; color: #735000; }
.status-failed { background: #f9dddd; color: var(--danger); }
.processing-panel { display: flex; align-items: center; gap: 20px; }
.processing-panel h2 { margin-bottom: 3px; }
.spinner { width: 36px; height: 36px; flex: 0 0 auto; border: 4px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-panel { border-left: 5px solid var(--danger); }
.transcript { white-space: pre-wrap; max-height: 65vh; overflow: auto; padding: 18px; background: var(--bg); border-radius: 8px; line-height: 1.75; }
audio { width: 100%; margin: 12px 0; }
.download-button { display: inline-block; padding: 9px 14px; border-radius: 8px; background: var(--brand); color: white; text-decoration: none; font-weight: 650; }
.chrome-button { background: #2f6fdb; }
.chrome-button:hover { background: #1f55ad; }
.browser-confirmation { text-align: center; }
.status-grid { display: grid; gap: 8px; margin-bottom: 20px; }
.status { padding: 10px 14px; background: white; border-left: 4px solid var(--brand); border-radius: 6px; }
.status.failed { border-color: var(--danger); }
.status a { float: right; }
.evidence, .panel { background: var(--card); padding: 22px; border: 1px solid var(--line); border-radius: 12px; margin: 20px 0; }
.evidence h2, .panel h2 { margin-top: 0; }
.warning { color: var(--warning); font-weight: 600; }
.evidence-counts { display: flex; flex-wrap: wrap; gap: 8px; }
.evidence-counts span, .badge { background: var(--accent); color: var(--brand-dark); padding: 4px 9px; border-radius: 999px; font-size: .88rem; }
.source-group { margin: 34px 0; scroll-margin-top: 80px; }
.result-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin: 12px 0; box-shadow: 0 2px 8px rgba(16,45,53,.04); }
.result-card h2, .result-card h3 { margin: 9px 0 4px; line-height: 1.3; }
.result-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); font-size: .9rem; }
.byline { color: var(--muted); margin-top: 4px; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.inline-form { display: inline; margin: 0; }
.link-button { padding: 0; background: transparent; font-weight: 400; }
.library-search { display: grid; grid-template-columns: minmax(260px, 1fr) 180px 150px auto; gap: 10px; }
.item-page > h1 { line-height: 1.2; }
.panel label { display: block; margin: 14px 0; font-weight: 600; }
.panel label input, .panel label textarea { display: block; margin-top: 5px; font-weight: 400; }
.file-list { padding-left: 20px; }
.login-card { max-width: 460px; margin: 80px auto; padding: 30px; background: white; border-radius: 14px; border: 1px solid var(--line); }
.login-card label { display: grid; gap: 6px; margin: 18px 0; }
.error { color: var(--danger); font-weight: 650; }
.empty { padding: 30px; text-align: center; color: var(--muted); }
.snippet mark { background: #ffe783; padding: 1px 2px; }
footer { text-align: center; color: var(--muted); padding: 24px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .site-header { align-items: flex-start; gap: 12px; }
  nav { gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-row, .library-search { grid-template-columns: 1fr; }
  .media-grid, .form-row-two { grid-template-columns: 1fr; }
  .emcrit-access-bar { align-items: flex-start; flex-direction: column; }
  .status a { float: none; display: block; }
}
@media (max-width: 480px) {
  .feature-grid { grid-template-columns: 1fr; }
}
