 :root {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
    --ink: #172033;
    --muted: #5f6b7a;
    --line: #d7dde8;
    --brand: #1357c8;
    --soft: #f4f7fb;
    --danger: #a51d2d;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--soft);
    color: var(--ink);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

a {
    color: var(--brand);
}

h1 {
    font-size: 32px;
    line-height: 1.15;
    margin-top: 0;
}

h2 {
    line-height: 1.2;
}

.shell {
    min-height: 100vh;
}

.topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 16px clamp(16px, 4vw, 40px);
}

.brand {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    text-decoration: none;
}

.brand img {
    display: block;
    height: 56px;
    max-width: min(320px, 56vw);
    object-fit: contain;
    width: auto;
}

.topbar form {
    margin: 0;
}

.nav {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.nav a {
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.account-nav {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.button,
button {
    align-items: center;
    background: var(--brand);
    border: 0;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    padding: 10px 14px;
    text-decoration: none;
    touch-action: manipulation;
}

.button:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(19, 87, 200, 0.28);
    outline-offset: 2px;
}

.button.secondary,
button.secondary {
    background: #e8edf6;
    color: var(--ink);
}

.content {
    margin: 0 auto;
    max-width: 1120px;
    padding: 32px clamp(16px, 4vw, 40px);
}

.content.content-wide {
    max-width: 1680px;
}

.panel {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 24px;
}

.grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 24px;
}

.actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.table-wrap {
    overflow-x: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
}

table {
    border-collapse: collapse;
    min-width: 640px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 13px;
    text-transform: uppercase;
}

.badge {
    background: #e8edf6;
    border-radius: 999px;
    color: #142033;
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    padding: 5px 9px;
}

.badge-success {
    background: #e7f6ed;
    color: #166534;
}

.alert {
    background: #e7f6ed;
    border: 1px solid #b7dfc4;
    border-radius: 8px;
    margin-bottom: 18px;
    padding: 12px 14px;
}

.metric {
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}

.metric strong {
    display: block;
    font-size: 28px;
    margin-bottom: 6px;
}

.muted {
    color: var(--muted);
}

.field {
    margin-bottom: 16px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 6px;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="date"],
input[type="file"],
select,
textarea {
    border: 1px solid var(--line);
    border-radius: 6px;
    font: inherit;
    padding: 11px 12px;
    width: 100%;
}

textarea {
    min-height: 110px;
    resize: vertical;
}

.error {
    color: var(--danger);
    font-size: 14px;
    margin-top: 6px;
}

.login-logo {
    display: block;
    height: auto;
    margin: 0 auto 24px;
    max-width: 320px;
    width: 100%;
}

.panel-stack {
    margin-top: 18px;
}

.panel-login {
    margin: 48px auto;
    max-width: 460px;
}

.panel-medium {
    max-width: 560px;
}

.label-plain {
    font-weight: 400;
}

.metric-link {
    color: inherit;
    display: block;
    text-decoration: none;
}

.stack-compact {
    margin-top: 18px;
}

.stack-tight {
    margin-top: 12px;
}

.soft-box {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin-bottom: 16px;
    padding: 16px;
}

.soft-box-title {
    margin-top: 0;
}

.soft-box-title-row {
    align-items: start;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
}

.soft-box-title-row .soft-box-title {
    margin-bottom: 6px;
}

.list-tight {
    margin-bottom: 0;
}

.form-stack {
    margin-top: 12px;
}

.onboarding-divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 24px 0;
}

.onboarding-optional {
    font-size: 14px;
    font-weight: 400;
}

.consent-panel {
    background: #f8fbff;
    border-color: #c8d9f4;
    padding: 18px;
}

.consent-caption {
    margin-bottom: 8px;
}

.consent-title {
    margin-bottom: 10px;
    margin-top: 0;
}

.consent-text-top {
    margin-top: 0;
}

.workflow-stack {
    display: grid;
    gap: 16px;
}

.workflow-card {
    background: #fbfcfe;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 18px;
}

.workflow-card + .workflow-card {
    margin-top: 2px;
}

