:root {
    --bg: #eef4fb;
    --bg-deep: #d9e7f7;
    --sidebar: #0f172a;
    --sidebar-soft: rgba(148, 163, 184, 0.18);
    --card: rgba(255, 255, 255, 0.94);
    --card-strong: #ffffff;
    --card-soft: #f7fbff;
    --ink: #0f172a;
    --muted: #5b6b83;
    --line: rgba(15, 23, 42, 0.1);
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.12);
    --success: #15803d;
    --success-soft: rgba(21, 128, 61, 0.12);
    --warn: #b45309;
    --warn-soft: rgba(180, 83, 9, 0.14);
    --danger: #b91c1c;
    --danger-soft: rgba(185, 28, 28, 0.12);
    --shadow-lg: 0 28px 70px rgba(15, 23, 42, 0.12);
    --shadow-md: 0 18px 40px rgba(37, 99, 235, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "MiSans", "Alibaba PuHuiTi 3.0", "PingFang SC", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 24%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 22%),
        linear-gradient(180deg, #f6fbff 0%, #e8f0f8 58%, #e2ebf6 100%);
}

h1,
h2,
h3,
h4,
p {
    margin: 0;
}

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

button,
input,
select,
textarea {
    border-radius: 16px;
    border: 1px solid var(--line);
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.92);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(37, 99, 235, 0.36);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
    background: #fff;
}

textarea {
    min-height: 180px;
    resize: vertical;
    line-height: 1.58;
}

button {
    width: 100%;
    padding: 12px 14px;
    cursor: pointer;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
    border-color: rgba(29, 78, 216, 0.2);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.18);
    filter: saturate(1.05);
}

button.secondary {
    color: var(--ink);
    background: #fff;
    box-shadow: none;
}

button.secondary:hover {
    background: #f6f9ff;
}

button.danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-color: rgba(185, 28, 28, 0.2);
}

.layout-shell {
    max-width: 1840px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 24px;
}

.sidebar {
    position: sticky;
    top: 24px;
    align-self: start;
    min-height: calc(100vh - 48px);
    padding: 28px 24px;
    border-radius: 30px;
    color: #dbe8ff;
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.24), transparent 24%),
        linear-gradient(180deg, #0f172a 0%, #111c34 100%);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.3);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.eyebrow {
    color: #8db8ff;
    font-size: 12px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-weight: 700;
}

.sidebar h1 {
    font-size: 30px;
    line-height: 1.08;
    color: #f8fbff;
}

.sidebar-text {
    line-height: 1.7;
    color: rgba(219, 232, 255, 0.78);
}

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

.mini-stat {
    padding: 14px 16px;
    border-radius: 20px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.14);
    backdrop-filter: blur(10px);
}

.mini-stat span {
    display: block;
    font-size: 12px;
    color: rgba(219, 232, 255, 0.72);
}

.mini-stat strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
    color: #fff;
}

.mini-stat strong.compact-stat {
    font-size: 22px;
    line-height: 1.2;
    word-break: break-word;
}

.panel-nav {
    display: grid;
    gap: 10px;
}

.panel-tab {
    text-align: left;
    color: rgba(232, 242, 255, 0.88);
    background: rgba(148, 163, 184, 0.08);
    border-color: rgba(148, 163, 184, 0.08);
    box-shadow: none;
}

.panel-tab:hover {
    box-shadow: none;
    background: rgba(59, 130, 246, 0.16);
}

