:root { color-scheme: light; font-family: system-ui, "Yu Gothic UI", "Meiryo", sans-serif; color: #142f33; background: #f1f5f4; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { width: min(680px, calc(100% - 32px)); margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 0 max(24px, env(safe-area-inset-bottom)); }
header { margin-bottom: 16px; }
body[data-embedded] main { padding-top: 12px; }
body[data-embedded] h1 { font-size: 1.25rem; }
h1 { font-size: clamp(1.55rem, 5vw, 2.5rem); margin: 0; line-height: 1.28; }
.controls, .transcript { background: #fff; border: 1px solid #d7e3e1; border-radius: 14px; padding: clamp(14px, 4vw, 24px); }
.controls { margin-bottom: 16px; }
.state { display: flex; align-items: center; gap: 10px; }
#indicator { width: 9px; height: 9px; border-radius: 100%; background: #6d808a; }
#indicator[data-state="recording"] { background: #b72c36; box-shadow: 0 0 0 4px #fbe7e9; }
#indicator[data-state="paused"] { background: #99600c; }
#indicator[data-state="saved"] { background: #168153; }
#timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 750; font-size: clamp(1.65rem, 6vw, 2.2rem); line-height: 1; }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 11px; }
button { font: inherit; font-weight: 700; border-radius: 9px; border: 1px solid #afc3c2; background: #fff; color: #142f33; padding: 9px 13px; min-height: 48px; cursor: pointer; }
button:disabled { opacity: .48; cursor: default; }
button:focus-visible, summary:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid #29847e; outline-offset: 2px; }
#start, #import { background: #075855; color: #fff; border-color: #075855; }
#stop { background: #9b2934; color: #fff; border-color: #9b2934; }
#message, #empty, #count, summary { color: #425d62; font-size: .9rem; line-height: 1.55; }
#message:not(:empty) { margin-top: 11px; overflow-wrap: anywhere; }
.preview-status { color: #5a4a22; font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
.preview-status:empty { display: none; }
#record-link, #download { color: #075855; font-weight: 700; }
#record-target, #file-target { color: #075855; font-size: .9rem; font-weight: 700; }
#record-target, #file-target, #record-link, #download { display: inline-flex; min-height: 44px; align-items: center; }
header:has(#record-target:not([hidden])) { margin-bottom: 3px; }
details { margin-top: 11px; }
summary { cursor: pointer; padding-block: 10px; }
#file-mode { border-top: 1px solid #d7e3e1; }
#file-mode label { display: block; font-size: .9rem; color: #425d62; }
input { max-width: 100%; font: inherit; min-height: 44px; }
#file-timing { margin: 0 0 12px; padding: 8px 10px 5px; border: 1px solid #d7e3e1; border-radius: 8px; min-width: 0; }
#file-timing legend { font-size: .85rem; color: #425d62; }
#file-timing input { display: block; width: 100%; padding-inline: 6px; margin: 4px 0 7px; }
#error-panel { background: #fff2f2; color: #7b2430; border: 1px solid #e7b4b8; border-radius: 9px; margin-top: 12px; padding: 12px; overflow-wrap: anywhere; }
#error-panel p { margin: 6px 0 0; line-height: 1.6; }
#error-details { margin: 3px 0 0; }
#error-details summary { color: inherit; }
#error-technical { font-size: .84rem; }
.transcript-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
h2 { font-size: 1.1rem; margin: 0 0 7px; }
ol { padding: 0; margin: 0; list-style: none; }
li { border-top: 1px solid #e5edf0; padding: 11px 0; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
li:first-child { border-top: 0; }
.transcript-time { display: block; color: #42616c; font-size: .875rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.secondary { margin-top: 16px; }
#audio { display: block; width: min(100%, 440px); margin: 10px 0; }
#diagnostics p { color: #526a75; font-size: .875rem; line-height: 1.6; }
#diagnostics > summary { font-size: 1rem; font-weight: 700; color: #152b36; }
.table-scroll { overflow-x: auto; margin: 12px 0 18px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .825rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
th, td { padding: 8px; border-bottom: 1px solid #dbe5e9; }
th { background: #f1f5f7; }
#timeline li { font-size: .875rem; padding-block: 6px; }

@media (max-width: 600px) {
  #primary-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  #primary-actions button, #import { min-height: 52px; width: 100%; }
  body:is([data-phase="recording"], [data-phase="pausing"], [data-phase="paused"], [data-phase="resuming"]) main {
    padding-bottom: calc(105px + env(safe-area-inset-bottom));
  }
  body:is([data-phase="recording"], [data-phase="pausing"], [data-phase="paused"], [data-phase="resuming"]) #primary-actions {
    position: fixed; inset: auto 0 0; z-index: 2; margin: 0; background: #fff; border-top: 1px solid #c5d7d5;
    padding: 10px max(16px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  }
  body:is([data-phase="recording"], [data-phase="paused"]) #retry { grid-column: 1 / -1; min-height: 44px; }
  body:is([data-phase="recording"], [data-phase="paused"]):has(#retry:not([hidden])) main { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
}