.workflow-card-header {
    align-items: start;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.workflow-card-header h3,
.workflow-card-header p {
    margin: 0;
}

.workflow-card-actions {
    margin-top: 14px;
}

.workflow-meta {
    margin-bottom: 0;
}

.workflow-divider {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 18px 0;
}

.availability-calendar-header {
    align-items: start;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
}

.availability-calendar-wrap {
    margin-top: 16px;
    padding: 0;
}

.availability-calendar-weekday {
    background: #faf7f0;
    color: #3f3f46;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 10px 8px;
    text-align: center;
    text-transform: uppercase;
}

.availability-calendar-table {
    background: #fffdf8;
    border-collapse: collapse;
    min-width: 980px;
    table-layout: fixed;
    width: 100%;
}

.availability-calendar-table th,
.availability-calendar-table td {
    border: 1px solid #d6d3d1;
    vertical-align: top;
}

.availability-calendar-cell {
    background: #fffdf8;
    height: 132px;
    padding: 8px;
}

.availability-calendar-cell.is-outside-month {
    background: #f5f5f4;
    color: #a8a29e;
}

.availability-calendar-cell.is-today {
    background: #eff6ff;
}

.availability-calendar-day-number {
    color: #44403c;
    font-size: 12px;
    line-height: 1;
    margin-bottom: 8px;
}

.availability-calendar-day-list {
    display: grid;
    gap: 6px;
}

.availability-calendar-entry {
    background: #dbeafe;
    border-left: 3px solid #2563eb;
    border-radius: 6px;
    color: inherit;
    display: grid;
    gap: 2px;
    padding: 6px 7px;
    text-decoration: none;
}

.availability-calendar-entry:hover {
    background: #bfdbfe;
}

.availability-calendar-entry strong,
.availability-calendar-entry span {
    font-size: 11px;
    line-height: 1.2;
}

.consent-text-bottom {
    margin-bottom: 0;
}

.consent-option {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #c8d9f4;
    border-radius: 8px;
    display: flex;
    gap: 14px;
    margin: 12px 0 8px;
    padding: 16px;
}

.consent-option label {
    font-weight: 400;
    margin-bottom: 0;
}

.consent-checkbox {
    height: 24px;
    margin: 2px 0 0;
    min-width: 24px;
    width: 24px;
}

.consent-option-title {
    display: block;
    margin-bottom: 4px;
}

@media (max-width: 760px) {
    body {
        font-size: 15px;
    }

    h1 {
        font-size: 26px;
        margin-bottom: 10px;
    }

    h2 {
        font-size: 20px;
        margin-bottom: 12px;
    }

    .topbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 12px 14px;
    }

    .brand img {
        height: 44px;
        max-width: 76vw;
    }

    .main-nav {
        align-items: center;
        flex-wrap: nowrap;
        gap: 10px;
        margin: 0 -14px;
        mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 38px), transparent 100%);
        overflow-x: auto;
        padding: 0 14px 4px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .main-nav::-webkit-scrollbar {
        display: none;
    }

    .main-nav a:not(.brand) {
        background: #eef3fb;
        border-radius: 999px;
        color: var(--ink);
        display: inline-flex;
        font-size: 14px;
        padding: 8px 11px;
    }

    .account-nav {
        display: grid;
        gap: 10px;
        grid-template-columns: 1fr 1fr;
    }

    .account-nav a,
    .account-nav button {
        align-items: center;
        display: flex;
        justify-content: center;
        min-height: 44px;
        width: 100%;
    }

    .content {
        padding: 16px max(12px, env(safe-area-inset-left)) 28px max(12px, env(safe-area-inset-right));
    }

    .panel,
    .metric {
        border-radius: 6px;
        padding: 16px;
    }

    .panel p:first-child {
        margin-top: 0;
    }

    .grid {
        grid-template-columns: 1fr;
        margin-top: 14px;
    }

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

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

    .button,
    button {
        min-height: 44px;
        text-align: center;
    }

    input[type="email"],
    input[type="password"],
    input[type="text"],
    input[type="date"],
    input[type="file"],
    select,
    textarea {
        min-height: 44px;
    }

    .table-wrap {
        margin: 0 -16px;
        padding: 30px 16px 10px;
    }

    .table-wrap::before {
        background: #eef3fb;
        border: 1px solid var(--line);
        border-radius: 999px;
        color: var(--muted);
        content: "Scroll for more";
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        padding: 6px 9px;
        pointer-events: none;
        position: absolute;
        right: 16px;
        top: 0;
        z-index: 2;
    }

    .table-wrap::after {
        background: linear-gradient(90deg, rgba(244, 247, 251, 0), #ffffff 80%);
        bottom: 10px;
        content: "";
        pointer-events: none;
        position: absolute;
        right: 0;
        top: 30px;
        width: 28px;
        z-index: 1;
    }

    .availability-calendar-cell {
        height: 112px;
    }

    th,
    td {
        padding: 10px;
    }

    .mobile-cards {
        min-width: 0;
    }

    .mobile-cards thead {
        display: none;
    }

    .mobile-cards,
    .mobile-cards tbody,
    .mobile-cards tr,
    .mobile-cards td {
        display: block;
        width: 100%;
    }

    .mobile-cards tr {
        background: #ffffff;
        border: 1px solid var(--line);
        border-radius: 6px;
        margin-bottom: 12px;
        padding: 10px 12px;
    }

    .mobile-cards td {
        border-bottom: 0;
        padding: 8px 0;
    }

    .mobile-cards td::before {
        color: var(--muted);
        content: attr(data-label);
        display: block;
        font-size: 12px;
        font-weight: 700;
        margin-bottom: 2px;
        text-transform: uppercase;
    }

    .mobile-cards td[colspan]::before {
        content: "";
        display: none;
    }

    .login-logo {
        max-width: 260px;
    }
}
