:root {
    color-scheme: light dark;
    --bg: #f4f6fa;
    --surface: #fff;
    --surface-2: #f1f4f9;
    --ink: #111827;
    --ink-2: #374151;
    --muted: #667085;
    --line: #e3e8ef;
    --line-strong: #cdd5df;
    --accent: #0b41cd;
    --accent-ink: #fff;
    --accent-soft: #e9effd;
    --ring: rgba(11, 65, 205, 0.35);
    --ok: #15703a;
    --ok-soft: #dcfce7;
    --warn: #92400e;
    --warn-soft: #fef3c7;
    --bad: #b42318;
    --bad-soft: #fee4e2;
    --info: #1d4ed8;
    --info-soft: #dbeafe;
    --neutral-soft: #eef1f5;
    --topbar: #0f172a;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.07);
    --shadow-lg: 0 16px 40px rgba(16, 24, 40, 0.2);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0b1120;
        --surface: #121a2b;
        --surface-2: #19233a;
        --ink: #e7ebf3;
        --ink-2: #c5ccda;
        --muted: #8f9bb3;
        --line: #243049;
        --line-strong: #34425f;
        --accent: #7d9dff;
        --accent-ink: #0b1120;
        --accent-soft: #1a2856;
        --ring: rgba(125, 157, 255, 0.45);
        --ok: #4ade80;
        --ok-soft: rgba(74, 222, 128, 0.13);
        --warn: #fbbf24;
        --warn-soft: rgba(251, 191, 36, 0.13);
        --bad: #f87171;
        --bad-soft: rgba(248, 113, 113, 0.13);
        --info: #93c5fd;
        --info-soft: rgba(147, 197, 253, 0.13);
        --neutral-soft: #1d2840;
        --topbar: #060a14;
        --shadow: none;
        --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.55);
    }
}

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

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.3;
}

h1 {
    font-size: 22px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

h2 {
    font-size: 16px;
    font-weight: 600;
}

p {
    margin: 0;
}

code,
.mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.92em;
}

code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--surface-2);
}

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

.small {
    font-size: 12.5px;
}

.strong {
    font-weight: 600;
}