.panel-tab.active {
    color: #fff;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.92) 0%, rgba(14, 165, 233, 0.78) 100%);
    border-color: rgba(96, 165, 250, 0.38);
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.muted-label {
    display: block;
    font-size: 12px;
    color: rgba(219, 232, 255, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.sidebar-footer strong {
    display: block;
    margin-top: 8px;
    font-size: 18px;
    color: #fff;
}

.workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.card {
    overflow: hidden;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    background: var(--card);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(12px);
}

.hero {
    display: grid;
    grid-template-columns: 1.45fr 0.9fr;
    gap: 22px;
    padding: 24px;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hero-copy h2 {
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1;
}

.subtitle,
.card-head p,
.control-head p,
.tip-card p,
.jump-card span,
.muted {
    color: var(--muted);
    line-height: 1.65;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.summary-card {
    padding: 18px;
    border-radius: 22px;
    border: 1px solid rgba(37, 99, 235, 0.08);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92) 0%, rgba(245, 250, 255, 0.96) 100%);
    box-shadow: var(--shadow-md);
}

.summary-card span {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.summary-card strong {
    display: block;
    margin: 10px 0 6px;
    font-size: 32px;
    line-height: 1;
}

.summary-card em {
    color: var(--muted);
    font-size: 13px;
    font-style: normal;
}

.control-panel {
    padding: 22px;
    border-radius: 24px;
    border: 1px solid rgba(37, 99, 235, 0.12);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 20%),
        linear-gradient(180deg, rgba(247, 251, 255, 0.95) 0%, rgba(255, 255, 255, 0.96) 100%);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.control-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-head h3,
.card-head h3,
.card-head h4,
.tip-card h4,
.sub-card h4 {
    font-size: 18px;
}

.card-head {
    padding: 22px 22px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-body {
    padding: 18px 22px 22px;
}

.head-row,
.toolbar-row,
.check-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.head-row {
    justify-content: space-between;
    align-items: flex-start;
}

.head-row > button {
    width: auto;
    min-width: 160px;
}

.toolbar-row input[type="number"] {
    max-width: 130px;
}

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

.check-row input {
    width: auto;
}

.flash {
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-strong);
}

.flash.error {
    background: var(--danger-soft);
    color: var(--danger);
}

.content-panel {
    display: none;
}

.content-panel.is-active {
    display: grid;
}

.overview-grid,
.panel-stack,
.form-grid,
.two-col,
.tip-grid,
.jump-grid,
.compact-filter-grid {
    display: grid;
    gap: 18px;
}

.overview-grid {
    grid-template-columns: 1.2fr 1fr;
}

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

.jump-card {
    min-height: 148px;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
    border-radius: 22px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 26%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(245, 249, 255, 0.98) 100%);
    border-color: rgba(37, 99, 235, 0.12);
    color: var(--ink);
    box-shadow: none;
}

.jump-card strong {
    display: block;
    margin-bottom: 10px;
    font-size: 18px;
}

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

.compact-filter-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding-top: 8px;
}

.tip-card,
.sub-card {
    padding: 18px;
    border-radius: 22px;
    background: var(--card-soft);
    border: 1px solid var(--line);
}

.tip-card {
    min-height: 170px;
}

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

.two-col {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.full {
    grid-column: 1 / -1;
}

.button-cell {
    display: flex;
    align-items: flex-end;
}

.button-row {
    display: flex;
    gap: 10px;
}

.button-row > * {
    flex: 1;
}

.button-row.wrap-row {
    flex-wrap: wrap;
}

.button-row.wrap-row > * {
    min-width: 88px;
}

.inline-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.08);
}

.inline-note span {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.inline-note strong {
    font-size: 16px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.mini-area {
    min-height: 112px;
}

.code-area {
    min-height: 250px;
    font-family: "JetBrains Mono", "SFMono-Regular", "Consolas", "Courier New", monospace;
}

.table-wrap {
    overflow: auto;
    padding: 0 22px 22px;
}

.table-toolbar,
.pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.table-toolbar {
    padding: 0 22px 16px;
}

.pager {
    justify-content: flex-end;
}

.pager span {
    min-width: 74px;
    text-align: center;
    color: var(--muted);
    font-weight: 700;
}

.pager button {
    width: auto;
    min-width: 96px;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.52;
    transform: none;
    box-shadow: none;
    filter: none;
}

.text-link-button {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--primary-strong);
    box-shadow: none;
    width: auto;
    font-weight: 700;
    text-align: left;
}

.text-link-button:hover {
    transform: none;
    box-shadow: none;
    filter: none;
    text-decoration: underline;
}

.device-toolbar {
    display: grid;
    gap: 16px;
}

.device-filter-grid,
.device-strip,
.device-grid,
.device-meta-grid,
.device-tag-list,
.preview-head {
    display: grid;
    gap: 14px;
}

.device-filter-grid {
    grid-template-columns: 1.4fr 0.8fr 0.8fr;
}

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

.status-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-chip {
    width: auto;
    padding: 10px 16px;
    border-radius: 999px;
    background: #fff;
    color: var(--muted);
    box-shadow: none;
}

.status-chip:hover {
    background: #f5f9ff;
    box-shadow: none;
    filter: none;
}

.status-chip.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 100%);
}

