:root {
  color-scheme: light;
  --paper: #f6f5f0;
  --white: #fffefa;
  --ink: #211a30;
  --muted: #625a6d;
  --line: #e1ddd6;
  --purple: #542ac5;
  --purple-dark: #4521a9;
  --night: #241938;
  --lime: #dbf88b;
  --mono: "IBM Plex Mono", "Cascadia Mono", Consolas, monospace;
  font: 16px/1.5 "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body { margin: 0; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button, a[href] { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid #885cff; outline-offset: 4px; }
h1, h2, p { margin: 0; }
html { scroll-padding-top: 24px; }
.wrap { width: min(1088px, calc(100% - 64px)); margin-inline: auto; }

.site-header {
  min-height: 73px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 760; letter-spacing: -.07em; text-decoration: none; }
.brand-mark { width: 33px; height: 33px; display: flex; align-items: center; justify-content: center; gap: 2px; border-radius: 9px; background: var(--purple); }
.brand-mark i { width: 2px; height: 8px; border-radius: 2px; background: white; }
.brand-mark i:nth-child(2) { height: 16px; }
.brand-mark i:nth-child(3) { height: 12px; }
.brand-mark i:nth-child(4) { height: 5px; }
nav { display: flex; align-items: center; gap: 25px; }
nav a { display: grid; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
nav a:hover, .site-footer a:hover { color: var(--purple); }

.tool-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 42px 0 25px; }
h1 { font-size: clamp(3.2rem, 7.2vw, 5.45rem); line-height: 1.01; font-weight: 760; letter-spacing: -.083em; }
h1 span { color: var(--purple); }
.tool-heading p { max-width: 34rem; margin-top: 13px; color: var(--muted); font-size: 18px; line-height: 1.5; }
.privacy { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid #e1d9f1; border-radius: 100px; background: #efebf8; color: #4b327e; font-size: 13px; font-weight: 650; white-space: nowrap; }
.lock { position: relative; width: 11px; height: 8px; border: 1.4px solid currentColor; border-radius: 2px; margin-top: 3px; }
.lock::before { content: ""; position: absolute; width: 7px; height: 5px; left: 50%; bottom: 100%; transform: translateX(-50%); border: 1.4px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; }

.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 21px; padding: 23px; min-width: 0; box-shadow: 0 6px 20px #251c3110; }
.input-panel { background: var(--white); border-color: #d9cfe9; }
.result-panel { background: var(--night); border-color: var(--night); color: #fffafc; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 17px; }
.panel-heading h2 { font-size: 19px; font-weight: 720; letter-spacing: -.035em; }
.format-label { font: 600 11px/1.2 var(--mono); letter-spacing: .045em; border-radius: 5px; padding: 5px 7px; color: #5a5066; background: #eeebe7; white-space: nowrap; }
.result-panel .format-label { background: #38294c; color: #ddd0f5; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  width: 100%;
  min-height: 208px;
  padding: 18px 14px;
  border: 1.5px dashed #b8a5de;
  border-radius: 13px;
  background: #f9f6ff;
  color: var(--ink);
  transition: border-color 150ms, background-color 150ms;
}
.dropzone:not(:disabled):hover, .dropzone.dragging { border-color: var(--purple); background: #f0e8ff; }
.dropzone.selected { border-color: #987ad9; background: #f6f0ff; }
.dropzone:disabled { cursor: wait; }
.file-icon { width: 45px; height: 45px; border-radius: 11px; background: #ece1ff; color: var(--purple); display: grid; place-items: center; margin-bottom: 5px; }
.file-icon span { display: grid; place-items: center; width: 17px; height: 21px; border: 1.5px solid currentColor; border-radius: 3px; font-size: 14px; line-height: 1; }
.choose-label { max-width: 100%; font-size: 19px; font-weight: 710; letter-spacing: -.035em; overflow-wrap: anywhere; }
.drop-hint { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.input-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 5px 0 6px; color: var(--muted); font-size: 13px; min-height: 38px; }
.input-meta a { color: #543294; font-weight: 650; text-underline-offset: 3px; padding-block: 10px; }
.input-meta span { text-align: right; }
.button { width: 100%; min-height: 51px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 15px; border: 0; border-radius: 9px; font-weight: 720; font-size: 15px; text-align: left; text-decoration: none; transition: background-color 150ms, transform 120ms; }
.button span:last-child { font-size: 21px; line-height: 1; }
.button:not([disabled]):not([aria-disabled="true"]):active { transform: translateY(1px); }
.convert-button { background: var(--purple); color: white; }
.convert-button:hover:not(:disabled) { background: var(--purple-dark); }
.convert-button:disabled { background: #e9e0f9; color: #605071; cursor: default; }
.download-button { background: var(--lime); color: #231e1b; }
.download-button:hover[href] { background: #e9ffac; }
.download-button[aria-disabled="true"] { background: #392d4b; color: #c8bdd8; }
progress { display: block; width: 100%; height: 8px; margin-top: 10px; accent-color: var(--purple); }
.status { font-size: 13px; color: var(--muted); }
.status:not(:empty):not(.sr-only) { margin-top: 9px; }
.status.error { color: #8e2535; background: #f9e9eb; padding: 9px 11px; border-radius: 7px; }

.roll { position: relative; height: 176px; overflow: hidden; background: #1a1228; border: 1px solid #463653; border-radius: 11px; }
.roll canvas { display: block; width: 100%; height: 100%; }
.roll-empty { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 8px; text-align: center; padding: 7px 10px; border-radius: 7px; color: #d9cee8; background: #1a1228; white-space: nowrap; font-size: 13px; }
.empty-note { font-size: 19px; color: #d8c0ff; line-height: 1; }
.metrics { display: grid; grid-template-columns: .72fr 1fr 1.2fr; gap: 8px; min-height: 82px; align-items: start; padding-top: 12px; margin: 0; }
.metrics > div + div { border-left: 1px solid #4a395f; padding-left: 12px; }
.metrics dt { color: #d0c0e1; font-size: 12px; }
.metrics dd { margin: 1px 0 0; font: 600 clamp(13px, 2vw, 16px)/1.25 var(--mono); overflow-wrap: anywhere; }
.metrics small { display: block; font: 11px/1.45 "Instrument Sans", "Segoe UI", system-ui, sans-serif; color: #d0c0e1; margin-top: 2px; }

.note-section { margin-top: 16px; border: 1px solid var(--line); border-radius: 15px; padding: 21px 23px 12px; background: var(--white); }
.note-heading { display: flex; gap: 5px 16px; align-items: baseline; flex-wrap: wrap; margin-bottom: 14px; }
.note-heading h2 { font-size: 21px; letter-spacing: -.035em; }
.note-heading p, .pagination { font-size: 13px; color: var(--muted); }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: 14px; }
th, td { padding: 8px; }
th { background: #eeebe7; font-weight: 700; }
td { border-bottom: 1px solid #ece7e2; font-family: var(--mono); font-variant-numeric: tabular-nums; }
th:first-child { border-radius: 5px 0 0 5px; }
th:last-child { border-radius: 0 5px 5px 0; }
tr:last-child td { border-bottom: 0; }
.pagination { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; }
.pagination button { min-width: 44px; min-height: 44px; border: 0; border-radius: 7px; background: #efebf8; color: #4b327e; font-size: 18px; margin-left: 4px; }
.pagination button:disabled { background: #eeebe7; color: #6e6576; cursor: default; }

.reading { margin-top: 104px; }
.reading-row { display: grid; grid-template-columns: minmax(205px, .55fr) minmax(0, 1fr); gap: 22px; padding: 27px 0 29px; border-top: 1px solid var(--line); }
.reading-row h2 { font-size: 24px; line-height: 1.2; letter-spacing: -.045em; }
.reading-row > div { max-width: 63ch; }
.reading-row p { color: var(--muted); line-height: 1.65; }
.reading-row p + p { margin-top: 11px; }
.formats { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 12px 0; }
.formats li { padding: 4px 7px; border-radius: 4px; background: #ede8f5; font: 600 12px/1.4 var(--mono); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:last-child { border-bottom: 0; }
.faq-list summary { min-height: 44px; padding: 10px 0; font-weight: 650; cursor: pointer; }
.faq-list p { padding: 0 0 13px 17px; }
.site-footer { border-top: 1px solid var(--line); padding: 19px 0 26px; font-size: 14px; color: var(--muted); }

.guide-page { max-width: 46rem; margin: clamp(30px, 7vw, 76px) auto 64px; }
.guide-page h1 { max-width: 15ch; font-size: clamp(2.35rem, 7vw, 4.45rem); letter-spacing: -.065em; }
.guide-page h2 { margin: 34px 0 10px; font-size: clamp(1.32rem, 3vw, 1.8rem); line-height: 1.18; letter-spacing: -.035em; }
.guide-page h3 { margin: 24px 0 6px; font-size: 1.1rem; }
.guide-page p, .guide-page li { line-height: 1.65; }
.guide-page p + p { margin-top: 12px; }
.guide-page .answer { margin: 18px 0 22px; color: var(--muted); font-size: clamp(1rem, 2.5vw, 1.2rem); }
.guide-page a { text-underline-offset: .2em; }
.guide-page .guide-action { display: inline-block; padding: 10px 16px; border-radius: 8px; color: white; background: var(--purple); text-decoration: none; font-weight: 650; }
.guide-page .guide-action:hover { background: var(--purple-dark); }
.guide-page figure { margin: 22px 0; }
.guide-page img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 14px; }
.guide-page figcaption { margin-top: 8px; color: var(--muted); font-size: .92rem; }
.guide-page table { margin: 14px 0; font-size: .9rem; }
.guide-page th, .guide-page td { padding-inline: 5px; }
.guide-page .guide-card { margin-top: 25px; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); }
.guide-page .guide-card h2 { margin: 0 0 8px; }
.site-footer a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; text-underline-offset: 3px; }
.site-footer nav { flex-wrap: wrap; gap: 0 18px; }
.privacy-policy { max-width: 70ch; margin: 16px 0 0; }
.privacy-policy h2 { margin-bottom: 8px; font-size: 1.1rem; }
.privacy-policy p + p { margin-top: 8px; }
.analytics-settings { min-height: 44px; padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.analytics-settings:hover { color: var(--purple); }
.analytics-prompt {
  position: fixed;
  z-index: 2;
  right: 12px;
  bottom: 12px;
  width: min(26rem, calc(100% - 24px));
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
  box-shadow: 0 6px 26px #24193825;
  font-size: 14px;
}
.analytics-prompt div { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.analytics-prompt button { min-height: 38px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); color: var(--ink); }
.analytics-prompt button:hover { border-color: var(--purple); }

@media (max-width: 730px) {
  .wrap { width: calc(100% - 36px); }
  .site-header { min-height: 60px; }
  nav { gap: 17px; }
  nav a { font-size: 13px; }
  .brand { font-size: 22px; }
  .brand-mark { width: 30px; height: 30px; }
  .tool-heading { display: block; margin: 24px 0 14px; }
  h1 { font-size: clamp(2.65rem, 11.5vw, 4.2rem); }
  .tool-heading p { margin-top: 8px; font-size: 16px; }
  .privacy { margin-top: 11px; }
  .tool-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .panel { padding: 14px; border-radius: 15px; }
  .panel-heading { margin-bottom: 11px; }
  .dropzone { min-height: 122px; }
  .roll { height: 114px; }
  .metrics { min-height: 69px; }
  .metrics dd { font-size: 14px; }
  .note-section { margin-top: 12px; padding: 15px 13px 8px; }
  th, td { padding: 7px 5px; font-size: 12px; }
  .reading { margin-top: 53px; }
  .reading-row { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 22px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
