/* =====================================================================
   Tamlil - business UI
   Ink workspace (from the logo) · electric blue for actions · amber only
   for the playback highlight · the transcript is a real document sheet.
   ===================================================================== */
:root {
  --ink: #0A1022;
  --ink-2: #0E1630;
  --panel: #111A35;
  --panel-2: #172245;
  --line: rgba(150, 172, 255, .12);
  --line-2: rgba(150, 172, 255, .22);
  --text: #EAF0FF;
  --text-2: #BAC5E0;
  --mute: #8592B3;
  --blue: #2F6BFF;
  --blue-hover: #4C80FF;
  --blue-soft: rgba(47, 107, 255, .14);
  --amber: #FFB23F;
  --ok: #34D399;
  --bad: #FF6170;
  --paper: #FCFCFA;
  --paper-ink: #151B2C;
  --paper-mute: #7D869B;
  --paper-line: #E8E9EE;
  --mark: rgba(255, 178, 63, .42);
  --serif: "Frank Ruhl Libre", "David Libre", Georgia, serif;
  --sans: "IBM Plex Sans Hebrew", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --r: 10px;
  --r-lg: 16px;
  --w: 1180px;
  --gutter: 16px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  overflow-x: hidden; overscroll-behavior-x: none;
  touch-action: manipulation;               /* no double-tap zoom */
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0; min-height: 100dvh; overflow-x: hidden;
  background: var(--ink); color: var(--text);
  font-family: var(--sans); font-size: 15.5px; line-height: 1.6;
}
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue-hover); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- app bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 16, 34, .86); backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-in { max-width: var(--w); margin: 0 auto; height: 60px; padding: 0 var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 24px; letter-spacing: .2px; }
.brand-mark { width: 32px; height: 32px; border-radius: 8px; display: block; box-shadow: 0 0 0 1px var(--line-2); }
.top-nav { display: flex; align-items: center; gap: 4px; }
.top-nav a, .top-nav button {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; background: none; border: 0; cursor: pointer; font-size: 14.5px; font-weight: 500;
}
.top-nav a:hover, .top-nav button:hover { background: var(--panel); color: var(--text); }
.top-nav .cta { background: var(--blue); color: #fff; }
.top-nav .cta:hover { background: var(--blue-hover); color: #fff; }
@media (max-width: 620px) { .top-nav .lbl { display: none; } .top-nav a, .top-nav button { padding: 0 10px; } }

main { max-width: var(--w); margin: 0 auto; padding: 0 var(--gutter) 150px; outline: none; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--panel); cursor: pointer;
  font-weight: 600; font-size: 14.5px; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:hover { border-color: var(--mute); background: var(--panel-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }
.btn.big { min-height: 50px; font-size: 16px; padding: 0 22px; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel); }
.btn.danger { color: var(--bad); border-color: rgba(255, 97, 112, .35); background: transparent; }
.btn.rec .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); }
select, .input, textarea {
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 9px 12px; min-height: 42px; max-width: 100%;
}
select:focus, .input:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px var(--blue-soft); }
select { padding-inline-end: 30px; }
textarea { width: 100%; resize: vertical; min-height: 76px; }
.input { width: 100%; }

/* ---------- home: hero + upload panel ---------- */
.home-hero { position: relative; isolation: isolate; display: grid; gap: 28px; padding: 38px 0 10px; align-items: start; }
.home-hero::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: -60px calc(50% - 50vw) auto; height: 640px;
  background:
    radial-gradient(42% 55% at 72% 18%, rgba(47, 107, 255, .26), transparent 70%),
    radial-gradient(30% 40% at 18% 40%, rgba(255, 178, 63, .07), transparent 70%),
    linear-gradient(rgba(150, 172, 255, .05) 1px, transparent 1px) 0 0 / 100% 44px,
    linear-gradient(90deg, rgba(150, 172, 255, .05) 1px, transparent 1px) 0 0 / 44px 100%;
  -webkit-mask-image: linear-gradient(#000 40%, transparent);
  mask-image: linear-gradient(#000 40%, transparent);
}
@media (min-width: 980px) { .home-hero { grid-template-columns: minmax(0, 1fr) 470px; gap: 56px; padding-top: 64px; } }
.hero-copy { padding-top: 6px; }
.hero-copy h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(32px, 8.4vw, 62px); line-height: 1.07; margin: 0 0 16px; letter-spacing: -.5px; }
.hero-copy .lead { color: var(--text-2); font-size: 17px; line-height: 1.75; max-width: 54ch; margin: 0 0 26px; }
.proof { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--line); max-width: 560px; }
.proof li { display: flex; gap: 14px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); color: var(--text-2); }
.proof b { color: var(--text); font-weight: 600; min-width: 132px; }
@media (max-width: 979px) { .proof { display: none; } .hero-copy .lead { margin-bottom: 0; } }

.upload-card { background: linear-gradient(180deg, rgba(23, 34, 69, .92), rgba(17, 26, 53, .96)); border: 1px solid var(--line-2); border-radius: 18px; padding: 20px; box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 40px 90px -40px rgba(0, 0, 0, .85), 0 0 0 1px rgba(47, 107, 255, .06); backdrop-filter: blur(8px); }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 14px; }
.card-head h2 { font-family: var(--serif); font-size: 22px; font-weight: 700; margin: 0; }
.card-head span { color: var(--mute); font-size: 12.5px; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--mute); margin: 18px 2px 8px; }
.opts { margin-top: 12px; }
.lbl.block { display: block; margin: 14px 0 6px; font-size: 13.5px; font-weight: 500; }
details.more .inner .opt-row:first-child { border-top: 0; }
.drop {
  border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 26px 16px; text-align: center; cursor: pointer;
  background: var(--ink-2); transition: border-color .15s, background .15s;
}
.drop:hover, .drop.drag { border-color: var(--blue); background: rgba(47, 107, 255, .06); }
.drop .ico { width: 46px; height: 46px; border-radius: 12px; background: var(--blue-soft); color: var(--blue-hover); display: inline-grid; place-items: center; margin-bottom: 10px; }
.drop .ico svg { width: 22px; height: 22px; }
.drop .t { font-weight: 600; font-size: 16px; }
.drop .s { color: var(--mute); font-size: 13px; margin: 2px 0 14px; }
.drop .actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