.device-strip-card {
    padding: 16px 18px;
    border-radius: 20px;
    border: 1px solid rgba(37, 99, 235, 0.1);
    background: linear-gradient(180deg, #ffffff 0%, #f5faff 100%);
}

.device-strip-card span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.device-strip-card strong {
    display: block;
    margin-top: 8px;
    font-size: 30px;
    line-height: 1;
}

.device-grid {
    padding: 0 22px 22px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.selection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.selection-toolbar .button-row {
    flex: 1;
    flex-wrap: wrap;
}

.selection-toolbar .button-row > * {
    flex: 0 0 auto;
    min-width: 132px;
}

.device-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.1), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(246, 250, 255, 0.98) 100%);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.device-card.offline {
    background:
        radial-gradient(circle at top right, rgba(180, 83, 9, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 248, 241, 0.96) 100%);
}

.device-card-head,
.device-action-row,
.device-preview-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.device-card-tools {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.device-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-title strong {
    font-size: 20px;
    line-height: 1.2;
}

.device-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.04);
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.device-select input {
    width: auto;
    margin: 0;
}

.device-subtitle {
    font-size: 13px;
    color: var(--muted);
}

.device-meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.device-meta {
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.device-meta span {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.device-meta strong {
    display: block;
    font-size: 15px;
    line-height: 1.4;
    word-break: break-word;
}

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

.device-tag {
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.device-tag.muted-tag {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.device-preview {
    min-height: 150px;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #f8fbff 0%, #edf4fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.device-preview-button {
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    width: 100%;
    height: 100%;
}

.device-preview-button:hover {
    transform: none;
    box-shadow: none;
    filter: none;
}

.device-preview-button img,
.device-preview img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.device-preview-placeholder {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    line-height: 1.7;
}

.device-action-row .button-row {
    flex: 1;
    flex-wrap: wrap;
}

.device-action-row .button-row > * {
    min-width: 110px;
}

.empty-state {
    padding: 36px 20px;
    border: 1px dashed rgba(100, 116, 139, 0.25);
    border-radius: 22px;
    color: var(--muted);
    text-align: center;
    background: rgba(255, 255, 255, 0.68);
}

.split-table {
    display: grid;
    grid-template-columns: 1.45fr 1fr;
    gap: 18px;
    padding: 0 22px 22px;
}

table {
    width: 100%;
    min-width: 680px;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
}

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

thead th {
    background: rgba(242, 247, 254, 0.98);
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

tbody tr:hover {
    background: rgba(37, 99, 235, 0.04);
}

tbody tr:last-child td {
    border-bottom: none;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

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

.status-pill.online,
.status-pill.success,
.status-pill.info {
    color: var(--success);
    background: var(--success-soft);
}

.status-pill.offline,
.status-pill.warn,
.status-pill.warning,
.status-pill.queued,
.status-pill.leased,
.status-pill.running,
.status-pill.blocked {
    color: var(--warn);
    background: var(--warn-soft);
}

.status-pill.failed,
.status-pill.error {
    color: var(--danger);
    background: var(--danger-soft);
}

.status-pill.cancelled,
.status-pill.skipped,
.status-pill.debug {
    color: #475569;
    background: rgba(71, 85, 105, 0.12);
}

.mono {
    font-family: "JetBrains Mono", "SFMono-Regular", "Consolas", "Courier New", monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.shot-thumb {
    display: inline-flex;
    width: 116px;
    height: 86px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

button.shot-thumb {
    padding: 0;
    background: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

button.shot-thumb:hover {
    transform: translateY(-1px);
    filter: none;
}

.shot-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.drawer-shell {
    position: fixed;
    inset: 0;
    z-index: 980;
}

.drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
}

.drawer-panel {
    position: absolute;
    top: 0;
    right: 0;
    width: min(560px, 100vw);
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(248, 251, 255, 0.98);
    border-left: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: -24px 0 60px rgba(15, 23, 42, 0.18);
}

.drawer-head {
    padding: 24px 22px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.12), transparent 24%),
        linear-gradient(180deg, #ffffff 0%, #f4f9ff 100%);
}

.drawer-head-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
}

.drawer-head-actions > button {
    width: auto;
    min-width: 96px;
}

.drawer-body {
    flex: 1;
    overflow: auto;
    padding: 20px 22px 28px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.drawer-section {
    padding: 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
}

.drawer-section-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
}

.drawer-section-head h4 {
    font-size: 17px;
}

.drawer-metrics,
.drawer-tag-list,
.drawer-list,
.drawer-gallery {
    display: grid;
    gap: 12px;
}

.drawer-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 12px;
}

.drawer-metric {
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.drawer-metric span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.drawer-metric strong {
    display: block;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

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

.drawer-tag {
    padding: 10px 12px;
    border-radius: 14px;
    text-align: center;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary-strong);
    font-size: 12px;
    font-weight: 700;
}

.drawer-tag.muted-tag {
    background: rgba(100, 116, 139, 0.12);
    color: #475569;
}

.drawer-list-item {
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.03);
    border: 1px solid rgba(15, 23, 42, 0.05);
}

.drawer-list-item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.drawer-list-item-title {
    font-weight: 700;
}

.drawer-list-item-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.drawer-list-item-body {
    font-size: 13px;
    line-height: 1.65;
    color: var(--ink);
}

.drawer-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.drawer-shot {
    width: 100%;
    min-height: 160px;
    padding: 0;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
}

.drawer-shot:hover {
    filter: none;
}

.drawer-shot img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.drawer-shot-meta {
    padding: 10px 12px 12px;
    text-align: left;
}

.drawer-shot-meta strong {
    display: block;
    font-size: 13px;
}

.drawer-shot-meta span {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(6px);
}

.preview-dialog {
    position: relative;
    z-index: 1;
    width: min(1080px, calc(100vw - 32px));
    margin: 32px auto;
    border-radius: 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.32);
}

.preview-head,
.preview-foot {
    padding: 18px 22px;
}

.preview-head {
    grid-template-columns: 1fr auto;
    align-items: center;
    border-bottom: 1px solid var(--line);
}

.preview-head > button {
    width: auto;
    min-width: 110px;
}

.preview-body {
    padding: 20px;
    background: linear-gradient(180deg, #0f172a 0%, #182237 100%);
}

.preview-body img {
    display: block;
    width: 100%;
    max-height: 72vh;
    object-fit: contain;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
}

.preview-foot {
    border-top: 1px solid var(--line);
}

a {
    color: var(--primary-strong);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

    .hero,
    .overview-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 1180px) {
    .layout-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        min-height: auto;
    }

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

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

    .form-grid,
    .two-col,
    .split-table,
    .tip-grid,
    .jump-grid,
    .compact-filter-grid,
    .device-filter-grid,
    .device-grid,
    .device-tag-list,
    .device-strip {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 780px) {
    .layout-shell {
        padding: 14px;
    }

    .sidebar,
    .hero {
        padding: 18px;
    }

    .sidebar-stats,
    .panel-nav,
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .device-meta-grid {
        grid-template-columns: 1fr;
    }

    .button-row,
    .toolbar-row,
    .head-row,
    .device-card-head,
    .device-action-row,
    .preview-head,
    .table-toolbar,
    .pager {
        flex-direction: column;
        align-items: stretch;
    }

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

    .table-wrap,
    .split-table {
        padding-left: 18px;
        padding-right: 18px;
        padding-bottom: 18px;
    }

    .card-head,
    .card-body {
        padding-left: 18px;
        padding-right: 18px;
    }

    table {
        min-width: 560px;
    }

    .preview-dialog {
        width: calc(100vw - 20px);
        margin: 10px auto;
    }

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

    .drawer-metrics,
    .drawer-tag-list,
    .drawer-gallery {
        grid-template-columns: 1fr;
    }
}
