:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #17232e;
  background: #f6f7f9;
  accent-color: var(--accent);
  --ink: #17232e;
  --muted: #4d5b68;
  --line: #dce2e8;
  --paper: #fff;
  --canvas: #f7f8fa;
  --accent: #166359;
  --tint: #e9f4ef;
  line-height: 1.55;
}
[data-tool="quizrelay"] { --accent: #59418c; --tint: #f1ebfb; }
[data-tool="textplate"] { --accent: #27518e; --tint: #eaf1fb; }
[data-tool="rtfdword"] { --accent: #3154a6; --tint: #ebeffb; }
[data-tool="comicproof"] { --accent: #99463b; --tint: #faeee9; }
[data-tool="losslessrescue"] { --accent: #255d5e; --tint: #e9f3f3; }
[data-tool="accessattachments"] { --accent: #6e3d52; --tint: #f6edf2; }
[data-tool="mattestack"] { --accent: #536525; --tint: #edf1e2; }
[data-tool="taggedoutline"] { --accent: #35557b; --tint: #e7eef7; }
[data-tool="storyaudio"] { --accent: #815429; --tint: #faefe2; }

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
:where(button, a, input, summary):focus-visible,
:where(.folder, .drop):focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.top { background: var(--paper); border-bottom: 1px solid var(--line); }
.top > div, main, footer { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.top > div, footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.top > div { min-height: 64px; }
.brand { color: var(--ink); text-decoration: none; font-weight: 750; font-size: 21px; letter-spacing: -.045em; }
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
nav a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 650; text-decoration: none; color: var(--muted); }
nav a:hover { color: var(--accent); text-decoration: underline; }

h1, h2, p { margin: 0; }
.intro {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 24px 40px;
  padding-block: clamp(30px, 5vw, 68px) 30px;
}
h1 {
  max-width: 24ch;
  font-size: clamp(34px, 4.5vw, 58px);
  line-height: 1.02;
  letter-spacing: -.055em;
  font-weight: 720;
  text-wrap: balance;
}
.intro p { color: var(--muted); margin-top: 15px; max-width: 67ch; font-size: clamp(15px, 1.8vw, 18px); }
.price {
  padding: 9px 16px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--muted);
  font-size: 13px;
}
.price strong { display: block; color: var(--ink); font-size: 23px; line-height: 1.2; letter-spacing: -.035em; }

.workbench {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 2px 3px #17232e08, 0 15px 35px #17232e08;
}
.source, .result { min-width: 0; padding: clamp(18px, 3vw, 28px); }
.source { border-right: 1px solid var(--line); }
.section-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 15px; }
.section-heading h2, .reader h2, .doc h2 { font-size: 20px; letter-spacing: -.026em; line-height: 1.25; }
.section-heading span {
  color: var(--accent);
  background: var(--tint);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 12px;
  font-weight: 680;
}

.drop {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 158px;
  padding: 16px;
  text-align: center;
  border: 1px dashed color-mix(in srgb, var(--accent) 75%, white);
  border-radius: 10px;
  background: var(--tint);
  color: var(--accent);
  cursor: pointer;
}
.drop::before {
  content: "";
  width: 20px;
  height: 20px;
  margin-bottom: 10px;
  background:
    linear-gradient(currentColor, currentColor) center 3px / 2px 10px no-repeat,
    linear-gradient(currentColor, currentColor) center bottom / 17px 2px no-repeat,
    linear-gradient(currentColor, currentColor) left 1px bottom / 2px 6px no-repeat,
    linear-gradient(currentColor, currentColor) right 1px bottom / 2px 6px no-repeat,
    linear-gradient(135deg, transparent 25%, currentColor 25% 43%, transparent 43%) center 2px / 10px 9px no-repeat,
    linear-gradient(225deg, transparent 25%, currentColor 25% 43%, transparent 43%) center 2px / 10px 9px no-repeat;
}
.drop[data-over], .drop:hover {
  border-style: solid;
  background: color-mix(in srgb, var(--tint) 89%, var(--accent));
}
.drop strong { font-size: 16px; }
.drop span, .selected, .file-actions button, .folder { font-size: 14px; }
.drop span { color: var(--muted); }
.drop input, .folder input { inline-size: 1px; block-size: 1px; overflow: hidden; position: absolute; opacity: 0; }
.file-actions { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; margin-top: 4px; }
.text-button, .folder {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  font-weight: 650;
  text-align: start;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-button:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.selected {
  padding: 9px 11px;
  margin: 3px 0 16px;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px,1fr)); gap: 10px; margin-bottom: 14px; }
.field-row label { font-size: 13px; font-weight: 650; display: grid; gap: 5px; }
.field-row input[type="number"] {
  min-height: 44px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #a9b4c0;
  padding: 8px;
  border-radius: 6px;
  width: 100%;
}
.field-row .check { min-height: 44px; display: flex; align-items: center; gap: 8px; }
.field-row .check input { flex-shrink: 0; inline-size: 16px; block-size: 16px; margin: 0; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  background: var(--accent);
  color: #fff;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}
.workbench .button { width: 100%; }
.workbench:has(#download:enabled) #prepare-button:enabled {
  background: var(--paper);
  color: var(--accent);
  border-color: var(--accent);
}
.button:hover:enabled, a.button:hover { filter: brightness(.9); }
.button:disabled { background: #ecf0f3; color: var(--muted); cursor: default; }
.proof {
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 158px;
  padding: 16px;
  overflow-wrap: anywhere;
}
.proof:not([data-empty]) #summary { font-weight: 700; }
.proof[data-empty] { display: grid; place-items: center; text-align: center; color: var(--muted); }
.proof img { display: block; max-width: 100%; max-height: 270px; object-fit: contain; margin: 12px auto 0; }
.proof audio { display: block; width: 100%; margin-top: 12px; }
.proof ul { padding-inline-start: 20px; margin: 12px 0 0; }
#preview-rows { color: var(--muted); font-size: 14px; }
#prepare-status, #billing-status { font-size: 14px; color: var(--muted); margin: 12px 0; }
#prepare-status:empty { margin: 0; }

.reader, .doc { max-width: 760px; }
.reader { margin-top: 34px; padding: 26px 0 44px; border-top: 1px solid var(--line); }
.reader h2:not(:first-child), .doc h2 { margin-top: 26px; margin-bottom: 9px; }
.reader p, .doc p, .reader li, .doc li { margin-bottom: 10px; }
.reader ol, .doc ol { padding-inline-start: 22px; }
.reader details { border-bottom: 1px solid var(--line); }
.reader details p { padding-inline-start: 16px; color: var(--muted); }
summary { min-height: 44px; padding-block: 10px; cursor: pointer; font-weight: 650; }
.doc { padding: 45px 0 54px; }
.doc h1 { margin-bottom: 21px; font-size: clamp(32px, 5.3vw, 52px); }
footer { padding: 15px 0 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
[hidden] { display: none !important; }

@media (max-width: 700px) {
  .top > div, main, footer { width: calc(100% - 32px); }
  .intro { grid-template-columns: 1fr; gap: 16px; padding-bottom: 20px; }
  .price { justify-self: start; display: flex; gap: 6px; align-items: baseline; padding: 4px 9px; }
  .price strong { font-size: 17px; }
  .workbench { grid-template-columns: 1fr; border-radius: 12px; }
  .source { border-right: 0; border-bottom: 1px solid var(--line); }
  .drop, .proof { min-height: 132px; }
  footer { align-items: flex-start; }
}