:focus-visible {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.skip {
    position: absolute;
    top: -60px;
    left: 12px;
    z-index: 100;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
}

.skip:focus {
    top: 12px;
}

.icon {
    flex: none;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon.xl {
    width: 44px;
    height: 44px;
    stroke-width: 1.5;
}

/* --- header and tabs --- */

.app-header {
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 56px;
    padding: 8px 24px;
    background: var(--topbar);
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 650;
    white-space: nowrap;
}

.logo {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: #8fb0ff;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.env {
    padding: 2px 8px;
    border-radius: 999px;
    background: #334155;
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.env[data-env="dev"] {
    background: #fcd34d;
    color: #422006;
}

.env[data-env="prod"] {
    background: #dc2626;
    color: #fff;
}

.spacer {
    flex: 1;
}

.user {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.avatar {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #3656d6;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.user-text {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.user-name {
    font-weight: 600;
}

.user-email {
    overflow: hidden;
    color: #9aa7bd;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px;
    overflow-x: auto;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.tabs [role="tab"] {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 12px;
    border: 0;
    background: none;
    color: var(--muted);
    font: inherit;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
}

.tabs [role="tab"]:hover {
    color: var(--ink);
}

.tabs [role="tab"][aria-selected="true"] {
    color: var(--accent);
}

.tabs [role="tab"][aria-selected="true"]::after {
    position: absolute;
    right: 4px;
    bottom: 0;
    left: 4px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--accent);
    content: "";
}

.tabs [role="tab"]:focus-visible {
    outline-offset: -3px;
}

.count {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
}

.count.alert {
    background: #b42318;
    color: #fff;
}

/* --- layout --- */

main {
    max-width: 1160px;
    margin: 0 auto;
    padding: 28px 24px 72px;
}

main:focus {
    outline: none;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px 24px;
    margin-bottom: 20px;
}

.page-head p {
    margin-top: 4px;
}

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

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 32px 0 12px;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.section-title:first-child {
    margin-top: 0;
}

.card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.stack {
    display: grid;
    gap: 12px;
}

.skeleton {
    display: grid;
    gap: 14px;
}

.skeleton span {
    display: block;
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
}

.skeleton span:first-child {
    width: 35%;
    height: 22px;
}

.skeleton span:nth-child(2) {
    width: 85%;
}

.skeleton span:nth-child(3) {
    width: 65%;
}

.skeleton span:nth-child(4) {
    width: 45%;
}

@keyframes shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.empty {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 48px 24px;
    text-align: center;
}

.empty > .icon {
    color: var(--muted);
}

.empty p {
    max-width: 560px;
    color: var(--muted);
}

.empty .btn {
    margin-top: 6px;
}

.empty-inline {
    padding: 18px;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

/* --- request form --- */

.request-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    align-items: start;
}

.steps {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.step-no {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
}

.filter {
    margin-bottom: 16px;
}

.group + .group {
    margin-top: 18px;
}

.group-title {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 10px;
}

.option {
    position: relative;
    display: block;
    cursor: pointer;
}

.option input {
    position: absolute;
    opacity: 0;
}

.option-body {
    position: relative;
    display: grid;
    gap: 2px;
    height: 100%;
    padding: 12px 14px 12px 42px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface);
    transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}

.option-body::before {
    position: absolute;
    top: 14px;
    left: 14px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--line-strong);
    border-radius: 50%;
    background: var(--surface);
    content: "";
}

.option:hover .option-body {
    border-color: var(--accent);
}

.option input:checked + .option-body {
    border-color: var(--accent);
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.option input:checked + .option-body::before {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: inset 0 0 0 3px var(--surface);
}

.option input:focus-visible + .option-body {
    outline: 3px solid var(--ring);
    outline-offset: 2px;
}

.option-title {
    font-weight: 600;
    overflow-wrap: anywhere;
}

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

.option-sub .mono {
    color: var(--ink-2);
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--neutral-soft);
    color: var(--ink-2);
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.tag.ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.tag.warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.segmented {
    display: inline-flex;
    justify-self: start;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-2);
}

.segmented label {
    position: relative;
}

.segmented input {
    position: absolute;
    opacity: 0;
}

.segmented span {
    display: block;
    padding: 6px 20px;
    border-radius: 7px;
    color: var(--muted);
    font-weight: 600;
    cursor: pointer;
}

.segmented input:checked + span {
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow), 0 0 0 1px var(--line);
}

.segmented input:focus-visible + span {
    outline: 3px solid var(--ring);
    outline-offset: 1px;
}

.field {
    display: grid;
    gap: 6px;
}

.field + .field {
    margin-top: 18px;
}

.field > label,
.label {
    color: var(--ink-2);
    font-size: 13px;
    font-weight: 600;
}

input[type="text"],
input[type="search"],
input[type="datetime-local"],
textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
input[type="search"]:focus,
input[type="datetime-local"]:focus,
textarea:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--ring);
}

input[type="datetime-local"] {
    max-width: 280px;
}

[aria-invalid="true"] {
    border-color: var(--bad) !important;
}

[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 3px var(--bad-soft) !important;
}

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

::placeholder {
    color: var(--muted);
    opacity: 0.8;
}

input[type="range"] {
    width: 100%;
    margin: 4px 0 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.range-scale {
    display: flex;
    justify-content: space-between;
    color: var(--muted);
    font-size: 12px;
}

output {
    margin-left: 6px;
    color: var(--accent);
    font-weight: 700;
}

.field-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.field-foot > .muted {
    margin-left: auto;
}

.field-error {
    color: var(--bad);
    font-size: 12.5px;
    font-weight: 500;
}

#entry-error {
    margin-top: 10px;
}

.summary {
    position: sticky;
    top: 124px;
}

