/* =====================================================================
   Parlante SPA · Morandi / cream palette, modern typography
   ===================================================================== */
:root {
    --bg: #f5efe6;
    --surface: #ffffff;
    --surface-muted: #fbf6ee;
    --bg-stone: #e8e0d0;
    --ink: #2a2520;
    --ink-soft: #6b5e4f;
    --ink-mute: #a39a8d;
    --accent: #a87b4a;
    --accent-soft: #d4ad7f;
    --accent-deep: #8a5a30;
    --success: #6b8e5a;
    --danger: #b97060;
    --radius-s: 10px;
    --radius-m: 14px;
    --radius-l: 22px;
    --shadow-card: 0 2px 8px rgba(80, 60, 30, 0.06), 0 0 0 1px rgba(80, 60, 30, 0.04);
    --shadow-soft: 0 6px 18px -8px rgba(80, 60, 30, 0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
    font-family: -apple-system, 'Inter', 'Helvetica Neue', sans-serif;
    color: var(--ink);
    background: var(--bg);
    min-height: 100vh;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: var(--accent-deep); text-decoration: none; }
.hidden { display: none !important; }

.screen {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    padding: 24px 20px 32px;
    background: var(--bg);
}

/* ========================== HERO / SIGN-IN ========================== */
.hero { padding: 12px 0 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: 0.04em; }
.brand-logo {
    width: 36px; height: 36px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-soft));
    display: grid; place-items: center; color: #fff;
    font-family: 'PT Serif', Georgia, serif; font-weight: 600; font-size: 18px;
}
.brand-logo.small { width: 26px; height: 26px; font-size: 13px; }
.brand.small { font-size: 13px; }

.hero h1 {
    font-family: 'PT Serif', Georgia, serif; font-weight: 500;
    font-size: 36px; line-height: 1.1; margin: 22px 0 8px; color: var(--ink);
}
.hero h1 em { font-style: italic; color: var(--accent-deep); }
.hero p { color: var(--ink-soft); font-size: 15px; line-height: 1.5; }

.auth-card {
    background: var(--surface);
    border-radius: var(--radius-l);
    padding: 20px;
    box-shadow: var(--shadow-card);
}
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tabs .tab {
    flex: 1; padding: 10px; border-radius: 999px;
    background: transparent; color: var(--ink-soft); font-weight: 600; font-size: 13px;
    transition: all 0.15s;
}
.auth-tabs .tab.active {
    background: var(--ink); color: #fff;
}
.auth-pane { padding: 12px 0 0; }
.auth-pane .hint { font-size: 12.5px; color: var(--ink-mute); margin-bottom: 12px; line-height: 1.5; }
.auth-pane input {
    width: 100%; padding: 14px 16px; border-radius: 10px;
    border: 1px solid var(--bg-stone); background: var(--surface);
    font-size: 15px; font-family: inherit; color: var(--ink);
    margin-bottom: 10px;
}
.auth-pane input:focus { outline: 2px solid var(--accent-soft); outline-offset: -1px; }

.btn {
    padding: 13px 18px; border-radius: 10px;
    font-weight: 600; font-size: 14px;
    transition: transform 0.1s, box-shadow 0.15s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    cursor: pointer;
}
.btn.block { width: 100%; }
.btn.primary { background: var(--ink); color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.btn.primary:active { transform: translateY(1px); }
.btn.google  { background: #ffffff; color: #1f1f1f; box-shadow: var(--shadow-card); border: 1px solid var(--bg-stone); }
.btn.apple   { background: #000; color: #fff; }

.dev-hint {
    margin-top: 12px; padding: 10px 12px;
    background: rgba(168, 123, 74, 0.10);
    border-radius: 8px; color: var(--accent-deep);
    font-family: 'SF Mono', Menlo, Consolas, monospace;
    font-size: 14px; text-align: center;
}
.error {
    color: var(--danger);
    font-size: 13px;
    margin-top: 10px;
    padding: 10px 12px;
    background: rgba(185, 112, 96, 0.10);
    border-radius: 8px;
}

/* ========================== HOME / TRANSLATE ========================== */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 4px 12px;
}
.topbar .title { font-weight: 600; }
.wallet-pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    background: linear-gradient(135deg, var(--accent-soft), var(--accent));
    color: #fff; font-size: 12px; font-weight: 600;
}
.icon-btn {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface-muted); display: grid; place-items: center;
    color: var(--ink);
}

