* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --orange: #ff8c00;
    --orange-dark: #e97451;
    --green: #009c4a;
    --dark: #18231f;
    --text: #27332e;
    --muted: #7b8781;
    --bg: #f7f9f7;
    --white: #ffffff;
    --border: #e7ebe8;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}


/* =========================
   TOPBAR
========================= */

.topbar {
    height: 82px;
    background: white;

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 5%;

    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.logo {
    width: 46px;
    height: 46px;

    border-radius: 14px;

    background:
        linear-gradient(
            135deg,
            var(--orange),
            var(--orange-dark)
        );

    display: flex;
    align-items: center;
    justify-content: center;

    color: white;

    font-size: 22px;
    font-weight: 900;

    box-shadow:
        0 8px 20px rgba(255, 140, 0, .20);
}

.logo b {
    color: #dff7e9;
    margin-left: 1px;
}

.brand h1 {
    font-size: 17px;
    letter-spacing: -.3px;
}

.brand h1 span {
    color: var(--orange);
}

.brand p {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

.status {
    font-size: 12px;
    font-weight: 600;

    padding: 8px 13px;

    background: #f0faf4;

    color: var(--green);

    border-radius: 30px;

    display: flex;
    align-items: center;
    gap: 7px;
}

.status-dot {
    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: var(--green);
}


/* =========================
   MAIN
========================= */

.container {
    width: min(1250px, 92%);
    margin: auto;
    padding: 45px 0 70px;
}


/* =========================
   HERO
========================= */

.hero {
    margin-bottom: 35px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    font-size: 10px;
    font-weight: 800;

    letter-spacing: 1.2px;

    color: var(--orange);

    background: #fff4e8;

    padding: 7px 11px;

    border-radius: 30px;

    margin-bottom: 13px;
}

.hero h2 {
    font-size: clamp(30px, 4vw, 47px);
    line-height: 1.06;

    letter-spacing: -1.8px;

    color: var(--dark);
}

.hero h2 span {
    color: var(--orange);
}

.hero p {
    max-width: 650px;

    margin-top: 15px;

    color: var(--muted);

    font-size: 14px;

    line-height: 1.7;
}


/* =========================
   WORKSPACE
========================= */

.workspace {
    display: grid;

    grid-template-columns:
        minmax(0, 1.55fr)
        minmax(330px, .75fr);

    gap: 22px;

    align-items: start;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 22px;
}


/* =========================
   CARDS
========================= */

.card {
    background: white;

    border: 1px solid var(--border);

    border-radius: 22px;

    box-shadow:
        0 10px 35px rgba(20, 40, 30, .045);
}

.card-header {
    padding: 22px 23px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 15px;

    display: flex;
    align-items: center;
    gap: 9px;
}

.card-header h3 i {
    color: var(--orange);
}

.card-header p {
    font-size: 11px;
    color: var(--muted);

    margin-top: 5px;
}


/* =========================
   EDITOR
========================= */

.editor-card {
    overflow: hidden;
}

textarea {
    display: block;

    width: 100%;

    min-height: 510px;

    resize: vertical;

    border: none;

    outline: none;

    padding: 24px;

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 14px;

    line-height: 1.75;

    color: var(--text);

    background: white;
}

textarea::placeholder {
    color: #adb6b1;
}

.editor-footer {
    min-height: 55px;

    padding: 0 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-top: 1px solid var(--border);

    color: var(--muted);

    font-size: 11px;
}

.counter {
    display: flex;
    gap: 18px;
}

.counter span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.counter i {
    color: var(--orange);
}

#chunkInfo {
    font-weight: 600;
}


/* =========================
   BUTTONS
========================= */

.small-btn {
    border: none;

    background: #f5f6f5;

    color: #68736e;

    padding: 8px 11px;

    border-radius: 9px;

    font-size: 11px;

    cursor: pointer;

    transition: .2s;
}

.small-btn:hover {
    background: #fff0e3;
    color: var(--orange);
}


/* =========================
   SETTINGS
========================= */

.settings-card {
    padding-bottom: 22px;
}

.settings-card .card-header {
    margin-bottom: 21px;
}

.settings-card label {
    display: block;

    padding: 0 22px 8px;

    font-size: 11px;

    font-weight: 700;

    color: #53605a;
}

.select-wrapper {
    padding: 0 22px;
}

select {
    width: 100%;

    padding: 13px 14px;

    border: 1px solid var(--border);

    border-radius: 12px;

    background: white;

    outline: none;

    font-size: 13px;

    color: var(--text);

    cursor: pointer;
}

select:focus {
    border-color: var(--orange);
}


.notice {
    margin: 18px 22px;

    padding: 12px;

    background: #fff9f2;

    border-radius: 12px;

    display: flex;

    gap: 9px;

    font-size: 10px;

    line-height: 1.5;

    color: #8a6d4b;
}

.notice i {
    color: var(--orange);

    margin-top: 1px;
}


/* =========================
   GENERATE
========================= */

.generate-btn {
    width: calc(100% - 44px);

    margin: 0 22px;

    border: none;

    padding: 16px;

    border-radius: 13px;

    background:
        linear-gradient(
            135deg,
            var(--orange),
            var(--orange-dark)
        );

    color: white;

    font-size: 12px;

    font-weight: 800;

    letter-spacing: .5px;

    cursor: pointer;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 9px;

    box-shadow:
        0 10px 25px rgba(255, 140, 0, .22);

    transition: .25s;
}

.generate-btn:hover {
    transform: translateY(-2px);

    box-shadow:
        0 14px 30px rgba(255, 140, 0, .30);
}

.generate-btn:disabled {
    opacity: .55;
    cursor: wait;
    transform: none;
}


/* =========================
   PROGRESS
========================= */

.progress-card {
    padding: 22px;
}

.progress-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.progress-top h3 {
    font-size: 14px;

    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-top h3 i {
    color: var(--orange);
}

.progress-top p {
    color: var(--muted);

    font-size: 11px;

    margin-top: 5px;
}

#progressPercent {
    color: var(--orange);
    font-size: 17px;
}

.progress-bar {
    height: 9px;

    background: #edf0ee;

    border-radius: 20px;

    margin-top: 20px;

    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;

    background:
        linear-gradient(
            90deg,
            var(--orange),
            var(--green)
        );

    border-radius: inherit;

    transition: width .3s ease;
}

.segment-status {
    margin-top: 9px;

    display: flex;
    justify-content: flex-end;

    font-size: 10px;

    color: var(--muted);
}


/* =========================
   RESULT
========================= */

.result-card {
    padding: 22px;

    display: flex;

    flex-direction: column;

    gap: 14px;
}

.result-card > div:first-child {
    display: flex;
    align-items: center;
}

.success-icon {
    width: 42px;
    height: 42px;

    border-radius: 13px;

    background: #edf9f2;

    color: var(--green);

    display: flex;
    align-items: center;
    justify-content: center;

    margin-right: 12px;
}

.result-info h3 {
    font-size: 14px;
}

.result-info p {
    color: var(--muted);

    font-size: 10px;

    margin-top: 4px;
}

audio {
    width: 100%;
    height: 40px;
}

.download-btn {
    width: 100%;

    border: none;

    padding: 13px;

    border-radius: 11px;

    background: var(--green);

    color: white;

    font-size: 11px;

    font-weight: 800;

    cursor: pointer;

    transition: .2s;
}

.download-btn:hover {
    filter: brightness(.94);

    transform: translateY(-1px);
}


/* =========================
   TIPS
========================= */

.tips {
    margin-top: 25px;

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 15px;
}

.tip {
    background: white;

    border: 1px solid var(--border);

    border-radius: 17px;

    padding: 17px;

    display: flex;

    gap: 12px;
}

.tip-icon {
    min-width: 38px;
    height: 38px;

    border-radius: 11px;

    background: #fff4e8;

    color: var(--orange);

    display: flex;
    align-items: center;
    justify-content: center;
}

.tip-icon.green {
    background: #edf9f2;
    color: var(--green);
}

.tip-icon.orange {
    background: #fff4e8;
    color: var(--orange-dark);
}

.tip strong {
    font-size: 11px;
}

.tip p {
    font-size: 10px;

    line-height: 1.5;

    color: var(--muted);

    margin-top: 5px;
}


/* =========================
   FOOTER
========================= */

footer {
    border-top: 1px solid var(--border);

    background: white;

    padding: 22px 5%;

    display: flex;

    justify-content: space-between;

    align-items: center;

    color: var(--muted);

    font-size: 10px;
}

footer strong {
    color: var(--dark);
}

footer strong span {
    color: var(--orange);
}

footer > div > span {
    color: var(--orange);
    margin-left: 3px;
}


/* =========================
   UTILITY
========================= */

.hidden {
    display: none !important;
}


/* =========================
   MOBILE
========================= */

@media (max-width: 850px) {

    .workspace {
        grid-template-columns: 1fr;
    }

    .tips {
        grid-template-columns: 1fr;
    }

    textarea {
        min-height: 400px;
    }

}

@media (max-width: 550px) {

    .topbar {
        height: 70px;
        padding: 0 4%;
    }

    .status {
        display: none;
    }

    .container {
        width: 94%;
        padding-top: 30px;
    }

    .brand h1 {
        font-size: 14px;
    }

    .hero h2 {
        font-size: 32px;
    }

    .card-header {
        padding: 18px;
    }

    textarea {
        padding: 18px;
    }

    .editor-footer {
        padding: 0 18px;
    }

    .counter {
        gap: 10px;
    }

    .counter span:first-child {
        display: none;
    }

    footer {
        flex-direction: column;
        gap: 8px;
    }

}