.summary h2 {
    margin-bottom: 14px;
}

.summary .kv {
    margin-bottom: 18px;
}

#summary-note {
    margin-top: 12px;
}

#form-error {
    margin-bottom: 14px;
}

/* --- buttons, badges, callouts --- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s, filter 0.15s;
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn.sm {
    padding: 5px 10px;
    font-size: 13px;
}

.btn.block {
    width: 100%;
    padding: 11px 16px;
}

.btn.primary {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn.success {
    background: #15803d;
    color: #fff;
}

.btn.danger {
    background: #b42318;
    color: #fff;
}

.btn.primary:hover:not(:disabled),
.btn.success:hover:not(:disabled),
.btn.danger:hover:not(:disabled) {
    filter: brightness(1.12);
}

.btn.outline {
    border-color: var(--line-strong);
}

.btn.outline:hover:not(:disabled) {
    background: var(--surface-2);
}

.btn.danger-outline {
    border-color: var(--bad);
    background: transparent;
    color: var(--bad);
}

.btn.danger-outline:hover:not(:disabled) {
    background: var(--bad-soft);
}

.btn.on-dark {
    border-color: rgba(255, 255, 255, 0.28);
    background: transparent;
    color: #e2e8f0;
}

.btn.on-dark:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn.link {
    padding: 2px 4px;
    border: 0;
    background: none;
    color: var(--accent);
}

.btn.link:hover {
    text-decoration: underline;
}

.btn[aria-busy="true"]::before {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    content: "";
    animation: spin 0.7s linear infinite;
}

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

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 10px 2px 8px;
    border-radius: 999px;
    background: var(--neutral-soft);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.badge.ok {
    background: var(--ok-soft);
    color: var(--ok);
}

.badge.warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.badge.bad {
    background: var(--bad-soft);
    color: var(--bad);
}

.badge.info {
    background: var(--info-soft);
    color: var(--info);
}

.badge.live::before {
    animation: pulse 1.8s ease-out infinite;
}

.badge.busy::before {
    border: 2px solid currentColor;
    border-right-color: transparent;
    background: none;
    animation: spin 0.8s linear infinite;
}

@keyframes pulse {
    from {
        box-shadow: 0 0 0 0 currentColor;
    }

    to {
        box-shadow: 0 0 0 6px transparent;
    }
}

.callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
}

.callout > .icon {
    margin-top: 2px;
}

.callout.bad {
    background: var(--bad-soft);
    color: var(--bad);
}

.callout.warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 13px;
}

#sc-info .callout {
    margin-bottom: 16px;
}

/* --- request cards and history --- */

.req {
    display: grid;
    gap: 10px;
    border-left: 4px solid var(--line-strong);
}

.req.ok {
    border-left-color: var(--ok);
}

.req.warn {
    border-left-color: #f59e0b;
}

.req.bad {
    border-left-color: var(--bad);
}

.req.info {
    border-left-color: var(--info);
}

.req.flash {
    animation: flash 2.4s ease-out;
}

@keyframes flash {
    from {
        box-shadow: 0 0 0 4px var(--ring);
    }
}

.req-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.req-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 10px;
    font-size: 16px;
    font-weight: 600;
}

.req-title .mono {
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
}

.req-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
}

.req-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    color: var(--ink-2);
}

.req-line > .icon {
    color: var(--muted);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

progress {
    display: block;
    width: 100%;
    height: 6px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: var(--surface-2);
    appearance: none;
}

progress::-webkit-progress-bar {
    border-radius: 999px;
    background: var(--surface-2);
}

progress::-webkit-progress-value {
    border-radius: 999px;
    background: var(--ok);
}

progress::-moz-progress-bar {
    border-radius: 999px;
    background: var(--ok);
}

details > summary {
    list-style: none;
    cursor: pointer;
}

details > summary::-webkit-details-marker {
    display: none;
}

.chev {
    display: inline-block;
    flex: none;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.15s;
}

details[open] > summary .chev {
    transform: translateY(-2px) rotate(45deg);
}

.more > summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
}

