:root {
    color-scheme: light;
    --canvas: #f4f5f0;
    --surface: #ffffff;
    --surface-muted: #edf0eb;
    --ink: #17211f;
    --ink-soft: #5c6965;
    --line: #d8ded8;
    --line-strong: #b8c2bd;
    --accent: #086f68;
    --accent-hover: #075e59;
    --accent-soft: #e2f1ee;
    --danger: #a92f25;
    --danger-soft: #fbe9e6;
    --warning: #795b08;
    --warning-soft: #f8f0d6;
    --success: #23643d;
    --success-soft: #e5f2e8;
    --focus: #0b7f77;
    --shadow: 0 18px 50px rgb(29 48 42 / 8%);
    --radius-control: 7px;
    --radius-panel: 12px;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--canvas);
}

body {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-size: 16px;
    line-height: 1.55;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
    cursor: not-allowed;
}

[hidden] {
    display: none !important;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 100;
    padding: 10px 14px;
    color: #ffffff;
    background: var(--ink);
    border-radius: var(--radius-control);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-shell {
    display: flex;
    min-height: 100dvh;
    flex-direction: column;
}

.topbar {
    display: flex;
    min-height: 68px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px clamp(18px, 4vw, 52px);
    border-bottom: 1px solid var(--line);
    background: rgb(244 245 240 / 94%);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 730;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #ffffff;
    background: var(--accent);
    border-radius: 9px;
    font-size: 0.92rem;
    font-weight: 800;
}

.session-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.session-identity {
    max-width: 40ch;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 0.875rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.main-content {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 44px);
    flex: 1;
}

.main-content:focus {
    outline: none;
}

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

h1,
h2 {
    text-wrap: balance;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 4vw, 3.65rem);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 8px;
    font-size: 1.24rem;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

p {
    color: var(--ink-soft);
}

.eyebrow {
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.loading-view {
    display: grid;
    min-height: min(68vh, 640px);
    align-content: center;
    grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
    gap: clamp(42px, 8vw, 110px);
}

.loading-copy {
    max-width: 620px;
}

.loading-copy p:last-child {
    max-width: 44ch;
}

.loading-lines {
    display: grid;
    align-self: center;
    gap: 14px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--surface);
}

.loading-lines span {
    display: block;
    height: 14px;
    border-radius: 4px;
    background: var(--surface-muted);
    animation: loading-pulse 1.25s ease-in-out infinite alternate;
}

.loading-lines span:nth-child(2) {
    width: 72%;
    animation-delay: 120ms;
}

.loading-lines span:nth-child(3) {
    width: 46%;
    animation-delay: 240ms;
}

@keyframes loading-pulse {
    to {
        background: #dfe6e0;
    }
}

.login-view {
    display: grid;
    min-height: min(68vh, 680px);
    align-items: center;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 430px);
    gap: clamp(48px, 9vw, 130px);
}

.login-intro {
    max-width: 650px;
}

.login-intro > p:not(.eyebrow) {
    max-width: 54ch;
    font-size: 1.06rem;
}

.trust-list {
    display: grid;
    gap: 9px;
    margin: 30px 0 0;
    padding: 0;
    color: var(--ink-soft);
    list-style: none;
}

.trust-list li {
    position: relative;
    padding-left: 26px;
}

.trust-list li::before {
    position: absolute;
    top: 0.62em;
    left: 2px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 2px;
    content: "";
    transform: rotate(45deg);
}

.form-panel,
.inline-form-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.form-panel {
    padding: clamp(24px, 4vw, 38px);
}

.form-heading {
    margin-bottom: 26px;
}

.form-heading p {
    margin-bottom: 0;
}

.form-heading-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.field {
    margin-bottom: 20px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    color: var(--ink);
    font-size: 0.9rem;
    font-weight: 690;
}

.field input,
.field select {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-control);
    outline: none;
    background: var(--surface);
    transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.field input:hover,
.field select:hover {
    border-color: #8e9d96;
}

