:root {
    --bg: #060914;
    --bg-elevated: rgba(10, 15, 29, 0.92);
    --panel: rgba(10, 15, 29, 0.78);
    --panel-soft: rgba(9, 14, 26, 0.72);
    --border: rgba(92, 114, 160, 0.16);
    --border-strong: rgba(100, 129, 189, 0.28);
    --text: #f4f7ff;
    --text-soft: #94a2c0;
    --text-muted: #68748d;
    --accent: #268dff;
    --accent-2: #55b4ff;
    --success: #26d77d;
    --warning: #ffcd4b;
    --danger: #ff667d;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.38);
    --radius: 18px;
    --radius-sm: 12px;
    --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    --sans: 'Sora', Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
    box-sizing: border-box;
}

html, body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    font-family: var(--sans);
    background:
        radial-gradient(circle at 35% 8%, rgba(38, 141, 255, 0.16), transparent 26%),
        radial-gradient(circle at 0% 0%, rgba(31, 68, 142, 0.22), transparent 22%),
        radial-gradient(circle at 100% 0%, rgba(17, 28, 54, 0.24), transparent 20%),
        linear-gradient(180deg, #070a14 0%, #060811 100%);
    letter-spacing: -0.01em;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.1;
    background-image: radial-gradient(rgba(255,255,255,0.35) 0.65px, transparent 0.65px);
    background-size: 3px 3px;
    mix-blend-mode: soft-light;
}

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.page-shell {
    width: min(100%, 820px);
    margin: 0 auto;
    padding: 28px 18px 42px;
}

.topbar,
.footer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 0.92rem;
    color: white;
    background: linear-gradient(180deg, #3bb2ff 0%, #1170ff 100%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 14px 30px rgba(18, 91, 255, 0.32);
}

.brand-name {
    font-weight: 700;
    font-size: 1.06rem;
}

.brand-subtitle {
    margin-top: 2px;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.63rem;
    letter-spacing: 0.16em;
}

.version-pill {
    border: 1px solid var(--border);
    background: rgba(11, 16, 31, 0.72);
    color: var(--text-soft);
    border-radius: 999px;
    padding: 9px 14px;
    font-family: var(--mono);
    font-size: 0.68rem;
}

.hero-panel {
    margin-top: 54px;
    padding: 10px 0 0;
}

.hero-copy h1 {
    margin: 0;
    font-size: clamp(2.55rem, 6vw, 4rem);
    line-height: 0.97;
    font-weight: 800;
    letter-spacing: -0.06em;
}

.hero-copy h1 span {
    color: var(--accent);
}

.hero-copy p {
    width: min(100%, 580px);
    margin: 20px 0 30px;
    color: var(--text-soft);
    line-height: 1.85;
    font-size: 0.98rem;
}

.mode-switcher {
    display: inline-flex;
    gap: 8px;
    padding: 6px;
    border-radius: 15px;
    border: 1px solid var(--border);
    background: rgba(9, 13, 26, 0.68);
    box-shadow: var(--shadow);
}

.mode-tab {
    border: 0;
    color: var(--text-muted);
    background: transparent;
    padding: 12px 16px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.83rem;
    font-weight: 600;
    transition: 0.18s ease;
}

.mode-tab:hover {
    color: var(--text);
}

.mode-tab.is-active {
    color: var(--text);
    background: rgba(15, 21, 40, 0.96);
    box-shadow: inset 0 0 0 1px rgba(112, 132, 176, 0.12);
}

.mode-dot,
.mode-square,
.mode-ring {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-radius: 50%;
    background: rgba(117, 130, 158, 0.4);
}

.mode-square {
    border-radius: 2px;
}

.mode-ring {
    background: transparent;
    border: 1px solid rgba(117, 130, 158, 0.65);
}

.badge-soon {
    margin-left: 2px;
    border-radius: 999px;
    padding: 2px 7px;
    font-family: var(--mono);
    font-size: 0.56rem;
    letter-spacing: 0.08em;
    color: #f8e4a5;
    background: rgba(133, 94, 22, 0.38);
    border: 1px solid rgba(212, 170, 74, 0.18);
}

.input-panel {
    margin-top: 24px;
}

.transcript-form {
    display: grid;
    gap: 16px;
}

.mode-pane {
    display: none;
}

.mode-pane.is-active {
    display: block;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
}

.input-row input,
.mode-pane textarea,
.mode-pane > input {
    width: 100%;
    border: 1px solid var(--border);
    background: rgba(8, 12, 24, 0.82);
    color: var(--text);
    padding: 18px 18px;
    border-radius: 16px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.02);
}

.input-row input::placeholder,
.mode-pane textarea::placeholder,
.mode-pane > input::placeholder {
    color: #4e5871;
}

