:root {
  color-scheme: light;
  --canvas: #f6f6f0;
  --surface: #fffefa;
  --ink: #1b2721;
  --muted: #55615a;
  --line: #dde2d8;
  --green: #205743;
  --green-dark: #174333;
  --green-light: #e8f0e6;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 2px solid #3a785d; outline-offset: 3px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-library { position: absolute; width: 0; height: 0; }
h1, h2, h3, p { margin: 0; }
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner, .shell { width: min(100% - 88px, 1320px); margin-inline: auto; }
.topbar-inner { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; letter-spacing: -.055em; }
.brand-mark { width: 35px; height: 35px; border-radius: 10px; background: var(--green); color: white; display: grid; place-items: center; }
.brand-mark svg { width: 24px; height: 24px; }
.header-actions { display: flex; gap: 9px; align-items: center; }
.button { min-height: 39px; border: 1px solid transparent; border-radius: 8px; padding: 8px 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-size: 13px; font-weight: 650; white-space: nowrap; }
.button svg { width: 16px; height: 16px; }
.primary { background: var(--green); color: white; }
.primary:hover:not(:disabled) { background: var(--green-dark); }
.primary:disabled { background: #e9eee6; color: #58675d; }
.secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.secondary:hover { background: var(--canvas); }
.shell { padding-block: 36px 14px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 25px; }
h1 { font-family: Georgia, serif; font-weight: 400; font-size: clamp(36px, 4.25vw, 63px); line-height: 1.07; letter-spacing: -.063em; }
h1 span { color: #688b61; }
.intro p { color: var(--muted); margin-top: 10px; font-size: 15px; line-height: 1.5; }
.privacy { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; white-space: nowrap; padding-bottom: 2px; }
.privacy svg { width: 15px; height: 15px; color: var(--green); }
.workspace { display: grid; grid-template-columns: minmax(270px, .39fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sidebar { display: grid; gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 2px 3px #26312506; min-width: 0; }
.card-title { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 16px 18px; }
.section-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--green); background: var(--green-light); }
.section-icon svg { width: 19px; height: 19px; }
h2 { font-size: 15px; font-weight: 690; letter-spacing: -.015em; }
.file-label { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; color: var(--muted); font-size: 12px; margin-top: 3px; }
.icon-button { display: inline-grid; place-items: center; width: 31px; height: 31px; flex: 0 0 auto; color: var(--muted); border: 0; border-radius: 6px; background: transparent; padding: 0; }
.icon-button:hover:not(:disabled) { background: var(--green-light); color: var(--green); }
.icon-button svg { width: 17px; height: 17px; }
.file-action { border: 1px solid var(--line); }
.player { padding: 0 16px 16px; }
.player-stage { position: relative; display: grid; place-items: center; min-height: 114px; aspect-ratio: 2.2; overflow: hidden; border-radius: 8px 8px 0 0; background: #203d31; isolation: isolate; }
.player-stage::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .35; background: repeating-linear-gradient(90deg, transparent 0 27px, #e7f5d926 27px 28px), repeating-linear-gradient(0deg, transparent 0 27px, #e7f5d926 27px 28px); mask-image: radial-gradient(ellipse, black 30%, transparent 92%); }
.audio-art { display: grid; place-items: center; width: min(65%, 190px); color: #a8c4a3; }
.audio-art svg { width: 100%; height: auto; stroke-width: 1.8; }
.player-stage video { display: block; position: absolute; inset: 0; width: 100%; height: 100%; background: #17241e; object-fit: contain; }
#show-video { position: absolute; z-index: 1; right: 6px; bottom: 6px; color: #eef8ed; background: #203d31dc; }
#show-video:hover { background: var(--green); }
.player-controls { padding: 12px 12px 11px; background: #f1f4ed; border: 1px solid #e7ebe1; border-top: 0; border-radius: 0 0 8px 8px; }
#progress { display: block; width: 100%; height: 16px; margin: 0; accent-color: var(--green); }
#volume { width: min(40%, 85px); margin: 0; accent-color: var(--green); }
#progress:disabled { opacity: .55; }
.time { display: flex; justify-content: space-between; margin-block: 2px 8px; color: var(--muted); font: 11px var(--mono); }
.transport { display: flex; align-items: center; justify-content: center; gap: 19px; }
.transport button { display: grid; place-items: center; border: 0; padding: 0; }
.play { width: 43px; height: 43px; border-radius: 50%; color: white; background: var(--green); }
.play:hover:not(:disabled) { background: var(--green-dark); }
.play:disabled { background: #567568; }
.play svg { width: 22px; height: 22px; }
.skip { width: 36px; height: 36px; color: var(--green); border-radius: 50%; background: transparent; }
.skip:disabled { opacity: .6; }
.skip:hover:not(:disabled) { background: #e3ebdf; }
.skip svg { width: 29px; height: 29px; }
.settings { padding: 15px 18px 10px; }
.settings h2 { margin-bottom: 5px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 43px; border-bottom: 1px solid #e8ebe4; font-size: 13px; }
.setting:last-child, .setting:has(+ details[hidden]) { border-bottom: 0; }
.setting select, .offset input { max-width: 85px; border: 1px solid var(--line); border-radius: 6px; min-height: 28px; padding: 2px 7px; color: var(--ink); background: var(--surface); font-size: 12px; }
.switch { appearance: none; display: inline-grid; align-items: center; flex: 0 0 34px; width: 34px; height: 20px; margin: 0; padding: 3px; border: 0; border-radius: 12px; background: #707c73; cursor: pointer; }
.switch::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: white; }
.switch:checked { background: var(--green); }
.switch:checked::before { justify-self: end; }
.settings details { font-size: 12px; color: var(--muted); padding-block: 10px 3px; }
.settings summary { cursor: pointer; }
.settings details p { line-height: 1.4; padding-top: 6px; }
.offset { border: 0; }
.transcript { overflow: hidden; display: flex; flex-direction: column; min-height: clamp(476px, calc(100dvh - 255px), 900px); }
.transcript-title { border-bottom: 1px solid var(--line); }
.transcript-actions, .editing-tools { display: flex; align-items: center; gap: 8px; }
.welcome { flex: 1; display: flex; flex-direction: column; padding: 20px; }
.drop-area { flex: 1; min-height: 325px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 25px 12px; border: 1.5px dashed #b8c8b8; border-radius: 10px; background: #f8faf4; }
.upload-mark { width: 52px; height: 52px; display: grid; place-items: center; background: var(--green-light); border: 1px solid #dbe7d8; border-radius: 13px; color: var(--green); margin-bottom: 15px; }
.upload-mark svg { width: 24px; height: 24px; }
.drop-area h3 { font: 400 clamp(24px, 3vw, 33px)/1.1 Georgia, serif; letter-spacing: -.045em; }
.drop-area p { color: var(--muted); font-size: 14px; margin: 7px 0 17px; }
.file-types { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 18px; }
.file-types span { display: flex; align-items: center; gap: 5px; border: 1px solid #dfe7dc; border-radius: 20px; padding: 4px 8px; color: var(--muted); font-size: 11px; }
.file-types svg { width: 13px; height: 13px; color: var(--green); }
.format-link { align-self: center; border: 0; background: transparent; margin-top: 12px; padding: 5px 8px; color: var(--green); font-size: 13px; font-weight: 650; }
.format-link:hover { text-decoration: underline; }
.editing { display: flex; flex-direction: column; flex: 1; }
.toolbar { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 10px 15px; border-bottom: 1px solid var(--line); background: #fafbf6; }
.view-options { display: inline-flex; padding: 3px; gap: 2px; background: #edf0e8; border-radius: 7px; white-space: nowrap; }
.view-options button { padding: 5px 9px; border: 0; border-radius: 5px; background: none; color: var(--muted); font-weight: 620; font-size: 12px; }
.view-options button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px #2432241f; }
#rename-speakers { min-height: 32px; font-size: 12px; padding: 5px 8px; }
#rename-speakers svg { width: 15px; height: 15px; }
.search { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 2px 4px 2px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); }
.search > svg { width: 15px; height: 15px; }
.search input { width: clamp(90px, 13vw, 154px); min-width: 0; border: 0; background: transparent; color: var(--ink); padding: 4px 0; font-size: 12px; }
.search input:focus-visible { outline: 0; }
.search:focus-within { outline: 2px solid #3a785d; outline-offset: 1px; }
.search output { font: 10px var(--mono); white-space: nowrap; }
.search button { width: 23px; height: 23px; }
.search button:disabled { opacity: .5; }
.transcript-scroll, .raw { height: clamp(318px, calc(100dvh - 414px), 744px); overflow: auto; }
.segment { display: grid; grid-template-columns: 116px minmax(0, 1fr); column-gap: 10px; position: relative; border-bottom: 1px solid #e9ebe4; padding: 13px 17px; scroll-margin-block: 12px; }
.segment:last-child { border-bottom: 0; }
.segment.active { background: #edf4e9; box-shadow: inset 3px 0 var(--green); }
.segment.search-match { background: #fcf8e8; }
.segment.current-match { background: #fbf1ce; box-shadow: inset 3px 0 #9b7628; }
.segment-meta { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.speaker { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; text-align: left; border: 0; border-radius: 4px; background: #e7efe9; color: #245342; padding: 3px 6px; font: 650 11px/1.2 var(--mono); }
.speaker span { overflow-wrap: anywhere; }
.speaker svg { width: 11px; height: 11px; opacity: 0; }
.speaker:hover, .speaker:focus-visible { box-shadow: 0 0 0 1px currentColor; }
.speaker:hover svg, .speaker:focus-visible svg { opacity: 1; }
.speaker[data-color="1"] { background: #ece9f3; color: #584974; }
.speaker[data-color="2"] { background: #f4ebda; color: #6c4b29; }
.speaker[data-color="3"] { background: #e4edf2; color: #2f5367; }
.speaker:not([data-color]) { background: transparent; color: var(--muted); font-weight: 400; }
.stamp { border: 0; padding: 3px 4px; border-radius: 4px; background: transparent; color: var(--muted); font: 11px var(--mono); white-space: nowrap; }
.stamp:hover:not(:disabled) { background: #deebdc; color: var(--green-dark); }
.stamp:disabled { cursor: default; }
.segment textarea { width: 100%; min-width: 0; min-height: 32px; resize: none; overflow: hidden; padding: 4px 6px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font-size: 15px; line-height: 1.65; }
.segment textarea:hover { border-color: #dce5d9; }
.segment textarea:focus { outline: 0; border-color: #6b9b80; background: var(--surface); box-shadow: 0 0 0 2px #cfe5d7; }
.segment.note textarea { color: var(--muted); }
.raw { display: block; width: 100%; border: 0; padding: 14px 17px; resize: none; background: var(--surface); color: var(--ink); font: 13px/1.65 var(--mono); }
.raw:focus-visible { outline-offset: -3px; }
.editor-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: 9px 17px; margin-top: auto; font-size: 11px; color: var(--muted); }
.editor-info { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 9px; }
.format-check { border: 0; padding: 2px 5px; border-radius: 4px; color: var(--green); background: var(--green-light); font-size: inherit; white-space: nowrap; }
.format-check[data-issues] { color: #774b16; background: #fcf0d7; }
.format-check:hover { text-decoration: underline; }
#save-status[data-dirty="true"] { color: #825b26; font-weight: 650; }
.shortcuts { display: none; align-items: flex-start; gap: 8px; padding: 2px 10px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.shortcuts svg { width: 17px; height: 17px; }
kbd { background: var(--surface); border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font: 10px var(--mono); padding: 1px 4px; }
.feedback { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #e0c99a; background: #fff7e4; color: #654a20; padding: 6px 8px 6px 11px; border-radius: 8px; margin-bottom: 12px; font-size: 13px; }
.drop-overlay { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; pointer-events: none; background: #17392bcf; color: white; }
.drop-overlay div { display: grid; place-items: center; gap: 15px; text-align: center; border: 2px dashed #b0c7ad; border-radius: 18px; background: #254d3c; padding: 45px 25px; font: 26px Georgia, serif; }
.drop-overlay svg { width: 35px; height: 35px; }
dialog { width: min(380px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); box-shadow: 0 10px 50px #172b2133; padding: 22px; }
dialog::backdrop { background: #182d2466; }
dialog h2 { font-size: 19px; }
#speaker-description { min-height: 16px; margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.speaker-field { display: grid; gap: 6px; margin-top: 14px; font-size: 13px; font-weight: 650; }
.speaker-field input, .speaker-field select { width: 100%; min-height: 39px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); padding: 6px 9px; color: var(--ink); font: 400 16px var(--sans); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 21px; }
#format-dialog { width: min(540px, calc(100% - 32px)); }
.format-results, .format-guide { font-size: 13px; line-height: 1.5; }
.format-results { margin-block: 12px; padding: 9px 11px; border-radius: 7px; background: var(--green-light); }
.format-results[data-issues] { background: #fcf0d7; color: #654a20; }
.format-results ul { margin: 5px 0 0; padding-left: 18px; max-height: min(25dvh, 180px); overflow: auto; }
.format-results ul:empty { display: none; }
.format-guide { margin-top: 12px; color: var(--muted); }
.format-guide pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--canvas); border: 1px solid var(--line); padding: 8px 10px; border-radius: 6px; color: var(--ink); }
.format-guide ul { margin: 0; padding-left: 19px; }
.format-line { border: 0; background: none; color: inherit; text-decoration: underline; padding: 0; font-weight: 650; }

.has-transcript { display: flex; flex-direction: column; height: 100dvh; overflow: hidden; }
.has-transcript :is(.topbar-inner, .shell) { width: calc(100% - 32px); }
.has-transcript .topbar-inner { min-height: 56px; }
.has-transcript .shell { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-block: 12px; }
.has-transcript .intro { display: none; }
.has-transcript .feedback { flex: none; max-height: 20dvh; overflow: auto; overflow-wrap: anywhere; }
.has-transcript .workspace { flex: 1; min-height: 0; grid-template-columns: clamp(245px, 23vw, 350px) minmax(0, 1fr); align-items: stretch; gap: 12px; }
.has-transcript .sidebar { align-content: start; gap: 10px; min-height: 0; overflow: auto; }
.has-transcript .shortcuts { display: flex; }
.has-transcript .transcript, .editing { min-height: 0; }
.has-transcript .transcript-title { padding-block: 11px; }
.toolbar, .transcript-title, .editor-footer { flex-shrink: 0; }
.transcript-scroll, .raw { flex: 1; height: auto; min-height: 0; overscroll-behavior: contain; }
@media (min-width: 761px) and (max-height: 700px) {
  .has-transcript .topbar-inner { min-height: 48px; }
  .has-transcript .shell, .has-transcript .transcript-title { padding-block: 8px; }
  .has-transcript :is(.toolbar, .editor-footer) { padding-block: 6px; }
}
@media (max-width: 1000px) { .topbar-inner, .shell { width: calc(100% - 42px); } }
@media (max-width: 760px) {
  .topbar-inner, .shell { width: calc(100% - 28px); }
  .topbar-inner { min-height: 61px; }
  .shell { padding-top: 24px; }
  .intro { align-items: flex-start; flex-direction: column; margin-bottom: 16px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .sidebar { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 10px; align-items: start; }
  .player-stage { min-height: 72px; }
  .player-controls { padding-inline: 6px; }
  .settings { padding-inline: 11px; }
  .card-title { padding-inline: 10px; gap: 6px; }
  .player { padding-inline: 8px; }
  .has-transcript :is(.topbar-inner, .shell) { width: calc(100% - 20px); }
  .has-transcript .shell { padding-block: 8px; }
  .has-transcript .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 8px; }
  .has-transcript .sidebar { max-height: min(30dvh, 230px); }
  .has-transcript .shortcuts { display: none; }
  .has-transcript .recording .card-title { padding-block: 8px; }
  .has-transcript .player { padding-bottom: 8px; }
  .has-transcript .player-stage:not(:has(video:not([hidden]))) { min-height: 44px; height: 44px; aspect-ratio: auto; }
  .has-transcript .audio-art { width: min(60%, 120px); }
  .has-transcript .player-controls { padding-block: 6px; }
  .has-transcript .transport { gap: 10px; }
  .has-transcript .play { width: 35px; height: 35px; }
  .has-transcript .settings { padding-block: 9px 6px; }
  .has-transcript .setting { min-height: 34px; }
  .has-transcript .settings details { padding-top: 6px; }
}
@media (max-width: 470px) {
  .brand { font-size: 20px; gap: 6px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 7px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .button { padding-inline: 8px; gap: 4px; font-size: 12px; }
  .header-actions { gap: 4px; }
  .section-icon { width: 26px; height: 26px; }
  .section-icon svg { width: 15px; height: 15px; }
  .toolbar { flex-wrap: wrap; }
  .has-transcript .toolbar { padding: 7px 9px; }
  .editor-footer { padding-inline: 8px; }
  .editor-info { column-gap: 5px; }
  .editing-tools { gap: 5px; }
  .view-options button { padding-inline: 6px; }
  .transcript-title { padding-inline: 13px; }
  .segment { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 9px 11px; }
  .segment-meta { flex-direction: row; align-items: center; }
  .segment textarea { font-size: 16px; }
}
@media (max-width: 760px) and (max-height: 650px) {
  .has-transcript .topbar-inner { min-height: 48px; }
  .has-transcript .shell { padding-block: 5px; }
  .has-transcript .transcript-title { padding-block: 6px; }
  .has-transcript .player-stage:not(:has(video:not([hidden]))) { min-height: 30px; height: 30px; }
  .has-transcript .audio-art { width: min(52%, 86px); }
  .has-transcript #show-video { width: 26px; height: 26px; bottom: 2px; }
  .has-transcript .toolbar, .has-transcript .editor-footer { padding-block: 5px; }
}
@media (pointer: coarse) { .speaker svg { opacity: 1; } }
