:root {
    color-scheme: dark;
    --ink: #e9eee6;
    --muted: #b6c2b0;
    --green: #bedf92;
    --on-green: #182611;
    --paper: #111711;
    --surface: #1b231b;
    --surface-alt: #253025;
    --input: #141c15;
    --line: #43523e;
    --link: #d0eba9;
    --highlight: #35482b;
    --accent-card: #25331f;
    --notice-bg: #273521;
    --notice-ink: #d6e8c3;
    --notice-line: #60754b;
    --warning-bg: #3a301a;
    --warning-ink: #f6d990;
    --warning-line: #8f793e;
    --danger-bg: #402720;
    --danger-ink: #ffd0be;
    --danger-line: #986954;
    --success-bg: #213b28;
    --success-ink: #c2e9bf;
    --success-line: #628860;
    --info-bg: #22363c;
    --info-ink: #c3e2ed;
    --radius: 16px;
    font-family: Inter, 'Segoe UI', Arial, sans-serif;
    font-size: 16px;
    font-synthesis: none;
    color: var(--ink);
    background: var(--paper);
}

:root[data-theme="light"] {
    color-scheme: light;
    --ink: #20362a;
    --muted: #53634d;
    --green: #235b3c;
    --on-green: #ffffff;
    --paper: #f5f7f1;
    --surface: #ffffff;
    --surface-alt: #edf2e7;
    --input: #fcfdf9;
    --line: #d2ddc9;
    --link: #315d25;
    --highlight: #e5efcf;
    --accent-card: #eaf1de;
    --notice-bg: #edf4e6;
    --notice-ink: #38512b;
    --notice-line: #c2d3b2;
    --warning-bg: #fff5dc;
    --warning-ink: #71520e;
    --warning-line: #d7bd72;
    --danger-bg: #fff0e9;
    --danger-ink: #963c26;
    --danger-line: #e5b9a7;
    --success-bg: #e9f4e4;
    --success-ink: #356228;
    --success-line: #b5d1a6;
    --info-bg: #eaf2f5;
    --info-ink: #315c6a;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    font-size: 0.9375rem
}

a {
    color: inherit;
    text-decoration: none
}

button,
input,
select,
textarea {
    font: inherit
}

button,
a,
input,
select,
textarea {
    outline-offset: 4px
}

button {
    cursor: pointer
}

p {
    line-height: 1.65;
    color: var(--muted);
    margin: 8px 0 18px
}

h1,
h2,
h3 {
    letter-spacing: -.035em;
    font-weight: 600;
    color: var(--ink)
}

h1 {
    font-size: 1.875rem;
    margin: 0
}

h2 {
    font-size: 1.375rem;
    margin: 0 0 8px
}

h3 {
    font-size: 1rem;
    margin: 22px 0 12px
}

small {
    font-size: 0.8125rem
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 245px;
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 35px 22px;
    overflow-y: auto;
    display: flex;
    flex-direction: column
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.75rem;
    font-weight: 650;
    letter-spacing: -2px
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    background: var(--green);
    border-radius: 13px;
    color: var(--on-green);
    font-size: 2.25rem;
    font-family: Georgia, serif;
    letter-spacing: -3px;
    padding-bottom: 5px
}

.brand-dot {
    color: var(--green);
    font-size: 0.8125rem;
    margin-left: -4px;
    align-self: center
}

.workspace {
    font-size: 0.8125rem;
    letter-spacing: .1em;
    margin: 38px 10px 25px;
    color: var(--muted);
    font-weight: 650
}

.workspace span {
    display: block;
    font-size: 0.8125rem;
    letter-spacing: 0;
    font-weight: 400;
    margin-top: 7px;
    color: var(--muted)
}

nav {
    display: grid;
    gap: 7px
}

nav a {
    padding: 13px 14px;
    border-radius: 10px;
    color: var(--muted);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 14px
}

nav a span {
    font-size: 1.25rem;
    width: 20px;
    text-align: center
}

