:root { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #172033; background: #f6f8fc; font-synthesis: none; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: radial-gradient(circle at 50% -20%, #e8f0ff 0, #f6f8fc 42%); }
.app { width: min(860px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 64px; }
.card { background: rgba(255,255,255,.94); border: 1px solid #e8edf5; border-radius: 22px; padding: 28px; margin-bottom: 18px; box-shadow: 0 12px 34px rgba(29,50,87,.07); }
.hero { position: relative; overflow: hidden; padding: 34px; background: linear-gradient(135deg, #f0f5ff, #fff 70%); }
.hero::after { content: ""; position: absolute; width: 190px; height: 190px; right: -70px; top: -90px; border-radius: 50%; background: #dce8ff; opacity: .65; }
.eyebrow { position: relative; z-index: 1; color: #3970df; font-size: 12px; letter-spacing: .08em; font-weight: 800; margin: 0 0 12px; }
h1 { position: relative; z-index: 1; margin: 0; font-size: clamp(32px, 6vw, 48px); letter-spacing: -.055em; line-height: 1.05; }
.subtitle, .hint { color: #75839a; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 6px; }
.section-kicker { margin: 0 0 5px; color: #3970df; font-size: 12px; font-weight: 800; letter-spacing: .08em; }
h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.step-badge { padding: 6px 10px; border-radius: 999px; background: #eaf0ff; color: #3970df; font-size: 12px; font-weight: 800; white-space: nowrap; }
.upload-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.file-input { display: none; }
.upload-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid #dbe3ef; border-radius: 12px; padding: 11px 17px; background: #eef2f8; color: #26334a; font-weight: 750; cursor: pointer; transition: transform .18s, box-shadow .18s; }
.upload-button:hover { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(34,57,96,.12); }
.primary-upload { border-color: transparent; background: #3970df; color: #fff; }
.image-panel { margin-top: 18px; padding: 12px; border: 1px solid #e4eaf3; border-radius: 16px; background: #f8faff; }
.image-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.image-gallery img { display: block; width: 100%; height: 130px; object-fit: cover; border-radius: 10px; background: #eef2f8; }
.image-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; color: #75839a; font-size: 13px; }
.image-actions { display: flex; gap: 8px; }
.ocr-button { width: 100%; margin-top: 14px; background: #eaf0ff; color: #2459c4; }
.ocr-status { min-height: 20px; margin: 10px 0 0; color: #75839a; font-size: 13px; text-align: center; }
.subtitle { position: relative; z-index: 1; margin: 14px 0 0; font-size: 16px; }
label { display: block; font-weight: 750; margin-bottom: 10px; color: #26334a; }
.words-editor, input { width: 100%; border: 1px solid #dbe3ef; border-radius: 14px; padding: 14px 16px; font: inherit; color: inherit; background: #fbfcff; transition: border-color .2s, box-shadow .2s, background .2s; }
.words-editor { min-height: 190px; line-height: 1.8; outline: none; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; }
.words-editor:empty::before { content: attr(data-placeholder); color: #a3aec0; }
.words-editor:focus, input:focus { outline: none; border-color: #6b96ee; box-shadow: 0 0 0 4px #e5edff; background: #fff; }
.editor-word { display: inline-block; transition: font-size .2s ease, font-weight .2s ease, color .2s ease; }
.editor-word.active { color: #2459c4; font-size: 1.35em; font-weight: 850; }
.hint { font-size: 13px; margin: 10px 0 22px; }
.word-preview { display: none; }
.settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.settings label { font-size: 13px; letter-spacing: .01em; }
.settings input { display: block; margin-top: 8px; }
.number-control { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 7px; margin-top: 8px; }
.number-control input { margin-top: 0; text-align: center; font-weight: 750; }
.number-control button { padding: 6px 0; font-size: 19px; line-height: 1; }
.volume-setting { display: flex; align-items: center; gap: 12px; margin-top: 20px; font-size: 13px; }
.volume-setting span { color: #3970df; font-weight: 800; }
.volume-setting input[type="range"] { flex: 1; padding: 0; border: 0; box-shadow: none; background: transparent; }
.actions, .nav-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }
button { min-height: 44px; border: 1px solid transparent; border-radius: 12px; padding: 11px 17px; background: #eef2f8; color: #26334a; font: inherit; font-weight: 750; cursor: pointer; transition: transform .18s, box-shadow .18s, background .18s; }
button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 14px rgba(34,57,96,.12); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: #3970df; color: white; box-shadow: 0 5px 14px rgba(57,112,223,.2); }
.player { text-align: center; padding-top: 22px; padding-bottom: 22px; }
.progress-row { display: flex; justify-content: center; gap: 12px; color: #71809a; font-size: 14px; }
.status { color: #3970df; font-weight: 800; }
.current-word { display: none; }
.progress-wrap { position: relative; width: 100%; padding: 5px 0 30px; }
.settings-progress { margin-top: 20px; padding-top: 5px; }
.progress-label { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; color: #71809a; font-size: 13px; }
.progress-slider { position: absolute; z-index: 2; top: 30px; left: 0; width: 100%; height: 32px; margin: 0; padding: 0; border: 0; appearance: none; background: linear-gradient(to right, #3970df var(--progress, 0%), #e8edf5 var(--progress, 0%)); border-radius: 8px; cursor: pointer; }
.progress-slider:disabled { cursor: not-allowed; }
.progress-slider::-webkit-slider-runnable-track { height: 8px; background: transparent; }
.progress-slider::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; margin-top: -4px; border: 3px solid #fff; border-radius: 50%; background: #3970df; box-shadow: 0 2px 6px rgba(38,70,130,.25); }
.progress-slider::-moz-range-track { height: 8px; background: transparent; }
.progress-slider::-moz-range-thumb { width: 12px; height: 12px; border: 3px solid #fff; border-radius: 50%; background: #3970df; box-shadow: 0 2px 6px rgba(38,70,130,.25); }
.progress-wrap > .progress { display: none; }
.nav-actions { justify-content: center; margin-top: 14px; }
@media (max-width: 900px) {
  .app { width: min(100% - 32px, 760px); }
  .card { padding: 24px; }
}
@media (max-width: 650px) {
  body { background: #f6f8fc; }
  .app { width: 100%; padding: 12px 12px 32px; }
  .card, .hero { padding: 18px; border-radius: 16px; margin-bottom: 12px; }
  .hero { padding-top: 22px; padding-bottom: 22px; }
  h1 { font-size: clamp(30px, 10vw, 40px); }
  h2 { font-size: 20px; }
  .subtitle { font-size: 14px; line-height: 1.6; }
  .section-heading { align-items: flex-start; }
  .step-badge { display: none; }
  .upload-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .upload-button { width: 100%; padding: 10px 8px; }
  .image-panel { padding: 10px; }
  .image-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .image-gallery img { height: 88px; border-radius: 8px; }
  .image-meta { align-items: stretch; flex-direction: column; gap: 10px; }
  .image-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .image-actions button { width: 100%; padding-left: 8px; padding-right: 8px; }
  .words-editor { min-height: 160px; padding: 12px; font-size: 16px; line-height: 2; }
  .settings { grid-template-columns: 1fr; gap: 10px; }
  .settings > label { padding: 10px 0; border-bottom: 1px solid #edf1f7; }
  .settings > label:last-child { border-bottom: 0; }
  .number-control { grid-template-columns: 48px minmax(0, 1fr) 48px; gap: 8px; }
  .number-control button { font-size: 21px; }
  .volume-setting { flex-wrap: wrap; gap: 8px 10px; margin-top: 14px; }
  .volume-setting input[type="range"] { flex-basis: 100%; min-height: 32px; }
  .progress-wrap { padding-bottom: 34px; }
  .progress-slider { top: 30px; height: 36px; }
  .progress-slider::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -6px; }
  .progress-slider::-moz-range-thumb { width: 16px; height: 16px; }
  .progress-row { flex-direction: column; gap: 4px; }
  .actions, .nav-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .actions button:first-child { grid-column: 1 / -1; }
  .actions button, .nav-actions button { width: 100%; }
}
