/* Titillium Web, self-hosted (latin subset) — no request to fonts.gstatic.com.
   Files under static/fonts/; refreshed from the Google Fonts css2 API. */
@font-face {
  font-family: "Titillium Web";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/titillium-web-400.woff2") format("woff2");
}
@font-face {
  font-family: "Titillium Web";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/titillium-web-600.woff2") format("woff2");
}
@font-face {
  font-family: "Titillium Web";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/titillium-web-700.woff2") format("woff2");
}

:root {
  --paper:#f4f4eb; --surface:#ffffff; --ink:#3d3d3d; --muted:#5a5a4f;
  --line:#e3ddca; --sand-bg:#eeeade;
  --blue:#003b75; --blue-2:#005cad; --blue-bg:#e3ecf5;
  --ok:#1f7a4d; --ok-bg:#e0efe6; --warn:#8a6d1f; --warn-bg:#f1ebd6;
  --bad:#b23b30; --bad-bg:#f4e3df;
  --font:"Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue-2); text-decoration: none; }
a:hover { color: var(--blue); text-decoration: underline; }
h1 { font-weight: 700; font-size: 28px; margin: 0; color: var(--blue); letter-spacing: -.2px; }
h2 { font-weight: 700; font-size: 18px; margin: 0; }

/* ---- top bar ---- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 48px; border-bottom: 3px solid var(--blue); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; color: var(--blue); }
.brand:hover { text-decoration: none; }
.brand img { width: 26px; height: 26px; display: block; border-radius: 3px; }
.id { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
}
.id-name { color: var(--ink); font-weight: 600; }
.id-sep { width: 1px; height: 18px; background: var(--line); }
.id form { display: inline; margin: 0; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 32px 48px 56px; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px;
  font-weight: 600; padding: 9px 16px; border-radius: 3px; border: 1px solid transparent;
  cursor: pointer; line-height: 1; text-decoration: none;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-2); color: #fff; text-decoration: none; }
.btn-primary[disabled], .btn-primary[aria-disabled="true"] { opacity: .55; cursor: default; }
.btn-ghost { background: #fff; color: var(--blue-2); border-color: #c9d6e4; }
.btn-ghost:hover { border-color: var(--blue-2); color: var(--blue-2); text-decoration: none; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-quiet {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  font-size: 13px; font-weight: 600; padding: 7px 10px; cursor: pointer; border-radius: 3px;
}
.btn-quiet:hover { color: var(--bad); }
.linkbtn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--blue-2);
  cursor: pointer;
}
.linkbtn:hover { color: var(--blue); text-decoration: underline; }

/* ---- job list ---- */
.headrow { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.headrow .sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

table.jobs { width: 100%; border-collapse: collapse; }
table.jobs th {
  text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted); padding: 0 12px 10px; border-bottom: 2px solid var(--blue);
}
table.jobs td { padding: 15px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.jobs tbody tr:hover td { background: #faf9f2; }
.title-cell { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; color: var(--muted); }
.until { font-size: 12px; color: var(--muted); margin-top: 3px; }
.until.soon { color: var(--bad); font-weight: 600; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; align-items: center; }
.job-error td { background: #fbf1ee; padding-top: 4px; }
.err-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.err-box .error-text { color: var(--bad); font-size: 13.5px; margin: 0; flex: 1; min-width: 220px; font-weight: 600; }
.job-error form { display: inline; margin: 0; }
.empty-state { color: var(--muted); }
.foot { margin-top: 20px; font-size: 12.5px; color: var(--muted); }

/* ---- badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600;
  padding: 4px 10px 4px 8px; border-radius: 3px; white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-info { background: var(--blue-bg); color: var(--blue-2); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }

/* ---- upload dialog ---- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--blue);
  border-radius: 4px; padding: 24px 26px; max-width: 620px; margin-top: 22px;
  box-shadow: 0 1px 3px rgba(0,40,90,.05);
}
.card h2 { margin-bottom: 4px; }
.card .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 18px; }
.upload-hint { color: var(--muted); font-size: 12.5px; margin: 0 0 14px; }
.field { margin-top: 20px; }
.field label {
  display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .4px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 7px;
}
.field label .opt { font-weight: 400; text-transform: none; letter-spacing: 0; }
input[type="text"], input[type="file"] {
  width: 100%; font: inherit; font-size: 14.5px; padding: 10px 12px;
  border: 1px solid #cfc9b6; border-radius: 3px; background: #fff; color: var(--ink);
}
input[type="text"]:focus { outline: 2px solid var(--blue-bg); border-color: var(--blue-2); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
progress { width: 100%; height: 8px; margin-top: 16px; }
.actions { margin-top: 20px; display: flex; gap: 10px; align-items: center; }
#upload-status { font-size: 13px; color: var(--muted); margin: 10px 0 0; }

/* ---- review page ---- */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); margin-bottom: 14px; }
.back:hover { color: var(--blue-2); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.review-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex: none; }

.section-label {
  font-weight: 700; font-size: 15px; margin: 28px 0 14px; text-transform: uppercase;
  letter-spacing: .6px; color: var(--muted);
}
.speakers { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 4px; }
.speaker-field { flex: 1; min-width: 200px; }
.speaker-field label {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.speaker-name { padding: 9px 11px; }

.toolbar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 24px 0 6px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.toolbar .fmt { font-size: 12px; color: var(--muted); }
.toolbar .fmt code { background: var(--sand-bg); border-radius: 3px; padding: 1px 5px; font-size: 11.5px; color: var(--ink); }
#copy-status { font-size: 12.5px; color: var(--blue-2); }

.segments { margin-top: 8px; }
.seg-speaker { font-weight: 700; font-size: 15px; color: var(--blue); margin: 22px 0 8px; }
.segment { display: flex; gap: 14px; margin-bottom: 10px; align-items: flex-start; }
.segment .ts { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12.5px; padding-top: 11px; flex: none; width: 58px; }
.segment textarea {
  flex: 1; font: inherit; font-size: 14.5px; line-height: 1.55; padding: 9px 11px;
  border: 1px solid transparent; border-radius: 3px; background: #fbfaf4; color: var(--ink);
  resize: vertical; min-height: 44px;
}
.segment textarea:hover { border-color: var(--line); }
.segment textarea:focus { outline: 2px solid var(--blue-bg); border-color: var(--blue-2); background: #fff; }

.in-progress { display: flex; gap: 14px; align-items: flex-start; margin-top: 22px; }
.in-progress .spinner {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  border: 2.5px solid var(--blue-bg); border-top-color: var(--blue);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.in-progress p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }

/* ---- login / error ---- */
.centered { display: flex; justify-content: center; padding-top: 40px; }
.auth-card {
  width: 380px; background: var(--surface); border-top: 4px solid var(--blue);
  border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: 4px;
  padding: 34px 36px 28px; text-align: center; box-shadow: 0 2px 14px rgba(0,40,90,.08);
}
.auth-card h1 { font-size: 24px; margin: 0 0 6px; }
.auth-card .sub { color: var(--muted); font-size: 13.5px; margin: 0 0 24px; }
.auth-card .btn { width: 100%; justify-content: center; }
.auth-card .fine { margin-top: 18px; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.error-text { color: var(--bad); font-weight: 600; }

/* same width as the page content column: .wrap max-width 1000px minus its 2x48px padding */
#summary-modal { width: min(904px, calc(100vw - 96px)); border: 0;
  border-top: 4px solid var(--blue); border-radius: 6px; padding: 0; color: var(--ink); }
#summary-modal::backdrop { background: rgba(0, 30, 70, .35); }
#summary-modal .modal-head { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid var(--line); margin: 0; }
#summary-modal h2 { color: var(--blue); font-size: 18px; }
.modal-x { border: 0; background: none; font-size: 20px; color: var(--muted); cursor: pointer; }
#summary-form, #summary-view { padding: 18px 22px 22px; max-height: 72vh; overflow: auto; }
.sect-label { font-weight: 700; font-size: 11px; letter-spacing: .7px; text-transform: uppercase;
  color: var(--muted); margin: 16px 0 8px; }
.doc-list { list-style: none; padding: 0; margin: 0; }
.doc-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 4px; margin-bottom: 6px; background: #fdfdfb; }
.doc-list li label { flex: 1; font-weight: 600; }
.doc-meta { color: var(--muted); font-size: 12px; }
.doc-del { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; }
.add-doc { display: inline-block; margin-top: 4px; font-size: 13px; font-weight: 600;
  color: var(--blue-2); border: 1px dashed #b8c6d6; border-radius: 4px; padding: 8px 12px;
  background: #f7f9fc; cursor: pointer; }
#summary-modal textarea { width: 100%; font: inherit; font-size: 13px; line-height: 1.5;
  padding: 10px 11px; border: 1px solid #cfc9b6; border-radius: 4px; resize: vertical; }
.modal-actions, .summary-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.modal-actions { justify-content: flex-end; }
.summary-list { list-style: none; padding: 0; margin: 0; }
.summary-list li { display: flex; align-items: center; gap: 10px; font-size: 13px;
  padding: 8px 0; border-bottom: 1px solid var(--line); }
.summary-list li span:first-child { flex: 1; }
.prov { background: var(--sand-bg); border-radius: 4px; padding: 12px 14px; font-size: 12px;
  color: var(--muted); margin: 10px 0 14px; display: flex; flex-direction: column; gap: 4px; }
.prov b { color: var(--ink); }
.prov pre { white-space: pre-wrap; font: inherit; font-size: 11.5px; margin: 6px 0 0; }
#summary-output.md h1 { color: var(--blue); font-size: 18px; }
#summary-output.md h2 { color: var(--blue); font-size: 15px; border-bottom: 1px solid var(--line);
  padding-bottom: 3px; margin-top: 16px; }
#summary-output.md table { border-collapse: collapse; }
#summary-output.md td, #summary-output.md th { border: 1px solid var(--line); padding: 3px 8px; }
