:root {
    color-scheme: light;
    --page-background: #edf2f6;
    --panel-background: #ffffff;
    --panel-muted: #f5f8fb;
    --text-primary: #102b42;
    --text-secondary: #52697b;
    --border: #bfd0dd;
    --border-strong: #7598b3;
    --accent: #155f96;
    --accent-hover: #0f4d7b;
    --accent-soft: #dcecf7;
    --application-bar: #0a263b;
    --application-bar-border: #244a66;
    --application-bar-text: #f2f7fb;
    --danger: #a43f3f;
    --danger-background: #fff1f0;
    --focus: #54a8df;
    --shadow: 0 16px 40px rgba(21, 52, 73, 0.08);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --page-background: #071b2a;
    --panel-background: #102d42;
    --panel-muted: #0c2436;
    --text-primary: #e9f2f8;
    --text-secondary: #adc3d2;
    --border: #315a75;
    --border-strong: #5d87a2;
    --accent: #61a8d4;
    --accent-hover: #83bddf;
    --accent-soft: #173e58;
    --application-bar: #061724;
    --application-bar-border: #244a66;
    --application-bar-text: #f1f6f9;
    --danger: #f08b87;
    --danger-background: #421f24;
    --focus: #79bce3;
    --shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 720px;
    background: var(--page-background);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text-primary);
    background: var(--page-background);
    font-size: 16px;
    line-height: 1.5;
}

button,
a {
    font: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.application-bar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 8px clamp(24px, 4vw, 64px);
    color: var(--application-bar-text);
    background: var(--application-bar);
    border-bottom: 1px solid var(--application-bar-border);
}

.brand {
    display: inline-flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
}

.brand__name {
    font-size: 1.1rem;
    font-weight: 750;
    letter-spacing: 0.01em;
}

.brand__description {
    color: #a9c7da;
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.application-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-button {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--application-bar-text);
    background: transparent;
    border: 1px solid #466b84;
    border-radius: 8px;
    cursor: pointer;
}

.icon-button:hover {
    background: #123a55;
}

.workspace {
    width: min(1380px, calc(100% - 48px));
    margin: 0 auto;
    padding: 40px 0 64px;
}

.workspace--narrow {
    width: min(840px, calc(100% - 48px));
}

.workspace-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 40px;
    margin-bottom: 28px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 920px;
    margin-bottom: 12px;
    font-size: clamp(2rem, 3.2vw, 3.7rem);
    line-height: 1.08;
    letter-spacing: -0.035em;
}

h2 {
    margin-bottom: 0;
    font-size: clamp(1.45rem, 2.2vw, 2.15rem);
    line-height: 1.2;
}

.workspace-heading__description {
    max-width: 840px;
    margin-bottom: 0;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.primary-action,
.secondary-action {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border-radius: 7px;
    font-weight: 750;
    text-decoration: none;
}

.primary-action {
    color: #ffffff;
    background: var(--accent);
    border: 1px solid var(--accent);
}

.primary-action:disabled {
    color: var(--text-secondary);
    background: var(--panel-muted);
    border-color: var(--border);
    cursor: not-allowed;
    opacity: 0.8;
}

.secondary-action {
    color: var(--text-primary);
    background: var(--panel-background);
    border: 1px solid var(--border-strong);
}

.process-panel,
.message-panel {
    overflow: hidden;
    background: var(--panel-background);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.process-panel__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.65fr);
    gap: 40px;
    align-items: end;
    padding: 26px 30px;
    border-bottom: 1px solid var(--border);
}

.process-panel__header > p {
    margin-bottom: 0;
    color: var(--text-secondary);
}

.process-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.process-stage {
    position: relative;
    display: grid;
    min-height: 190px;
    grid-template-columns: 42px minmax(0, 1fr) 24px;
    gap: 14px;
    align-items: start;
    padding: 26px;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.process-stage:nth-child(3n) {
    border-right: 0;
}

.process-stage:nth-last-child(-n + 3) {
    border-bottom: 0;
}

.process-stage__number {
    color: var(--accent);
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 0.82rem;
    font-weight: 700;
}

.process-stage h3 {
    margin-bottom: 9px;
    font-size: 1.04rem;
    line-height: 1.25;
}

.process-stage p {
    margin-bottom: 0;
    color: var(--text-secondary);
    font-size: 0.91rem;
}

.process-stage__status {
    color: var(--border-strong);
    font-size: 1.35rem;
    line-height: 1;
}

.message-panel {
    margin-top: 48px;
    padding: 30px;
}

.message-panel h1 {
    font-size: 2rem;
}

.message-panel--error {
    border-left: 5px solid var(--danger);
    background: var(--danger-background);
}

.message-panel .secondary-action {
    margin-top: 8px;
}

@media (max-width: 1050px) {
    .process-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .process-stage,
    .process-stage:nth-child(3n),
    .process-stage:nth-last-child(-n + 3) {
        border-right: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .process-stage:nth-child(2n) {
        border-right: 0;
    }

    .process-stage:last-child {
        border-bottom: 0;
    }
}

@media (max-width: 820px) {
    .workspace {
        width: calc(100% - 32px);
        padding-top: 28px;
    }

    .workspace-heading,
    .process-panel__header {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 18px;
    }

    .primary-action {
        justify-self: start;
    }

    .process-stage {
        min-height: 175px;
        padding: 22px;
    }
}