nav a.active {
    background: var(--highlight);
    color: var(--ink);
    font-weight: 650
}

nav a:hover {
    background: var(--surface-alt)
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid var(--line);
    padding-top: 22px;
    display: flex;
    align-items: center;
    gap: 10px
}

.sidebar-footer strong {
    font-size: 0.9375rem;
    display: block;
    max-width: 115px;
    overflow: hidden
}

.sidebar-footer a {
    font-size: 0.8125rem;
    color: var(--muted);
    display: block;
    margin-top: 5px
}

.sidebar-footer form {
    margin-left: auto
}

.avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--highlight);
    display: grid;
    place-items: center
}

.main {
    margin-left: 245px
}

.topbar {
    height: 76px;
    padding: 0 45px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.9375rem;
    background: var(--surface-alt)
}

.topbar b {
    margin: 0 13px;
    font-weight: 400;
    color: var(--muted)
}

.private-label {
    font-size: 0.8125rem;
    color: var(--muted)
}

.private-label:first-letter {
    color: var(--muted)
}

main {
    padding: 34px 44px;
    max-width: 1540px;
    margin: 0 auto
}

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

.eyebrow {
    font-size: 0.8125rem;
    letter-spacing: .17em;
    font-weight: 650;
    margin: 0 0 10px;
    color: var(--muted)
}

.environment-switch {
    display: flex;
    padding: 4px;
    background: var(--highlight);
    border-radius: 10px;
    font-size: 0.8125rem
}

.environment-switch a {
    padding: 10px 14px;
    border-radius: 7px;
    color: var(--muted)
}

.environment-switch .selected {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 2px 4px #24332a0b
}

.environment-switch .production {
    color: var(--danger-ink)
}

.notice {
    display: flex;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--notice-line);
    border-radius: 10px;
    background: var(--notice-bg);
    padding: 13px 17px;
    color: var(--notice-ink);
    font-size: 0.9375rem;
    margin-bottom: 18px;
    line-height: 1.6;
    overflow-wrap: anywhere
}

.notice strong {
    font-size: 0.8125rem;
    letter-spacing: .025em;
    flex-shrink: 0
}

.notice.warning {
    background: var(--warning-bg);
    border-color: var(--warning-line);
    color: var(--warning-ink)
}

.notice.danger {
    background: var(--danger-bg);
    border-color: var(--danger-line);
    color: var(--danger-ink)
}

.notice.success {
    background: var(--success-bg);
    border-color: var(--success-line);
    color: var(--success-ink)
}

.metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin: 24px 0
}

.metric {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    position: relative
}

.metric p {
    font-size: 0.9375rem;
    margin: 0 0 18px
}

.metric>strong {
    font-size: 2.25rem;
    font-weight: 550;
    display: block;
    letter-spacing: -1.5px
}

.metric>small {
    color: var(--muted);
    display: block;
    margin-top: 10px
}

.metric-dot {
    position: absolute;
    right: 22px;
    top: 24px;
    width: 8px;
    height: 8px;
    border-radius: 50%
}

.green {
    background: #7da074
}

.red {
    background: #d8a499
}

.amber {
    background: #d1b878
}

.blue {
    background: #9db5bc
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.65fr 1fr;
    gap: 20px
}

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 26px;
    margin-bottom: 22px
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 20px
}

.section-heading p {
    font-size: 0.9375rem;
    margin: 5px 0 0
}

.section-heading h2 {
    margin: 0
}

.pill {
    font-size: 0.8125rem;
    letter-spacing: .06em;
    display: inline-block;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 6px;
    padding: 7px 10px;
    white-space: nowrap
}

.checklist-item {
    padding: 19px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    border-top: 1px solid var(--line)
}

.checklist-item strong {
    font-size: 0.9375rem;
    font-weight: 550
}

.checklist-item small {
    display: block;
    color: var(--muted);
    margin-top: 6px
}

.checklist-item>.muted {
    margin-left: auto;
    font-size: 0.8125rem
}