.picked { display: flex; align-items: center; gap: 12px; padding: 12px; margin-top: 12px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--line); }
.picked .fi { width: 38px; height: 38px; border-radius: 9px; background: var(--blue-soft); color: var(--blue-hover); display: grid; place-items: center; flex: none; }
.picked .name { font-weight: 600; word-break: break-word; font-size: 14.5px; }
.picked .meta { color: var(--mute); font-size: 13px; }
.picked .grow { flex: 1; min-width: 0; }

.section-title { font-size: 13px; font-weight: 600; color: var(--mute); margin: 20px 0 8px; }
.modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; }
.mode { padding: 9px 6px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; text-align: center; color: var(--text-2); }
.mode .t { display: block; font-weight: 600; font-size: 14.5px; }
.mode .s { display: block; font-size: 11.5px; color: var(--mute); margin-top: 1px; }
.mode:hover { background: var(--panel-2); }
.mode[aria-pressed="true"] { background: var(--blue); color: #fff; }
.mode[aria-pressed="true"] .s { color: rgba(255, 255, 255, .78); }
.mode-desc { color: var(--mute); font-size: 13px; margin: 8px 2px 0; line-height: 1.55; }

.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 6px 2px; border-bottom: 1px solid var(--line); }
.opt-row:first-of-type { border-top: 1px solid var(--line); }
.opt-row label { cursor: pointer; }
.opt-row .lbl { font-weight: 500; font-size: 14.5px; }
.opt-row .sub { display: block; font-size: 12.5px; color: var(--mute); font-weight: 400; }
.opt-row select { min-width: 150px; }

.switch { position: relative; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line-2); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); transition: transform .18s, background .18s; }
.switch input:checked + span { background: var(--blue); border-color: var(--blue); }
.switch input:checked + span::after { transform: translateX(-18px); background: #fff; }
.switch input:disabled + span { opacity: .45; }
.switch input:focus-visible + span { outline: 2px solid var(--blue-hover); outline-offset: 2px; }

details.more { border-bottom: 1px solid var(--line); }
details.more summary { cursor: pointer; padding: 14px 2px; font-weight: 500; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::after { content: "+"; color: var(--mute); font-size: 18px; line-height: 1; }
details.more[open] summary::after { content: "−"; }
details.more .inner { padding: 0 2px 14px; }
.hint { color: var(--mute); font-size: 12.5px; margin: 6px 0 0; }
.go { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.go .btn { width: 100%; }

/* upload progress */
.uploading { margin-top: 12px; padding: 16px; border-radius: 12px; background: var(--ink-2); border: 1px solid var(--line); }
.bar { height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: width .3s; }
.up-line { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; color: var(--mute); font-size: 13px; font-variant-numeric: tabular-nums; }
.big-num { font-weight: 600; font-size: 34px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }

/* how it works (a real sequence) */
.how { display: grid; gap: 0; margin: 34px 0 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); counter-reset: how; }
@media (min-width: 760px) { .how { grid-template-columns: repeat(3, 1fr); } .how li + li { border-inline-start: 1px solid var(--line); } }
.how { list-style: none; padding: 0; }
.how li { padding: 18px 16px; counter-increment: how; }
.how li::before { content: counter(how); display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line-2); font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.how b { display: block; font-weight: 600; margin-bottom: 2px; }
.how span { color: var(--mute); font-size: 13.5px; }

/* ---------- history ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 40px 0 12px; }
.section-head h2 { font-family: var(--serif); font-size: 26px; font-weight: 700; margin: 0; }
.section-head .count { color: var(--mute); font-size: 13.5px; }
.jobs { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--ink-2); }
.job-list { list-style: none; margin: 0; padding: 0; }
.jobs-head { display: none; }
@media (min-width: 760px) {
  .jobs-head { display: grid; grid-template-columns: minmax(0, 1fr) 90px 110px 130px 110px; gap: 16px; padding: 10px 18px; font-size: 12.5px; color: var(--mute); border-bottom: 1px solid var(--line); background: var(--ink-2); }
}
.job-row + .job-row { border-top: 1px solid var(--line); }
.job-row a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 18px; text-decoration: none; transition: background .12s; }
.job-row a:hover { background: var(--panel); }
.job-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-row .c { color: var(--mute); font-size: 13px; font-variant-numeric: tabular-nums; }
.job-row .c.dur, .job-row .c.lang, .job-row .c.date { display: none; }
.job-row .meta { grid-column: 1; color: var(--mute); font-size: 13px; }
.job-row .state { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
.job-row .mini { grid-column: 1 / -1; margin-top: 8px; height: 4px; }
@media (min-width: 760px) {
  .job-row a { grid-template-columns: minmax(0, 1fr) 90px 110px 130px 110px; gap: 16px; align-items: center; }
  .job-row .meta { display: none; }
  .job-row .c.dur, .job-row .c.lang, .job-row .c.date { display: block; }
  .job-row .state { grid-row: auto; grid-column: auto; }
}
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-done { color: var(--ok); }
.st-error { color: var(--bad); }
.st-processing, .st-queued { color: var(--blue-hover); }
.st-canceled { color: var(--mute); }
.empty { color: var(--mute); padding: 22px 18px; }

.foot { color: var(--mute); font-size: 12.5px; text-align: center; margin-top: 48px; display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; }

/* ---------- job page ---------- */
.job-head { padding: 22px 0 4px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--mute); text-decoration: none; font-size: 13.5px; padding: 4px 0; }
.back:hover { color: var(--text); }
.job-title { font-family: var(--serif); font-weight: 700; font-size: clamp(28px, 6vw, 40px); line-height: 1.15; margin: 8px 0 10px; word-break: break-word; outline: none; border-radius: 6px; cursor: text; }
.job-title[contenteditable="true"]:focus { box-shadow: 0 0 0 2px var(--blue); }
.job-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.job-meta span { font-size: 12.5px; color: var(--text-2); border: 1px solid var(--line); background: var(--ink-2); border-radius: 99px; padding: 2px 10px; }

.progress-card { margin: 22px 0; padding: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); }
.progress-card .top-line { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.progress-card .msg { font-size: 15px; color: var(--text-2); min-height: 1.6em; }
.progress-card .big-num { font-size: 44px; }
.progress-grid { display: grid; gap: 22px; margin-top: 18px; }
@media (min-width: 860px) { .progress-grid { grid-template-columns: 260px minmax(0, 1fr); } }
.eta { color: var(--mute); font-size: 13px; margin-top: 8px; }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { counter-increment: s; display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--mute); font-size: 14.5px; position: relative; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 12px; flex: none; background: var(--ink-2); }
.steps li.now { color: var(--text); font-weight: 600; }
.steps li.now::before { background: var(--blue); color: #fff; border-color: var(--blue); }
.steps li.past { color: var(--text-2); }
.steps li.past::before { content: "✓"; color: var(--ok); border-color: rgba(52, 211, 153, .45); }

.eng-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.eng { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 11px 14px; font-size: 14px; background: var(--ink-2); }
.eng + .eng { border-top: 1px solid var(--line); }
.eng .n { direction: ltr; text-align: right; }
.eng .v { color: var(--mute); font-variant-numeric: tabular-nums; font-size: 13px; }
.eng .bar { grid-column: 1 / -1; height: 3px; }
.eng-done .v { color: var(--ok); }
.eng-done .bar > i { background: var(--ok); }
.eng-failed .v { color: var(--bad); }
.eng-failed .bar > i { background: var(--bad); width: 100% !important; opacity: .5; }

.notice { padding: 11px 14px; border-radius: var(--r); background: rgba(255, 178, 63, .08); border: 1px solid rgba(255, 178, 63, .28); font-size: 13.5px; margin: 12px 0; color: var(--text-2); }
.notice.bad { background: rgba(255, 97, 112, .08); border-color: rgba(255, 97, 112, .35); }
.danger-zone { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px; }

/* done: document + side panel */
.tabs { display: flex; gap: 4px; padding: 4px; margin: 18px 0 0; background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; position: sticky; top: calc(64px + env(safe-area-inset-top)); z-index: 6; }
.tab { flex: 1; background: none; border: 0; padding: 9px 8px; cursor: pointer; color: var(--mute); font-weight: 600; font-size: 14px; border-radius: 9px; }
.tab[aria-selected="true"] { background: var(--panel-2); color: var(--text); }
.job-layout { display: block; }
@media (min-width: 1100px) {
  .job-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; margin-top: 18px; }
  .job-layout .tabs { display: none; }
  .job-layout section[data-panel] { display: block !important; }
  .job-layout .aside { position: sticky; top: 80px; max-height: calc(100vh - 190px); overflow: auto; display: grid; gap: 16px; }
  .job-layout .aside section { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
  .job-layout .aside section:empty { display: none !important; }
}
.aside-title { font-size: 13px; font-weight: 600; color: var(--mute); margin: 0 0 10px; display: none; }
@media (min-width: 1100px) { .aside-title { display: block; } }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 14px 0 10px; }
.toolbar .search { flex: 1 1 200px; min-width: 0; }
.seg-switch { display: inline-flex; padding: 3px; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: var(--r); }
.seg-switch button { background: none; border: 0; padding: 6px 12px; font-size: 13px; cursor: pointer; color: var(--mute); border-radius: 7px; }
.seg-switch button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); font-weight: 600; }
#dispHint { margin: 0 0 10px; }

