@import url('https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=DM+Sans:wght@400;500;600;700&display=swap');

:root {
  color-scheme: light;
  --ink: #172b27;
  --ink-soft: #52635d;
  --muted: #7f8a82;
  --paper: #f5f6f0;
  --card: #fffefa;
  --line: #e1e6dc;
  --line-strong: #cbd4c8;
  --forest: #174d3d;
  --forest-deep: #123b31;
  --lime: #d9fa73;
  --lime-soft: #f0f8d6;
  --danger: #a94336;
  --danger-bg: #fff0eb;
  --font-ui: "DM Sans", "Noto Sans Myanmar", "Myanmar Text", Padauk, sans-serif;
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-family: var(--font-ui);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 8% 8%, rgba(217, 250, 115, .15), transparent 28rem),
    var(--paper);
}

button, input, select, textarea { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.page-shell { width: min(100% - 56px, 936px); margin: 0 auto; }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
.brand-mark { display: inline-flex; width: 38px; height: 38px; color: var(--forest); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: -.55px; }
.brand-name span { margin-left: 4px; color: #819086; font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.install-app-button { min-height: 36px; padding: 0 12px; border: 1px solid #cbdac5; border-radius: 8px; background: #f0f6e7; color: var(--forest); font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.install-app-button:hover { background: #e6f0d7; }
.install-app-button:focus-visible { outline: 3px solid rgba(23,77,61,.22); outline-offset: 2px; }
.install-app-button[hidden] { display: none; }
.install-status { max-width: 650px; margin: 12px 0 0 auto; padding: 10px 13px; border: 1px solid #d7e2d0; border-radius: 9px; background: #f0f6e7; color: #405b45; font-size: 11px; line-height: 1.8; }
.install-status[hidden] { display: none; }
.topbar-note { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: #52645b; font: 500 10px/1 var(--font-mono); letter-spacing: .035em; }
.online-dot, .confidence-dot { width: 7px; height: 7px; border-radius: 50%; background: #8eb85b; box-shadow: 0 0 0 3px rgba(142,184,91,.14); }

.intro { max-width: 740px; margin: 64px auto 37px; text-align: center; }
.eyebrow, .section-kicker { display: inline-flex; align-items: center; color: #73847a; font: 500 10px/1.5 var(--font-mono); letter-spacing: .12em; }
.eyebrow { gap: 10px; }
.eyebrow-line { width: 23px; height: 1px; background: #97aa95; }
h1, h2, p { margin: 0; }
h1 { margin-top: 18px; font-size: clamp(34px, 5.7vw, 53px); line-height: 1.14; letter-spacing: -.065em; font-weight: 600; }
.title-emoji { display: inline-block; margin-right: 4px; font-size: .78em; vertical-align: .08em; }
.title-last { color: var(--forest); }
.intro-copy { max-width: 625px; margin: 18px auto 0; color: var(--ink-soft); font-size: 16px; line-height: 1.9; }

.workspace, .result-section { position: relative; padding: 29px 32px 24px; border: 1px solid #e2e6de; border-radius: 19px; background: rgba(255,254,250,.94); box-shadow: 0 16px 44px rgba(40,58,47,.055), 0 2px 7px rgba(40,58,47,.025); }
.workspace-heading, .result-topline { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.workspace-heading h2, .result-topline h2 { margin-top: 5px; font-size: 20px; line-height: 1.45; letter-spacing: -.04em; font-weight: 600; }
.format-pill { padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: #718077; font: 400 9px/1 var(--font-mono); letter-spacing: .015em; white-space: nowrap; }

.upload-zone { min-height: 214px; margin-top: 23px; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 23px 20px; border: 1px dashed #c5d0c2; border-radius: 14px; background: linear-gradient(135deg, rgba(243,248,234,.6), rgba(250,251,246,.8)); text-align: center; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.upload-zone:hover, .upload-zone.drag-active { border-color: #6a9979; background: #f1f7e8; }
.upload-zone:active { transform: scale(.997); }
.upload-zone:focus-within { outline: 3px solid rgba(23,77,61,.16); outline-offset: 3px; }
.upload-icon { width: 43px; height: 43px; margin-bottom: 12px; display: grid; place-items: center; color: var(--forest); border: 1px solid #dfe8d5; border-radius: 13px; background: #f1f7e7; }
.upload-icon svg { width: 28px; height: 28px; }
.upload-title { color: var(--ink); font-size: 16px; font-weight: 600; line-height: 1.7; }
.upload-subtitle { margin-top: 4px; color: #7c8980; font-size: 12px; line-height: 1.7; }
.browse-cta { margin-top: 14px; padding: 8px 13px; border: 1px solid #dde4d9; border-radius: 8px; background: #fffefa; color: var(--forest); font-size: 12px; font-weight: 600; }
.browse-cta span { margin-left: 5px; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
#file-input:focus-visible + .upload-zone { outline: 3px solid rgba(23,77,61,.22); outline-offset: 3px; }

.selected-file { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcf8; }
.file-type-icon { display: grid; width: 37px; height: 37px; flex: 0 0 auto; place-items: center; border-radius: 9px; background: var(--lime-soft); color: var(--forest); font: 500 9px/1 var(--font-mono); }
.file-name { min-width: 0; overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.file-size { margin-left: auto; flex: 0 0 auto; color: var(--muted); font: 400 10px/1 var(--font-mono); }
.remove-file { display: grid; width: 28px; height: 28px; flex: 0 0 auto; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #7e8981; font-size: 22px; cursor: pointer; }
.remove-file:hover { background: #eef1ea; color: var(--ink); }

.target-language-field { display: flex; flex-direction: column; gap: 7px; margin-top: 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcf8; }
.target-language-label { color: var(--ink); font-size: 12px; font-weight: 600; }
.target-language-label span { color: var(--muted); font-size: 11px; font-weight: 400; }
.target-language-select { width: 100%; max-width: 480px; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); }
.target-language-select:focus-visible { outline: 3px solid rgba(23,77,61,.2); outline-offset: 2px; }
.target-language-help, .translation-note { color: #7d8980; font-size: 10px; line-height: 1.75; }
.translation-note { color: #617267; }

.sound-settings { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcf8; }
.sound-settings-heading { display: flex; flex-direction: column; gap: 3px; }
.sound-settings-heading strong { color: var(--ink); font-size: 12px; font-weight: 600; }
.sound-settings-heading span, .sound-settings-help { color: #7d8980; font-size: 10px; line-height: 1.7; }
.sound-settings-controls { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(220px, 1fr) auto; align-items: end; gap: 12px; }
.sound-control { display: flex; min-width: 0; flex-direction: column; gap: 6px; color: var(--ink); font-size: 11px; font-weight: 600; }
.sound-type-select { width: 100%; min-height: 39px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 11px; }
.sound-volume-row { display: flex; align-items: center; gap: 9px; min-height: 39px; }
.sound-volume-slider { width: 100%; accent-color: var(--forest); cursor: pointer; }
.sound-volume-value { min-width: 42px; color: #506353; font: 500 11px/1 var(--font-mono); text-align: right; }
.sound-preview-button { min-height: 39px; padding: 0 13px; border: 1px solid #d8e2d2; border-radius: 8px; background: #f0f6e7; color: var(--forest); font-size: 11px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.sound-preview-button:hover { background: #e6f0d7; transform: translateY(-1px); }
.sound-type-select:focus-visible, .sound-volume-slider:focus-visible, .sound-preview-button:focus-visible { outline: 3px solid rgba(23,77,61,.2); outline-offset: 2px; }
.sound-settings-help { margin-top: -2px; }

.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 20px; }
.privacy-note { display: flex; align-items: center; gap: 7px; color: #7d8980; font-size: 11px; line-height: 1.8; }
.privacy-note svg { width: 16px; height: 16px; flex: 0 0 auto; color: #6d9271; }
.generate-button, .download-button { min-height: 45px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; padding: 0 17px; border: 0; border-radius: 9px; background: var(--forest); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .18s ease, transform .18s ease, opacity .18s ease; }
.generate-button svg { width: 19px; height: 19px; }
.generate-button:hover:not(:disabled), .download-button:hover:not(:disabled) { background: var(--forest-deep); transform: translateY(-1px); }
.generate-button:disabled, .download-button:disabled { opacity: .46; cursor: not-allowed; }
.generate-button:focus-visible, .download-button:focus-visible, .remove-file:focus-visible { outline: 3px solid rgba(23,77,61,.25); outline-offset: 3px; }

.progress-panel { display: flex; align-items: center; gap: 13px; margin-top: 17px; padding: 14px 15px; border: 1px solid #e1e9d6; border-radius: 10px; background: #f5f9eb; }
.spinner { width: 20px; height: 20px; flex: 0 0 auto; border: 2px solid #d4e3c5; border-top-color: var(--forest); border-radius: 50%; animation: spin .75s linear infinite; }
.progress-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.progress-copy strong { color: #344e3e; font-size: 12px; font-weight: 600; line-height: 1.7; }
.progress-copy span { color: #7a887d; font-size: 11px; line-height: 1.7; }
.progress-label { margin-left: auto; flex: 0 0 auto; color: #718263; font: 500 9px/1 var(--font-mono); letter-spacing: .04em; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-panel { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 13px 14px; border: 1px solid #f0d5cc; border-radius: 10px; background: var(--danger-bg); color: #853e33; font-size: 12px; line-height: 1.85; }
.error-icon { width: 19px; height: 19px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: #f5d6cd; color: #933e32; font: 600 12px/1 var(--font-mono); }

.result-section { margin-top: 22px; padding-bottom: 22px; }
.result-topline { align-items: flex-start; }
.language-cards { display: flex; gap: 8px; }
.language-card { display: flex; align-items: center; gap: 9px; min-width: 150px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcf8; }
.language-orb { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; background: #edf4dd; color: var(--forest); font: 500 12px/1 var(--font-mono); }
.target-orb { background: #e7f0e9; }
.language-card small { display: block; color: #849087; font-size: 9px; line-height: 1.55; }
.language-card strong { display: block; margin-top: 1px; color: #354a3d; font: 500 11px/1.4 var(--font-mono); letter-spacing: .06em; }
.confidence-line { display: flex; align-items: center; gap: 8px; margin: 15px 0 10px; color: #849087; font-size: 11px; }
.confidence-line strong { color: #506353; font: 500 11px/1 var(--font-mono); }
.confidence-dot { width: 6px; height: 6px; }
.srt-output { display: block; width: 100%; min-height: 265px; resize: vertical; padding: 15px 16px; border: 1px solid #dfe5dc; border-radius: 10px; outline: none; background: #fbfcf8; color: #34433c; font: 12px/1.8 var(--font-mono); tab-size: 2; }
.srt-output:focus { border-color: #8ba58a; box-shadow: 0 0 0 3px rgba(97,139,97,.1); }
.srt-output::placeholder { color: #9aa49c; }
.result-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 15px; }
.edit-hint { display: inline-flex; align-items: center; gap: 6px; color: #829087; font-size: 11px; line-height: 1.7; }
.edit-hint svg { width: 15px; height: 15px; flex: 0 0 auto; }
.download-button { min-height: 42px; font-size: 12px; }
.download-button svg { width: 18px; height: 18px; }

.page-footer { display: flex; align-items: center; justify-content: space-between; padding: 26px 2px 30px; color: #8a958d; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; font: 500 9px/1 var(--font-mono); letter-spacing: .13em; }
.footer-mark { width: 6px; height: 6px; border-radius: 2px; background: #87a76e; transform: rotate(45deg); }
.footer-note { font-size: 11px; }

@media (max-width: 680px) {
  .page-shell { width: min(100% - 34px, 560px); }
  .topbar { height: 68px; }
  .topbar-actions { gap: 7px; }
  .topbar-note { display: none; }
  .install-app-button { min-height: 34px; padding: 0 9px; font-size: 10px; }
  .intro { margin: 46px auto 27px; }
  .eyebrow { font-size: 9px; }
  h1 { max-width: 480px; margin: 16px auto 0; font-size: clamp(31px, 8.5vw, 43px); line-height: 1.22; }
  .intro-copy { margin-top: 13px; font-size: 14px; line-height: 1.85; }
  .workspace, .result-section { padding: 22px 19px 19px; border-radius: 15px; }
  .workspace-heading { align-items: flex-start; flex-direction: column; gap: 10px; }
  .format-pill { align-self: flex-start; }
  .upload-zone { min-height: 205px; margin-top: 18px; padding: 20px 15px; }
  .upload-title { font-size: 15px; }
  .upload-subtitle { max-width: 260px; font-size: 11px; }
  .form-footer { align-items: stretch; flex-direction: column; gap: 14px; margin-top: 16px; }
  .sound-settings-controls { grid-template-columns: 1fr 1fr; }
  .sound-preview-button { grid-column: 1 / -1; }
  .privacy-note { align-items: flex-start; font-size: 10px; }
  .privacy-note svg { margin-top: 2px; }
  .generate-button { width: 100%; }
  .progress-label { display: none; }
  .result-topline { align-items: flex-start; }
  .language-cards { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
  .language-card { min-width: auto; padding: 7px 8px; gap: 7px; }
  .language-orb { width: 28px; height: 28px; }
  .language-card small { font-size: 8px; }
  .language-card strong { font-size: 10px; }
  .result-footer { align-items: stretch; flex-direction: column; gap: 12px; }
  .edit-hint { align-items: flex-start; }
  .edit-hint svg { margin-top: 2px; }
  .download-button { width: 100%; }
  .page-footer { padding-top: 22px; }
}

@media (max-width: 420px) {
  .page-shell { width: min(100% - 26px, 560px); }
  .topbar-note { padding: 7px 9px; font-size: 8px; }
  .brand-name { font-size: 14px; }
  .install-app-button { padding: 0 7px; font-size: 9px; }
  .workspace, .result-section { padding-right: 15px; padding-left: 15px; }
  .sound-settings { padding: 12px; }
  .sound-settings-controls { grid-template-columns: 1fr; }
  .sound-preview-button { grid-column: auto; }
  .upload-subtitle { font-size: 10px; }
  .file-size { display: none; }
  .result-topline h2, .workspace-heading h2 { font-size: 18px; }
  .footer-note { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