.step {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--surface-alt);
    color: var(--muted);
    font-size: 0.9375rem;
    flex-shrink: 0
}

.step.done {
    background: var(--highlight);
    color: var(--link)
}

.accent-card {
    background: var(--accent-card);
    overflow: hidden;
    position: relative
}

.accent-card h2 {
    font-size: 1.75rem;
    margin: 23px 0 14px;
    line-height: 1.25
}

.accent-card p {
    font-size: 0.9375rem;
    max-width: 270px
}

.mini-illustration {
    position: relative;
    margin: 25px auto -75px;
    width: 220px;
    height: 210px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    transform: rotate(-8deg);
    box-shadow: 15px 14px 0 var(--highlight)
}

.mini-illustration span {
    font: 35px Georgia, serif;
    color: var(--green)
}

.mini-illustration i {
    display: block;
    height: 5px;
    background: var(--line);
    margin: 10px 0;
    border-radius: 3px
}

.mini-illustration i:nth-child(3) {
    width: 70%
}

.mini-illustration b {
    display: block;
    background: var(--highlight);
    padding: 10px;
    margin-top: 20px;
    font-size: 0.9375rem;
    transform: rotate(8deg)
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 16px;
    font-size: 0.9375rem;
    color: var(--link);
    line-height: 1.3;
    min-height: 39px
}

.button:hover {
    filter: brightness(.97)
}

.primary {
    background: var(--green);
    border-color: var(--green);
    color: var(--on-green)
}

.text-link {
    font-size: 0.8125rem;
    color: var(--link);
    white-space: nowrap
}

.full {
    width: 100%
}

.table-scroll {
    overflow-x: auto
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left
}

th {
    font-size: 0.8125rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--surface-alt);
    padding: 12px 15px;
    font-weight: 500;
    white-space: nowrap
}

td {
    padding: 17px 15px;
    font-size: 0.9375rem;
    border-bottom: 1px solid var(--line)
}

td strong {
    font-weight: 550
}

td small {
    display: block;
    color: var(--muted);
    margin-top: 6px
}

.money {
    font-variant-numeric: tabular-nums;
    white-space: nowrap
}

.status {
    border-radius: 6px;
    padding: 6px 9px;
    display: inline-block;
    font-size: 0.8125rem;
    white-space: nowrap;
    background: var(--surface-alt);
    color: var(--muted)
}

.status.accepted {
    color: var(--success-ink);
    background: var(--success-bg)
}

.status.rejected {
    color: var(--danger-ink);
    background: var(--danger-bg)
}

.status.pending_validation,
.status.submitted,
.status.needs_review {
    color: var(--warning-ink);
    background: var(--warning-bg)
}

.status.ready {
    color: var(--info-ink);
    background: var(--info-bg)
}

.empty-state {
    text-align: center;
    padding: 45px 15px
}

.empty-state>span {
    font-size: 1.875rem;
    color: #a6b68e
}

.empty-state h3 {
    font-size: 1rem;
    margin: 13px 0 7px
}

.empty-state p {
    font-size: 0.9375rem
}

.muted,
.fine {
    color: var(--muted)
}

.fine {
    font-size: 0.8125rem;
    line-height: 1.7
}

.page-description {
    margin-bottom: 25px
}

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

label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--muted);
    margin: 13px 0 18px
}

input,
select,
textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--line);
    background: var(--input);
    border-radius: 8px;
    color: var(--ink);
    min-width: 0;
    font-size: 0.9375rem
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--green);
    outline: 2px solid var(--highlight)
}

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

input[type=checkbox] {
    width: 16px;
    accent-color: var(--green)
}

input[type=file] {
    font-size: 0.9375rem
}

select {
    max-width: 100%
}

.wide {
    grid-column: 1/-1
}

.checkbox {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    font-weight: 400;
    line-height: 1.6
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--line);
    margin-top: 15px;
    padding-top: 18px;
    gap: 15px
}

