/* Shared visual system: dark, readable, compact management workspace. */
:root {
  color-scheme: dark;
  --bg:#0c1522; --nav:#101b2c; --surface:#142237; --raised:#192b43; --input:#101d30;
  --text:#eaf1fa; --muted:#afc0d5; --subtle:#92a9c2; --line:#2a3e58; --line-soft:#22364e;
  --primary:#2e6cc2; --primary-hover:#3573c3; --focus:#9acbff;
  --success:#9ce0bb; --warning:#efd095; --danger:#ffb7c1; --radius:10px;
}

/* Foundations and keyboard access */
* { box-sizing:border-box; }
html { min-width:320px; scrollbar-gutter:stable; }
body { margin:0; background:var(--bg); color:var(--text); font:15px/1.6 "Microsoft YaHei UI","Microsoft YaHei","PingFang SC",system-ui,sans-serif; }
button,input,textarea,select { font:inherit; }
button,a,input,textarea,select { -webkit-tap-highlight-color:transparent; outline-offset:3px; }
button { cursor:pointer; }
button:disabled { cursor:not-allowed; opacity:.48; }
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible { outline:3px solid var(--focus); }
[hidden] { display:none!important; }
h1,h2,h3,p { margin:0; }
h1 { font-size:28px; line-height:1.4; font-weight:650; letter-spacing:-.5px; }
h2 { font-size:17px; line-height:1.5; font-weight:600; }
h3 { font-size:15px; line-height:1.6; font-weight:600; }
svg { width:20px; height:20px; flex-shrink:0; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
::selection { background:#315f91; color:#fff; }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
.skip-link { position:fixed; top:-90px; left:16px; z-index:30; padding:10px 16px; border-radius:6px; background:var(--text); color:var(--bg); }
.skip-link:focus { top:12px; }

/* Navigation and page frame */
.app-shell { display:grid; grid-template-columns:204px minmax(0,1fr); min-height:100dvh; }
.sidebar { position:sticky; top:0; height:100dvh; min-width:0; display:flex; flex-direction:column; padding:30px 16px 24px; border-right:1px solid var(--line-soft); background:var(--nav); overflow-y:auto; overflow-x:hidden; scrollbar-width:thin; }
.brand { display:flex; align-items:center; gap:12px; min-width:0; padding:0 13px 34px; color:var(--text); font-size:16px; font-weight:550; }
.brand-mark { display:inline-block; color:#8bbdff; font-size:32px; font-weight:750; line-height:1; letter-spacing:-2px; }
.sidebar nav { display:grid; gap:7px; }
.nav-item { display:flex; align-items:center; gap:12px; min-height:46px; padding:11px 14px; border:0; border-radius:7px; background:transparent; color:var(--muted); text-align:left; font-size:14px; font-weight:550; transition:color .15s,background .15s; }
.nav-item:hover { color:var(--text); background:#1a2c44; }
.nav-item.active { background:#1c385a; color:#e8f2ff; box-shadow:inset 3px 0 #76b4ff; }
.sidebar-note { display:grid; gap:6px; min-width:0; margin-top:auto; padding:22px 12px 0; border-top:1px solid var(--line-soft); color:var(--subtle); font-size:12px; }
.sidebar-note br { display:none; }
#identity-label { color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; }
#identity-role { overflow-wrap:anywhere; }
.sidebar-note .button { margin-top:8px; justify-self:start; min-height:38px; padding:7px 12px; font-size:12px; }
.main { min-width:0; width:100%; max-width:1800px; padding:30px 32px 22px; }
.topbar { display:flex; align-items:center; justify-content:space-between; gap:24px; margin-bottom:28px; }
.page-heading,.topbar>div:first-child { min-width:0; }
.workspace-name { max-width:52ch; margin-bottom:7px; color:var(--muted); font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.top-actions { display:flex; align-items:center; flex-shrink:0; gap:10px; }
.connection-status { display:inline-flex; align-items:center; gap:7px; max-width:170px; margin-right:6px; color:var(--muted); white-space:nowrap; font-size:13px; }
.connection-status::before,.connection-pill::before { content:""; display:inline-block; flex-shrink:0; width:7px; height:7px; border-radius:50%; background:#8a9eb6; }
.connection-status.connected::before { background:#7bd4a2; }
.connection-status.error::before { background:#ed8899; }
.page-footer { display:flex; justify-content:space-between; gap:20px; padding-top:28px; color:var(--subtle); font-size:12px; }
.page-footer span { text-align:right; }

/* Buttons, fields and feedback */
.button { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px; max-width:100%; padding:9px 16px; border:1px solid transparent; border-radius:7px; font-size:14px; line-height:1.5; font-weight:550; white-space:nowrap; transition:background-color .15s,border-color .15s; }
.primary { color:#fff; background:var(--primary); border-color:var(--primary); }
.primary:hover:not(:disabled) { background:var(--primary-hover); border-color:var(--primary-hover); }
.secondary { color:var(--text); background:#1c304a; border-color:#3b5675; }
.secondary:hover:not(:disabled) { background:#25415f; border-color:#567798; }
.quiet { color:var(--muted); background:transparent; border-color:var(--line); }
.quiet:hover:not(:disabled) { color:var(--text); background:var(--raised); border-color:#48617f; }
fieldset { padding:0; margin:0; border:0; min-width:0; }
label { display:block; margin-bottom:8px; font-size:14px; line-height:1.5; font-weight:550; }
input,textarea,select { display:block; width:100%; min-width:0; max-width:100%; min-height:44px; padding:10px 12px; border:1px solid #3b526f; border-radius:6px; background:var(--input); color:var(--text); font-size:14px; line-height:1.6; transition:border-color .15s; }
input:hover:not(:disabled),textarea:hover:not(:disabled),select:hover:not(:disabled) { border-color:#5d7796; }
input::placeholder,textarea::placeholder { color:#8ca2bc; opacity:1; }
input[readonly] { color:#c1d0e0; background:#16263c; }
input:disabled,textarea:disabled,select:disabled { color:#c5d2e1; background:#17263a; border-color:#30435d; cursor:not-allowed; opacity:1; }
input[aria-invalid="true"],textarea[aria-invalid="true"] { border-color:#e38c9e; }
textarea { resize:vertical; min-height:100px; line-height:1.75; }
select { padding-right:28px; text-overflow:ellipsis; }
fieldset>label:not(:first-of-type),#task-existing-fields>label { margin-top:20px; }
.required { margin-left:5px; color:var(--subtle); font-size:12px; font-weight:400; }
.field-help { margin-top:8px; color:var(--muted); font-size:12px; line-height:1.75; overflow-wrap:anywhere; }
.form-pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; margin-top:20px; }
.form-actions { display:flex; align-items:center; flex-wrap:wrap; gap:10px; margin-top:22px; }
.form-feedback { padding:12px 14px; margin-top:18px; border:1px solid var(--line); border-radius:7px; color:var(--muted); font-size:13px; line-height:1.7; overflow-wrap:anywhere; }
.check-field { display:flex; align-items:flex-start; gap:10px; margin-top:22px; font-weight:400; }
.check-field input { flex-shrink:0; width:18px; height:18px; min-height:18px; margin-top:2px; padding:0; accent-color:var(--primary); }
.notice { margin-bottom:20px; padding:13px 16px; border:1px solid #34587e; border-radius:8px; background:#18314d; color:#c8e2ff; font-size:14px; line-height:1.7; overflow-wrap:anywhere; }
.notice.error,.form-feedback.error { border-color:#714354; background:#3b2634; color:var(--danger); }
.notice.success { padding:8px 0; margin-bottom:14px; border:0; background:transparent; color:var(--success); font-size:13px; }
.form-feedback.success { border-color:#365c4e; background:#1b372f; color:var(--success); }
.announcement { max-width:100%; margin-bottom:24px; padding:12px 16px; border-left:3px solid #547eae; border-radius:0 6px 6px 0; background:#14253a; color:#c2d3e6; font-size:14px; white-space:pre-wrap; overflow-wrap:anywhere; }

/* Shared panels and overview */
.task-list-panel,.detail-panel,.settings-panel { min-width:0; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); }
.panel-heading { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:19px 22px; border-bottom:1px solid var(--line); }
.panel-heading>div { min-width:0; }
.panel-subtitle { margin-top:4px; color:var(--subtle); font-size:12px; line-height:1.6; }
.overview-heading { display:flex; justify-content:space-between; align-items:center; gap:20px; margin-bottom:22px; }
.overview-heading>div { min-width:0; }
.overview-heading h2 { font-size:18px; }
.overview-heading p { margin-top:6px; color:var(--muted); font-size:14px; line-height:1.7; }
.overview-stats { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:12px; margin-bottom:26px; }
.overview-stats:empty { display:none; }
.stat-item { display:block; min-width:0; padding:19px 18px; margin:0; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--text); text-align:left; font:inherit; transition:border-color .15s,background-color .15s; }
button.stat-item:hover { border-color:#577ca8; background:var(--raised); }
.stat-item.active { border-color:#71adf1; background:#1a3655; }
.stat-item span { display:block; color:var(--muted); font-size:13px; white-space:nowrap; }
.stat-item strong { display:block; margin-top:10px; color:#edf5ff; font-size:30px; font-weight:600; line-height:1.3; font-variant-numeric:tabular-nums; }
.stat-item .stat-hint { margin-top:10px; color:var(--subtle); font-size:12px; line-height:1.6; white-space:normal; overflow-wrap:anywhere; }
.overview-grid { display:grid; grid-template-columns:minmax(0,1.08fr) minmax(0,1fr); gap:22px; align-items:start; }
.compact-list { padding:0 22px; }
.compact-item { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:17px 0; border-bottom:1px solid var(--line-soft); }
.compact-item:last-child { border-bottom:0; }
.compact-item>div { min-width:0; flex:1; }
.compact-item .button,.compact-item .status-badge { flex-shrink:0; }
.compact-item p,.compact-item time { display:block; margin-top:5px; color:var(--muted); font-size:12px; line-height:1.7; overflow-wrap:anywhere; }
.compact-item p:first-child { color:var(--text); font-size:14px; }
.list-placeholder { padding:38px 20px; color:var(--muted); font-size:14px; line-height:1.8; text-align:center; overflow-wrap:anywhere; }

/* Task list and detail editor */
.task-workspace { display:grid; grid-template-columns:minmax(0,1fr) 380px; align-items:start; gap:24px; }
.list-toolbar { display:flex; align-items:flex-end; gap:14px; padding:20px 22px 16px; }
.search-field { flex:1; min-width:0; }
.status-field { flex:0 0 144px; min-width:0; }
.list-summary { display:flex; align-items:flex-start; justify-content:space-between; flex-wrap:wrap; gap:6px 16px; padding:0 22px 16px; color:var(--muted); font-size:12px; }
.table-region { position:relative; min-height:0; }
.table-region[aria-busy="true"]::before { content:""; position:absolute; z-index:1; top:0; left:0; right:0; height:2px; background:linear-gradient(90deg,#2e5277,#8fc5ff,#2e5277); background-size:200% 100%; animation:loading-line 1.1s linear infinite; }
.task-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.task-table th { padding:12px 10px; border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:#182a41; color:var(--muted); font-size:12px; line-height:1.5; font-weight:500; text-align:left; white-space:nowrap; }
.task-table th:first-child { width:auto; padding-left:22px; }
.task-table th:nth-child(2) { width:90px; }
.task-table th:nth-child(3) { width:70px; }
.task-table th:nth-child(4) { width:88px; }
.task-table th:nth-child(5) { width:106px; }
.task-table td { padding:15px 10px; border-bottom:1px solid var(--line-soft); vertical-align:middle; font-size:13px; line-height:1.65; overflow-wrap:anywhere; }
.task-table td:first-child { padding-left:22px; }
.task-table tr:last-child td { border-bottom:0; }
.task-table tbody tr:hover { background:#192d46; }
.task-table tr.selected { background:#1b3859; }
.task-table tr.selected td:first-child { box-shadow:inset 3px 0 #7fb9ff; }
.task-link { display:block; min-width:0; max-width:100%; min-height:28px; margin:0; padding:0; border:0; background:transparent; color:var(--text); font-size:14px; line-height:1.6; font-weight:550; text-align:left; overflow-wrap:anywhere; }
.task-link:hover { color:#9bcaff; }
.task-id { display:block; max-width:26ch; margin-top:5px; color:var(--subtle); font-size:12px; line-height:1.5; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.status-badge { display:inline-flex; align-items:center; min-height:26px; padding:3px 8px; border:1px solid transparent; border-radius:5px; background:#293b50; color:#c2d1e0; font-size:12px; line-height:1.5; font-weight:500; white-space:nowrap; }
.status-in_progress { background:#1c416b; color:#add3ff; }
.status-completed { background:#1d4137; color:#a6e4c3; }
.status-cancelled { background:#333b4b; color:#c5cedc; }
.priority-high { color:#ffb9be; font-weight:600; }
.priority-low { color:var(--subtle); }
.date-cell { color:var(--muted); font-variant-numeric:tabular-nums; }
.owner-cell { max-width:12ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.empty-state { display:flex; align-items:center; justify-content:center; flex-direction:column; padding:38px 24px; text-align:center; }
.empty-state svg { width:40px; height:40px; margin-bottom:16px; color:#95b1d1; stroke-width:1.4; }
.empty-state h2 { font-size:16px; margin-bottom:8px; }
.empty-state p { max-width:30em; margin-bottom:22px; color:var(--muted); font-size:14px; line-height:1.8; }
.pagination { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; padding:15px 20px; border-top:1px solid var(--line); color:var(--muted); font-size:12px; }
.pagination>div { display:flex; align-items:center; gap:8px; }
.pagination .button { min-height:36px; padding:7px 12px; font-size:12px; }
.draft-label { padding:3px 7px; border-radius:4px; background:#403728; color:var(--warning); font-size:12px; white-space:nowrap; }
.editor-empty { padding:32px 24px; text-align:center; }
.editor-empty p { margin-bottom:8px; font-size:16px; }
.editor-empty span { display:block; max-width:24em; margin:0 auto; color:var(--muted); font-size:14px; line-height:1.8; }
#task-form { padding:20px 22px 24px; }
.meta { min-width:0; margin-bottom:16px; color:var(--subtle); font-size:12px; line-height:1.75; overflow-wrap:anywhere; }
#task-meta { padding-bottom:14px; border-bottom:1px solid var(--line-soft); white-space:pre-line; overflow-wrap:anywhere; }
.full-identifier { white-space:pre-line; overflow-wrap:anywhere; }
#task-role-help { margin-top:10px; }
#task-existing-fields { padding-top:1px; }
.history-panel { padding:0 22px 22px; }
.history-panel h3 { margin-bottom:16px; padding-top:19px; border-top:1px solid var(--line); font-size:14px; }
#task-history { max-height:420px; overflow:auto; padding-right:5px; scrollbar-width:thin; }
.history-item { padding:2px 0 5px 15px; margin-bottom:18px; border-left:2px solid #4b76a6; }
.history-item:last-child { margin-bottom:0; }
.history-item p { font-size:14px; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
.history-item .meta { margin:8px 0 0; font-size:12px; }
.result-text { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.8; }

/* Device inventory and one-time connection credentials */
.device-heading-actions { margin-top:0; }
.device-list { padding:0 22px; }
.device-row { display:grid; grid-template-columns:minmax(170px,1.25fr) 90px minmax(145px,1fr) minmax(130px,1fr) auto; align-items:center; gap:22px; padding:22px 0; border-bottom:1px solid var(--line-soft); }
.device-row:last-child { border-bottom:0; }
.device-row>div { min-width:0; }
.device-row h3 { font-size:15px; overflow-wrap:anywhere; }
.device-row .meta { margin:5px 0 0; }
.device-row>div:first-child .meta { max-width:30ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.device-row .button { min-height:38px; padding:8px 13px; }
.device-task .task-link { font-size:13px; }
.connection-pill { display:inline-flex; align-items:center; gap:7px; color:var(--muted); font-size:13px; white-space:nowrap; }
.connection-pill.online { color:#a2dfba; }
.connection-pill.online::before { background:#7bd4a2; }
.connection-pill.disabled { color:#f1b5bf; }
.registration-panel { max-width:680px; margin-bottom:24px; }
.registration-panel>#device-register-form { padding:22px; }
.registration-panel>form>.button { margin-top:20px; }
#device-register-feedback { margin:0 22px 20px; }
#device-token-result { padding:0 22px 24px; }
#device-token-value { font-family:ui-monospace,Consolas,monospace; font-size:14px; }

/* Logs and settings */
.event-list { padding:0 22px; }
.event-row { display:grid; grid-template-columns:130px minmax(0,1fr) 120px 130px; align-items:start; gap:22px; padding:20px 0; border-bottom:1px solid var(--line-soft); }
.event-row:last-child { border-bottom:0; }
.event-row>div { min-width:0; }
.event-row p { font-size:14px; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
.event-row .meta { margin:6px 0 0; font-size:12px; }
.event-time { color:var(--muted); font-size:12px; line-height:1.8; font-variant-numeric:tabular-nums; }
.event-actor { color:var(--muted); font-size:13px; line-height:1.8; overflow-wrap:anywhere; }
.event-row .task-link { font-size:13px; }
#events-feedback { margin:0 22px 16px; }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:24px; max-width:1200px; }
.settings-grid:has(>#local-connection-panel[hidden]) { grid-template-columns:minmax(0,760px); }
.settings-panel>form { padding:0 24px 26px; }
.section-description { padding:20px 24px 24px; color:var(--muted); font-size:14px; line-height:1.8; overflow-wrap:anywhere; }
#config-refresh { max-width:180px; }

/* Authentication and initial loading */
.auth-shell { min-height:100dvh; display:grid; place-items:center; padding:40px 24px; }
.auth-card { width:min(456px,100%); padding:36px; border:1px solid #30465f; border-radius:14px; background:var(--surface); box-shadow:0 18px 50px #00000026; }
.auth-card .brand { padding:0 0 30px; font-size:16px; }
.auth-card h1 { margin-bottom:12px; font-size:25px; }
.auth-card .section-description { padding:0 0 28px; font-size:14px; }
.auth-card>p { margin:14px 0 0; color:var(--muted); font-size:14px; line-height:1.8; }
.auth-card #login-button { width:100%; min-height:46px; margin-top:25px; font-size:15px; }
.auth-note { margin-top:22px; padding-top:18px; border-top:1px solid var(--line); color:var(--subtle); font-size:12px; line-height:1.8; }
.boot-brand { display:flex; align-items:center; justify-content:space-between; margin-bottom:30px; }
.boot-indicator { width:24px; height:24px; border:2px solid #3e5878; border-top-color:#91c2ff; border-radius:50%; animation:boot-spin .9s linear infinite; }
#boot-retry { margin-top:22px; }
.auth-card:has(#boot-retry:not([hidden])) .boot-indicator { animation:none; border-color:#b49b71; }
@keyframes boot-spin { to { transform:rotate(360deg); } }
@keyframes loading-line { to { background-position:-200% 0; } }

/* Compact desktop */
@media (max-width:1320px) {
  .app-shell { grid-template-columns:184px minmax(0,1fr); }
  .main { padding:26px 24px 22px; }
  .task-workspace { grid-template-columns:minmax(0,1fr) 350px; gap:20px; }
  .date-column,.date-cell { display:none; }
  .task-table th:nth-child(4) { width:80px; }
  .overview-stats { gap:10px; }
  .stat-item { padding:17px 14px; }
  .device-row { grid-template-columns:minmax(150px,1fr) 90px minmax(140px,1fr) auto; gap:16px; }
  .device-task { grid-column:1/-1; }
}
/* Tablet: keep type readable and place the editor below the list. */
@media (max-width:1120px) {
  .task-workspace { grid-template-columns:minmax(0,1fr); }
  .detail-panel { width:100%; }
  .date-column,.date-cell { display:table-cell; }
  .overview-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
  .overview-grid,.settings-grid { grid-template-columns:minmax(0,1fr); }
  .event-row { grid-template-columns:115px minmax(0,1fr); gap:10px 20px; }
  .event-row .event-time { grid-column:1; grid-row:1; }
  .event-row>div { grid-column:2; grid-row:1/3; }
  .event-row .event-actor { grid-column:1; grid-row:2; }
  .event-row .task-link,.event-row>.meta { grid-column:2; }
}
@media (max-width:920px) {
  .app-shell { grid-template-columns:168px minmax(0,1fr); }
  .sidebar { padding:26px 12px 20px; }
  .brand { padding-left:8px; padding-right:8px; gap:9px; }
  .main { padding:24px 20px 20px; }
  .topbar { flex-wrap:wrap; gap:16px; }
  .top-actions { width:100%; }
  .connection-status { margin-right:auto; }
  .task-table .date-column,.task-table .date-cell { display:none; }
  .task-table .owner-column,.task-table .owner-cell { display:none; }
  .panel-heading,.list-toolbar { padding-left:18px; padding-right:18px; }
  .list-summary { padding-left:18px; padding-right:18px; }
  .device-row { grid-template-columns:minmax(0,1fr) 90px; gap:14px 20px; }
  .device-row>div:first-child { grid-column:1; grid-row:1; }
  .device-row>.connection-pill { grid-column:2; grid-row:1; }
  .device-row>div:nth-child(3) { grid-column:1; grid-row:2; }
  .device-row>.button { grid-column:2; grid-row:2; }
  .device-task { grid-column:1/-1; }
}
/* Phone: complete navigation and accessible controls. */
@media (max-width:700px) {
  html { scrollbar-gutter:auto; }
  body { font-size:16px; }
  .app-shell { display:block; }
  .sidebar { position:static; height:auto; display:flex; flex-direction:row; align-items:center; flex-wrap:wrap; gap:17px 12px; padding:18px 14px 12px; border-right:0; border-bottom:1px solid var(--line); overflow:visible; }
  .brand { padding:0; gap:9px; font-size:15px; }
  .brand-mark { font-size:29px; }
  .sidebar nav { order:2; width:100%; grid-template-columns:repeat(5,minmax(0,1fr)); gap:4px; }
  .nav-item { flex-direction:column; justify-content:center; gap:5px; min-height:62px; padding:8px 2px; border-radius:6px; font-size:12px; line-height:1.5; }
  .nav-item.active { box-shadow:inset 0 -2px #76b4ff; }
  .nav-item svg { width:19px; height:19px; }
  .sidebar-note { display:flex; align-items:center; gap:8px; min-width:0; max-width:58%; margin:0 0 0 auto; padding:0; border:0; }
  #identity-label { max-width:92px; font-size:12px; }
  #identity-role { display:none; }
  .sidebar-note .button { flex-shrink:0; min-height:34px; margin:0; padding:6px 8px; font-size:12px; }
  .main { padding:22px 14px 20px; }
  h1 { font-size:25px; }
  h2 { font-size:16px; }
  .workspace-name { font-size:12px; margin-bottom:5px; }
  .topbar { margin-bottom:22px; gap:17px; }
  .top-actions { gap:8px; }
  .top-actions .button { min-height:42px; padding:8px 11px; font-size:13px; }
  .connection-status { font-size:12px; gap:6px; margin-right:auto; }
  .button { min-height:44px; padding:10px 14px; }
  input,textarea,select { min-height:46px; font-size:16px; }
  label { font-size:14px; }
  .notice { padding:12px 14px; margin-bottom:18px; }
  .notice.success { padding:6px 0; }
  .announcement { margin-bottom:20px; }
  .overview-heading { align-items:flex-start; flex-wrap:wrap; gap:13px; margin-bottom:18px; }
  .overview-heading h2 { font-size:17px; }
  .overview-heading p { font-size:14px; }
  .overview-heading>.button { min-height:38px; padding:8px 12px; font-size:13px; }
  .overview-stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-bottom:20px; }
  .stat-item { padding:16px; }
  .stat-item span { font-size:13px; }
  .stat-item strong { font-size:28px; margin-top:8px; }
  .overview-grid { gap:18px; }
  .panel-heading { padding:17px 18px; }
  .compact-list { padding:0 18px; }
  .compact-item { gap:12px; padding:16px 0; align-items:flex-start; }
  .compact-item .button { min-height:36px; padding:7px 9px; font-size:12px; }
  .list-toolbar { gap:11px; padding:17px 15px 14px; }
  .status-field { flex-basis:118px; }
  .list-summary { padding:0 15px 14px; gap:5px 10px; }
  .task-table th,.task-table td { padding-left:8px; padding-right:8px; }
  .task-table th:first-child,.task-table td:first-child { padding-left:15px; }
  .task-table th:nth-child(2) { width:80px; }
  .task-table th:nth-child(3) { width:62px; }
  .task-table .owner-column,.task-table .owner-cell { display:none; }
  .task-table td { padding-top:14px; padding-bottom:14px; }
  .task-link { font-size:14px; min-height:32px; }
  .task-id { max-width:17ch; font-size:12px; }
  .status-badge { padding-left:6px; padding-right:6px; font-size:12px; }
  .empty-state { padding:30px 20px; }
  .pagination { padding:13px 15px; gap:10px; }
  .pagination .button { min-height:38px; padding:7px 10px; }
  #task-form { padding:18px; }
  #task-meta { margin-bottom:18px; }
  .form-pair { gap:12px; }
  .editor-empty { padding:28px 22px; }
  .history-panel { padding:0 18px 20px; }
  .history-item p { font-size:14px; }
  .device-heading-actions { gap:8px; margin:0; width:100%; }
  .device-heading-actions .button { min-height:40px; padding:8px 12px; font-size:13px; }
  .device-list { padding:0 18px; }
  .device-row { grid-template-columns:minmax(0,1fr) 80px; gap:13px 14px; padding:20px 0; }
  .device-row h3 { font-size:15px; }
  .device-row .button { min-height:38px; padding:7px 10px; font-size:13px; }
  .event-list { padding:0 18px; }
  .event-row { grid-template-columns:minmax(0,1fr) minmax(0,110px); gap:9px 14px; padding:18px 0; }
  .event-row .event-time { grid-column:1; grid-row:1; }
  .event-row .event-actor { grid-column:2; grid-row:1; text-align:right; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .event-row>div { grid-column:1/-1; grid-row:2; }
  .event-row .task-link,.event-row>.meta { grid-column:1/-1; grid-row:3; }
  .event-row .task-link { min-height:30px; font-size:13px; color:#9ac9ff; }
  .event-row p { font-size:14px; }
  #events-view .list-toolbar { flex-wrap:wrap; }
  #events-view .search-field { flex-basis:100%; }
  #events-search { min-height:38px; font-size:13px; }
  .settings-grid { gap:18px; }
  .settings-panel>form { padding:0 18px 22px; }
  .section-description { padding:18px 18px 22px; }
  .registration-panel>#device-register-form { padding:18px; }
  #device-register-feedback { margin:0 18px 18px; }
  #device-token-result { padding:0 18px 22px; }
  .page-footer { padding-top:24px; gap:10px; font-size:12px; }
  .page-footer span { max-width:19em; }
  .auth-shell { padding:24px 16px; }
  .auth-card { padding:28px 24px; border-radius:12px; }
  .auth-card .brand { padding-bottom:26px; }
  .auth-card h1 { font-size:24px; }
  .auth-card .section-description { padding-bottom:24px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation:none!important; transition:none!important; }
}