.lang-card {
    margin: 14px 0;
    padding: 14px;
    background: var(--surface-muted);
    border-radius: var(--radius-m);
    display: flex; align-items: center; gap: 8px;
}
.lang-card .lang { flex: 1; display: flex; align-items: center; gap: 10px; background: transparent; border: 0; padding: 0; text-align: left; cursor: pointer; transition: opacity .15s; }
.lang-card .lang:hover { opacity: 0.75; }
.lang-card .lang:active { transform: scale(0.98); }
.lang-card .flag {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--bg-stone); display: grid; place-items: center; font-size: 18px;
}
.lang-card .lang-info { display: flex; flex-direction: column; }
.lang-card .name { font-weight: 600; font-size: 14px; }
.lang-card .auto { font-size: 11px; color: var(--ink-mute); }
.swap {
    width: 36px; height: 36px; border-radius: 50%;
    background: var(--surface); color: var(--accent-deep);
    box-shadow: var(--shadow-card);
    display: grid; place-items: center;
}
.voice-pick {
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 500;
    box-shadow: var(--shadow-card);
    display: inline-flex; align-items: center; gap: 6px;
    align-self: center;
}
.voice-pick .voice-icon { font-size: 14px; }
.voice-pick .voice-name { font-weight: 600; color: var(--accent-deep); }
.lang-card .voice-pick { margin-left: auto; margin-right: auto; }

.transcript {
    margin: 16px 0;
    min-height: 160px; max-height: 260px;
    padding: 16px;
    background: var(--surface);
    border-radius: var(--radius-m);
    border: 1px solid var(--bg-stone);
    box-shadow: var(--shadow-card);
    overflow-y: auto;
    font-size: 15px; line-height: 1.55;
}
.transcript .placeholder { color: var(--ink-mute); font-style: italic; text-align: center; }
.transcript .turn {
    margin: 8px 0;
    padding: 10px 12px;
    background: var(--surface-muted);
    border-radius: 10px;
    border-left: 3px solid var(--accent);
}
.transcript .turn.translated { border-left-color: var(--accent-deep); }
.transcript .small { font-size: 11px; color: var(--ink-mute); margin-top: 2px; }
.transcript .text-original { font-weight: 500; }
.transcript .text-translated { color: var(--accent-deep); margin-top: 4px; }

.hold-zone {
    margin: 32px auto 24px;
    width: 200px;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.mic-button {
    width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff, var(--accent) 60%, var(--accent-deep) 100%);
    color: #fff;
    display: grid; place-items: center;
    box-shadow: 0 0 0 6px rgba(168, 123, 74, 0.12), 0 16px 32px -10px rgba(140, 90, 45, 0.5);
    position: relative;
    user-select: none; -webkit-user-select: none;
    touch-action: none;           /* prevent scroll on hold */
}
.mic-button.recording {
    box-shadow: 0 0 0 16px rgba(168, 123, 74, 0.10), 0 16px 32px -10px rgba(140, 90, 45, 0.5);
    transform: scale(0.97);
}
.mic-button i {
    width: 36px; height: 36px; display: block;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='%23fff' d='M12 14q-1.25 0-2.125-.875T9 11V5q0-1.25.875-2.125T12 2q1.25 0 2.125.875T15 5v6q0 1.25-.875 2.125T12 14Zm-1 5h2v3h-2v-3Zm-7-7q0 1.875.7 3.425t2.05 2.825q1.4 1.275 3.4 1.95T12 21q2.15 0 4.225-.7t3.55-1.95q1.45-1.275 2.125-2.825T22 12h-2q0 2.4-1.375 4.275T15.65 18.9q-1.575 1.05-3.65 1.075T8.5 18.9Q5.4 17.25 4.375 15.275T3 11H2Z'/></svg>");
    background-size: contain; background-repeat: no-repeat;
}
.mic-button.recording i {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><rect x='6' y='6' width='12' height='12' rx='2' fill='%23fff'/></svg>");
}
.hold-zone .hint { font-size: 12px; color: var(--ink-soft); text-align: center; }

/* Debug-only: appears when ?debug=1. Small icon button below the
   mic hint that lets the user save the last ~30s of TTS audio as a
   WAV file (for sharing "what they heard" with devs when reporting
   audio quality bugs). */
.tts-save-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(168, 123, 74, 0.15);
    border: 1px solid rgba(168, 123, 74, 0.4);
    color: var(--accent-deep);
    display: grid; place-items: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.tts-save-btn:hover { background: rgba(168, 123, 74, 0.25); }