/* the document sheet - the transcript reads like a finished deliverable */
.paper { background: var(--paper); color: var(--paper-ink); border-radius: 12px; box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 30px 70px -40px rgba(0, 0, 0, .9); padding: 26px 18px 18px; }
@media (min-width: 700px) { .paper { padding: 42px 46px 30px; } }
.doc-head { border-bottom: 1px solid var(--paper-line); padding-bottom: 14px; margin-bottom: 6px; }
.doc-head .dt { font-family: var(--serif); font-size: 24px; font-weight: 700; line-height: 1.25; }
.doc-head .dm { color: var(--paper-mute); font-size: 12.5px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.transcript { margin-top: 4px; }
.para { display: grid; grid-template-columns: 54px 1fr; gap: 0 14px; padding: 12px 0; border-bottom: 1px solid var(--paper-line); }
.para:last-child { border-bottom: 0; }
.para .tc { font-family: var(--sans); font-size: 12px; color: var(--paper-mute); padding-top: 7px; cursor: pointer; background: none; border: 0; text-align: start; font-variant-numeric: tabular-nums; direction: ltr; justify-self: start; }
.para .tc:hover { color: var(--blue); }
.para .body { font-family: var(--serif); font-size: 19px; line-height: 1.9; max-width: 70ch; }
.spk { display: inline-block; font-family: var(--sans); font-size: 12.5px; font-weight: 700; margin: 0 0 2px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--c, #2F6BFF); letter-spacing: .2px; }
.spk:hover { text-decoration: underline; }
.seg { border-radius: 2px; cursor: pointer; transition: background .2s; }
@media (hover: hover) { .seg:hover { background: rgba(47, 107, 255, .07); } }
.seg.active { background: var(--mark); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.seg.edited { text-decoration: underline dotted rgba(21, 27, 44, .35); text-underline-offset: 5px; }
.seg mark { background: rgba(47, 107, 255, .2); color: inherit; border-radius: 2px; }
.seg.disputed { text-decoration: underline wavy rgba(47, 107, 255, .75); text-decoration-thickness: 1.5px; text-underline-offset: 6px; }
.seg.disputed.check { text-decoration-color: rgba(220, 70, 40, .85); background: rgba(220, 70, 40, .07); border-radius: 4px; }
.editing .seg { cursor: text; }
.editing .seg[contenteditable="true"]:focus { outline: 2px solid var(--blue); outline-offset: 1px; background: #fff; }
.transcript .empty { color: var(--paper-mute); }

/* summary / report / export panels */
.summary h3 { font-family: var(--serif); font-size: 21px; line-height: 1.3; margin: 18px 0 8px; font-weight: 700; }
.summary h3:first-child { margin-top: 0; }
.summary p { font-size: 15.5px; line-height: 1.8; color: var(--text-2); margin: 0; }
.summary ul { padding-inline-start: 18px; margin: 0; color: var(--text-2); }
.summary li { margin: 6px 0; font-size: 15px; line-height: 1.7; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.tags span { border: 1px solid var(--line-2); border-radius: 99px; padding: 1px 10px; font-size: 12.5px; color: var(--text-2); }
.report { list-style: none; padding: 0; margin: 0; }
.report li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.report b { color: var(--text); font-variant-numeric: tabular-nums; }
.export-list { list-style: none; padding: 0; margin: 10px 0 0; border-top: 1px solid var(--line); }
.export-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.export-list .f { font-weight: 600; font-size: 14.5px; }
.export-list .d { color: var(--mute); font-size: 12.5px; display: block; font-weight: 400; }
#panel-e .opt-row:first-of-type { margin-top: 6px; }

/* player */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: rgba(14, 22, 48, .96); backdrop-filter: blur(14px); border-top: 1px solid var(--line-2); padding: 10px var(--gutter) calc(env(safe-area-inset-bottom) + 10px); }
.player .in { max-width: var(--w); margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 6px 14px; align-items: center; }
.player .play { width: 46px; height: 46px; border-radius: 50%; background: var(--blue); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; }
.player .play:hover { background: var(--blue-hover); }
.player .play svg { width: 20px; height: 20px; }
.player .mid { min-width: 0; }
.player input[type=range] { width: 100%; accent-color: var(--blue); direction: ltr; }
.player .times { display: flex; justify-content: space-between; font-size: 12px; color: var(--mute); direction: ltr; font-variant-numeric: tabular-nums; }
.player .side { display: flex; gap: 6px; direction: ltr; }
.player .side button { min-width: 42px; height: 34px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-size: 12.5px; font-weight: 600; }
.player .side button[aria-pressed="true"] { background: var(--text); color: var(--ink); }
.video-wrap video { width: 100%; border-radius: 12px; background: #000; margin-top: 14px; max-height: 56vh; }
.video-wrap video::cue { font-family: var(--sans); font-size: 18px; line-height: 1.45; background: rgba(0, 0, 0, .75); color: #fff; }

/* login */
.login { max-width: 380px; margin: 14vh auto 0; text-align: center; }
.login h1 { font-family: var(--serif); font-size: 40px; margin: 0 0 6px; }
.login p { color: var(--mute); margin: 0 0 22px; }
.login form { display: flex; flex-direction: column; gap: 10px; }
.login .input { text-align: center; font-size: 17px; min-height: 50px; }

/* dialogs */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(5, 8, 18, .72); backdrop-filter: blur(6px); display: grid; place-items: center; padding: var(--gutter); }
.sheet { width: 100%; max-width: 440px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; padding: 24px 22px; text-align: center; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8); }
.sheet h2 { font-family: var(--serif); font-size: 26px; line-height: 1.2; margin: 0 0 6px; font-weight: 700; }
.sheet .clock { font-size: 56px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; direction: ltr; margin-top: 8px; letter-spacing: -1px; }
.meter { display: flex; align-items: center; justify-content: center; gap: 3px; height: 60px; margin: 14px 0 18px; direction: ltr; }
.meter i { width: 4px; border-radius: 3px; background: var(--blue-hover); height: 6px; transition: height .08s; }
.sheet .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--bad); margin-inline-end: 8px; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.sheet.alts, .sheet.engines { text-align: start; max-width: 540px; max-height: 88vh; overflow: auto; }
.alts .final-pick { font-family: var(--serif); font-size: 19px; line-height: 1.7; margin: 8px 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--paper); color: var(--paper-ink); }
.alts ul { list-style: none; padding: 0; margin: 0 0 16px; border-top: 1px solid var(--line); }
.alts li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: center; }
.alts .who { grid-column: 1 / -1; font-size: 12px; color: var(--mute); direction: ltr; text-align: right; }
.alts .what { font-family: var(--serif); font-size: 17px; line-height: 1.6; }
.prov { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.prov > span { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.engines details summary { cursor: pointer; color: var(--mute); font-size: 13px; padding: 8px 0; }
.keys { list-style: none; padding: 0; margin: 0 0 6px; }
.keys li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; border-bottom: 1px dashed var(--line); }

#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 92px); transform: translateX(-50%) translateY(16px); background: var(--text); color: var(--ink); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; max-width: calc(100% - 32px); text-align: center; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .6); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.muted { color: var(--mute); }
.spacer { height: 10px; }

@media (prefers-reduced-motion: reduce) {
  .rec-dot { animation: none; }
  * { transition: none !important; }
}

/* features: four plain columns separated by hairlines */
.features { display: grid; grid-template-columns: 1fr; margin: 46px 0 0; border-top: 1px solid var(--line); }
.features > div { padding: 20px 4px; border-bottom: 1px solid var(--line); }
.features .fi { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--blue-soft); color: var(--blue-hover); margin-bottom: 10px; }
.features b { display: block; font-size: 15.5px; font-weight: 600; margin-bottom: 4px; }
.features p { margin: 0; color: var(--mute); font-size: 13.5px; line-height: 1.65; max-width: 34ch; }
@media (min-width: 760px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .features > div { padding: 22px 20px; }
  .features > div:nth-child(odd) { border-inline-end: 1px solid var(--line); }
}
@media (min-width: 1100px) {
  .features { grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
  .features > div { border-bottom: 0; border-inline-end: 1px solid var(--line); }
  .features > div:last-child { border-inline-end: 0; }
}
.how { margin-top: 0; border-top: 0; }

.site-foot { margin-top: 64px; padding: 26px 0 10px; border-top: 1px solid var(--line); display: grid; gap: 6px; justify-items: center; text-align: center; color: var(--mute); font-size: 13px; }
.sf-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-family: var(--serif); font-weight: 700; font-size: 18px; }
.sf-brand img { border-radius: 7px; }
.sf-meta { display: flex; align-items: center; gap: 10px; font-size: 12.5px; }

.export-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.export-list .fx { width: 44px; height: 30px; border-radius: 7px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; letter-spacing: .4px; color: var(--blue-hover); background: var(--blue-soft); direction: ltr; }

.summary + .summary { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------- feels like an app on phones ---------- */
button, .btn, .tab, .mode, .seg-switch button, .top-nav a { -webkit-user-select: none; user-select: none; }
.btn:active, .mode:active, .tab:active, .player .play:active { transform: scale(.97); }
@media (max-width: 760px) {
  /* iOS zooms into any field under 16px and stays zoomed - never let that happen */
  input, select, textarea, .input { font-size: 16px !important; }
  .hero-copy .lead { font-size: 16px; }
  .home-hero { padding-top: 26px; gap: 22px; }
  .upload-card { padding: 16px; border-radius: 16px; }
}
.enter { animation: viewIn .22s ease-out; }
@keyframes viewIn { from { opacity: 0; } to { opacity: 1; } }

/* dialogs become bottom sheets on phones */
@media (max-width: 640px) {
  .overlay { align-items: end; padding: 0; }
  .sheet { max-width: none !important; border-radius: 22px 22px 0 0; border-bottom: 0; max-height: 92dvh; overflow: auto;
           padding-bottom: calc(24px + env(safe-area-inset-bottom)); animation: sheetUp .26s cubic-bezier(.2, .8, .2, 1); }
  .sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: -10px auto 16px; }
  .sheet > .btn, .sheet .row .btn { width: 100%; }
}
@keyframes sheetUp { from { transform: translateY(48px); opacity: .5; } to { transform: none; opacity: 1; } }

/* transcript on phones: the timecode sits above the text so the text gets the full width */
@media (max-width: 560px) {
  .paper { padding: 22px 16px 14px; border-radius: 14px; }
  .para { grid-template-columns: 1fr; padding: 14px 0; }
  .para .tc { padding: 0; margin-bottom: 2px; justify-self: right; }
  .para .body { font-size: 18px; line-height: 1.85; }
  .doc-head .dt { font-size: 21px; }
}

/* loading skeleton */
.skel { background: linear-gradient(90deg, var(--panel) 0, var(--panel-2) 50%, var(--panel) 100%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-title { height: 34px; width: 60%; margin: 14px 0 12px; }
.skel-chips { height: 22px; width: 40%; border-radius: 99px; }
.skel-paper { height: 420px; margin-top: 22px; border-radius: 12px; }

/* product preview next to the headline (desktop) */
.preview { display: none; }
@media (min-width: 980px) {
  .preview { display: block; margin-top: 34px; max-width: 560px; border-radius: 14px; background: var(--paper); color: var(--paper-ink);
             box-shadow: 0 50px 90px -50px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .04); overflow: hidden; }
  .pv-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--paper-line); font-size: 13px; }
  .pv-head b { font-family: var(--serif); font-size: 16px; }
  .pv-head .ok { color: #0f9d63; font-weight: 600; font-size: 12px; display: inline-flex; align-items: center; gap: 6px; }
  .pv-head .ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .pv-row { display: grid; grid-template-columns: 48px 1fr; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--paper-line); }
  .pv-row:last-child { border-bottom: 0; }
  .pv-row i { font-style: normal; font-size: 11.5px; color: var(--paper-mute); direction: ltr; padding-top: 4px; }
  .pv-row em { display: block; font-style: normal; font-size: 11.5px; font-weight: 700; color: #2F6BFF; }
  .pv-row em.s2 { color: #C2410C; }
  .pv-row div { font-family: var(--serif); font-size: 16px; line-height: 1.75; }
  .pv-row mark { background: var(--mark); color: inherit; }
}
@media (prefers-reduced-motion: reduce) { .enter, .sheet, .skel { animation: none !important; } }

/* =====================================================================
   Torah lesson: a separate, book-like reading of the transcript.
   Warm paper, ink type, one muted gold accent - no loud colors.
   ===================================================================== */
:root {
  --sf-paper: #FBF8F1;
  --sf-paper-2: #F5EFE2;
  --sf-ink: #1E1B16;
  --sf-mute: #7A7263;
  --sf-line: #E6DECD;
  --sf-gold: #A8823F;
  --sf-gold-soft: rgba(168, 130, 63, .1);
  --sf-brown: #5A3E1B;
  --sf-name: #23314F;
}

/* view switch: plain transcript / Torah lesson */
.view-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 14px 0 0; background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px; }
.view-switch button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; background: none; border: 0; border-radius: 9px; color: var(--mute); font-weight: 600; font-size: 14.5px; cursor: pointer; }
.view-switch button[aria-selected="true"] { background: var(--panel-2); color: var(--text); }
.view-switch button[data-view="torah"][aria-selected="true"] svg { color: #D9B878; }
.vs-new { font-style: normal; font-size: 10.5px; font-weight: 700; color: #1B1406; background: #D9B878; border-radius: 99px; padding: 1px 7px; }

.torah-cta { display: flex; align-items: center; gap: 14px; margin: 14px 0 0; padding: 14px 16px; border: 1px solid rgba(217, 184, 120, .32); border-radius: 14px; background: linear-gradient(270deg, rgba(217, 184, 120, .11), rgba(217, 184, 120, .03)); }
.torah-cta .tc-icon { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(217, 184, 120, .16); color: #E2C38A; }
.torah-cta .tc-icon svg { width: 22px; height: 22px; }
.torah-cta .tc-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.torah-cta .tc-copy b { font-size: 15px; }
.torah-cta .tc-copy span { color: var(--text-2); font-size: 13.5px; line-height: 1.55; }
.torah-cta.lesson { border-color: rgba(217, 184, 120, .55); }
.btn.torah-btn { background: #D9B878; border-color: #D9B878; color: #1B1406; font-weight: 700; }
.btn.torah-btn:hover { background: #E4C68C; border-color: #E4C68C; }
@media (max-width: 640px) {
  .torah-cta { flex-wrap: wrap; }
  .torah-cta .torah-btn { width: 100%; justify-content: center; min-height: 44px; }
}

/* intro + progress */
.torah-intro { max-width: 640px; margin: 18px auto 8px; padding: 30px 22px 24px; text-align: center; background: var(--sf-paper); color: var(--sf-ink); border-radius: 16px; box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .9); }
.torah-intro .ti-mark { width: 54px; height: 54px; margin: 0 auto 10px; display: grid; place-items: center; border-radius: 50%; background: var(--sf-gold-soft); color: var(--sf-gold); }
.torah-intro .ti-mark svg { width: 26px; height: 26px; }
.torah-intro h3 { font-family: var(--serif); font-size: 27px; margin: 0 0 6px; }
.torah-intro .ti-lead { color: var(--sf-mute); margin: 0 auto 16px; max-width: 46ch; }
.torah-intro .ti-list { list-style: none; padding: 0; margin: 0 auto 22px; max-width: 470px; text-align: start; }
.torah-intro .ti-list li { position: relative; padding: 7px 26px 7px 0; border-bottom: 1px solid var(--sf-line); font-size: 14.5px; }
.torah-intro .ti-list li:last-child { border-bottom: 0; }
.torah-intro .ti-list li::before { content: ""; position: absolute; right: 4px; top: 15px; width: 8px; height: 8px; transform: rotate(45deg); background: var(--sf-gold); border-radius: 1px; }
.torah-intro .btn { background: #2B2417; border-color: #2B2417; color: #F6EEDC; }
.torah-intro .btn:hover { background: #3A311F; }
.torah-intro .hint { color: var(--sf-mute); }
.torah-progress { margin: 18px 0; padding: 20px; background: var(--panel); border: 1px solid rgba(217, 184, 120, .28); border-radius: var(--r-lg); }
.torah-progress .tp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.torah-progress .tp-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(217, 184, 120, .14); color: #E2C38A; flex: none; }
.torah-progress .tp-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.torah-progress .tp-copy span { color: var(--text-2); font-size: 13.5px; }
.torah-progress .tp-num { font-size: 26px; font-variant-numeric: tabular-nums; }
.torah-progress .bar > i { background: #D9B878; }

/* toolbar + menu + review bar */
.torah-tools { padding-top: 14px; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; z-index: 15; inset-inline-end: 0; top: calc(100% + 6px); min-width: 210px; padding: 6px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .8); }
.menu-pop button { display: block; width: 100%; text-align: start; padding: 10px 12px; background: none; border: 0; border-radius: 8px; color: var(--text); cursor: pointer; font-size: 14px; }
.menu-pop button:hover { background: var(--panel); }
.review-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; padding: 8px 8px 8px 14px; border-radius: var(--r); background: rgba(255, 178, 63, .08); border: 1px solid rgba(255, 178, 63, .28); font-size: 13.5px; color: var(--text-2); }
.link { background: none; border: 0; padding: 0; color: var(--blue-hover); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- the book ---------- */
.sefer { position: relative; background: var(--sf-paper); color: var(--sf-ink); border-radius: 14px; padding: 30px 20px 26px; box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 30px 70px -40px rgba(0, 0, 0, .9); font-family: var(--serif); }
@media (min-width: 760px) { .sefer { padding: 56px 72px 40px; } }
.sefer > * { max-width: 70ch; margin-inline: auto; }
.sf-head { text-align: center; margin-bottom: 26px; }
.sf-kicker { font-family: var(--sans); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; color: var(--sf-gold); margin-bottom: 8px; }
.sf-title { font-size: 30px; font-weight: 700; line-height: 1.25; margin: 0 0 10px; }
@media (min-width: 760px) { .sf-title { font-size: 38px; } }
.sf-sub { font-size: 17.5px; color: #4E483D; margin: 0 auto 10px; max-width: 52ch; line-height: 1.7; }
.sf-meta { font-family: var(--sans); font-size: 12.5px; color: var(--sf-mute); display: flex; justify-content: center; gap: 4px 16px; flex-wrap: wrap; }
.sf-orn { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px auto 0; max-width: 260px; }
.sf-orn::before, .sf-orn::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--sf-gold)); }
.sf-orn::after { transform: scaleX(-1); }
.sf-orn i { width: 7px; height: 7px; transform: rotate(45deg); background: var(--sf-gold); border-radius: 1px; }

.sf-toc { margin: 0 auto 34px; padding: 16px 20px 12px; max-width: 520px; background: var(--sf-paper-2); border: 1px solid var(--sf-line); border-radius: 12px; font-family: var(--sans); }
.sf-toc .toc-t { font-size: 12.5px; font-weight: 700; color: var(--sf-mute); letter-spacing: .06em; margin-bottom: 6px; }
.sf-toc ol { list-style: none; margin: 0; padding: 0; }
.sf-toc li a { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; color: var(--sf-ink); text-decoration: none; font-family: var(--serif); font-size: 17px; border-bottom: 1px dotted var(--sf-line); }
.sf-toc li:last-child a { border-bottom: 0; }
.sf-toc li a:hover { color: var(--sf-brown); }
.sf-n { font-family: var(--serif); font-weight: 700; color: var(--sf-gold); min-width: 1.6em; }

.sf-sec { margin-top: 10px; }
.sf-h { display: flex; align-items: baseline; gap: 10px; font-size: 23px; font-weight: 700; line-height: 1.35; margin: 34px auto 14px; padding-bottom: 8px; border-bottom: 1px solid var(--sf-line); scroll-margin-top: 140px; }
.sf-sec:first-of-type .sf-h { margin-top: 6px; }
.sf-pw, .sf-quote, .sf-qa { position: relative; }
.sf-p { font-size: 19.5px; line-height: 2; margin: 0 0 16px; text-align: justify; text-justify: inter-word; }
@media (max-width: 640px) { .sf-p { font-size: 18px; line-height: 1.95; text-align: start; } }
.sf-quote { margin: 6px auto 20px; padding: 10px 18px 10px 14px; border-inline-start: 3px solid #C9A86A; background: var(--sf-gold-soft); border-radius: 10px 0 0 10px; color: #3F2C14; }
.sf-quote .q-text { font-size: 18.5px; line-height: 1.95; }
.sf-quote cite { display: block; margin-top: 6px; font-style: normal; font-family: var(--sans); font-size: 12.5px; color: var(--sf-gold); }
.sf-qa { margin: 8px auto 20px; padding: 12px 16px 6px; background: #F1ECE1; border-radius: 12px; }
.sf-qa .qa-l { display: block; font-family: var(--sans); font-size: 11.5px; font-weight: 700; color: var(--sf-mute); letter-spacing: .05em; }
.sf-qa p { margin: 2px 0 8px; font-size: 17.5px; line-height: 1.9; color: #3B372F; }

/* inline marks: quotations, sages, books, sources, spots to check */
.t-quote { color: var(--sf-brown); }
.t-name { color: var(--sf-name); font-weight: 600; }
.t-book { color: var(--sf-brown); font-weight: 600; }
.t-ref { font-family: var(--sans); font-size: .8em; font-weight: 600; color: #7E5E27; background: var(--sf-gold-soft); border-radius: 4px; padding: .05em .3em; white-space: nowrap; }
.t-unsure { background: linear-gradient(transparent 60%, rgba(255, 178, 63, .42) 60%); }

/* blocks a person should check */
.sefer .rv::before { content: ""; position: absolute; inset-inline-start: -12px; top: .45em; bottom: .9em; width: 3px; border-radius: 2px; background: #E0A33A; }
@media (max-width: 640px) { .sefer .rv::before { inset-inline-start: -9px; } }
.rv-note { font-family: var(--sans); font-size: 12px; color: #9A6A12; margin: -10px 0 16px; }
.sf-quote .rv-note, .sf-qa .rv-note { margin: 4px 0 2px; }
.flash { animation: flash 1.4s ease; }
@keyframes flash { 0%, 60% { box-shadow: 0 0 0 6px rgba(255, 178, 63, .35); border-radius: 6px; } 100% { box-shadow: 0 0 0 0 rgba(255, 178, 63, 0); } }

/* play from here (desktop margin) */
.sf-t { position: absolute; top: .5em; inset-inline-end: -62px; display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; font-family: var(--sans); font-size: 11px; color: var(--sf-mute); background: none; border: 0; border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .15s; direction: ltr; font-variant-numeric: tabular-nums; }
.sf-t svg { width: 11px; height: 11px; fill: currentColor; stroke: none; }
.sf-pw:hover .sf-t, .sf-quote:hover .sf-t, .sf-qa:hover .sf-t, .sf-t:focus-visible { opacity: 1; }
.sf-t:hover { color: var(--sf-brown); background: var(--sf-gold-soft); }
@media (max-width: 1099px) { .sf-t { display: none; } }

/* end matter */
.sf-end { margin-top: 42px; padding-top: 22px; border-top: 1px solid var(--sf-line); font-family: var(--sans); }
.sf-idx { margin-bottom: 22px; }
.sf-idx h3 { font-family: var(--serif); font-size: 19px; margin: 0 0 4px; }
.sf-note { font-size: 12.5px; color: var(--sf-mute); margin: 0 0 10px; }
.sf-src { list-style: none; margin: 0; padding: 0; }
.sf-src li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--sf-line); }
.sf-src .src { font-family: var(--serif); font-size: 16.5px; }
.sf-src .k { flex: none; font-size: 11.5px; color: var(--sf-mute); background: var(--sf-paper-2); border: 1px solid var(--sf-line); border-radius: 99px; padding: 1px 9px; }
.sf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sf-chips .chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 11px; font-family: var(--serif); font-size: 15px; background: #FFFDF8; border: 1px solid var(--sf-line); border-radius: 99px; }
.sf-chips .chip small { font-family: var(--sans); font-size: 11px; color: var(--sf-mute); }
.sf-foot { font-size: 12px; color: var(--sf-mute); margin: 18px 0 0; line-height: 1.6; }

/* manual editing */
.sefer.editing [contenteditable="true"] { outline: 1px dashed rgba(47, 107, 255, .35); outline-offset: 3px; border-radius: 4px; }
.sefer.editing [contenteditable="true"]:focus { outline: 2px solid rgba(47, 107, 255, .6); background: #fff; }
.sefer.editing .sf-t { display: none; }
.sefer .sf-sub:empty::before { content: "תיאור קצר של השיעור (לא חובה)"; color: var(--sf-mute); }
.edit-hint { margin: 0 0 10px; }

@media print {
  .top, .tabs, .view-switch, .toolbar, .player, .aside, .notice, .review-bar, .torah-cta, .sf-t, .rv-note, .edit-hint { display: none !important; }
  body { background: #fff; }
  .sefer { box-shadow: none; padding: 0; background: #fff; }
}

/* =====================================================================
   v1.9.1 - nothing may widen the page on a phone; custom pickers and
   dialogs instead of the browser's own select / confirm / prompt.
   ===================================================================== */
.home-hero { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .home-hero { grid-template-columns: minmax(0, 1fr) 470px; } }
.home-hero > *, .upload-card, .main-col, .aside, .job-layout > *, .opt-row > *, .picked .grow { min-width: 0; }
.job-head h1, .doc-head .dt, .sf-title, .picked .name, .job-list .name, .job-list a { overflow-wrap: anywhere; }
.up-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.up-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--mute); font-size: 14px; }
.up-head .big-num { font-size: 26px; flex: none; }

/* ---------- picker (replaces <select>) ---------- */
.pick { position: relative; flex: none; max-width: 62%; }
.pick-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; max-width: 100%; padding: 0 12px 0 10px;
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 11px; color: var(--text); font-size: 14.5px; font-weight: 500; cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s; }
.pick-btn:hover { border-color: var(--mute); background: var(--panel-2); }
.pick-btn[aria-expanded="true"] { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.pick-btn .pk-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pick-btn .pk-i, .pick-pop .pk-i { display: grid; place-items: center; flex: none; color: var(--blue-hover); }
.pick-btn .pk-i svg { width: 17px; height: 17px; }
.pick-btn .pk-c { display: grid; place-items: center; flex: none; color: var(--mute); margin-inline-start: 2px; transition: transform .2s; }
.pick-btn .pk-c svg { width: 16px; height: 16px; }
.pick-btn[aria-expanded="true"] .pk-c { transform: rotate(180deg); }
.pick-pop { position: fixed; z-index: 70; padding: 6px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .85), 0 0 0 1px rgba(47, 107, 255, .06); animation: popIn .14s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.pp-search { padding: 4px 4px 8px; }
.pp-search input { width: 100%; min-height: 40px; padding: 0 12px; background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 10px; color: var(--text); font-size: 14.5px; }
.pp-search input:focus { outline: none; border-color: var(--blue); }
.pp-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; max-height: 340px; overscroll-behavior: contain; outline: none; }
.pp-list li { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 9px; cursor: pointer; font-size: 14.5px; color: var(--text); }
.pp-list li.act { background: var(--panel); }
.pp-list li[aria-selected="true"] { color: #fff; font-weight: 600; }
.pp-list .o-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pp-list .o-t small { font-size: 12.5px; color: var(--mute); font-weight: 400; line-height: 1.45; margin-top: 1px; }
.pp-list .o-c { flex: none; display: grid; place-items: center; color: var(--blue-hover); opacity: 0; }
.pp-list .o-c svg { width: 18px; height: 18px; stroke-width: 2.4; }
.pp-list li[aria-selected="true"] .o-c { opacity: 1; }
.pick-pop.rich .pp-list li { align-items: flex-start; padding: 11px 10px; }
.pick-pop.rich .pk-i { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-soft); }
.pick-pop.rich .pk-i svg { width: 18px; height: 18px; }
.pick-pop.rich li[aria-selected="true"] .pk-i { background: var(--blue); color: #fff; }
.pick-pop.rich .o-c { align-self: center; }
/* phones: a bottom sheet */
.pick-back { position: fixed; inset: 0; z-index: 69; background: rgba(5, 8, 18, .6); backdrop-filter: blur(4px); animation: fadeIn .18s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.pick-pop.as-sheet { left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 82dvh; display: flex; flex-direction: column; padding: 8px 12px calc(12px + env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; border-bottom: 0; animation: sheetUp .24s cubic-bezier(.2, .8, .2, 1); }
.pick-pop.as-sheet .pp-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 2px auto 10px; flex: none; }
.pick-pop.as-sheet .pp-head { padding: 0 6px 8px; font-size: 16px; flex: none; }
.pick-pop.as-sheet .pp-list { max-height: none; flex: 1; }
.pick-pop.as-sheet .pp-list li { min-height: 50px; font-size: 16px; }
.pick-pop.as-sheet .pp-search input { font-size: 16px; }
html.pick-lock, html.pick-lock body { overflow: hidden; }

/* ---------- dialog (replaces confirm / prompt) ---------- */
.overlay.dlg-ov { z-index: 75; }
.sheet.dlg { max-width: 400px; text-align: start; padding: 22px; }
.sheet.dlg h3 { font-size: 18px; margin: 0 0 6px; line-height: 1.35; }
.sheet.dlg .dlg-text { color: var(--text-2); font-size: 14.5px; margin: 0 0 16px; line-height: 1.6; }
.sheet.dlg .input { margin: 4px 0 16px; }
.dlg-actions { display: flex; gap: 8px; flex-direction: row; }
.dlg-actions .btn { flex: 1; min-height: 46px; }
.btn.danger-solid { background: #E5484D; border-color: #E5484D; color: #fff; }
.btn.danger-solid:hover { background: #F05A5F; border-color: #F05A5F; }
@media (max-width: 640px) {
  .sheet.dlg { padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); }
  .dlg-actions { flex-direction: column; }
  .pick { max-width: 58%; }
}

.torah-progress.waiting { border-color: rgba(255, 178, 63, .35); }
.torah-progress.waiting .bar > i { background: #E0A33A; }
.torah-progress .tp-actions { margin-top: 12px; }

/* ===================================================================== 2.0: projects, dictionary, words to check */
.outs { margin-bottom: 14px; }
.outs .mode .s { white-space: normal; line-height: 1.35; }
.notes-row { display: block; }
.notes-row textarea { width: 100%; margin-top: 8px; min-height: 64px; }
.page-head { padding: 34px 0 10px; }
.page-head h1 { font-size: clamp(24px, 4vw, 32px); margin: 0 0 6px; }
.page-head .lead { color: var(--text-2); max-width: 720px; margin: 0; }
h2.sec { font-size: 17px; margin: 26px 0 8px; color: var(--text-2); }
.proj-bar { position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin: 14px 0; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--r); }
.proj-bar #selCount { font-weight: 600; margin-inline-end: auto; }
.proj-list { list-style: none; padding: 0; margin: 14px 0 40px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.proj-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; }
.proj-row + .proj-row { border-top: 1px solid var(--line); }
.proj-row a { min-width: 0; text-decoration: none; display: flex; flex-direction: column; }
.proj-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-row .meta { color: var(--mute); font-size: 13px; }
.proj-list .empty { padding: 22px; color: var(--mute); list-style: none; }
.ck { position: relative; width: 22px; height: 22px; display: inline-block; cursor: pointer; }
.ck input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ck span { position: absolute; inset: 0; border: 1.5px solid var(--line-2); border-radius: 6px; background: var(--ink-2); }
.ck input:checked + span { background: var(--blue); border-color: var(--blue); }
.ck input:checked + span::after { content: ""; position: absolute; inset: 4px 7px 6px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ck input:disabled + span { opacity: .35; }
.ck input:focus-visible + span { outline: 2px solid var(--blue-hover); outline-offset: 2px; }
.book-card { margin: 14px 0; padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--panel); }
.bc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bc-head svg { width: 20px; height: 20px; color: var(--amber); }
.bc-head .btn { margin-inline-start: auto; }
.bc-dl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.dict-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 18px 0 4px; }
.dict-add .input { flex: 1 1 180px; min-width: 0; }
.dict-add .arrow { color: var(--mute); }
.dict-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--r); }
.dict-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 11px 14px; }
.dict-list li + li { border-top: 1px solid var(--line); }
.dict-list .pair s { color: var(--mute); }
.dict-list .ctx { color: var(--mute); font-size: 13px; flex-basis: 100%; order: 3; }
.dict-list .acts { margin-inline-start: auto; display: flex; gap: 6px; }
.dict-list .empty { color: var(--mute); }
/* words to check inside the transcript sheet */
.transcript .sus { background: rgba(255, 178, 63, .2); border-bottom: 2px dotted #c47a00; border-radius: 3px; cursor: pointer; }
.transcript .fixd { background: rgba(52, 211, 153, .16); border-bottom: 2px solid #1f9e72; border-radius: 3px; cursor: pointer; }
.word-sheet { max-width: 460px; }
.ws-word { font: 600 22px/1.4 var(--serif); margin-bottom: 4px; }
.ws-cands { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.ws-own { display: flex; gap: 8px; }
.ws-own .input { flex: 1; min-width: 0; }
.ws-foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.learn-pop { position: fixed; inset-inline: 16px; bottom: 96px; z-index: 60; max-width: 520px; margin-inline: auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px; background: var(--panel-2);
  border: 1px solid var(--line-2); border-radius: var(--r); box-shadow: 0 12px 30px rgba(0, 0, 0, .35); }
.learn-pop span { flex: 1 1 220px; }
.learn-pop s { color: var(--mute); }
.video-maker .vm-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.video-maker .bar { margin: 8px 0; }
.notice.good { background: rgba(52, 211, 153, .08); border-color: rgba(52, 211, 153, .35); }
.quality { margin-top: 22px; }
.qtable { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13.5px; }
.qtable th, .qtable td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.qtable th { color: var(--mute); font-weight: 600; }
.sec-title { font-size: clamp(20px, 3vw, 26px); margin: 0 0 16px; }
.products { margin: 40px 0 10px; }
.prod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.prod { padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--ink-2); }
.prod b { display: block; font-size: 16px; margin: 8px 0 4px; }
.prod p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.65; }
.prod .fi svg { width: 22px; height: 22px; color: var(--blue-hover); }
.faq { margin: 34px 0; }
.faq details { border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px; margin-bottom: 8px; background: var(--ink-2); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; }
.faq details p { margin: 0 0 14px; color: var(--text-2); line-height: 1.7; }
.video-maker .vm-o { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.video-maker .vm-l { font-size: 12.5px; color: var(--mute); }
.video-maker .vm-o .pick, .video-maker .vm-o .pick-btn { width: 100%; }
