/* ════════════════════════════════════════════
   DESIGN TOKENS
════════════════════════════════════════════ */
:root {
    --ink: #0c0c0e;
    --ink-2: #3a3a42;
    --ink-3: #78788a;
    --ink-4: #b4b4c4;
    --ink-5: #dedee8;
    --rule: #e4e0d6;
    --parchment: #f7f4ed;
    --paper: #faf9f5;
    --surface: #ffffff;

    --accent: #c8321a;
    --accent-h: #a8280f;
    --accent-ring: rgba(200, 50, 26, 0.18);
    --accent-bg: rgba(200, 50, 26, 0.07);

    --ok: #1a8848;
    --ok-bg: rgba(26, 136, 72, 0.08);
    --err: #c8321a;
    --err-bg: rgba(200, 50, 26, 0.08);
    --inf: #1a5cb8;
    --inf-bg: rgba(26, 92, 184, 0.08);

    --ff-d: 'Libre Baskerville', Georgia, serif;
    --ff-b: 'IBM Plex Sans', system-ui, sans-serif;
    --ff-m: 'IBM Plex Mono', 'Courier New', monospace;

    --r-xs: 4px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 26px;
    --r-pill: 999px;

    --sh-xs: 0 1px 3px rgba(0, 0, 0, .06);
    --sh-sm: 0 2px 8px rgba(0, 0, 0, .08), 0 1px 3px rgba(0, 0, 0, .05);
    --sh-md: 0 8px 24px rgba(0, 0, 0, .10), 0 2px 8px rgba(0, 0, 0, .06);
    --sh-lg: 0 20px 60px rgba(0, 0, 0, .14), 0 8px 24px rgba(0, 0, 0, .08);
    --sh-xl: 0 32px 80px rgba(0, 0, 0, .18), 0 12px 32px rgba(0, 0, 0, .10);

    --ease: cubic-bezier(.4, 0, .2, 1);
    --hdr-h: 56px;
    --tfr-h: 78px;
    --drw-w: 340px;
}

/* ════════════════════════════════════════════
   RESET + BASE
════════════════════════════════════════════ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: var(--ff-b);
    background: var(--parchment);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
}

input,
select,
textarea {
    font-family: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--ink-5);
    border-radius: var(--r-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ink-4);
}

/* Subtle noise texture */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: .02;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px;
}

/* ════════════════════════════════════════════
   APP HEADER
════════════════════════════════════════════ */
.app-header {
    height: var(--hdr-h);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    background: var(--surface);
    border-bottom: 1.5px solid var(--rule);
    position: relative;
    z-index: 10;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    user-select: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    background: var(--ink);
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-mark svg {
    width: 20px;
    height: 20px;
}

.brand-name {
    font-family: var(--ff-d);
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -.3px;
}

.brand-name em {
    font-style: italic;
    color: var(--accent);
}

/* Center chip */
.hdr-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--parchment);
    border: 1px solid var(--rule);
    border-radius: var(--r-pill);
    font-family: var(--ff-m);
    font-size: 10px;
    color: var(--ink-3);
    letter-spacing: .8px;
    text-transform: uppercase;
}

.sig-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: sigpulse 2.5s ease-in-out infinite;
}

@keyframes sigpulse {
    0% {
        box-shadow: 0 0 0 0 rgba(200, 50, 26, .45);
    }

    60% {
        box-shadow: 0 0 0 7px rgba(200, 50, 26, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(200, 50, 26, 0);
    }
}

/* Header actions */
.hdr-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    color: var(--ink-3);
    transition: all .18s var(--ease);
}

.btn-icon:hover {
    background: var(--parchment);
    border-color: var(--rule);
    color: var(--ink);
}

.btn-icon.is-active {
    background: var(--accent-bg);
    border-color: var(--accent-ring);
    color: var(--accent);
}

.btn-icon svg {
    width: 17px;
    height: 17px;
}

.btn-menu {
    display: none;
}

@media (max-width: 767px) {
    .btn-menu {
        display: none; /* Hide redundant menu icon, use gear only */
    }

    .hdr-center {
        display: none;
    }
}