.icon-button {
    padding: 8px;
    color: var(--muted);
    border: 0;
    background: transparent;
    font-size: 1.125rem;
    border-radius: 6px
}

.icon-button:hover {
    background: var(--surface-alt)
}

summary {
    font-size: 1.125rem;
    font-weight: 550;
    cursor: pointer;
    letter-spacing: -.02em
}

summary span {
    float: right;
    font-size: 0.9375rem;
    color: var(--muted)
}

details[open] summary {
    margin-bottom: 20px
}

.search-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px
}

.search-row input {
    max-width: 400px
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
    font-size: 0.8125rem
}

.narrow {
    max-width: 560px
}

.compact {
    grid-template-columns: repeat(3, 1fr)
}

.compact .metric strong small {
    display: inline;
    font-size: 0.9375rem;
    letter-spacing: 0;
    color: var(--muted)
}

.steps-list {
    padding-left: 23px;
    color: var(--muted);
    font-size: 0.9375rem;
    line-height: 1.8
}

.steps-list li {
    padding: 8px 0
}

.document-line {
    display: grid;
    grid-template-columns: minmax(180px, 4fr) 1fr 1fr 35px;
    gap: 12px;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid var(--line)
}

.document-line label {
    min-width: 0
}

.space-top {
    margin-top: 25px
}

.total-strip {
    display: flex;
    justify-content: flex-end;
    gap: 32px;
    border-top: 1px solid var(--line);
    margin-top: 25px;
    padding: 25px 0
}

.total-strip>span {
    display: flex;
    flex-direction: column;
    font-size: 0.8125rem;
    gap: 10px;
    color: var(--muted)
}

.total-strip b {
    font-size: 1rem;
    color: var(--ink);
    font-weight: 500
}

.total-strip strong {
    font-size: 1.375rem;
    color: var(--green);
    font-weight: 600
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px
}

.emission-panel {
    padding: 20px;
    background: var(--surface-alt);
    border-radius: 10px;
    margin-top: 25px;
    border: 1px solid var(--line)
}

.emission-panel summary {
    font-size: 0.9375rem
}

.uuid {
    word-break: break-all;
    margin-top: 22px
}

.document-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 35px;
    margin: 25px 0
}

.document-facts small {
    display: block;
    color: var(--muted);
    margin-bottom: 10px
}

.document-facts strong {
    font-size: 0.9375rem;
    font-weight: 550
}

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

.file-list a {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow-wrap: anywhere
}

.file-list a>* {
    display: block;
    margin: 4px 0
}

.file-list strong {
    font-size: 0.9375rem
}

.file-list span,
.file-list small {
    font-size: 0.8125rem;
    color: var(--muted)
}

.timeline {
    list-style: none;
    padding: 0 0 0 15px;
    border-left: 1px solid var(--line)
}

.timeline li {
    position: relative;
    padding: 0 0 15px 12px
}

.timeline li:before {
    content: '';
    position: absolute;
    left: -19px;
    top: 3px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted)
}

.timeline small {
    color: var(--muted)
}

.timeline p {
    font-size: 0.9375rem;
    margin: 6px 0
}

footer {
    padding: 12px 44px 30px;
    font-size: 0.8125rem;
    color: var(--muted)
}

footer span {
    padding: 0 10px
}

.login-page {
    background: var(--paper)
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    gap: 90px;
    padding: 70px 9%;
    max-width: 1400px
}

.login-story {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px 0;
    min-height: 560px
}

.login-story h1 {
    font-size: 3rem;
    line-height: 1.08;
    font-weight: 500;
    letter-spacing: -3px;
    margin: 25px 0
}

.login-story p {
    font-size: 1rem
}

.login-story>span {
    font-size: 0.8125rem;
    color: var(--muted)
}

.login-card {
    background: var(--surface);
    padding: 50px;
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: 0 20px 60px #49672f08
}

.login-card h2 {
    font-size: 1.75rem;
    margin-top: 25px
}

