:root {
  color-scheme: light;
  --ink: #19251d;
  --lime: #c6f574;
  --muted: #566357;
  --line: #d6dbcf;
  font-family: "DM Sans", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background: #f4f5ee;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.5; }
[hidden] { display: none !important; }
header { border-bottom: 1px solid var(--line); background: #fcfcf8; }
.brand, main { max-width: 980px; margin: auto; width: calc(100% - 56px); }
.brand { height: 72px; display: flex; align-items: center; gap: 10px; font: bold 22px/1 Arial, sans-serif; letter-spacing: -1px; }
.brand-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: var(--ink); color: var(--lime); font-size: 27px; }
main { padding: 44px 0 64px; }
.source, .result { border-radius: 20px; overflow: hidden; }
.source { background: #1b3025; color: #f8f9f4; padding: 39px 42px 33px; position: relative; isolation: isolate; }
h1,h2,p { margin: 0; }
h1 { font-size: clamp(29px,4.2vw,48px); line-height: 1.2; letter-spacing: -.065em; }
.intro p { margin-top: 11px; color: #d1ddce; font-size: 15px; }
.wave { position: absolute; top: 2px; right: -16px; width: 32%; height: 130px; z-index: -1; opacity: .62; transform: rotate(-9deg); background: repeating-linear-gradient(90deg, transparent 0 6px, #a6d879 6px 9px); clip-path: polygon(0 48%,6% 44%,12% 14%,18% 44%,24% 32%,30% 47%,36% 22%,42% 36%,48% 6%,54% 42%,60% 28%,66% 41%,72% 10%,78% 37%,84% 25%,90% 45%,100% 32%,100% 68%,90% 55%,84% 75%,78% 63%,72% 90%,66% 59%,60% 72%,54% 58%,48% 94%,42% 64%,36% 78%,30% 53%,24% 68%,18% 56%,12% 86%,6% 56%,0 52%); }
form { margin-top: 33px; }
form label { display: block; font-size: 13px; font-weight: bold; margin-bottom: 8px; }
.field-row { display: flex; gap: 10px; }
input,button { font: inherit; }
#url { min-width: 0; flex: 1; padding: 0 17px; height: 52px; border-radius: 9px; border: 1px solid transparent; background: #fff; color: var(--ink); font-size: 15px; }
button { cursor: pointer; color: var(--ink); border: 1px solid var(--line); font-size: 14px; font-weight: 700; border-radius: 8px; background: white; padding: 9px 16px; }
button:hover:enabled { background: #eff4e6; }
button:disabled { cursor: default; color: #828a81; background: #f5f6f1; }
button.extract { background: var(--lime); border-color: var(--lime); padding: 0 23px; }
button.extract:hover:enabled { background: #d9ff95; }
.extract span { margin-left: 10px; }
button:focus-visible,input:focus-visible,#transcript:focus-visible,.toggle:has(input:focus-visible) { outline: 3px solid #769f3c; outline-offset: 3px; }
#request-status:not(:empty),#export-status:not(:empty) { padding-top: 12px; font-size: 14px; }
#request-status.error { color: #ffcfaf; }
.result { background: #fdfdf9; border: 1px solid var(--line); margin-top: 22px; }
.result-head,.exports { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 22px 29px; }
.result-head { border-bottom: 1px solid var(--line); }
h2 { font-size: 21px; letter-spacing: -.05em; }
#meta,small { color: var(--muted); font-size: 12px; }
#meta { margin-top: 5px; overflow-wrap: anywhere; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; cursor: pointer; flex-shrink: 0; position: relative; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { width: 33px; height: 20px; background: #a2aca0; border-radius: 15px; padding: 3px; }
.track::before { display: block; content: ''; width: 14px; height: 14px; background: white; border-radius: 100%; }
.toggle input:checked + .track { background: #43632d; }
.toggle input:checked + .track::before { transform: translateX(13px); }
#empty { min-height: 225px; display: grid; gap: 5px; align-content: center; justify-items: center; text-align: center; padding: 24px; }
#empty strong { font-size: 15px; }
#empty p { color: var(--muted); font-size: 13px; }
.paper { background: #f2f5df; border: 1.6px solid #526845; width: 36px; height: 44px; border-radius: 4px; margin: 0 0 15px; transform: rotate(-6deg); box-shadow: 4px 4px 0 #dbe3bf; padding: 11px 6px; }
.paper i { display: block; background: #728068; height: 2px; margin-bottom: 5px; }
.paper i:last-child { width: 65%; }
#transcript { max-height: 420px; overflow: auto; padding: 12px 29px; white-space: pre-wrap; overflow-wrap: anywhere; }
#transcript div { padding: 9px 0; line-height: 1.65; }
time { font: 13px/1.5 ui-monospace, Consolas, monospace; color: #446535; }
.exports { border-top: 1px solid var(--line); background: #f8f9f3; padding-block: 17px; }
.actions { display: flex; gap: 7px; }
#export-status:not(:empty) { padding: 10px 29px; color: var(--muted); }
@media(max-width: 650px) {
  .brand,main { width: calc(100% - 32px); }
  .brand { height: 58px; }
  main { padding-top: 22px; }
  .source { padding: 26px 20px 21px; }
  .wave { opacity: .15; }
  .field-row,.exports { flex-direction: column; align-items: stretch; }
  #url { flex: none; width: 100%; }
  button.extract { height: 46px; }
  .result-head,.exports { padding: 18px 16px; gap: 10px; }
  h2 { font-size: 18px; }
  .actions button { flex: 1; }
  #transcript { padding-inline: 16px; }
}
