:root {
    --bg: #f4efe6;
    --surface: rgba(255, 252, 247, 0.82);
    --surface-strong: #fffaf1;
    --text: #1e1c18;
    --muted: #6d6559;
    --line: rgba(61, 52, 38, 0.12);
    --accent: #d86d35;
    --accent-dark: #9e4418;
    --accent-soft: rgba(216, 109, 53, 0.12);
    --mint: #1f8c73;
    --mint-soft: rgba(31, 140, 115, 0.12);
    --danger: #b44933;
    --danger-soft: rgba(180, 73, 51, 0.14);
    --shadow: 0 22px 70px rgba(70, 48, 24, 0.14);
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --font-display: "Avenir Next", "Gill Sans", "Trebuchet MS", sans-serif;
    --font-body: "Avenir Next", "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text);
    background:
            radial-gradient(circle at top left, rgba(245, 174, 103, 0.34), transparent 30%),
            radial-gradient(circle at top right, rgba(71, 179, 157, 0.22), transparent 26%),
            linear-gradient(180deg, #f7f2ea 0%, #f1ebdf 100%);
}

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

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

.auth-shell,
.app-shell {
    position: relative;
    overflow-x: hidden;
}

.ambient {
    position: fixed;
    border-radius: 999px;
    filter: blur(20px);
    opacity: 0.75;
    pointer-events: none;
}

.ambient-left {
    top: 8vh;
    left: -8rem;
    width: 18rem;
    height: 18rem;
    background: rgba(216, 109, 53, 0.18);
}

.ambient-right {
    right: -6rem;
    bottom: 10vh;
    width: 16rem;
    height: 16rem;
    background: rgba(31, 140, 115, 0.18);
}

.ambient-top {
    top: -8rem;
    left: 20%;
    width: 28rem;
    height: 18rem;
    background: rgba(216, 109, 53, 0.15);
}

.auth-layout,
.page,
.error-layout {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.auth-layout,
.error-layout {
    min-height: 100vh;
    padding: 2rem 0;
}

.auth-layout {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 2rem;
    align-items: center;
}

.error-layout {
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-copy,
.hero-card,
.detail-hero {
    animation: fade-up 0.6s ease both;
}

.auth-copy h1,
.hero-card h1,
.detail-hero h1 {
    margin: 0 0 1rem;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4vw, 4.5rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.auth-copy p,
.hero-card p,
.detail-hero p,
.panel-header p,
.empty-state p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.eyebrow {
    display: inline-flex;
    margin-bottom: 1rem;
    padding: 0.45rem 0.85rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.auth-highlights,
.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.highlight-card,
.stat-card {
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(12px);
}

.highlight-value,
.stat-value {
    display: block;
    margin-bottom: 0.35rem;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
}

.highlight-label,
.stat-label {
    color: var(--muted);
    line-height: 1.5;
}

.panel,
.hero-card {
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.58);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.auth-panel,
.hero-card,
.detail-hero,
.info-panel,
.config-panel,
.slot-panel,
.device-card,
.error-panel {
    padding: 1.6rem;
}

.error-panel {
    width: min(640px, 100%);
    text-align: center;
}

.error-panel h1 {
    margin: 0 0 0.9rem;
    font-family: var(--font-display);
    font-size: clamp(2.1rem, 4vw, 3.6rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
}

.error-path {
    margin: 1.25rem 0 0;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    color: var(--muted);
    word-break: break-word;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 0.85rem;
    margin-top: 1.4rem;
}

.panel-header {
    margin-bottom: 1.25rem;
}

.panel-header h2,
.slot-card h3,
.device-card h2 {
    margin: 0 0 0.35rem;
    font-family: var(--font-display);
    letter-spacing: -0.03em;
}

.stack-form,
.slot-form {
    display: grid;
    gap: 1rem;
}

.slot-form.is-submitting,
.config-form.is-submitting,
.device-name-form.is-submitting {
    opacity: 0.72;
}

.slot-form.is-submitting .button,
.config-form.is-submitting .button,
.device-name-form.is-submitting .button {
    cursor: progress;
}

.field,
.days-group {
    display: grid;
    gap: 0.45rem;
}

.field span,
.days-group > span {
    font-size: 0.9rem;
    font-weight: 700;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 3.1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.field textarea {
    min-height: 7rem;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(216, 109, 53, 0.55);
    box-shadow: 0 0 0 4px rgba(216, 109, 53, 0.12);
    transform: translateY(-1px);
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px rgba(195, 74, 50, 0.14);
}

.password-control {
    position: relative;
    display: block;
}

.password-control input {
    padding-right: 3.7rem;
}

.password-toggle {
    position: absolute;
    display: inline-flex;
    top: 50%;
    right: 0.6rem;
    align-items: center;
    justify-content: center;
    width: 2.3rem;
    height: 2.3rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--accent-dark);
    cursor: pointer;
    transform: translateY(-50%);
}

.password-eye {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.password-eye-closed,
.password-toggle[aria-pressed="true"] .password-eye-open {
    display: none;
}

.password-toggle[aria-pressed="true"] .password-eye-closed {
    display: block;
}

.field-error {
    color: var(--danger);
    line-height: 1.4;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.9rem 1.2rem;
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--accent) 0%, #f08c48 100%);
    color: #fff9f4;
    box-shadow: 0 18px 32px rgba(216, 109, 53, 0.2);
}

.button-ghost {
    background: rgba(255, 255, 255, 0.64);
    color: var(--text);
    border: 1px solid var(--line);
}

.button-active {
    background: var(--accent-soft);
    color: var(--accent-dark);
    border-color: rgba(216, 109, 53, 0.26);
}

.button-danger {
    background: var(--danger-soft);
    color: #7c291b;
    border: 1px solid rgba(180, 73, 51, 0.18);
}

.button:disabled,
.button[disabled],
.field select:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
}

.panel-footer {
    margin: 1.2rem 0 0;
    color: var(--muted);
}

.panel-footer a {
    color: var(--accent-dark);
    font-weight: 700;
}

.topbar {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 1.4rem 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.brand-mark {
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--mint));
    box-shadow: 0 0 0 0.35rem rgba(216, 109, 53, 0.15);
}

.page {
    padding: 1.5rem 0 2.5rem;
}

.hero-card,
.detail-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-hero-tags {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.detail-hero-main {
    flex: 1 1 auto;
    min-width: 0;
}

.device-name-form {
    display: flex;
    align-items: end;
    gap: 0.75rem;
    max-width: 42rem;
    margin-top: 1rem;
}

.device-name-field {
    flex: 1 1 18rem;
    min-width: 14rem;
}

.device-name-form .button {
    flex: 0 0 auto;
}

.flash {
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    line-height: 1.5;
}

.toast-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1200;
    display: grid;
    gap: 0.75rem;
    width: min(25rem, calc(100vw - 2rem));
    pointer-events: none;
}

.toast-stack .flash {
    margin: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.85rem;
    border: 1px solid rgba(61, 52, 38, 0.18);
    box-shadow: 0 20px 54px rgba(49, 36, 24, 0.26);
    pointer-events: auto;
}

.toast-stack .flash-success {
    background: rgba(230, 245, 240, 0.94);
    color: #0f4f41;
}

.toast-stack .flash-error {
    background: rgba(249, 231, 226, 0.94);
    color: #6f261a;
}

.flash-message {
    flex: 1;
    min-width: 0;
}

.toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 1.8rem;
    height: 1.8rem;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    opacity: 0.72;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.48);
    opacity: 1;
}

.toast-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
    opacity: 1;
}

.flash-success {
    background: var(--mint-soft);
    color: #155a4a;
}

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

.list-controls {
    padding: 1.1rem;
    margin-bottom: 1.25rem;
}

.device-list-form,
.list-filter-form {
    display: grid;
    grid-template-columns: minmax(16rem, 2fr) repeat(3, minmax(8.5rem, 1fr)) auto;
    gap: 0.85rem;
    align-items: end;
}

.user-list-form {
    grid-template-columns: minmax(16rem, 2fr) repeat(4, minmax(8.5rem, 1fr)) auto;
}

.list-search-field {
    min-width: 0;
}

.list-size-field {
    max-width: 8rem;
}

.list-control-actions {
    display: flex;
    gap: 0.65rem;
    align-items: end;
    justify-content: flex-end;
}

.list-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 0.9rem;
    margin-top: 0.95rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.device-grid,
.detail-grid {
    display: grid;
    gap: 1.25rem;
}

.device-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.device-card {
    display: grid;
    gap: 1.2rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.device-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 26px 64px rgba(70, 48, 24, 0.18);
}

.device-card-top,
.slot-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.device-card-top > div,
.slot-card-top > div {
    min-width: 0;
}

.device-card-top p,
.slot-card-top p {
    margin: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.device-card-top h2,
.slot-card-top h3 {
    overflow-wrap: anywhere;
}

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

.device-meta span,
.info-grid div {
    display: grid;
    gap: 0.2rem;
}

.device-meta strong,
.info-grid strong {
    font-size: 0.95rem;
}

.device-meta span span,
.info-grid span {
    color: var(--muted);
    font-size: 0.82rem;
}

.device-link {
    font-weight: 700;
    color: var(--accent-dark);
}

.status-pill,
.tag {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag {
    background: rgba(255, 255, 255, 0.76);
    color: var(--muted);
}

.status-online {
    background: rgba(31, 140, 115, 0.14);
    color: #146452;
}

.status-offline {
    background: rgba(180, 73, 51, 0.14);
    color: #8d3323;
}

.status-pending {
    background: rgba(216, 109, 53, 0.14);
    color: var(--accent-dark);
}

.status-accepted,
.status-downloading,
.status-installing {
    background: rgba(216, 109, 53, 0.14);
    color: var(--accent-dark);
}

.status-success {
    background: rgba(31, 140, 115, 0.14);
    color: #146452;
}

.status-failed,
.status-cancelled,
.status-rejected {
    background: rgba(180, 73, 51, 0.14);
    color: #8d3323;
}

.detail-grid {
    grid-template-columns: 1fr;
    align-items: start;
}

.info-grid,
.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

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

.slot-list {
    display: grid;
    gap: 1rem;
}

.slot-card {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(61, 52, 38, 0.08);
}

.slot-card.is-delete-pending {
    border-color: rgba(180, 73, 51, 0.28);
    background: rgba(180, 73, 51, 0.08);
}

.slot-delete-button {
    justify-self: start;
    flex: 0 0 auto;
    align-self: end;
}

.floating-slot-actions {
    position: fixed;
    right: clamp(1rem, 4vw, 2rem);
    bottom: clamp(1rem, 4vw, 2rem);
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.floating-slot-actions .button {
    box-shadow: 0 18px 42px rgba(155, 85, 36, 0.28);
}

.day-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.slot-days-row {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
}

.slot-days-row .days-group {
    flex: 1 1 auto;
    min-width: 0;
}

.day-chip {
    position: relative;
}

.day-chip input {
    position: absolute;
    opacity: 0;
    inset: 0;
}

.day-chip span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.5rem;
    min-height: 2.4rem;
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.74);
    color: var(--muted);
    transition: all 0.2s ease;
}

.day-chip input:checked + span {
    background: var(--accent-soft);
    border-color: rgba(216, 109, 53, 0.35);
    color: var(--accent-dark);
    font-weight: 700;
}

.toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 700;
}

.toggle-row input {
    width: 1rem;
    height: 1rem;
}

.overview-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.overview-action {
    min-height: 2.55rem;
    padding: 0.65rem 0.95rem;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.firmware-admin-grid {
    grid-template-columns: 1fr;
    align-items: start;
}

.firmware-panel {
    padding: 1.6rem;
}

.firmware-job-card,
.firmware-empty-state {
    margin-bottom: 1rem;
}

.firmware-job-card {
    display: grid;
    gap: 1rem;
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(61, 52, 38, 0.08);
}

.firmware-job-header,
.firmware-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.firmware-job-header div {
    display: grid;
    gap: 0.2rem;
}

.firmware-job-header span:first-child,
.firmware-job-grid span {
    color: var(--muted);
    font-size: 0.82rem;
}

.firmware-job-header strong,
.mono-value,
.table-url {
    overflow-wrap: anywhere;
}

.firmware-actions {
    justify-content: flex-start;
}

.firmware-trace {
    display: grid;
    gap: 0.85rem;
    margin: 0 0 1rem;
    padding: 1rem;
    border: 1px solid rgba(31, 140, 115, 0.18);
    border-radius: var(--radius-lg);
    background:
            linear-gradient(135deg, rgba(31, 140, 115, 0.10), rgba(255, 255, 255, 0.58)),
            rgba(255, 255, 255, 0.56);
}

.firmware-trace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.firmware-trace-header span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.firmware-trace-header strong {
    color: var(--mint);
    font-size: 0.82rem;
}

.firmware-trace ol {
    display: grid;
    gap: 0.55rem;
    max-height: 16rem;
    margin: 0;
    padding: 0;
    overflow: auto;
    list-style: none;
}

.firmware-trace li {
    display: grid;
    grid-template-columns: minmax(7rem, auto) minmax(8rem, auto) 1fr;
    gap: 0.75rem;
    align-items: baseline;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(61, 52, 38, 0.08);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.64);
}

.firmware-trace time,
.firmware-trace span {
    color: var(--muted);
    font-size: 0.82rem;
}

.firmware-trace strong {
    color: var(--text);
    overflow-wrap: anywhere;
}

.table-url,
.mono-value {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.empty-state {
    padding: 2rem;
    text-align: center;
}

.empty-state .button {
    margin-top: 1.2rem;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1.25rem 0 0;
}

.pagination-pages {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.45rem;
}

.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.45rem;
    height: 2.45rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.64);
    color: var(--muted);
    font-weight: 800;
}