.login-card>p {
    font-size: 0.9375rem
}

.login-card form {
    margin-top: 30px
}

.login-card label {
    margin-bottom: 20px
}

.login-card .button {
    margin-top: 10px
}

.login-card .fine {
    font-size: 0.8125rem;
    margin: 25px 0 0
}

.login-card .notice {
    margin-top: 20px
}

.login-card .pill {
    background: var(--highlight)
}

@media(min-width:1500px) {
    main {
        padding-top: 42px
    }
}

@media(max-width:1100px) {
    .sidebar {
        width: 210px;
        padding: 30px 16px
    }

    .main {
        margin-left: 210px
    }

    main {
        padding: 28px 25px
    }

    .topbar {
        padding: 0 25px
    }

    .metrics {
        gap: 12px
    }

    .metric {
        padding: 18px
    }

    .metric p {
        font-size: 0.8125rem
    }

    .dashboard-grid {
        grid-template-columns: 1fr
    }

    .accent-card {
        min-height: 260px
    }

    .mini-illustration {
        position: absolute;
        right: 35px;
        top: 20px
    }

    .accent-card p,
    .accent-card h2 {
        max-width: 50%
    }

    .login-shell {
        gap: 45px;
        padding: 50px 6%
    }

    .login-story h1 {
        font-size: 2.75rem
    }

    .login-card {
        padding: 32px
    }
}

@media(max-width:760px) {
    .sidebar {
        position: relative;
        width: 100%;
        padding: 18px;
        border-right: 0;
        border-bottom: 1px solid var(--line)
    }

    .brand {
        font-size: 1.75rem
    }

    .brand-icon {
        width: 34px;
        height: 34px;
        font-size: 1.75rem
    }

    .workspace,
    .sidebar-footer {
        display: none
    }

    nav {
        display: flex;
        overflow-x: auto;
        margin-top: 18px;
        gap: 5px
    }

    nav a {
        font-size: 0.8125rem;
        white-space: nowrap;
        padding: 10px
    }

    nav a span {
        display: none
    }

    .main {
        margin-left: 0
    }

    .topbar {
        height: 48px;
        padding: 0 20px;
        font-size: 0.8125rem
    }

    main {
        padding: 25px 18px
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
        margin-bottom: 20px
    }

    h1 {
        font-size: 1.75rem
    }

    .eyebrow {
        font-size: 0.8125rem
    }

    .notice {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        padding: 12px;
        font-size: 0.8125rem
    }

    .metrics {
        grid-template-columns: repeat(2, 1fr);
        margin: 20px 0;
        gap: 10px
    }

    .metric {
        padding: 17px
    }

    .metric>strong {
        font-size: 1.75rem
    }

    .metric-dot {
        right: 16px;
        top: 19px
    }

    .card {
        padding: 20px;
        border-radius: 12px
    }

    .section-heading {
        align-items: flex-start
    }

    .section-heading h2 {
        font-size: 1.25rem
    }

    .section-heading>.button {
        padding: 10px;
        font-size: 0.8125rem
    }

    .checklist-item>.muted {
        font-size: 0.8125rem
    }

    .checklist-item {
        gap: 10px
    }

    .checklist-item small {
        font-size: 0.8125rem
    }

    .accent-card {
        min-height: 280px
    }

    .mini-illustration {
        right: 0;
        top: 70px;
        transform: rotate(-12deg);
        width: 160px
    }

    .accent-card p,
    .accent-card h2 {
        max-width: 65%
    }

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

    .wide {
        grid-column: auto
    }

    .form-footer {
        align-items: flex-start
    }

    .compact {
        grid-template-columns: 1fr
    }

    .document-line {
        grid-template-columns: minmax(120px, 2fr) 1fr 1fr 25px;
        gap: 7px
    }

    .document-line label {
        font-size: 0.8125rem
    }

    .document-line input,
    .document-line select {
        padding: 9px 6px;
        font-size: 0.8125rem
    }

    .file-list {
        grid-template-columns: 1fr
    }

    .total-strip {
        gap: 20px
    }

    .total-strip strong {
        font-size: 1.25rem
    }

    .total-strip b {
        font-size: 0.9375rem
    }

    .login-shell {
        display: block;
        padding: 30px 22px
    }

    .login-story {
        min-height: 0;
        padding: 0
    }

    .login-story>div,
    .login-story>span {
        display: none
    }

    .login-card {
        margin-top: 35px;
        padding: 30px 24px
    }

    .private-label {
        display: none
    }

    footer {
        padding: 0 20px 25px
    }
}