/* ════════════════════════════════════════════
   APP BODY (flex row: editor)
════════════════════════════════════════════ */
.app-body {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
    position: relative;
}

/* ─── EDITOR COLUMN ─── */
.editor-col {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Toolbar */
.ed-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 28px 0;
    flex-shrink: 0;
}

.ed-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--ff-m);
    font-size: 10px;
    color: #000;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.ed-label svg {
    width: 12px;
    height: 12px;
    stroke: #000;
    fill: none;
}

.ed-stats {
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--ff-m);
    font-size: 10px;
    color: var(--ink-4);
}

.stat strong {
    color: var(--ink-2);
    font-weight: 500;
}

/* Editor scroll area */
.ed-area {
    flex: 1;
    min-height: 0;
    padding: 14px 24px 0;
    display: flex;
}

/* Line numbers */
.line-nums {
    width: 38px;
    flex-shrink: 0;
    padding-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    overflow: hidden;
    user-select: none;
    pointer-events: none;
}

.ln {
    font-family: var(--ff-m);
    font-size: 11px;
    color: var(--ink-5);
    line-height: 28px;
    padding-right: 10px;
    transition: color .15s;
}

.ln.cur {
    color: var(--accent);
    font-weight: 500;
}

/* Textarea wrapper */
.ed-box {
    flex: 1;
    min-width: 0;
    border-left: 2px solid var(--ink-5);
    transition: border-color .2s;
    position: relative;
}

.ed-box.focused {
    border-left-color: var(--accent);
}

.script-ta {
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    padding: 16px 28px 40px 20px;
    font-family: var(--ff-m);
    font-size: 14px;
    line-height: 28px;
    color: var(--ink);
    caret-color: var(--accent);
    /* ruled lines */
    background-image: repeating-linear-gradient(to bottom,
            transparent,
            transparent 27px,
            rgba(0, 0, 0, .055) 27px,
            rgba(0, 0, 0, .055) 28px);
    background-attachment: local;
    background-position: 0 17px;
}

.script-ta::placeholder {
    color: var(--ink-3);
    font-style: italic;
    font-family: var(--ff-d);
    font-size: 15px;
    letter-spacing: .1px;
}

@media (max-width: 640px) {
    .ed-area {
        padding: 12px 12px 0;
    }

    .line-nums {
        display: none;
    }

    .ed-box {
        border-left: none;
    }

    .script-ta {
        padding: 16px 12px 40px;
        font-size: 13px;
    }

    .ed-stats {
        gap: 8px;
    }

    .stat {
        font-size: 9px;
    }

    .script-ta {
        padding: 19px 12px 40px;
        font-size: 13px;
    }
}

/* ════════════════════════════════════════════
   TRANSPORT BAR
════════════════════════════════════════════ */
.transport {
    height: var(--tfr-h);
    flex-shrink: 0;
    background: var(--surface);
    border-top: 1.5px solid var(--rule);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: relative;
    z-index: 10;
}

/* Left meta */
.t-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 76px;
    flex-shrink: 0;
}

.t-meta-row {
    display: flex;
    gap: 5px;
    align-items: center;
    font-family: var(--ff-m);
    font-size: 10px;
    color: var(--ink-4);
}

.t-meta-row strong {
    color: var(--ink-2);
    font-weight: 500;
}

@media (max-width: 480px) {
    .t-meta {
        display: flex;
        width: 100%;
        justify-content: space-between;
        flex-direction: row;
        padding-bottom: 5px;
    }
}

/* Divider */
.t-div {
    width: 1.5px;
    height: 36px;
    background: var(--rule);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .t-div {
        display: none;
    }
}

/* Generate button */
.btn-gen {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 48px;
    padding: 0 28px;
    background: var(--ink);
    border-radius: var(--r-lg);
    color: var(--surface);
    font-family: var(--ff-b);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .15px;
    flex-shrink: 0;
    transition: all .22s var(--ease);
    box-shadow: var(--sh-sm);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-gen::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, .07) 0%, transparent 60%);
}