.field input:focus-visible,
.field select:focus-visible,
.button:focus-visible,
.icon-button:focus-visible,
.message-action:focus-visible,
.brand:focus-visible {
    outline: 3px solid rgb(11 127 119 / 24%);
    outline-offset: 2px;
}

.field input:focus-visible,
.field select:focus-visible {
    border-color: var(--focus);
    box-shadow: 0 0 0 1px var(--focus);
}

.field input[aria-invalid="true"],
.field select[aria-invalid="true"] {
    border-color: var(--danger);
}

.field-help,
.field-error {
    margin: 7px 0 0;
    font-size: 0.82rem;
}

.field-error {
    color: var(--danger);
    font-weight: 620;
}

.button,
.icon-button,
.message-action {
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: var(--radius-control);
    font-weight: 700;
    line-height: 1.2;
    transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 17px;
}

.button-primary {
    color: #ffffff;
    background: var(--accent);
}

.button-primary:hover:not(:disabled) {
    background: var(--accent-hover);
}

.button-primary:disabled {
    color: #dae5e2;
    background: #67847f;
}

.button-secondary {
    color: var(--ink);
    border-color: var(--line-strong);
    background: var(--surface);
}

.button-secondary:hover:not(:disabled),
.button-quiet:hover:not(:disabled) {
    background: var(--surface-muted);
}

.button-quiet {
    color: var(--ink-soft);
    border-color: transparent;
    background: transparent;
}

.button-block {
    width: 100%;
}

.button[aria-busy="true"] {
    position: relative;
    color: transparent;
}

.button[aria-busy="true"]::after {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    color: #ffffff;
    content: "";
    animation: button-spin 720ms linear infinite;
}

@keyframes button-spin {
    to {
        transform: rotate(360deg);
    }
}

.message {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
    padding: 13px 15px;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    background: var(--surface-muted);
    font-size: 0.9rem;
}

.message[data-tone="error"] {
    color: #762119;
    border-color: #efc6c0;
    background: var(--danger-soft);
}

.message[data-tone="success"] {
    color: #184d2e;
    border-color: #bad9c3;
    background: var(--success-soft);
}

.message[data-tone="warning"] {
    color: #624906;
    border-color: #ead99b;
    background: var(--warning-soft);
}

.message-action {
    min-width: max-content;
    min-height: 36px;
    padding: 7px 10px;
    color: currentColor;
    border-color: currentColor;
    background: transparent;
}

.workspace {
    display: grid;
    align-items: start;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: clamp(28px, 5vw, 64px);
}

.workspace-sidebar {
    position: sticky;
    top: 24px;
    padding: 4px 0;
}