[hidden] {
    display: none !important;
}

.mobile-account {
    display: none;
}

.text-button {
    border: 0;
    background: transparent;
    color: var(--link);
    font-size: 11px;
    padding: 4px;
}

@media (max-width: 760px) {
    .mobile-account {
        display: flex;
        align-items: center;
        gap: 15px;
        font-size: 11px;
    }

    .document-line {
        grid-template-columns: 1fr 1fr 28px;
    }

    .document-line label:first-child {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .document-line input,
    .document-line select {
        font-size: 12px;
        padding: 10px;
    }
}

/* Lectura y controles: 15 px de cuerpo y 13 px de texto secundario. */
body {
    line-height: 1.6;
}

:focus-visible {
    outline: 3px solid var(--green);
    outline-offset: 4px;
}

p,
label,
input,
select,
textarea,
td,
nav a,
.button {
    line-height: 1.6;
}

main,
.main,
.card,
.metric,
.form-grid>* {
    min-width: 0;
}

.metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}

.section-heading,
.form-footer,
.total-strip,
.pagination {
    flex-wrap: wrap;
}

.button,
.theme-toggle,
.text-button {
    min-height: 44px;
}

.button,
.section-heading>.button,
.text-button {
    font-size: 0.9375rem;
}

input,
select,
textarea {
    min-height: 42px;
}

input[type="checkbox"] {
    width: 20px;
    height: 20px;
    min-height: 20px;
    flex-shrink: 0;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 1;
}

.table-scroll {
    max-width: 100%;
}

.primary {
    color: var(--on-green);
}

.sidebar {
    overflow-y: auto;
}

.topbar {
    min-height: 88px;
    height: auto;
    padding-top: 16px;
    padding-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}

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

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-alt);
    color: var(--ink);
    font-size: 0.9375rem;
    white-space: nowrap;
}

.theme-toggle:hover {
    border-color: var(--green);
}

.theme-toggle [data-theme-icon] {
    font-size: 1.375rem;
    line-height: 1;
}

.login-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.login-card,
.login-card .pill {
    border-color: var(--line);
}

.login-card .pill {
    color: var(--ink);
}

.login-card .fine {
    font-size: .875rem;
}

