@import url('/main.css');

/* Shared navigation and readable tool pages. */
.home-brand { color: var(--text); text-decoration: none; }
.home-brand:hover .brand-name { color: var(--accent); }
.tool-nav { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-width: 780px; margin: 20px auto 0; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #edf1e8; }
.tool-nav a { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 9px 12px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); font-size: 0.9rem; font-weight: 600; text-decoration: none; text-align: center; line-height: 1.4; }
.tool-nav a.current { background: white; border-color: var(--line); color: var(--accent-dark); box-shadow: 0 2px 5px #263c2d05; }
.tool-nav a:hover { background: white; color: var(--accent); }
.tool-main { max-width: 780px; margin: 0 auto; }
.tool-intro { text-align: center; padding: 26px 0 24px; }
.tool-intro h1 { font-size: clamp(1.6rem, 3.5vw, 2.1rem); line-height: 1.35; font-weight: 650; letter-spacing: -0.03em; }
.tool-intro > p:last-child { color: var(--muted); margin-top: 12px; }
.tool-card { padding: 30px 36px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); min-width: 0; margin-bottom: 22px; }
.tool-card h2 { font-size: 1.5rem; line-height: 1.35; font-weight: 650; letter-spacing: -0.03em; }
.tool-card h2:focus { outline: none; }
.tool-card h3 { font-size: 1rem; margin: 0; }
.source-editor { min-height: 230px; }
.editor-tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.editor-tools .back-button { margin: 0; padding: 8px 0; font-size: 0.85rem; }
.editor-tools .back-button:disabled { color: var(--muted); }
.file-shortcut { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px; border: 1px solid var(--line-strong); border-radius: 10px; color: var(--accent); background: #f7faf4; cursor: pointer; }
.file-shortcut input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-shortcut svg { width: 24px; height: 24px; flex: none; }
.file-shortcut:focus-within { outline: 3px solid var(--focus); outline-offset: 4px; }
.file-shortcut.dragging, .file-shortcut:hover { background: var(--accent-soft); border-color: var(--accent); }
.file-formats { margin-top: 8px; text-align: center; }
.language-field { margin-top: 22px; }
.language-field > span { color: var(--text); font-size: 1rem; }
.tool-settings { margin-top: 16px; }
.import-options { margin-top: 22px; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.full-field { grid-column: 1 / -1; }
.tool-progress { margin: 20px 0 0; }
.tool-progress[data-state='error'] .progress-help { color: var(--warn); }
.result-heading { display: flex; align-items: center; gap: 12px; }
.completion-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 1.15rem; }
.output-label { color: var(--accent); margin: 24px 0 10px !important; font-weight: 650; }
.output-box { resize: none; min-height: 300px; }
.tool-result-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin: 22px 0 8px; }
.tool-result-actions .big-button { margin: 0; }
.save-button::after { content: '↓'; }
.cost-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 14px 0; }
.cost-panel > div { display: grid; gap: 5px; }
.cost-panel span { color: var(--muted); font-size: 0.85rem; }
.cost-panel strong { font-size: 1rem; overflow-wrap: anywhere; }
.quality { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding-bottom: 16px; }
.quality ul { margin: 10px 0 0; padding-left: 1.2em; color: var(--muted); }
.quality li + li { margin-top: 8px; }
.tool-footer { padding-top: 4px; }
.footer-hint { padding: 10px 0; font-size: 0.85rem; }

