:root {
    color-scheme: light;
    --ink: #122d55;
    --sub: #25446b;
    --muted: #466385;
    --blue: #1854bd;
    --blue-deep: #123b89;
    --blue-wash: #e5f2ff;
    --line: #bad7ef;
    --field-fill: #f7fbff;
    --control-line: #759fc8;
    --canvas: #fff;
    --quiet: #eaf6ff;
    --error: #a52634;
    --ease: cubic-bezier(.22, 1, .36, 1);
    --control: 48px;
    --radius: 10px;
    --panel-radius: 20px;
    --panel-shadow: 0 12px 26px -18px #184a8170;
    --bar-height: 68px;
    font: 400 16px/1.55 "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
    color: var(--ink);
    background: var(--quiet);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-inline-size: 0; }
::selection { color: var(--blue-deep); background: #c9e4ff; }
a { color: inherit; text-underline-offset: 4px; }
a, button, input, select, summary { -webkit-tap-highlight-color: #185bd922; }
button, input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
p, dl, dd, h1, h2, h3 { margin: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.2; font-weight: 800; letter-spacing: -.025em; }
h2, h3 { font-weight: 700; font-size: 1rem; }
code, .data-value { font: 400 .9375rem/1.5 ui-monospace, Consolas, "Microsoft YaHei UI", monospace; overflow-wrap: anywhere; }
time, .capacity { font-variant-numeric: tabular-nums; }
.icon { display: block; flex: none; width: 20px; height: 20px; object-fit: contain; }
.skip-link { position: fixed; z-index: 20; top: 8px; left: 8px; padding: 10px 16px; background: var(--canvas); border-radius: var(--radius); transform: translateY(calc(-100% - 16px)); }
.skip-link:focus { transform: none; }

.topbar { position: relative; background: #f8fcff; border-bottom: 1px solid #d3e7f6; }
.topbar-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: calc(var(--bar-height) - 1px);
    max-width: 1160px;
    padding-inline: 28px;
    margin-inline: auto;
    column-gap: 16px;
}
.brand { display: inline-flex; align-items: center; justify-self: start; gap: 10px; font-weight: 800; font-size: 1.125rem; white-space: nowrap; text-decoration: none; }
.brand-mark { display: block; flex: none; width: 38px; height: 38px; object-fit: cover; border-radius: 10px; }
.nav { display: flex; align-items: center; gap: 8px; }
.nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding-inline: 12px; font-size: .9rem; white-space: nowrap; text-decoration: none; color: var(--sub); }
.nav a[aria-current="page"] { color: var(--blue-deep); font-weight: 700; }
.nav a[aria-current="page"]::after { content: ""; align-self: end; position: absolute; inset: auto 0 0; height: 2px; background: #609be2; }
.nav a { position: relative; }
.nav a:hover { color: var(--blue); }

.lookup-page, .login-page, .admin-layout {
    background: var(--quiet) url('cartoon/desk.webp') center bottom / cover fixed no-repeat;
}
.lookup-shell, .login-shell { min-height: calc(100svh - var(--bar-height)); }
.lookup-shell { display: grid; align-items: center; padding-block: 48px 76px; }
.lookup-shell.has-result { align-items: start; padding-block: 38px 64px; }
.lookup-content { width: min(100% - 40px, 530px); margin-inline: auto; }
.query-panel {
    background: #fffefa;
    border: 1px solid #cee3f4;
    border-radius: 24px;
    box-shadow: 0 22px 44px -30px #184a8180, 0 4px 12px #184a8109;
}
.query-card { padding: 36px 40px 40px; }
.query-heading { margin-bottom: 24px; font-size: clamp(1.65rem, 4vw, 2.25rem); text-wrap: balance; }
.lookup-form { display: grid; gap: 16px; }
.submission-return { margin-top: 12px; }

.field { display: grid; align-content: start; gap: 8px; min-width: 0; }
.field label, legend { font-size: .9375rem; font-weight: 700; }
.field small { margin-inline-start: 4px; font-size: .8125rem; font-weight: 400; color: var(--muted); }
.field > input, .field select {
    width: 100%;
    min-height: var(--control);
    padding: 8px 14px;
    color: var(--ink);
    background: var(--field-fill);
    border: 1px solid var(--control-line);
    border-radius: var(--radius);
    caret-color: var(--blue);
    transition: background-color 180ms var(--ease), border-color 180ms var(--ease), box-shadow 180ms var(--ease);
}
.field > input:not(:hover, :focus, [aria-invalid="true"]), .field select:not(:hover, :focus) {
    border-image: url('cartoon/input.png') 24 fill / 6px stretch;
}
.field > input::placeholder { color: var(--muted); }
.field > input:hover, .field select:hover { background: #eff7ff; border-color: var(--blue); }
.field > input:focus, .field select:focus { outline: none; background: #f0f8ff; border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.field > input[aria-invalid="true"] { border-color: var(--error); }
.field > input[aria-invalid="true"]:focus { box-shadow: inset 0 0 0 1px var(--error); }
.lookup-form .field input {
    width: 100%;
    min-height: 52px;
    padding: 10px 14px;
    color: var(--ink);
    background: var(--field-fill);
    border: 1px solid #7793ae;
    border-image: none;
    border-radius: 12px;
    caret-color: var(--blue);
    transition: background-color 150ms var(--ease), border-color 150ms var(--ease), box-shadow 150ms var(--ease);
}
.lookup-form input::placeholder { color: var(--muted); }
.lookup-form .field input:hover { border-color: #497eb4; }
.lookup-form .field input:focus {
    outline: 2px solid transparent;
    background: #fff;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px #1854bd24;
}
.lookup-form .field input[aria-invalid="true"] { border-color: var(--error); }
.lookup-form .field input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px #a5263424; }
.field-hint { color: var(--muted); font-size: .8125rem; }
.select-control { position: relative; }
.select-control select { appearance: none; padding-inline-end: 40px; }
.select-control .icon { position: absolute; inset: 50% 12px auto auto; transform: translateY(-50%) rotate(90deg); pointer-events: none; width: 15px; height: 15px; }
.field-error { color: var(--error); font-size: .875rem; overflow-wrap: anywhere; }
.notice { color: var(--sub); font-size: .875rem; background: var(--quiet); padding: 12px 16px; border-radius: var(--radius); overflow-wrap: anywhere; }

/* Generated blue enamel plate with LeiBox-inspired press feedback on native controls. */
.tactile-button, .action-link {
    border: 1px solid transparent;
    border-radius: 12px;
    border-image: url('cartoon/button.png') 27 fill / 10px 13px 9px stretch;
    background: #1856cd padding-box;
    color: #fff;
    transition: transform 160ms var(--ease), filter 160ms var(--ease);
}
.tactile-button { padding: 0; min-width: 112px; font-weight: 700; cursor: pointer; touch-action: manipulation; }
.tactile-button .button-outer { display: block; }
.tactile-button .button-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: var(--control);
    padding: 5px 18px 8px;
}
.tactile-button .icon-arrow { filter: brightness(0) invert(1); }
@media (hover: hover) {
    .tactile-button:not(:disabled):hover, .action-link:hover { filter: brightness(1.07); }
}
.tactile-button:not(:disabled):active, .action-link:active { transform: translateY(2px) scale(.985); }
.tactile-button:disabled { cursor: wait; filter: saturate(.8); }

.front-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 54px;
    padding: 8px 16px 9px;
    border: 1px solid #2459a9;
    border-radius: 13px;
    background: #2868c6;
    color: #fff;
    box-shadow: inset 0 1px 0 #ffffff29, inset 0 -2px 0 #1d56a7, 0 4px 8px -4px #183f7f77;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
    transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease), transform 160ms var(--ease);
}
.front-action [data-button-label] { min-inline-size: 4em; }
.front-action-icon { transition: transform 160ms var(--ease); }
@media (hover: hover) {
    .front-action:not(:disabled):hover { background: #225ab3; }
    .front-action:not(:disabled):hover .icon-search { transform: scale(1.08); }
    .front-action:not(:disabled):hover .icon-send { transform: translate(1px, -1px); }
}
.front-action:not(:disabled):active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 3px #123b8940;
}
.front-action:disabled { background: #42648e; border-color: #42648e; box-shadow: none; cursor: wait; }
@media (prefers-reduced-motion: no-preference) {
    .front-action:disabled .icon { animation: front-action-pending 440ms var(--ease) 4 alternate; }
    @keyframes front-action-pending {
        to { transform: translateX(2px); }
    }
}

.lookup-result { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--line); }
.result-top { display: grid; justify-items: start; gap: 8px; }
.result-top h2, .lookup-details dt, .card-meta dt { color: var(--muted); font-size: .8125rem; font-weight: 600; }
#result-title:focus { outline: none; }
.lookup-details { display: grid; gap: 14px; margin-top: 20px; padding-block: 18px; border-block: 1px solid var(--line); }
.lookup-details dd { margin-top: 4px; font-size: .9375rem; }
.tone-waiting { --state: #92560b; }
.tone-working { --state: var(--blue); }
.tone-complete { --state: #147456; }
.tone-paused { --state: #6b5b8b; }
.current-status { display: flex; align-items: baseline; gap: 8px; max-width: 100%; padding: 5px 10px; border-radius: 6px; background: var(--blue-wash); color: var(--state, var(--blue)); font-size: .9375rem; font-weight: 700; overflow-wrap: anywhere; }
.current-status::before, .state::before { content: ""; display: inline-block; width: 8px; height: 8px; flex: none; background: var(--state, var(--blue)); border-radius: 50%; }
.result-history { margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--line); }
.lookup-result .result-history { margin-top: 16px; padding-top: 0; border-top: 0; }
.timeline { margin: 14px 0 0; padding: 0; list-style: none; }
.timeline-row { display: grid; grid-template-columns: 20px minmax(0, 1fr); column-gap: 9px; row-gap: 2px; position: relative; padding-bottom: 13px; }
.timeline-row:last-child { padding-bottom: 0; }
.timeline-row:not(:last-child)::before { content: ""; position: absolute; width: 1px; background: #a6c8ed; inset: 12px auto -8px 9px; }
.node { display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; position: relative; }
.node:empty::after { content: ""; width: 10px; height: 10px; background: var(--state); border-radius: 50%; border: 2px solid #fffdf5; box-sizing: content-box; }
.node .icon { width: 18px; height: 18px; }
.timeline strong { font-size: .9375rem; font-weight: 600; overflow-wrap: anywhere; }
.timeline time { grid-column: 2; color: var(--muted); font-size: .8125rem; }

.login-shell { display: grid; justify-items: center; align-content: center; padding: 44px 20px 72px; }
.login-panel { width: min(100%, 424px); padding: 36px; }
.login-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; }
.login-heading h1 { font-size: 1.875rem; }
.login-heading .icon { width: 34px; height: 34px; }
.login-panel .notice, .login-panel .field-error { margin-bottom: 16px; }
.login-panel > :last-child { margin-bottom: 0; }
.heading-label { display: flex; align-items: center; gap: 12px; }
.heading-label .icon { width: 40px; height: 40px; }

.stack-form { display: grid; gap: 20px; }
.stack-form > .tactile-button { justify-self: start; }
.login-panel .tactile-button { justify-self: stretch; }
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100svh; }
.admin-sidebar {
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    align-self: start;
    height: 100svh;
    overflow-y: auto;
    padding: 24px 16px 16px;
    background: #f7fcff;
    border-inline-end: 1px solid var(--line);
}
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding-inline: 8px; }
.sidebar-nav, .sidebar-footer { display: grid; align-content: start; gap: 4px; }
.sidebar-nav { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.sidebar-nav a, .sidebar-footer a, .sidebar-footer button { display: flex; align-items: center; gap: 12px; min-height: 44px; padding-inline: 12px; border: 1px solid transparent; border-radius: var(--radius); color: var(--sub); text-decoration: none; font-size: .9375rem; transition: background-color 170ms var(--ease), color 170ms var(--ease); }
.sidebar-nav a[aria-current="page"] {
    color: var(--blue-deep);
    border-color: #c8e1f7;
    background: #e5f2ff;
    font-weight: 700;
}
.sidebar-nav a:hover, .sidebar-footer a:hover, .sidebar-footer button:hover { color: var(--blue-deep); background: var(--blue-wash); text-decoration: none; }
.sidebar-footer { margin-top: auto; padding-top: 16px; }
.sidebar-footer button { width: 100%; }
.admin-mobile-bar, .sidebar-brand .drawer-close, .drawer-backdrop { display: none; }
.admin-shell { width: min(100% - 64px, 800px); margin: 48px auto 64px; }
.admin-wide { width: min(100% - 64px, 1120px); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-heading h1 { font-size: clamp(1.625rem, 2.5vw, 2.125rem); }
.admin-shell > .field-error, .admin-shell > .notice { margin-bottom: 16px; }
.admin-panel, .empty-state, .table-wrap, .key-list {
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: var(--panel-radius);
    box-shadow: var(--panel-shadow);
}
.admin-panel, .empty-state { padding: 28px; }
.empty-state { display: grid; justify-items: center; gap: 18px; padding-block: 48px; text-align: center; color: var(--sub); }
.empty-state .icon { width: 84px; height: 80px; }
.admin-shell > .notice { background: var(--blue-wash); color: var(--blue-deep); }
.text-action, .back-link, .action-link, .pagination a { display: inline-flex; align-items: center; min-height: 44px; gap: 8px; color: var(--blue); text-decoration: none; }
.text-action { padding: 0; border: 0; background: transparent; cursor: pointer; }
.text-action:hover, .back-link:hover, .pagination a:hover { text-decoration: underline; }
.back-link { margin-bottom: 8px; font-size: .875rem; }
.action-link { padding: 0 16px 2px; color: #fff; font-size: .875rem; font-weight: 700; white-space: nowrap; }
.action-link .icon { filter: brightness(0) invert(1); }
.field-pair, .card-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mode-group { margin: 0; padding: 0; border: 0; min-inline-size: 0; }
.mode-group legend { padding: 0; margin-bottom: 8px; }
.mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); position: relative; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--quiet); margin-bottom: 16px; }
.mode-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mode-switch label { display: grid; place-items: center; min-height: 44px; font-size: .875rem; color: var(--sub); border: 1px solid transparent; border-radius: 4px; cursor: pointer; transition: background-color 150ms var(--ease), color 150ms var(--ease); }
.mode-switch label:hover { background: var(--blue-wash); }
.mode-switch input:checked + label {
    color: var(--blue-deep);
    border-color: transparent;
    border-image: url('cartoon/tab.png') 18 fill / 8px stretch;
    font-weight: 700;
}
.mode-switch input:focus-visible + label { outline: 2px solid var(--blue); outline-offset: 1px; }
.mode-group:has(#mode-random:checked) .custom-fields, .mode-group:has(#mode-custom:checked) .random-fields { display: none; }
.card-meta { padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.card-meta dd { margin-top: 4px; }
.progress-fields { grid-template-columns: minmax(0, 1fr) minmax(112px, 26%); }
.copy-group { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; max-width: 100%; }
.icon-button { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; padding: 0; color: var(--blue); background: transparent; border: 0; border-radius: 4px; cursor: pointer; }
.icon-button:hover { background: var(--blue-wash); }
.copy-feedback { font-size: .8125rem; color: var(--muted); }
.card-table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: left; }
.card-table th, .card-table td { padding: 12px 20px; text-align: left; vertical-align: middle; overflow-wrap: anywhere; }
.card-table thead th { color: var(--sub); font-size: .8125rem; font-weight: 600; background: #e3f1ff; }
.card-table thead th:first-child { border-radius: 19px 0 0; }
.card-table thead th:last-child { border-radius: 0 19px 0 0; width: 116px; }
.card-table tbody tr { border-top: 1px solid var(--line); }
.card-table tbody tr:last-child th:first-child { border-end-start-radius: 19px; }
.card-table tbody tr:last-child td:last-child { border-end-end-radius: 19px; }
.card-table tbody tr:focus-within > * { background: var(--field-fill); }
@media (hover: hover) {
    .card-table tbody tr:hover > * { background: var(--field-fill); }
}
.card-table td { font-size: .875rem; color: var(--sub); }
.mobile-label { display: none; }
.reveal summary { display: flex; align-items: center; gap: 4px; width: fit-content; color: var(--blue); cursor: pointer; padding-block: 8px; }
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary .icon { width: 14px; height: 14px; transition: transform 180ms var(--ease); }
.reveal[open] summary .icon { transform: rotate(90deg); }
.row-actions { display: grid; }
.row-actions .text-action { min-height: 36px; }
.binding-current { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 24px; background: var(--quiet); border-radius: 10px; }
.binding-current > div { min-width: 0; }
.meta-label { display: block; font-size: .8125rem; color: var(--muted); }
.field .checkbox-field {
    position: relative;
    display: flex;
    justify-self: start;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    max-width: 100%;
    padding: 8px 10px;
    border-radius: var(--radius);
    color: var(--sub);
    font-weight: 400;
    cursor: pointer;
    transition: background-color 150ms var(--ease), color 150ms var(--ease);
}
.checkbox-field input { position: absolute; inset: 50% auto auto 10px; transform: translateY(-50%); margin: 0; width: 20px; height: 20px; opacity: 0; }
.checkbox-box {
    flex: none;
    width: 20px;
    height: 20px;
    border-radius: 5px;
    background: url('cartoon/unchecked.png') center / contain no-repeat;
}
.field .checkbox-field:hover, .field .checkbox-field:has(input:checked) { background: var(--blue-wash); color: var(--blue-deep); }
.checkbox-field input:checked + .checkbox-box { background-image: url('cartoon/checked.png'); }
.checkbox-field input:focus-visible + .checkbox-box { outline: 2px solid var(--blue); outline-offset: 3px; }
.progress-binding { width: fit-content; margin-block: -12px 12px; }
.state { display: inline-flex; align-items: baseline; gap: 8px; max-width: 100%; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 16px; margin-top: 12px; font-size: .875rem; color: var(--muted); }
.capacity { font-size: .9375rem; color: var(--muted); }
.key-slot + .key-slot { border-top: 1px solid var(--line); }
.key-slot:first-child > summary { border-start-start-radius: 19px; border-start-end-radius: 19px; }
.key-slot:last-child:not([open]) > summary { border-end-start-radius: 19px; border-end-end-radius: 19px; }
.key-slot > summary { display: grid; grid-template-columns: minmax(0, 1fr) 76px 36px; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; list-style: none; cursor: pointer; }
.key-slot > summary::-webkit-details-marker { display: none; }
.key-slot > summary { transition: background-color 170ms var(--ease); }
.key-slot > summary:hover, .key-slot[open] > summary { background: var(--quiet); }
.key-name { font-weight: 600; overflow-wrap: anywhere; }
.key-state { font-size: .8125rem; color: var(--muted); }
.key-edit { font-size: .875rem; color: var(--blue); }
.key-form-wrap { padding: 20px 16px 24px; }
.key-form-wrap > .field-error { margin-bottom: 12px; }
.remove-key { margin-top: 12px; }
.danger { color: var(--error); }

@media (max-width: 900px) {
    .admin-layout { display: block; }
    .admin-mobile-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; background: var(--canvas); border-bottom: 1px solid var(--line); }
    .admin-mobile-bar .drawer-open { display: none; }
    .admin-sidebar { height: auto; overflow: visible; position: static; border-inline-end: 0; border-bottom: 1px solid var(--line); }
    .admin-sidebar .sidebar-brand { display: none; }
    .sidebar-nav { margin-top: 0; }
    .admin-sidebar .sidebar-footer { margin-top: 20px; }
    .admin-layout.drawer-enabled .drawer-open, .drawer-enabled .sidebar-brand .drawer-close { display: inline-grid; width: 44px; height: 44px; }
    .drawer-enabled .admin-sidebar {
        position: fixed;
        z-index: 10;
        inset: 0 auto 0 0;
        width: min(280px, 90vw);
        height: 100dvh;
        overflow: auto;
        border-inline-end: 1px solid var(--line);
        visibility: hidden;
        transform: translateX(-100%);
        transition: transform 260ms var(--ease), visibility 0s linear 260ms;
    }
    .drawer-enabled .sidebar-brand { display: flex; }
    .drawer-enabled .sidebar-nav { margin-top: 28px; }
    .drawer-enabled .sidebar-footer { margin-top: auto; }
    .drawer-enabled .drawer-backdrop { display: block; position: fixed; z-index: 9; inset: 0; background: #15233a55; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 240ms var(--ease), visibility 0s linear 240ms; }
    .drawer-opened { overflow: hidden; }
    .drawer-opened .admin-sidebar { visibility: visible; transform: translateX(0); transition-delay: 0s; }
    .drawer-opened .drawer-backdrop { visibility: visible; opacity: 1; pointer-events: auto; transition-delay: 0s; }
    .admin-layout .admin-shell { width: min(100% - 40px, 840px); margin-inline: auto; }
}


@media (max-width: 760px) {
    :root { --bar-height: 62px; }
    .topbar-inner { padding-inline: 20px; }
    .lookup-shell, .lookup-shell.has-result { align-items: start; padding-block: 32px 52px; }
    .query-card { padding: 26px 24px 24px; }
    .query-heading { margin-bottom: 20px; }
    .lookup-result { margin-top: 24px; padding-top: 18px; }
    .admin-shell, .admin-layout .admin-shell { width: calc(100% - 32px); margin-top: 28px; }
    .section-heading { margin-bottom: 16px; gap: 10px; }
    .heading-label { gap: 9px; }
    .heading-label .icon { width: 29px; height: 29px; }
    .admin-panel { padding: 20px; }
    .table-wrap { padding: 0 16px; }
    .card-table, .card-table tbody, .card-table tr, .card-table th, .card-table td { display: block; }
    .card-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .card-table tbody tr { display: grid; padding: 12px 0; }
    .card-table tbody tr:first-child { border-top: 0; }
    .card-table tbody th, .card-table tbody td:not(:last-child) { display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: center; gap: 8px; }
    .card-table tbody th, .card-table tbody td { padding: 4px 0; }
    .card-table tbody tr:hover > *, .card-table tbody tr:focus-within > * { background: var(--canvas); }
    .row-actions { display: flex; justify-content: flex-end; gap: 16px; }
    .row-actions .text-action { min-height: 44px; }
    .mobile-label { display: inline; font: 400 .8125rem/1.5 "Microsoft YaHei UI", system-ui, sans-serif; color: var(--muted); }
    .icon-button { width: 44px; height: 44px; }
}

@media (max-width: 460px) {
    .topbar-inner { grid-template-columns: auto auto; justify-content: space-between; padding-inline: 14px; column-gap: 4px; }
    .brand { font-size: 1rem; gap: 7px; }
    .brand-mark { width: 32px; height: 32px; }
    .nav { gap: 2px; }
    .nav a { font-size: .8125rem; }
    .nav a { padding-inline: 8px; }
    .login-panel { padding: 24px; }
    .field-pair { grid-template-columns: minmax(0, 1fr); }
    .binding-current { align-items: start; flex-direction: column; }
}

@media (min-width: 761px) and (max-height: 650px) {
    .lookup-shell { padding-block: 24px; }
    .query-card { padding-block: 24px; }
    .query-heading { margin-bottom: 16px; }
    .lookup-form { gap: 12px; }
    .lookup-form .field { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .tactile-button:not(:disabled):active, .action-link:active,
    .front-action:not(:disabled):active, .front-action:not(:disabled):hover .icon { transform: none; }
}

@media (forced-colors: active) {
    .lookup-page, .login-page, .admin-layout { background: Canvas; }
    .tactile-button, .action-link, .field input, .field select, .query-panel { border-image: none !important; }
    .tactile-button, .action-link { border-color: ButtonText; }
    .front-action { border-color: ButtonText; color: ButtonText; background: ButtonFace; }
    .front-action:disabled { border-color: GrayText; color: GrayText; }
    .tactile-button .icon-arrow, .action-link .icon { filter: none; }
    .field input:focus, .field select:focus, .lookup-form .field input:focus { outline: 2px solid Highlight; outline-offset: -2px; }
    .checkbox-box { border: 1px solid CanvasText; }
    .mode-switch input:checked + label, .nav a[aria-current="page"], .sidebar-nav a[aria-current="page"] { border: 2px solid Highlight; border-image: none; }
}