.btn-gen:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px rgba(200, 50, 26, .30);
}

.btn-gen:active {
    transform: translateY(0);
    box-shadow: var(--sh-xs);
}

.btn-gen:disabled {
    opacity: .65;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--sh-xs);
}

.btn-gen svg {
    width: 15px;
    height: 15px;
    fill: currentColor;
    flex-shrink: 0;
}

.kbd-hint {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 3px;
    opacity: .4;
}

.kbd-hint kbd {
    font-family: var(--ff-m);
    font-size: 9px;
    background: rgba(255, 255, 255, .15);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 3px;
    padding: 1px 4px;
    line-height: 1.4;
}

@media (max-width: 560px) {
    .kbd-hint {
        display: none;
    }
}

/* Spinner */
.gen-spin {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .25);
    border-top-color: rgba(255, 255, 255, .9);
    border-radius: 50%;
    animation: spin .65s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Player section */
.t-player {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    pointer-events: none;
    transform: translateX(10px);
    transition: opacity .3s var(--ease), transform .3s var(--ease);
}

.t-player.on {
    opacity: 1;
    pointer-events: all;
    transform: none;
}

.btn-pp {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--surface);
    flex-shrink: 0;
    transition: all .18s var(--ease);
    box-shadow: var(--sh-xs);
}

.btn-pp:hover {
    background: var(--accent);
    box-shadow: 0 4px 14px rgba(200, 50, 26, .28);
    transform: scale(1.07);
}

.btn-pp svg {
    width: 13px;
    height: 13px;
    fill: currentColor;
}

/* Seek */
.seek-grp {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.seek-track {
    position: relative;
    height: 3px;
    background: var(--ink-5);
    border-radius: var(--r-pill);
}

.seek-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: var(--ink);
    border-radius: var(--r-pill);
    pointer-events: none;
    transition: width .1s linear;
}

input[type="range"].seek-r {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    margin: 0;
    padding: 10px 0;
    margin-top: -10px;
}

.t-time {
    font-family: var(--ff-m);
    font-size: 10px;
    color: var(--ink-3);
}

/* Volume */
.vol-grp {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

@media (max-width: 620px) {
    .vol-grp {
        display: none;
    }
}

.vol-grp svg {
    width: 13px;
    height: 13px;
    stroke: var(--ink-3);
    fill: none;
    flex-shrink: 0;
}

input[type="range"].vol-r {
    -webkit-appearance: none;
    appearance: none;
    width: 58px;
    height: 3px;
    background: var(--ink-5);
    border-radius: var(--r-pill);
    outline: none;
    cursor: pointer;
    border: none;
}

input[type="range"].vol-r::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 11px;
    height: 11px;
    background: var(--ink-2);
    border-radius: 50%;
    cursor: pointer;
    transition: background .15s;
}

input[type="range"].vol-r::-webkit-slider-thumb:hover {
    background: var(--accent);
}

input[type="range"].vol-r::-moz-range-thumb {
    width: 11px;
    height: 11px;
    background: var(--ink-2);
    border: none;
    border-radius: 50%;
}