.sidebar-heading {
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.sidebar-heading h2 {
    margin-bottom: 5px;
}

.sidebar-heading p:last-child {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.workspace-sidebar > .field {
    margin-top: 24px;
}

.sidebar-actions {
    display: grid;
    gap: 8px;
    margin-top: 24px;
}

.workspace-main {
    min-width: 0;
}

.page-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 28px;
}

.page-heading h1 {
    margin-bottom: 8px;
    font-size: clamp(2.2rem, 5vw, 4.6rem);
}

.page-heading p:last-child {
    max-width: 58ch;
    margin-bottom: 0;
}

.status-badge,
.next-step-state {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 760;
    white-space: nowrap;
}

.status-neutral {
    color: #4e5c57;
    background: #e5e9e5;
}

.status-active {
    color: #174c2c;
    background: var(--success-soft);
}

.status-warning {
    color: #624906;
    background: var(--warning-soft);
}

.status-ended {
    color: #762119;
    background: var(--danger-soft);
}

.product-summary {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.product-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    padding: clamp(24px, 4vw, 38px);
}

.product-primary p {
    max-width: 58ch;
    margin-bottom: 0;
}

.metrics {
    display: grid;
    margin: 0;
    padding: 0 clamp(24px, 4vw, 38px) clamp(24px, 4vw, 38px);
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metrics > div {
    min-width: 0;
    padding: 19px 20px 0;
    border-top: 1px solid var(--line);
}

.metrics > div:first-child {
    padding-left: 0;
}

.metrics > div + div {
    border-left: 1px solid var(--line);
}

.metrics dt {
    margin-bottom: 6px;
    color: var(--ink-soft);
    font-size: 0.79rem;
    font-weight: 690;
}

.metrics dd {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--ink);
    font-size: 1.03rem;
    font-weight: 730;
}

.next-step {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 22px;
    padding: 22px 24px;
    border: 1px solid #b9d9d4;
    border-radius: var(--radius-panel);
    background: var(--accent-soft);
}

.next-step h2 {
    margin-bottom: 5px;
}

.next-step p {
    margin-bottom: 0;
    color: #315d57;
}

.next-step-state {
    color: var(--accent-hover);
    border: 1px solid #9ccac3;
    background: #f5fbfa;
}

.empty-state {
    display: flex;
    min-height: 420px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    padding: clamp(26px, 5vw, 50px);
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.empty-state-copy {
    max-width: 630px;
}

.empty-state h1 {
    max-width: 12ch;
}

.empty-state p:last-child {
    max-width: 48ch;
    margin-bottom: 0;
}

.inline-form-panel {
    margin-top: 24px;
    padding: clamp(24px, 4vw, 34px);
}

.icon-button {
    min-width: 54px;
    padding: 8px 10px;
    color: var(--ink-soft);
    border-color: var(--line);
    background: var(--surface);
    font-size: 0.84rem;
}

.icon-button:hover {
    color: var(--ink);
    background: var(--surface-muted);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 18px;
}

.field-wide,
.form-actions {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px clamp(18px, 4vw, 52px);
    color: var(--ink-soft);
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
}

@media (max-width: 820px) {
    .loading-view,
    .login-view,
    .workspace {
        grid-template-columns: 1fr;
    }

    .loading-view,
    .login-view {
        gap: 34px;
    }

    .workspace-sidebar {
        position: static;
        display: grid;
        align-items: end;
        grid-template-columns: minmax(0, 1fr) minmax(220px, 0.8fr);
        gap: 16px 24px;
        padding-bottom: 24px;
        border-bottom: 1px solid var(--line);
    }

    .sidebar-heading {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .workspace-sidebar > .field,
    .sidebar-actions {
        margin-top: 0;
    }

    .sidebar-actions {
        grid-column: 1 / -1;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .topbar {
        min-height: 62px;
    }

    .session-identity {
        display: none;
    }

    .main-content {
        padding-top: 30px;
        padding-bottom: 38px;
    }

    h1 {
        font-size: clamp(2rem, 11vw, 2.75rem);
    }

    .loading-view {
        min-height: 62vh;
    }

    .login-view {
        align-content: start;
    }

    .login-intro > p:not(.eyebrow) {
        font-size: 1rem;
    }

    .trust-list {
        margin-top: 22px;
    }

    .form-panel,
    .inline-form-panel {
        box-shadow: none;
    }

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

    .sidebar-actions {
        grid-column: auto;
        grid-template-columns: 1fr;
    }

    .page-heading,
    .product-primary,
    .next-step,
    .empty-state,
    .form-heading-row {
        align-items: stretch;
        flex-direction: column;
    }

    .page-heading {
        gap: 14px;
    }

    .page-heading .status-badge {
        align-self: flex-start;
    }

    .product-primary .button,
    .empty-state .button {
        width: 100%;
    }

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

    .metrics > div,
    .metrics > div:first-child {
        padding: 15px 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .metrics > div + div {
        border-left: 0;
    }

    .empty-state {
        min-height: 390px;
    }

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

    .field-wide,
    .form-actions {
        grid-column: auto;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
    }

    .message {
        align-items: stretch;
        flex-direction: column;
    }

    .message-action {
        width: 100%;
    }

    .footer {
        flex-direction: column;
        gap: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