.kv {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px 18px;
    margin: 0;
}

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

.kv dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.kv .tag {
    white-space: normal;
}

.more .kv,
.hist-body .kv,
.dialog-body .kv {
    padding: 14px 16px;
    border-radius: 10px;
    background: var(--surface-2);
}

.more .kv {
    margin-top: 12px;
}

.copy {
    margin-left: 6px;
    vertical-align: middle;
    color: var(--muted);
}

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

.hist + .hist {
    border-top: 1px solid var(--line);
}

.hist > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    padding: 12px 18px;
}

.hist > summary:hover {
    background: var(--surface-2);
}

.hist-status {
    flex: none;
    width: 150px;
}

.hist-main {
    display: grid;
    flex: 1 1 220px;
    min-width: 0;
}

.hist-when {
    flex: none;
    color: var(--muted);
    font-size: 13px;
}

.hist > summary .chev {
    color: var(--muted);
}

.hist-body {
    padding: 0 18px 16px;
}

.hist-body .actions {
    justify-content: flex-start;
    margin-top: 12px;
}

.hist-foot {
    padding: 10px 18px;
    border-top: 1px solid var(--line);
    text-align: center;
}

/* --- approvals --- */

.approval {
    display: grid;
    gap: 12px;
}

.person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.person .avatar {
    background: var(--accent-soft);
    color: var(--accent);
}

.person-text {
    display: grid;
    min-width: 0;
    line-height: 1.3;
}

.quote {
    margin: 0;
    padding: 10px 14px;
    border-left: 3px solid var(--line-strong);
    border-radius: 0 8px 8px 0;
    background: var(--surface-2);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.approval-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* --- toasts and dialog --- */

.toasts {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 50;
    display: grid;
    gap: 10px;
    width: min(400px, calc(100vw - 40px));
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 10px 12px 14px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--info);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    animation: rise 0.2s ease-out;
}

.toast > .icon {
    margin-top: 2px;
}

.toast.ok {
    border-left-color: var(--ok);
}

.toast.ok > .icon {
    color: var(--ok);
}

.toast.bad {
    border-left-color: var(--bad);
}

.toast.bad > .icon {
    color: var(--bad);
}

.toast p {
    flex: 1;
    overflow-wrap: anywhere;
}

.toast .x {
    display: inline-grid;
    place-items: center;
    padding: 3px;
    border: 0;
    border-radius: 6px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}

.toast .x:hover {
    background: var(--surface-2);
    color: var(--ink);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

dialog {
    width: min(500px, calc(100vw - 32px));
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow-lg);
}

dialog[open] {
    animation: rise 0.18s ease-out;
}

dialog::backdrop {
    background: rgba(8, 12, 24, 0.55);
}

.dialog-form {
    display: grid;
    gap: 16px;
    padding: 24px;
}

.dialog-body {
    display: grid;
    gap: 12px;
    color: var(--ink-2);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* --- small screens and motion --- */

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

    .summary {
        position: static;
    }
}

@media (max-width: 640px) {
    .topbar {
        gap: 10px;
        padding: 8px 14px;
    }

    .user-text {
        display: none;
    }

    .tabs {
        padding: 0 8px;
    }

    main {
        padding: 20px 12px 64px;
    }

    .card {
        padding: 16px;
    }

    .kv {
        grid-template-columns: minmax(0, 1fr);
        gap: 2px;
    }

    .kv dd + dt {
        margin-top: 8px;
    }

    .approval-foot .actions,
    .approval-foot .actions .btn {
        flex: 1;
    }

    .toasts {
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
    }
}

@media (max-width: 480px) {
    .user {
        display: none;
    }

    .tabs {
        gap: 0;
        padding: 0 4px;
    }

    .tabs [role="tab"] {
        gap: 6px;
        padding: 12px 8px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}