.input-row input:focus,
.mode-pane textarea:focus,
.mode-pane > input:focus {
    border-color: rgba(57, 144, 255, 0.48);
    box-shadow: 0 0 0 4px rgba(38, 141, 255, 0.11);
}

#submitButton,
.primary-btn,
.secondary-btn {
    border: 0;
    border-radius: 16px;
    padding: 0 22px;
    min-height: 60px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

#submitButton,
.primary-btn {
    background: linear-gradient(180deg, #4098ff 0%, #1b73ff 100%);
    color: white;
    box-shadow: 0 18px 40px rgba(18, 91, 255, 0.28), inset 0 1px 0 rgba(255,255,255,0.22);
}

#submitButton:hover,
.primary-btn:hover {
    transform: translateY(-1px);
}

.secondary-btn {
    background: rgba(13, 19, 34, 0.92);
    border: 1px solid var(--border-strong);
    color: var(--text);
}

.pane-label {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 0.82rem;
    color: var(--text-soft);
}

.mode-pane textarea {
    resize: vertical;
    min-height: 130px;
}

.pane-helper {
    margin-top: 10px;
    font-family: var(--mono);
    color: var(--text-muted);
    font-size: 0.72rem;
}

.progress-panel,
.console-panel,
.result-panel {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--panel-soft);
    box-shadow: var(--shadow);
}

.progress-header,
.console-header,
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.progress-header,
.console-header {
    font-family: var(--mono);
    font-size: 0.71rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.progress-bar {
    width: 100%;
    height: 10px;
    margin-top: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(3, 7, 17, 0.92);
    border: 1px solid rgba(255,255,255,0.04);
}

.progress-fill {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2381ff 0%, #4fc2ff 100%);
    transition: width 0.25s ease;
}

.console-clear {
    background: transparent;
    border: 0;
    color: var(--text-muted);
    font-family: inherit;
    font-size: inherit;
}

.console-body {
    min-height: 84px;
    margin-top: 14px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(89, 110, 152, 0.08);
    background: rgba(3, 7, 17, 0.86);
    color: #8ea0c5;
    font-family: var(--mono);
    font-size: 0.74rem;
    line-height: 1.8;
    white-space: pre-wrap;
}

.result-header h2 {
    margin: 0;
    font-size: 1.18rem;
}

.result-header p {
    margin: 6px 0 0;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.result-actions {
    display: inline-flex;
    gap: 10px;
}

.result-grid {
    margin-top: 18px;
    display: grid;
    grid-template-columns: 0.95fr 1.25fr;
    gap: 16px;
}

.result-card {
    border-radius: 15px;
    border: 1px solid rgba(99, 120, 167, 0.12);
    background: rgba(7, 12, 23, 0.84);
    padding: 16px;
}

.card-label {
    font-family: var(--mono);
    color: var(--text-muted);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.result-card h3 {
    margin: 12px 0 14px;
    font-size: 1.14rem;
    line-height: 1.45;
}

.meta-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.meta-list li {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.meta-label {
    color: var(--text-muted);
    font-size: 0.82rem;
}

.meta-value {
    text-align: right;
    font-size: 0.82rem;
    color: var(--text);
    max-width: 62%;
    word-break: break-word;
}

.transcript-card pre {
    margin: 12px 0 0;
    max-height: 360px;
    overflow: auto;
    color: #d7e3ff;
    font-family: var(--mono);
    font-size: 0.76rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.footer-bar {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,0.06);
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.66rem;
}

.log-ok {
    color: #9fd9b4;
}

.log-error {
    color: #ff9cae;
}

.log-info {
    color: #8ea0c5;
}

@media (max-width: 820px) {
    .page-shell {
        padding-top: 18px;
    }

    .topbar,
    .footer-bar,
    .progress-header,
    .console-header,
    .result-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .input-row,
    .result-grid {
        grid-template-columns: 1fr;
    }

    #submitButton,
    .primary-btn,
    .secondary-btn {
        width: 100%;
    }

    .result-actions {
        width: 100%;
        flex-direction: column;
    }

    .mode-switcher {
        display: grid;
        width: 100%;
    }

    .mode-tab {
        justify-content: flex-start;
    }
}


.input-feedback {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(8, 12, 24, 0.72);
    color: var(--text-soft);
    font-size: 0.84rem;
}

.input-feedback.is-error {
    border-color: rgba(255, 102, 125, 0.3);
    background: rgba(52, 17, 25, 0.55);
    color: #ffbac4;
}

.input-feedback.is-success {
    border-color: rgba(38, 215, 125, 0.24);
    background: rgba(10, 40, 26, 0.55);
    color: #9ef1c1;
}

.input-row input.is-invalid {
    border-color: rgba(255, 102, 125, 0.58);
    box-shadow: 0 0 0 4px rgba(255, 102, 125, 0.09);
}