/* Live captions keep the words and the stop button in view. */
.live-main { max-width: 900px; }
.live-control-card h2 { font-size: 1.3rem; }
.live-control-card #liveMeta { margin-top: 6px; }
.live-meter { display: flex; align-items: flex-start; gap: 14px; border: 1px solid var(--line); border-radius: 12px; background: #f7faf4; margin: 20px 0; padding: 16px 18px; }
.live-meter > div:last-child { display: grid; gap: 4px; }
.live-meter span { color: var(--muted); font-size: 0.95rem; }
.live-dot { flex: none; width: 12px; height: 12px; margin-top: 10px; border-radius: 50%; background: var(--line-strong); }
.live-dot.active { background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.source-help { margin-top: 10px; }
.stop-button { background: var(--warn); border-color: var(--warn); }
.stop-button::after { display: none; }
.stop-button:hover:not(:disabled) { background: #792914; border-color: #792914; }
.live-progress { margin-top: 16px; font-size: 0.9rem; color: var(--muted); }
.live-progress .progress-head { font-weight: 400; }
.live-progress .progress-track, .live-progress #progressPercent { display: none; }
.caption-heading { margin-bottom: 22px; }
.caption-heading p { color: var(--muted); margin-top: 8px; font-size: 0.9rem; }
.caption-stage { min-height: 210px; max-height: 65vh; overflow: auto; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdf8; }
.caption-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; min-height: 200px; color: var(--muted); }
.caption-empty svg { width: 45px; height: 45px; color: var(--accent); margin-bottom: 4px; }
.caption-empty strong { font-size: 1.1rem; color: var(--text); }
.caption-empty span { font-size: 0.95rem; }
.caption-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.caption-item:first-child { padding-top: 0; }
.caption-item:last-child { border-bottom: 0; padding-bottom: 0; }
.caption-number { color: var(--accent); font-size: 0.85rem; padding-top: 8px; }
.caption-text { color: var(--text); font-size: 1.5rem; line-height: 1.65; overflow-wrap: anywhere; }
.caption-chinese { grid-column: 2; font-size: 1.1rem; color: var(--muted); line-height: 1.8; overflow-wrap: anywhere; }
.caption-stage.hide-chinese .caption-chinese { display: none; }
.caption-options { margin-top: 22px; }

/* The access-code page has one field and one main action. */
.login-shell { min-height: 100vh; padding: 36px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; }
.login-controls { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; width: min(540px, 100%); }
.login-brand { justify-content: center; }
.login-card { width: min(540px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: 22px; background: white; box-shadow: var(--shadow); }
.login-lock { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); margin: 0 0 18px; }
.login-lock svg { width: 28px; height: 28px; }
.login-card h1 { font-size: 1.6rem; line-height: 1.4; letter-spacing: -0.03em; }
.login-card > p { margin: 12px 0 24px; color: var(--muted); }
.login-card .field > span { color: var(--text); font-size: 1rem; }
.login-card input { min-height: 64px; border: 1.5px solid var(--line-strong); border-radius: 12px; font-size: 1.3rem; padding: 12px 16px; width: 100%; }
.login-card .login-error { color: var(--warn); margin: 12px 0 0; font-weight: 600; }
.login-error:empty { display: none; }
.login-note { font-size: 0.9rem; color: var(--muted); text-align: center; max-width: 500px; }

@media (max-width: 760px) {
  .tool-intro { padding: 26px 0; }
  .tool-card { padding: 28px; }
  .footer-hint { display: none; }
}
@media (max-width: 480px) {
  .tool-nav { margin: 18px auto; padding: 4px; gap: 3px; border-radius: 12px; }
  .tool-nav a { font-size: 0.85rem; padding: 10px 5px; min-height: 52px; }
  .tool-page .top { align-items: center; flex-wrap: nowrap; gap: 12px; }
  .tool-page .top-actions { width: auto; flex: none; }
  .tool-page .tagline, .tool-page .text-size-button > span:first-child { display: none; }
  .tool-intro { text-align: left; padding: 8px 0 22px; }
  .tool-intro .eyebrow { display: none; }
  .tool-intro h1 { font-size: 1.4rem; }
  .tool-intro > p:last-child { font-size: 0.95rem; margin-top: 8px; }
  .tool-card { padding: 24px 20px; border-radius: 16px; margin-bottom: 18px; }
  .tool-card h2 { font-size: 1.3rem; }
  .control-grid, .quality, .tool-result-actions { grid-template-columns: 1fr; }
  .cost-panel { grid-template-columns: 1fr; gap: 12px; }
  .cost-panel > div { grid-template-columns: minmax(0, 1fr) auto; }
  .full-field { grid-column: auto; }
  .source-editor { min-height: 220px; }
  .file-shortcut { font-size: 0.95rem; padding: 12px; gap: 10px; }
  .caption-stage { padding: 18px; }
  .caption-text { font-size: 1.3rem; }
  .caption-empty { min-height: 180px; }
  .live-meter { padding: 14px; }
  .login-shell { padding: 24px 16px; gap: 20px; justify-content: flex-start; }
  .login-card { padding: 26px 22px; border-radius: 16px; }
  .login-card h1 { font-size: 1.4rem; }
  .login-brand .tagline { display: none; }
  .login-controls .text-size-button { font-size: 0.85rem; }
  .welcome { padding: 0; }
  .welcome h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