.pagination-page.is-active {
    background: var(--accent-soft);
    border-color: rgba(216, 109, 53, 0.28);
    color: var(--accent-dark);
}

.pagination-link {
    min-height: 2.45rem;
    padding: 0.65rem 0.95rem;
    font-size: 0.86rem;
    font-weight: 800;
}

.pagination-link.is-disabled {
    cursor: not-allowed;
    opacity: 0.54;
}

.data-panel {
    padding: 0;
    overflow: hidden;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.firmware-release-panel .table-scroll {
    overflow-x: visible;
}

.firmware-release-table {
    min-width: 0;
    table-layout: fixed;
}

.firmware-release-table th,
.firmware-release-table td {
    padding: 0.9rem 0.85rem;
    overflow-wrap: anywhere;
}

.release-note-preview {
    display: -webkit-box;
    max-height: 4.4rem;
    color: var(--muted);
    flex: 1 1 auto;
    line-height: 1.45;
    overflow: hidden;
    text-align: left;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.release-note-cell,
.table-action-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.release-note-cell {
    justify-content: space-between;
}

.release-notes-dialog {
    width: min(34rem, calc(100vw - 2rem));
    padding: 0;
    border: 1px solid rgba(61, 52, 38, 0.16);
    border-radius: var(--radius-lg);
    background: var(--surface-strong);
    color: var(--text);
    box-shadow: 0 26px 80px rgba(49, 36, 24, 0.28);
}

.release-notes-dialog::backdrop {
    background: rgba(30, 28, 24, 0.36);
    backdrop-filter: blur(3px);
}

.firmware-notes-form {
    display: grid;
    gap: 1rem;
    min-width: 12rem;
    padding: 1.25rem;
}

.firmware-notes-form textarea {
    width: 100%;
    min-height: 8rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.78);
    color: var(--text);
    resize: vertical;
}

.dialog-header,
.dialog-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dialog-header div {
    display: grid;
    gap: 0.2rem;
    text-align: left;
}

.dialog-header span {
    color: var(--muted);
    font-size: 0.82rem;
}

.dialog-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.dialog-close-button {
    min-height: 2.2rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    cursor: pointer;
    font-weight: 800;
}

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

.data-table th {
    background: rgba(255, 255, 255, 0.52);
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.data-table td {
    color: var(--muted);
    font-size: 0.92rem;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.data-table tbody tr.clickable-row {
    cursor: pointer;
    transition: background 0.16s ease;
}

.data-table tbody tr.clickable-row:hover {
    background: rgba(216, 109, 53, 0.07);
}

.data-table strong {
    display: block;
    color: var(--text);
    font-size: 0.96rem;
}

.data-table td > span {
    display: block;
    margin-top: 0.2rem;
}

.firmware-release-table th,
.firmware-release-table td {
    padding: 0.85rem 0.75rem;
    width: 16.6667%;
    text-align: center;
    vertical-align: middle;
}

.firmware-release-table form {
    display: flex;
    justify-content: center;
}

.firmware-release-table .firmware-notes-form {
    display: grid;
    justify-content: stretch;
}

.table-action-button {
    min-height: 2.25rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 800;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    color: var(--muted);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
    transform: translateY(-1px);
}

.icon-button-danger {
    background: var(--danger-soft);
    border-color: rgba(180, 73, 51, 0.22);
    color: #7c291b;
}

.button-icon {
    width: 1.05rem;
    height: 1.05rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.table-link {
    display: inline-block;
    color: inherit;
}

.table-link:hover strong {
    color: var(--accent-dark);
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 980px) {
    .auth-layout,
    .detail-grid,
    .firmware-admin-grid,
    .device-list-form,
    .list-filter-form,
    .hero-card,
    .detail-hero {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 720px) {
    .auth-layout,
    .page,
    .error-layout,
    .topbar {
        width: min(100% - 1rem, 100%);
    }

    .auth-layout,
    .error-layout {
        padding: 1rem 0 1.5rem;
    }

    .hero-stats,
    .auth-highlights,
    .field-grid,
    .info-grid,
    .device-meta,
    .overview-actions {
        grid-template-columns: 1fr;
    }

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

    .overview-actions {
        flex-direction: column;
    }

    .topbar form,
    .topbar-actions form,
    .topbar-actions a,
    .list-control-actions .button,
    .button {
        width: 100%;
    }

    .list-size-field {
        max-width: none;
    }

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

    .floating-slot-actions {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        flex-direction: column;
    }

    .slot-days-row {
        align-items: stretch;
        flex-direction: column;
    }

    .firmware-trace li {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .device-name-form {
        flex-direction: column;
        align-items: stretch;
    }

    .device-name-field {
        min-width: 0;
    }

    .error-actions {
        flex-direction: column;
    }

    .slot-card-top,
    .device-card-top,
    .firmware-job-header,
    .firmware-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .slot-card-top,
    .device-card-top {
        align-items: flex-start;
    }

    .toast-stack {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }
}
