/* ================================================================
   VoiceLab
   Global stylesheet
   ================================================================ */


/* ----------------------------------------------------------------
   Reset
   ---------------------------------------------------------------- */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    background: #f6f7f9;
    color: #111318;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
a,
input,
textarea {
    font: inherit;
}

button {
    border: 0;
}

a {
    color: inherit;
    text-decoration: none;
}


/* ----------------------------------------------------------------
   Shared
   ---------------------------------------------------------------- */

.hidden {
    display: none !important;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    background: #a5aab3;
    flex: 0 0 auto;
}

.status-dot.connected {
    background: #20a46b;
}

.status-dot.connecting {
    background: #d99b27;
}

.status-dot.error {
    background: #d95555;
}

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #111318;
    color: #ffffff;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.04em;
}

.brand-name {
    font-size: 17px;
    font-weight: 750;
    letter-spacing: -0.025em;
}

.panel-label,
.card-label,
.eyebrow {
    color: #737985;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}


/* ================================================================
   HOME
   ================================================================ */

.home-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background:
        radial-gradient(
            circle at 50% 35%,
            #ffffff 0,
            #f6f7f9 55%,
            #eef0f3 100%
        );
}

.hero {
    width: min(900px, 100%);
    min-height: 640px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 34px;
    border: 1px solid #e2e5e9;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow:
        0 24px 80px rgba(20, 25, 35, 0.08);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.hero-content {
    max-width: 680px;
    margin: auto 0;
}

.hero-content .eyebrow {
    margin-bottom: 22px;
}

.hero-content h1 {
    font-size: clamp(56px, 9vw, 94px);
    line-height: 0.92;
    letter-spacing: -0.075em;
    font-weight: 800;
}

.hero-content h1 span {
    color: #777d87;
}

.hero-description {
    max-width: 570px;
    margin-top: 30px;
    color: #666d78;
    font-size: 18px;
    line-height: 1.65;
}

.start-button {
    margin-top: 34px;
    min-height: 56px;
    padding: 0 20px 0 24px;
    display: inline-flex;
    align-items: center;
    gap: 26px;
    border-radius: 14px;
    background: #111318;
    color: #ffffff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition:
        transform 160ms ease,
        background 160ms ease,
        box-shadow 160ms ease;
}

.start-button:hover {
    transform: translateY(-2px);
    background: #20232a;
    box-shadow:
        0 10px 28px rgba(17, 19, 24, 0.18);
}

.start-button:active {
    transform: translateY(0);
}

.start-button:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.button-arrow {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 18px;
}

.demo-note {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #818792;
    font-size: 12px;
}


/* ================================================================
   WORKSPACE
   ================================================================ */

.workspace-page {
    min-height: 100vh;
    padding: 22px;
    background: #f4f5f7;
}

.workspace-header {
    height: 54px;
    max-width: 1480px;
    margin: 0 auto 18px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.workspace-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #777d87;
    font-size: 12px;
    font-weight: 650;
}

.workspace-grid {
    width: min(1480px, 100%);
    min-height: calc(100vh - 94px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(380px, 520px);
    gap: 18px;
}

.voice-panel,
.research-panel {
    border: 1px solid #e1e4e8;
    border-radius: 22px;
    background: #ffffff;
    box-shadow:
        0 12px 40px rgba(20, 25, 35, 0.045);
}

.voice-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.research-panel {
    padding: 22px;
    overflow-y: auto;
    max-height: calc(100vh - 94px);
}

.panel-header {
    padding: 22px 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid #eceef1;
}

.panel-header h1,
.panel-header h2 {
    margin-top: 7px;
    font-size: 22px;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.panel-header h2 {
    font-size: 20px;
}


/* ----------------------------------------------------------------
   Voice area
   ---------------------------------------------------------------- */

.voice-area {
    min-height: 310px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px;
    border-bottom: 1px solid #eceef1;
}

.voice-orb {
    width: 132px;
    height: 132px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(
            circle,
            #ffffff 0 38%,
            #e8ebef 39% 55%,
            #d7dbe0 56% 100%
        );
    box-shadow:
        0 0 0 12px #f4f5f7,
        0 20px 50px rgba(40, 46, 55, 0.12);
    transition:
        transform 300ms ease,
        box-shadow 300ms ease;
}

.voice-orb-inner {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #111318;
    color: #ffffff;
    font-size: 23px;
    font-weight: 800;
}

.voice-orb.listening {
    transform: scale(1.05);
    box-shadow:
        0 0 0 12px #f0f2f4,
        0 0 0 26px #f7f8f9,
        0 24px 60px rgba(30, 35, 45, 0.15);
    animation: voice-pulse 1.8s ease-in-out infinite;
}

.voice-orb.processing {
    animation: processing-pulse 1.4s ease-in-out infinite;
}

.voice-orb.speaking {
    transform: scale(1.08);
}

.voice-state {
    margin-top: 24px;
    color: #22262d;
    font-size: 15px;
    font-weight: 750;
}

.voice-hint {
    margin-top: 7px;
    color: #90959e;
    font-size: 12px;
}

@keyframes voice-pulse {
    0%,
    100% {
        transform: scale(1.02);
    }

    50% {
        transform: scale(1.08);
    }
}

@keyframes processing-pulse {
    0%,
    100% {
        opacity: 0.72;
    }

    50% {
        opacity: 1;
    }
}


/* ----------------------------------------------------------------
   Conversation
   ---------------------------------------------------------------- */

.conversation-container {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.conversation-header {
    padding: 16px 24px 11px;
    color: #858a94;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.transcript {
    flex: 1;
    min-height: 120px;
    max-height: 310px;
    overflow-y: auto;
    padding: 0 24px 18px;
}

.empty-transcript {
    padding: 24px 0;
    color: #969ba4;
    font-size: 13px;
    line-height: 1.7;
}

.empty-transcript strong {
    display: block;
    margin-top: 3px;
    color: #545a64;
    font-weight: 650;
}

.transcript-message {
    padding: 13px 0;
    border-bottom: 1px solid #f0f1f3;
}

.transcript-role {
    margin-bottom: 4px;
    color: #8a9099;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.12em;
}

.transcript-text {
    color: #252a31;
    font-size: 13px;
    line-height: 1.55;
}

.user-message .transcript-text {
    color: #111318;
    font-weight: 600;
}


/* ----------------------------------------------------------------
   Voice controls
   ---------------------------------------------------------------- */

.voice-controls {
    padding: 18px 24px 22px;
    border-top: 1px solid #eceef1;
    display: flex;
    justify-content: center;
}

.mic-button {
    min-width: 190px;
    height: 48px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid #dfe2e6;
    border-radius: 13px;
    background: #ffffff;
    color: #252a31;
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
    transition:
        background 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.mic-button:hover {
    background: #f6f7f8;
    border-color: #cdd1d7;
}

.mic-button:active {
    transform: scale(0.98);
}

.mic-button.active {
    background: #111318;
    color: #ffffff;
    border-color: #111318;
}

#mic-icon {
    font-size: 10px;
}


/* ----------------------------------------------------------------
   Research cards
   ---------------------------------------------------------------- */

.research-panel > .panel-header {
    margin: -22px -22px 18px;
}

.research-card {
    margin-bottom: 12px;
    padding: 16px;
    border: 1px solid #e7e9ec;
    border-radius: 14px;
    background: #fafbfc;
}

.large-value {
    margin-top: 8px;
    color: #15181d;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.045em;
}

.secondary-value {
    margin-top: 3px;
    color: #858a94;
    font-size: 12px;
}

.placeholder,
.result-placeholder {
    padding: 12px 0 2px;
    color: #a0a5ad;
    font-size: 12px;
}


/* ----------------------------------------------------------------
   Operations
   ---------------------------------------------------------------- */

.operations-list {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.operation-item {
    min-width: 0;
    padding: 8px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 7px;
    border: 1px solid #e6e8eb;
    border-radius: 8px;
    background: #ffffff;
}

.operation-symbol {
    color: #22262d;
    font-size: 12px;
    font-weight: 750;
}

.operation-type {
    overflow: hidden;
    color: #999ea6;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}


/* ----------------------------------------------------------------
   Matrices
   ---------------------------------------------------------------- */

.matrices-container,
.representation-container {
    margin-top: 10px;
}

.matrix-block,
.representation-item {
    padding: 10px 0;
    border-top: 1px solid #e9ebee;
}

.matrix-block:first-child,
.representation-item:first-child {
    border-top: 0;
}

.matrix-title {
    margin-bottom: 7px;
    color: #5f6570;
    font-size: 10px;
    font-weight: 800;
}

.matrix-table,
.result-matrix-table {
    border-collapse: collapse;
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
}

.matrix-table td {
    min-width: 48px;
    padding: 3px 5px;
    color: #272c33;
    font-size: 10px;
    text-align: center;
}

.matrix-inline {
    overflow-x: auto;
    color: #464c55;
    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 9px;
    line-height: 1.5;
}


/* ----------------------------------------------------------------
   Characters
   ---------------------------------------------------------------- */

.characters-container {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.character-item {
    padding: 8px;
    border: 1px solid #e5e7ea;
    border-radius: 8px;
    background: #ffffff;
}

.character-item span {
    display: block;
    overflow: hidden;
    color: #777d87;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-item strong {
    display: block;
    margin-top: 3px;
    color: #20242a;
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
    font-size: 12px;
}


/* ----------------------------------------------------------------
   Verification
   ---------------------------------------------------------------- */

.verification-container {
    margin-top: 12px;
    padding: 16px;
    border: 1px solid #cfe7db;
    border-radius: 14px;
    background: #f6fbf8;
}

.verification-status {
    margin-top: 7px;
    color: #188355;
    font-size: 18px;
    font-weight: 850;
    letter-spacing: -0.02em;
}

.verification-status.flag {
    color: #b66d18;
}

.verification-checks {
    margin-top: 10px;
}

.verification-check {
    min-height: 30px;
    display: grid;
    grid-template-columns: 22px 1fr auto;
    align-items: center;
    gap: 5px;
    border-top: 1px solid #e0eee7;
    color: #626872;
    font-size: 10px;
}

.check-icon {
    color: #188355;
    font-weight: 900;
}

.verification-check strong {
    color: #188355;
    font-size: 9px;
}

.result-button {
    width: 100%;
    min-height: 48px;
    margin-top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-radius: 12px;
    background: #111318;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
}

.result-button:hover {
    background: #22252b;
}


/* ================================================================
   RESULT PAGE
   ================================================================ */

.result-page {
    min-height: 100vh;
    padding: 22px;
    background: #f4f5f7;
}

.result-header {
    width: min(1120px, 100%);
    height: 54px;
    margin: 0 auto 20px;
    padding: 0 3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.back-link {
    color: #737985;
    font-size: 12px;
    font-weight: 700;
}

.back-link:hover {
    color: #111318;
}

.result-content {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 30px;
    border: 1px solid #e1e4e8;
    border-radius: 22px;
    background: #ffffff;
    box-shadow:
        0 12px 40px rgba(20, 25, 35, 0.045);
}

.result-title-section {
    padding-bottom: 28px;
    border-bottom: 1px solid #e8eaed;
}

.result-title-row {
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.result-title-row h1 {
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1;
    letter-spacing: -0.055em;
}

.result-title-row p {
    margin-top: 11px;
    color: #7c828c;
    font-size: 13px;
}

.verified-badge {
    flex: 0 0 auto;
    padding: 9px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #cbe5d8;
    border-radius: 9px;
    background: #f2faf6;
    color: #178257;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.1em;
}


/* ----------------------------------------------------------------
   Result summary
   ---------------------------------------------------------------- */

.result-summary-grid {
    margin: 24px 0 34px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.result-summary-card {
    padding: 16px;
    border: 1px solid #e7e9ec;
    border-radius: 12px;
    background: #fafbfc;
}

.result-summary-card strong {
    display: block;
    margin-top: 7px;
    color: #191c21;
    font-size: 18px;
    font-weight: 800;
}


/* ----------------------------------------------------------------
   Result sections
   ---------------------------------------------------------------- */

.result-section {
    padding: 28px 0;
    border-top: 1px solid #e8eaed;
}

.section-heading {
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 11px;
}

.section-number {
    color: #9a9fa7;
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
    font-size: 10px;
    font-weight: 750;
}

.section-heading h2 {
    color: #24282e;
    font-size: 17px;
    letter-spacing: -0.025em;
}


/* ----------------------------------------------------------------
   Result operations
   ---------------------------------------------------------------- */

.result-operations {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.result-operation {
    padding: 13px;
    display: flex;
    align-items: center;
    gap: 11px;
    border: 1px solid #e5e7ea;
    border-radius: 10px;
    background: #fafbfc;
}

.result-operation-symbol {
    min-width: 35px;
    color: #1d2126;
    font-size: 13px;
    font-weight: 800;
}

.result-operation-details strong {
    display: block;
    color: #343940;
    font-size: 11px;
}

.result-operation-details span {
    display: block;
    margin-top: 2px;
    color: #989da5;
    font-size: 9px;
}


/* ----------------------------------------------------------------
   Result matrices / representation
   ---------------------------------------------------------------- */

.result-matrices,
.result-representation {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.result-matrix-block,
.result-representation-block {
    min-width: 0;
    padding: 14px;
    border: 1px solid #e5e7ea;
    border-radius: 10px;
    background: #fafbfc;
    overflow-x: auto;
}

.result-matrix-title {
    margin-bottom: 9px;
    color: #5c626c;
    font-size: 10px;
    font-weight: 800;
}

.result-matrix-table {
    width: auto;
}

.result-matrix-table td {
    min-width: 55px;
    padding: 5px 7px;
    border: 1px solid #e5e7ea;
    background: #ffffff;
    color: #272c33;
    font-size: 10px;
    text-align: center;
}


/* ----------------------------------------------------------------
   Result characters
   ---------------------------------------------------------------- */

.result-characters {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 7px;
}

.result-character {
    padding: 13px 10px;
    border: 1px solid #e5e7ea;
    border-radius: 10px;
    background: #fafbfc;
    text-align: center;
}

.result-character span {
    display: block;
    overflow: hidden;
    color: #777d87;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-character strong {
    display: block;
    margin-top: 5px;
    color: #1e2228;
    font-family:
        "SFMono-Regular",
        Consolas,
        monospace;
    font-size: 15px;
}


/* ----------------------------------------------------------------
   Verification result
   ---------------------------------------------------------------- */

.verification-section {
    padding-bottom: 18px;
}

.verification-result {
    padding: 20px;
    border: 1px solid #cde5d9;
    border-radius: 14px;
    background: #f6fbf8;
}

.verification-result-header {
    display: flex;
    align-items: center;
    gap: 13px;
}

.verification-result-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #dff2e8;
    color: #188355;
    font-size: 20px;
    font-weight: 900;
}

.verification-result-icon.failed {
    background: #f8e7d4;
    color: #b66d18;
}

.verification-result-status {
    color: #188355;
    font-size: 13px;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.verification-result-status.failed {
    color: #b66d18;
}

.verification-result-header p {
    margin-top: 4px;
    color: #727a83;
    font-size: 11px;
    line-height: 1.5;
}

.verification-result-checks {
    margin-top: 16px;
    border-top: 1px solid #dcece4;
}

.result-verification-check {
    min-height: 37px;
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #dcece4;
    color: #616871;
    font-size: 11px;
}

.verification-check-icon {
    color: #188355;
    font-weight: 900;
}

.verification-check-icon.failed {
    color: #b66d18;
}

.result-verification-check strong {
    color: #188355;
    font-size: 9px;
}

.result-verification-error {
    padding: 9px;
    color: #a45f18;
    font-size: 10px;
}


/* ----------------------------------------------------------------
   Result actions
   ---------------------------------------------------------------- */

.result-actions {
    padding-top: 26px;
    display: flex;
    align-items: center;
    gap: 9px;
}

.export-button,
.secondary-button {
    min-height: 46px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.export-button {
    background: #111318;
    color: #ffffff;
}

.export-button:hover {
    background: #22252b;
}

.export-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.secondary-button {
    border: 1px solid #dfe2e6;
    background: #ffffff;
    color: #4f555e;
}

.secondary-button:hover {
    background: #f7f8f9;
}


/* ----------------------------------------------------------------
   Result loading / error
   ---------------------------------------------------------------- */

.result-loading {
    min-height: 460px;
    width: min(1120px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 1px solid #e1e4e8;
    border-radius: 22px;
    background: #ffffff;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid #e4e6e9;
    border-top-color: #24282e;
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

.result-loading p {
    margin-top: 15px;
    color: #858b94;
    font-size: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.result-error {
    width: min(520px, 100%);
    margin: 100px auto;
    padding: 34px;
    border: 1px solid #e1e4e8;
    border-radius: 20px;
    background: #ffffff;
    text-align: center;
}

.error-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f7e8e8;
    color: #bd4d4d;
    font-size: 18px;
    font-weight: 900;
}

.result-error h2 {
    color: #24282e;
    font-size: 21px;
    letter-spacing: -0.03em;
}

.result-error p {
    margin: 9px 0 20px;
    color: #808690;
    font-size: 12px;
    line-height: 1.6;
}


/* ================================================================
   Scrollbars
   ================================================================ */

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: #d5d8dd;
}

::-webkit-scrollbar-thumb:hover {
    background: #bfc3c9;
}


/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 1050px) {

    .workspace-grid {
        grid-template-columns: 1fr;
    }

    .research-panel {
        max-height: none;
    }

    .voice-panel {
        min-height: 700px;
    }

    .result-matrices,
    .result-representation {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .result-operations {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .result-characters {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}


@media (max-width: 700px) {

    .home-page,
    .workspace-page,
    .result-page {
        padding: 12px;
    }

    .hero {
        min-height: calc(100vh - 24px);
        padding: 24px;
        border-radius: 20px;
    }

    .hero-content h1 {
        font-size: 58px;
    }

    .hero-description {
        font-size: 15px;
    }

    .workspace-header,
    .result-header {
        margin-bottom: 10px;
    }

    .workspace-grid {
        gap: 10px;
    }

    .voice-panel,
    .research-panel,
    .result-content,
    .result-loading {
        border-radius: 17px;
    }

    .research-panel {
        padding: 16px;
    }

    .research-panel > .panel-header {
        margin: -16px -16px 14px;
    }

    .panel-header {
        padding: 18px;
    }

    .voice-area {
        min-height: 260px;
    }

    .result-content {
        padding: 20px;
    }

    .result-title-row {
        flex-direction: column;
    }

    .result-summary-grid {
        grid-template-columns: 1fr;
    }

    .result-operations,
    .result-matrices,
    .result-representation {
        grid-template-columns: 1fr;
    }

    .result-characters {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .result-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .export-button,
    .secondary-button {
        width: 100%;
    }
}


@media (max-width: 440px) {

    .brand-name {
        font-size: 15px;
    }

    .connection-status {
        font-size: 10px;
    }

    .hero-content h1 {
        font-size: 48px;
    }

    .hero-description {
        font-size: 14px;
    }

    .start-button {
        width: 100%;
        justify-content: space-between;
    }

    .operations-list {
        grid-template-columns: 1fr;
    }

    .characters-container,
    .result-characters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}


/* ================================================================
   Accessibility
   ================================================================ */

button:focus-visible,
a:focus-visible {
    outline: 3px solid #b8c0ca;
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}