/* Wave bars */
.wave-bars {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.wb {
    width: 2px;
    border-radius: 2px;
    background: var(--accent);
    opacity: .3;
}

.wave-bars.play .wb {
    opacity: 1;
    animation: wbdance .6s ease-in-out infinite;
}

.wb:nth-child(1) {
    height: 5px;
    animation-delay: 0s;
}

.wb:nth-child(2) {
    height: 9px;
    animation-delay: .08s;
}

.wb:nth-child(3) {
    height: 14px;
    animation-delay: .16s;
}

.wb:nth-child(4) {
    height: 11px;
    animation-delay: .24s;
}

.wb:nth-child(5) {
    height: 7px;
    animation-delay: .32s;
}

.wb:nth-child(6) {
    height: 13px;
    animation-delay: .40s;
}

.wb:nth-child(7) {
    height: 9px;
    animation-delay: .48s;
}

@keyframes wbdance {

    0%,
    100% {
        transform: scaleY(.5);
    }

    50% {
        transform: scaleY(1.4);
    }
}

/* Download */
.btn-dl {
    background: transparent;
    border: 1px solid var(--rule);
    border-radius: var(--r-sm);
    padding: 7px;
    color: var(--ink-3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .18s var(--ease);
}

.btn-dl:hover {
    color: var(--ink);
    border-color: var(--ink-4);
    background: var(--parchment);
}

.btn-dl svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* Status */
.t-status {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--r-sm);
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity .25s var(--ease), transform .25s var(--ease);
    flex-shrink: 0;
    white-space: nowrap;
}

.t-status.on {
    opacity: 1;
    transform: none;
}

.t-status.ok {
    color: var(--ok);
    background: var(--ok-bg);
}

.t-status.err {
    color: var(--err);
    background: var(--err-bg);
}

.t-status.inf {
    color: var(--inf);
    background: var(--inf-bg);
}

.t-status svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .transport {
        height: auto;
        flex-wrap: wrap;
        padding: 12px 14px;
        gap: 10px;
    }

    .btn-gen {
        width: 100%;
        order: 2; /* Put button below player/stats on tiny screens */
    }

    .t-meta {
        order: 1;
    }

    .t-player {
        width: 100%;
        border-top: 1.5px solid var(--rule);
        padding-top: 10px;
    }

    .t-div {
        display: none;
    }

    .t-status {
        display: none;
    }
}

/* ════════════════════════════════════════════
   SETTINGS DRAWER
════════════════════════════════════════════ */
.drw-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(12, 12, 14, .35);
    backdrop-filter: blur(4px);
    z-index: 60;
    visibility: hidden;
    opacity: 0;
    transition: opacity .3s var(--ease), visibility .3s;
}

.drw-backdrop.on {
    visibility: visible;
    opacity: 1;
}

.settings-drw {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--drw-w);
    max-width: 92vw;
    background: var(--surface);
    border-left: 1.5px solid var(--rule);
    z-index: 70;
    display: flex;
    flex-direction: column;
    transform: translateX(100.5%); /* Slightly more off-screen */
    transition: transform .32s var(--ease), visibility .32s;
    visibility: hidden;
}

.settings-drw.open {
    transform: none;
    visibility: visible;
    box-shadow: var(--sh-xl);
}

/* Drawer header */
.drw-hd {
    padding: 20px 22px 18px;
    border-bottom: 1.5px solid var(--rule);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.drw-title {
    font-family: var(--ff-d);
    font-size: 18px;
    font-weight: 700;
    color: var(--ink);
}

.drw-sub {
    font-size: 11px;
    color: var(--ink-4);
    margin-top: 2px;
}

.btn-close {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: var(--parchment);
    border: 1px solid var(--rule);
    color: var(--ink-3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .18s;
}

.btn-close:hover {
    color: var(--ink);
    border-color: var(--ink-4);
}

.btn-close svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

/* Drawer body */
.drw-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 22px;
}

.sec-head {
    font-family: var(--ff-m);
    font-size: 9px;
    font-weight: 500;
    color: var(--ink-4);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sec-head::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ink-5);
}

.sec+.sec {
    padding-top: 22px;
    border-top: 1px solid var(--rule);
    margin-top: 4px;
}

.fld {
    margin-bottom: 16px;
}

.fld-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 7px;
    letter-spacing: .1px;
}

.fld-label em {
    color: var(--accent);
    font-style: normal;
}

.inp-row {
    position: relative;
    display: flex;
    align-items: center;
}

.fld-inp {
    width: 100%;
    height: 40px;
    background: var(--parchment);
    border: 1.5px solid var(--rule);
    border-radius: var(--r-sm);
    padding: 0 14px;
    font-family: var(--ff-m);
    font-size: 12px;
    color: var(--ink);
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
    letter-spacing: .3px;
}

.fld-inp::placeholder {
    color: var(--ink-5);
    font-family: var(--ff-b);
    font-size: 13px;
    letter-spacing: 0;
}