.tts-save-btn:active { transform: scale(0.92); }
.tts-save-btn.flash {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}
.tts-save-btn i.save {
    width: 18px; height: 18px; display: block;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M5 20h14v-2H5v2zm7-18l-5.5 5.5L8 9l3-3v10h2V6l3 3 1.5-1.5L12 2z'/></svg>");
    background-size: contain; background-repeat: no-repeat;
}

.tabbar {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; max-width: 480px; margin: 0 auto;
    background: var(--surface);
    border-top: 1px solid var(--bg-stone);
    padding: 8px 8px 14px;
}
.tabbar .tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 6px 0; color: var(--ink-mute); font-size: 10px;
}
.tabbar .tab.active { color: var(--accent-deep); }
.tabbar .tab i {
    width: 22px; height: 22px; display: block;
    background-size: contain; background-repeat: no-repeat; background-position: center;
}
.tabbar .tab .home   { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M12 3L2 12h3v8h5v-6h4v6h5v-8h3L12 3z'/></svg>"); }
.tabbar .tab .wallet { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='currentColor' d='M21 7H5v10h16v-3h-2q-.65 0-1.075-.425T17.5 12.5q0-.65.425-1.075T19 11h2V7zM3 5h18q.825 0 1.413.588T23 7v10q0 .825-.587 1.413T21 19H3q-.825 0-1.413-.587T1 17V7q0-.825.587-1.412T3 5z'/></svg>"); }

/* ========================== WALLET SCREEN ========================== */
.wallet-body { padding: 12px 0 100px; }
.balance-card {
    margin: 12px 0 24px;
    padding: 24px 22px;
    border-radius: var(--radius-l);
    background: linear-gradient(135deg, var(--accent-deep), var(--accent));
    color: #fff;
    box-shadow: 0 18px 36px -16px rgba(140, 90, 45, 0.6);
}
.balance-card .label {
    font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.8;
}
.balance-card .amount {
    font-family: 'PT Serif', Georgia, serif; font-weight: 500;
    font-size: 40px; margin: 6px 0;
}
.balance-card .sub { font-size: 12px; opacity: 0.85; margin-bottom: 12px; }
.balance-card .usage-row {
    display: flex; justify-content: space-between;
    font-size: 11.5px; opacity: 0.85; margin-bottom: 6px;
}
.balance-card .usage-bar {
    height: 6px; border-radius: 3px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}
.balance-card .usage-bar > span {
    display: block; height: 100%; width: 50%;
    background: rgba(255, 255, 255, 0.85);
}

.section-title {
    font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
    color: var(--ink-mute); margin: 18px 0 10px;
}
.plans, .packs { display: flex; flex-direction: column; gap: 10px; }
.plan-row, .pack-row {
    display: flex; align-items: center; gap: 12px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--bg-stone);
    border-radius: var(--radius-m);
}
.plan-row .body { flex: 1; }
.plan-row .name { font-weight: 600; font-size: 15px; }
.plan-row .desc { font-size: 12px; color: var(--ink-mute); margin-top: 2px; }
.plan-row .price { font-weight: 600; font-size: 15px; color: var(--accent-deep); }
.plan-row .cta, .pack-row .cta {
    padding: 8px 12px; border-radius: 8px;
    background: var(--ink); color: #fff; font-size: 13px; font-weight: 600;
}
.pack-row .per-hour { font-size: 11px; color: var(--ink-mute); }

/* -------- Language picker modal -------- */
.modal-backdrop {
    position: fixed; inset: 0; background: rgba(20, 14, 8, 0.45);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    display: flex; align-items: flex-end; justify-content: center;
    z-index: 100; animation: fadeIn .18s ease-out;
}
.modal-backdrop.hidden { display: none; }
.modal-sheet {
    background: var(--surface); width: 100%; max-width: 480px;
    border-radius: var(--radius-l) var(--radius-l) 0 0;
    padding: 14px 18px 28px;
    box-shadow: 0 -8px 32px rgba(80, 60, 30, 0.25);
    animation: slideUp .25s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 80vh; overflow-y: auto;
}
.modal-handle {
    width: 40px; height: 4px; background: var(--bg-stone); border-radius: 2px;
    margin: 0 auto 14px;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-title { font-size: 17px; font-weight: 700; color: var(--ink); }
.modal-close {
    width: 32px; height: 32px; border-radius: 50%;
    background: var(--surface-muted); color: var(--ink-soft);
    font-size: 22px; line-height: 1; display: grid; place-items: center;
}
.modal-hint { font-size: 12px; color: var(--ink-mute); margin-top: 14px; text-align: center; line-height: 1.5; }
.lang-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lang-row {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 14px; border-radius: var(--radius-m);
    background: var(--surface-muted); color: var(--ink);
    text-align: left; border: 1.5px solid transparent;
    transition: all .12s; font-size: 14px;
}
.lang-row:hover { background: var(--bg-stone); }
.lang-row:active { transform: scale(0.97); }
.lang-row.selected {
    border-color: var(--accent);
    background: rgba(168, 123, 74, 0.10);
}
.lang-row .flag { font-size: 22px; line-height: 1; }
.lang-row .name { font-weight: 600; flex: 1; }
.lang-row .check {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--accent); color: #fff;
    display: grid; place-items: center;
    font-size: 11px;
    position: relative;
}
.lang-row .check::before { content: '✓'; font-weight: 900; }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* -------- Live draft visual hint (subtle pulse so it doesn't look identical to finalized) -------- */
.turn.live-draft { opacity: 0.85; }
.turn.live-draft::before {
    content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); margin-right: 6px; animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* -------- Mode tabs (STT / STS / 2-Way) -------- */
.mode-tabs {
    display: flex; gap: 4px; padding: 4px;
    background: var(--surface-muted);
    border-radius: 999px;
    margin: 4px 0 14px;
}
.mode-tabs .tab {
    flex: 1; padding: 9px 12px;
    border-radius: 999px;
    color: var(--ink-soft); font-weight: 600; font-size: 13px;
    background: transparent; border: 0;
    transition: all .15s;
}
.mode-tabs .tab.active {
    background: var(--ink); color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

/* -------- Two-way layout: two transcripts side-by-side -------- */
body.mode-twoway .transcripts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
body.mode-twoway .transcripts .transcript-2 {
    display: flex; flex-direction: column;
}
body.mode-twoway .transcripts #transcript-2:not(.hidden) { display: block; }
body.mode-twoway .transcript {
    min-height: 140px; max-height: 220px;
    font-size: 13px;
}
body.mode-twoway .lang-card .swap { display: none; }

/* -------- TTS playback indicator -------- */
.mic-button.tts-playing {
    box-shadow: 0 0 0 6px rgba(107, 142, 90, 0.25), 0 16px 32px -10px rgba(140, 90, 45, 0.5);
}
.mic-button.tts-playing::after {
    content: ''; position: absolute;
    top: -22px; left: 50%; transform: translateX(-50%);
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(107, 142, 90, 0.7);
    animation: tts-pulse 1.4s infinite;
}
@keyframes tts-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(107, 142, 90, 0.6); }
    70%  { box-shadow: 0 0 0 12px rgba(107, 142, 90, 0); }
    100% { box-shadow: 0 0 0 0 rgba(107, 142, 90, 0); }
}

/* -------- Live draft visual hint -------- */
.turn.live-draft { opacity: 0.85; }
.turn.live-draft::before {
    content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
    background: var(--accent); margin-right: 6px; animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* -------- Soft banner (10s remaining) -------- */
.soft-banner {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 90;
    background: linear-gradient(135deg, #ff9800, #f57c00);
    color: #fff;
    text-align: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    animation: slideDown 0.3s ease-out;
}
@keyframes slideDown {
    from { transform: translateY(-100%); }
    to   { transform: translateY(0); }
}
.banner-cta {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 6px;
    padding: 3px 10px;
    margin-left: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.banner-cta:hover { background: rgba(255, 255, 255, 0.4); }

/* -------- Paywall sheet -------- */
.paywall-sheet {
    padding: 20px 18px 24px;
    max-width: 480px;
    width: 100%;
}
.paywall-header {
    text-align: center;
    margin-bottom: 18px;
}
.paywall-emoji {
    font-size: 44px;
    margin-bottom: 6px;
}
.paywall-title {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.paywall-sub {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
    line-height: 1.4;
}
.paywall-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.paywall-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}
.paywall-option:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.paywall-trial { border-color: #6b8e5a; background: linear-gradient(135deg, #f0f7eb, #fff); }
.paywall-trial:hover { border-color: #587a48; }
.paywall-subscribe { border-color: #2563eb; }
.paywall-pack { border-color: var(--border); }
.paywall-option-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.paywall-option-cta {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.paywall-option-detail {
    font-size: 12px;
    color: var(--muted);
}
.paywall-option-arrow {
    font-size: 18px;
    color: var(--muted);
    margin-left: 8px;
}
.paywall-dismiss {
    width: 100%;
    background: none;
    border: none;
    padding: 12px;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
    margin-top: 6px;
    font-family: inherit;
}
.paywall-dismiss:hover { color: var(--text); }

/* -------- Trial confirmation modal -------- */
.paywall-trial-info {
    background: #f9fafb;
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.trial-info-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}
.trial-info-row span:first-child { color: var(--muted); }
.trial-info-row span:last-child { color: var(--text); font-weight: 500; }

/* -------- Pack purchase grid -------- */
.pack-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.pack-tile {
    position: relative;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 16px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.pack-tile:hover {
    transform: translateY(-1px);
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.pack-amount { font-size: 18px; font-weight: 700; color: var(--text); }
.pack-min { font-size: 12px; color: var(--muted); }
.pack-badge {
    position: absolute;
    top: -8px;
    right: -6px;
    background: #2563eb;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.pack-fineprint {
    text-align: center;
    font-size: 11px;
    color: var(--muted);
    margin: 0 0 8px;
}

/* -------- Account / Settings / History screens -------- */
.account-body, .history-body {
    padding: 16px 18px 80px;
    max-width: 560px;
    margin: 0 auto;
}
.account-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
}
.account-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #6b8e5a);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    flex-shrink: 0;
}
.account-info { flex: 1; min-width: 0; }
.account-name { font-size: 17px; font-weight: 700; color: var(--text); }
.account-email { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text);
}
.account-row > span:first-child { color: var(--muted); font-weight: 500; }
.account-row select {
    font-family: inherit;
    font-size: 14px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
}
.btn.danger {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.btn.danger:hover { background: #fecaca; }
.section-title.danger { color: #b91c1c; }

/* iOS-style switch */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #d1d5db; border-radius: 24px;
    transition: background 0.2s;
}
.slider::before {
    content: ""; position: absolute; height: 18px; width: 18px;
    left: 3px; top: 3px; background: #fff; border-radius: 50%;
    transition: transform 0.2s;
}
.switch input:checked + .slider { background: #2563eb; }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* History list */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.history-item:hover { background: #f9fafb; }
.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.history-item-pair {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.history-item-mode {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--muted);
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.4px;
}
.history-item-meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    gap: 8px;
}
.history-item-snippet {
    font-size: 13px;
    color: var(--text);
    margin-top: 6px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.history-detail-modal {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.history-detail-sheet {
    background: #fff;
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    border-radius: 16px 16px 0 0;
    padding: 18px 18px 28px;
    overflow-y: auto;
}
.history-detail-sheet h3 { margin: 0 0 8px; font-size: 16px; }
.history-turn {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.history-turn:last-child { border-bottom: none; }
.history-turn-orig { font-size: 13px; color: var(--muted); }
.history-turn-trans { font-size: 14px; color: var(--text); margin-top: 2px; }

/* -------- Voice clone UI -------- */
.voice-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.voice-item {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}
.voice-item-name { font-weight: 600; color: var(--text); }
.voice-item-meta { color: var(--muted); font-size: 12px; }
.voice-item-status { font-size: 11px; padding: 2px 8px; border-radius: 4px; text-transform: uppercase; }
.voice-item-status.ready    { background: #d1fae5; color: #047857; }
.voice-item-status.pending  { background: #fef3c7; color: #92400e; }
.voice-item-status.failed   { background: #fee2e2; color: #b91c1c; }

.voice-record-overlay {
    position: fixed; inset: 0; z-index: 250;
    background: rgba(0, 0, 0, 0.5);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.voice-record-sheet {
    background: #fff; border-radius: 14px;
    padding: 24px 22px; width: 100%; max-width: 420px;
    text-align: center;
}
.voice-record-sheet h3 { margin: 0 0 8px; }
.voice-record-progress {
    height: 8px; background: #f3f4f6; border-radius: 4px;
    margin: 16px 0; overflow: hidden;
}
.voice-record-progress-bar {
    height: 100%; background: #2563eb; width: 0%;
    transition: width 0.1s linear;
}
.voice-record-status { font-size: 14px; color: var(--muted); margin: 8px 0 16px; }
.voice-record-label-input {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit;
    margin-bottom: 12px;
}
.voice-record-lang-select {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 14px; font-family: inherit;
    margin-bottom: 12px; background: #fff;
}