.compact {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.document-line {
    grid-template-columns: minmax(160px, 4fr) minmax(90px, 1fr) minmax(110px, 1fr) 40px;
}

.total-strip {
    font-variant-numeric: tabular-nums;
}

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

    .dashboard-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .notice {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

@media (max-width: 900px) {
    .document-line {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px;
    }

    .document-line label:first-child {
        grid-column: 1 / -1;
        margin-bottom: 0;
    }

    .compact {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .sidebar {
        overflow: visible;
    }

    .topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
        gap: 12px;
    }

    .mobile-account,
    .mobile-account .text-button {
        font-size: 0.9375rem;
    }

    .login-story>.login-tools {
        display: flex;
    }

    .login-tools {
        gap: 12px;
    }

    .checklist-item {
        display: grid;
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 8px 12px;
    }

    .checklist-item>.step {
        grid-row: 1 / 3;
        align-self: start;
    }

    .checklist-item>.muted {
        grid-column: 2;
        margin-left: 0;
    }

    .accent-card h2,
    .accent-card p {
        max-width: 100%;
    }

    .mini-illustration {
        position: relative;
        right: auto;
        top: auto;
        margin-top: 34px;
        width: 200px;
    }

    .document-line input,
    .document-line select,
    .document-line label {
        font-size: 0.9375rem;
    }

    .total-strip {
        justify-content: flex-start;
    }
}

@media (max-width: 360px) {
    .metrics {
        grid-template-columns: minmax(0, 1fr);
    }

    .search-row,
    .environment-switch {
        flex-wrap: wrap;
    }

    .document-line {
        column-gap: 8px;
    }
}

.responsibility-options {
    min-width: 0;
    margin: 12px 0 20px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.responsibility-options legend {
    padding: 0 6px;
    color: var(--ink);
    font-weight: 550;
}

.responsibility-options p {
    margin: 0 0 10px;
}

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

.responsibility-grid .checkbox {
    margin: 8px 0;
    align-items: flex-start;
}

.responsibility-grid .checkbox input {
    margin-top: 3px;
}

.responsibility-grid small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
}

.responsibility-options .responsibility-help {
    margin: 14px 0 0;
}

.api-guide {
    min-width: 0;
}

.api-guide .card {
    scroll-margin-top: 20px;
}

.api-guide code {
    font-family: Consolas, 'Liberation Mono', monospace;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.guide-flow {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding-left: 24px;
    margin: 24px 0;
}

.guide-flow li {
    padding-right: 12px;
    line-height: 1.6;
}

.guide-flow strong,
.guide-flow span {
    display: block;
}

.guide-flow span {
    color: var(--muted);
    margin-top: 6px;
}

.guide-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
}

.guide-toc a {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 13px;
    color: var(--link);
}

.guide-toc a:hover {
    background: var(--surface-alt);
}

.guide-code {
    min-width: 0;
    margin: 18px 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    background: var(--input);
}

.guide-code-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-alt);
}

.guide-code-heading>div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.guide-code-heading .button {
    padding: 7px 12px;
    min-height: 36px;
}

.guide-code pre {
    margin: 0;
    padding: 18px;
    max-height: 480px;
    overflow: auto;
    line-height: 1.65;
    tab-size: 4;
}

.guide-code pre code {
    white-space: pre;
    overflow-wrap: normal;
}

.guide-endpoints td:nth-child(2) {
    min-width: 210px;
}

.guide-details {
    margin: 22px 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.guide-details summary {
    cursor: pointer;
    color: var(--link);
    font-weight: 550;
    line-height: 1.6;
}

.guide-details code {
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.guide-details[open] summary {
    margin-bottom: 16px;
}

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

.guide-columns>div {
    min-width: 0;
}

.guide-states dt {
    font-family: Consolas, 'Liberation Mono', monospace;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
    margin-top: 18px;
    color: var(--ink);
}

.guide-states dd {
    margin: 5px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.guide-list {
    padding-left: 22px;
    line-height: 1.75;
    color: var(--muted);
}

.guide-list li {
    margin: 10px 0;
}

@media (max-width: 760px) {

    .guide-flow,
    .guide-columns {
        grid-template-columns: minmax(0, 1fr);
    }

    .guide-code-heading {
        flex-wrap: wrap;
        padding: 12px;
    }

    .guide-code pre {
        padding: 14px;
    }

    .guide-details {
        padding: 12px;
    }
}

@media (max-width: 760px) {

    input,
    select,
    textarea,
    .document-line input,
    .document-line select {
        font-size: 1rem;
        min-height: 44px;
    }

    .responsibility-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.wizard-card { width: min(48rem, calc(100vw - 2rem)); max-width: 48rem; margin: 3rem auto; padding: clamp(1rem, 4vw, 3rem); }
.wizard-card h1 { font-size: clamp(1.5rem, 3vw, 2rem); }
.wizard-card .form-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.card pre { max-width: 100%; overflow: auto; padding: 1rem; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 8px; }
.card pre code { white-space: pre; overflow-wrap: normal; }