.fld-inp:focus {
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.fld-inp.has-icon {
    padding-right: 40px;
}

.inp-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 5px;
    color: var(--ink-4);
    display: flex;
    align-items: center;
    border-radius: var(--r-xs);
    transition: color .15s;
}

.inp-btn:hover {
    color: var(--ink);
}

.inp-btn svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

.fld-hint {
    margin-top: 5px;
    font-size: 11px;
    color: var(--ink-4);
    display: flex;
    align-items: center;
    gap: 4px;
    line-height: 1.5;
}

.fld-hint svg {
    width: 11px;
    height: 11px;
    stroke: var(--ink-5);
    flex-shrink: 0;
}

.sel-wrap {
    position: relative;
}

.fld-sel {
    width: 100%;
    height: 40px;
    background: var(--parchment);
    border: 1.5px solid var(--rule);
    border-radius: var(--r-sm);
    padding: 0 34px 0 14px;
    font-family: var(--ff-b);
    font-size: 13px;
    color: var(--ink);
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}

.fld-sel:focus {
    background: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}

.sel-arr {
    position: absolute;
    right: 11px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--ink-4);
}

.sel-arr svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
}

/* Drawer footer */
.drw-ft {
    padding: 14px 22px 20px;
    border-top: 1.5px solid var(--rule);
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.btn-save {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 42px;
    background: var(--ink);
    border-radius: var(--r-md);
    color: var(--surface);
    font-size: 13px;
    font-weight: 600;
    transition: all .2s var(--ease);
}

.btn-save.on {
    display: flex;
}

.btn-save:hover {
    background: var(--accent);
    box-shadow: 0 4px 14px rgba(200, 50, 26, .25);
}

.btn-save svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.btn-clear {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 38px;
    background: transparent;
    border: 1.5px solid var(--rule);
    border-radius: var(--r-md);
    color: var(--ink-3);
    font-size: 13px;
    font-weight: 500;
    transition: all .2s var(--ease);
}

.btn-clear.on {
    display: flex;
}

.btn-clear:hover {
    color: var(--err);
    border-color: rgba(200, 50, 26, .25);
    background: var(--err-bg);
}

.btn-clear svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* ════════════════════════════════════════════
   CONFIRM MODAL
════════════════════════════════════════════ */
.modal-veil {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: rgba(12, 12, 14, .55);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity .22s var(--ease), visibility .22s;
    padding: 20px;
}

.modal-veil.open {
    visibility: visible;
    opacity: 1;
}

.modal-card {
    background: var(--surface);
    border: 1.5px solid var(--rule);
    border-radius: var(--r-xl);
    padding: 32px 28px 28px;
    width: 100%;
    max-width: 360px;
    box-shadow: var(--sh-xl);
    transform: scale(.93) translateY(14px);
    transition: transform .26s var(--ease);
}

.modal-veil.open .modal-card {
    transform: none;
}

.modal-ico {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--err-bg);
    border: 1.5px solid rgba(200, 50, 26, .14);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
}

.modal-ico svg {
    width: 22px;
    height: 22px;
    stroke: var(--err);
}

.modal-ttl {
    font-family: var(--ff-d);
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    color: var(--ink);
    margin-bottom: 8px;
}

.modal-txt {
    font-size: 13px;
    color: var(--ink-3);
    text-align: center;
    line-height: 1.65;
    margin-bottom: 26px;
}

.modal-row {
    display: flex;
    gap: 10px;
}

.btn-mc {
    flex: 1;
    height: 42px;
    background: var(--parchment);
    border: 1.5px solid var(--rule);
    border-radius: var(--r-md);
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 500;
    transition: all .18s;
}

.btn-mc:hover {
    background: var(--surface);
    border-color: var(--ink-4);
    color: var(--ink);
}

.btn-md {
    flex: 1;
    height: 42px;
    background: var(--err);
    border: none;
    border-radius: var(--r-md);
    color: white;
    font-size: 13px;
    font-weight: 600;
    transition: all .18s;
}

.btn-md:hover {
    background: var(--accent-h);
    box-shadow: 0 4px 14px rgba(200, 50, 26, .3);
}
