:root {
  font-family: "Segoe UI", Arial, sans-serif;
  color: #202b43;
  background: #f5f7fb;
  font-synthesis: none;
  --muted: #69758c;
  --border: #e5eaf2;
  --primary: #445bdd;
  --primary-dark: #3047ca;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button, a, input, select, summary { touch-action: manipulation; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible, .table-scroll:focus-visible { outline: 3px solid #8194ff; outline-offset: 3px; }
[hidden] { display: none !important; }
a { color: var(--primary); }
.app-shell { max-width: 1536px; padding: 0 48px; margin: 0 auto; }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--border); }
.brand { display: flex; gap: 13px; align-items: center; text-decoration: none; font-size: 21px; color: #202b43; font-weight: 700; letter-spacing: -.5px; }
.brand-mark { height: 36px; width: 36px; background: var(--primary); color: #fff; border-radius: 10px; display: grid; place-items: center; font-size: 22px; box-shadow: 0 3px 8px #445bdd1a; }
.brand-divider { color: #c9d0df; font-weight: 400; margin: 0 14px; }
.brand-section { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.source-badge { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #64728a; border: 1px solid #dde4ef; background: #ffffff80; padding: 7px 11px; border-radius: 20px; white-space: nowrap; }
.source-dot, .footer-dot { display: inline-block; height: 6px; width: 6px; background: #7587a2; border-radius: 100%; }
main { padding-top: 36px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 30px; }
.eyebrow { font-size: 10px; font-weight: 750; letter-spacing: 1.5px; color: var(--primary); margin: 0 0 10px; }
h1 { font-size: clamp(26px, 2.7vw, 35px); font-weight: 650; letter-spacing: -1.2px; line-height: 1.2; margin: 0 0 11px; }
h2 { font-size: 17px; margin: 0; letter-spacing: -.3px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
.page-description { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }
.heading-controls { display: flex; align-items: flex-start; gap: 16px; }
.profile-control { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.profile-control select { min-width: 125px; }
.refresh-area { text-align: right; flex-shrink: 0; }
.button { min-height: 42px; border-radius: 8px; border: 1px solid transparent; padding: 10px 17px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 650; text-decoration: none; transition: background .15s, box-shadow .15s; }
.button-primary { background: var(--primary); color: #fff; box-shadow: 0 3px 7px #445bdd20; }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { border-color: #dce3ed; background: #fff; color: #4b5871; }
.button-secondary:hover { background: #f4f6fa; }
.button-quiet { color: #65728b; background: transparent; }
.button-quiet:hover { background: #e9edf5; }
.button-danger { color: #a22d42; background: #fff4f5; border-color: #efd5da; }
.button-danger:hover { background: #ffe8ec; }
.button-small { min-height: 36px; font-size: 12px; padding: 8px 12px; }
.update-time { font-size: 11px; margin: 8px 0 0; color: #788499; min-height: 15px; }
.notice { padding: 13px 16px; border: 1px solid; border-radius: 9px; font-size: 13px; line-height: 1.6; margin-bottom: 20px; overflow-wrap: anywhere; }
.notice-error { border-color: #efd1d5; color: #9f3444; background: #fff1f3; }
.notice-info { border-color: #d9e2fa; color: #3d5795; background: #edf3ff; }
.notice-success { border-color: #cfe9da; color: #316c51; background: #edf8f1; }
.notice-warning { border-color: #efdfb9; color: #906627; background: #fff9e9; }
.loading-message { padding: 35px 0; color: var(--muted); font-size: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px; margin-bottom: 29px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px 23px 18px; box-shadow: 0 2px 3px #25335402; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #657189; font-size: 12px; font-weight: 600; }
.stat-icon { height: 34px; width: 34px; display: grid; place-items: center; border-radius: 9px; font-size: 21px; font-weight: 400; }
.indigo { background: #eff0ff; color: #6670da; }
.mint { background: #eaf6f1; color: #479779; }
.blue { background: #eef5fc; color: #5790c3; }
.amber { background: #fff5e6; color: #c49040; }
.stat-value { font-size: 30px; letter-spacing: -1px; font-weight: 650; line-height: 1.2; margin: 12px 0 9px; font-variant-numeric: tabular-nums; }
.stat-value-date { font-size: 22px; line-height: 36px; letter-spacing: -.5px; }
.stat-note { font-size: 11px; color: #75839b; margin: 0; line-height: 1.5; }
.panel-tabs { display: flex; gap: 5px; overflow-x: auto; margin-bottom: 23px; border-bottom: 1px solid #e0e6f0; }
.panel-tab { padding: 13px 20px; min-height: 46px; background: none; border: 0; border-bottom: 3px solid transparent; color: #77839b; font-weight: 600; font-size: 13px; white-space: nowrap; }
.panel-tab:hover { color: var(--primary); }
.panel-tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.panel { border: 1px solid var(--border); border-radius: 12px; background: #fff; box-shadow: 0 3px 10px #22325802; overflow: hidden; }
.panel-heading { padding: 24px 25px 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.panel-heading p { margin: 8px 0 0; color: #77849a; font-size: 12px; line-height: 1.6; }
.count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 25px; min-height: 24px; padding: 3px 8px; border-radius: 6px; background: #f0f3f8; color: #6a7891; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.toolbar { display: flex; align-items: flex-end; gap: 12px; padding: 0 25px 20px; }
.toolbar label { max-width: 190px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 11px; color: #748198; padding: 0 25px 18px; }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { height: 9px; width: 9px; border-radius: 3px; display: inline-block; }
.legend-dot.signal-red { background: #df6b7a; }
.legend-dot.signal-yellow { background: #d1a33d; }
.legend-dot.flagged { background: #8b82cf; }
.table-scroll { overflow-x: auto; }
.measurement-table { border-collapse: separate; border-spacing: 0; width: 100%; text-align: center; font-size: 12px; }
.measurement-table thead { background: #f8fafd; }
.measurement-table th { font-size: 10px; text-transform: uppercase; letter-spacing: .3px; font-weight: 650; color: #78859a; padding: 13px 10px; min-width: 94px; border-top: 1px solid #edf0f6; border-bottom: 1px solid #edf0f6; line-height: 1.5; }
.measurement-table th:first-child { min-width: 120px; }
.measurement-table td { padding: 7px 5px; border-bottom: 1px solid #edf0f6; }
.measurement-table td:first-child, .measurement-table th:first-child { position: sticky; left: 0; z-index: 1; text-align: left; padding-left: 20px; padding-right: 14px; background: #fff; }
.measurement-table th:first-child { background: #f8fafd; }
.measurement-table tbody th { background: #fff; border-top: 0; font-weight: 400; text-transform: none; }
.measurement-table tbody tr:last-child td { border-bottom: 0; }
.measurement-table tbody tr:last-child th { border-bottom: 0; }
.measurement-table tbody tr:hover > td, .measurement-table tbody tr:hover > th { background: #fbfcff; }
.date-label { display: block; color: #4b5b75; font-size: 12px; font-weight: 600; white-space: nowrap; }
.date-secondary { display: block; color: #8a97a9; font-size: 10px; margin-top: 4px; }
.today-row .date-label { color: var(--primary); }
.measurement-cell { width: 100%; min-height: 46px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: #475974; padding: 9px 7px; font-size: 12px; line-height: 1.5; white-space: nowrap; }
.measurement-cell:hover { background: #eef2fc; border-color: #dce3f5; }
.measurement-cell.signal-red { background: #fff0f2; color: #a22d42; }
.measurement-cell.signal-yellow { background: #fff7de; color: #8b6516; }
.measurement-cell.flagged { background: #f1eefd; color: #6c52a9; }
.measurement-cell .cell-mark { display: block; font-size: 9px; font-weight: 650; }
.cell-empty { display: block; min-height: 46px; padding-top: 13px; color: #bbc4d3; }
.cell-empty.scheduled { color: #9aa6bd; }
.cell-note { min-width: 170px; max-width: 250px; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; color: #6f7d94; font-size: 11px; padding: 12px !important; }
.panel-footer { display: flex; justify-content: space-between; gap: 14px; border-top: 1px solid var(--border); padding: 14px 25px; color: #8490a4; font-size: 10px; }
.empty-state { text-align: center; padding: 43px 24px 47px; border-top: 1px solid #edf0f6; }
.empty-illustration { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: #f1f4fd; color: #7f8fd6; margin: 0 auto 18px; font-size: 37px; }
.empty-state h3 { margin: 0 0 10px; color: #52617c; }
.empty-state p { font-size: 13px; line-height: 1.7; color: #7c89a0; max-width: 385px; margin: 0 auto; }
.empty-inline { font-size: 13px; color: #8390a5; padding: 12px 0 23px; margin: 0; line-height: 1.6; }
.two-columns { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: start; }
.panel-form { padding: 0 25px 26px; display: flex; flex-direction: column; gap: 18px; }
label { display: flex; flex-direction: column; gap: 8px; color: #53627c; font-size: 12px; font-weight: 600; }
input:not([type="checkbox"]):not([type="radio"]), select, textarea { width: 100%; border: 1px solid #dce3ee; border-radius: 7px; background: #fff; color: #324158; padding: 10px 12px; min-height: 42px; font-size: 14px; font-weight: 400; }
textarea { line-height: 1.6; resize: vertical; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 18px; height: 18px; flex-shrink: 0; margin: 0; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-hint { color: #7c89a0; font-size: 11px; font-weight: 400; line-height: 1.6; margin: 0; }
.check-label { display: flex; flex-direction: row; align-items: flex-start; font-size: 11px; font-weight: 400; line-height: 1.6; color: #748198; }
.panel-form > .button { align-self: flex-start; }
.value-fields { display: flex; flex-direction: column; gap: 15px; }
.value-fields.numeric-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.choice-row { display: flex; gap: 12px; }
.choice-row label { flex-direction: row; align-items: center; min-width: 110px; padding: 13px 16px; border: 1px solid #e1e6f0; border-radius: 8px; }
.choice-row label:has(input:checked) { background: #eef1ff; border-color: #bac5f2; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
fieldset { border: 1px solid #e1e7f0; border-radius: 9px; margin: 0; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
legend { color: #5b6b84; font-size: 12px; font-weight: 650; padding: 0 7px; }
.settings-section { border: 1px solid var(--border); border-radius: 9px; padding: 0 18px 18px; }
.settings-section:not([open]) { padding-bottom: 0; }
.settings-section summary { padding: 17px 0; font-size: 13px; color: #536580; font-weight: 600; }
.settings-section > .field-hint { margin-bottom: 13px; }
.settings-section > label + label { margin-top: 17px; }
.code-editor { font: 12px/1.6 Consolas, "Courier New", monospace; tab-size: 2; background: #fafbfe; }
.section-space { margin-top: 22px; }
.card-list { padding: 0 25px 5px; }
.device-card { border: 1px solid #e2e8f1; background: #fcfdff; border-radius: 9px; padding: 19px; margin-bottom: 20px; }
.device-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.device-card h3 { margin: 0 0 8px; color: #42536e; }
.pair-code { font-size: 26px; font-weight: 650; letter-spacing: 4px; color: #445bdd; font-variant-numeric: tabular-nums; }
.device-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding: 0; margin: 22px 0; }
.device-meta dt { font-size: 10px; color: #8692a5; margin-bottom: 6px; line-height: 1.5; }
.device-meta dd { font-size: 12px; line-height: 1.6; margin: 0; color: #52647e; overflow-wrap: anywhere; }
.device-actions { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 17px; }
.device-actions select { min-width: 150px; }
.status-badge { display: inline-flex; align-items: center; border-radius: 5px; padding: 5px 8px; background: #eef1f6; color: #6e7d94; font-size: 10px; font-weight: 600; white-space: nowrap; }
.status-badge.success { background: #eaf6ef; color: #3c8064; }
.status-badge.warning { background: #fff6e7; color: #946b2c; }
.status-badge.error { background: #fff0f2; color: #ab4254; }
.status-badge.info { background: #edf3fe; color: #46699c; }
.contact-settings { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.contact-settings summary { font-size: 12px; color: #63748e; }
.contact-settings form { display: flex; flex-direction: column; gap: 13px; margin-top: 18px; max-width: 620px; }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: 10px; color: #8794a8; padding: 24px 2px 33px; }
.page-footer > span:first-child { display: flex; align-items: center; gap: 7px; }
.footer-dot { width: 5px; height: 5px; background: #97a7ba; }
.login-card { max-width: 430px; padding: 36px; margin: 48px auto; background: #fff; border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 4px 20px #23385305; }
.form-stack { display: flex; flex-direction: column; gap: 14px; margin-top: 26px; }
.form-stack label { margin-bottom: -5px; }
.form-stack .button { margin-top: 6px; }
.sr-only { 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: 8px; left: 8px; z-index: 100; background: #fff; padding: 12px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
dialog { padding: 0; border: 1px solid #e0e6ef; border-radius: 16px; width: min(800px, calc(100vw - 40px)); max-height: calc(100vh - 56px); box-shadow: 0 30px 100px #192a4e33; color: #2c3951; }
dialog::backdrop { background: #1d294960; backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); padding: 24px 28px; }
.dialog-header h2 { font-size: 21px; }
.dialog-header .field-hint { margin-top: 8px; }
.icon-button { width: 36px; height: 36px; border: 1px solid #e4e9f2; background: #fff; border-radius: 8px; color: #7a879b; display: grid; place-items: center; flex-shrink: 0; font-size: 25px; }
.icon-button:hover { background: #f4f6fa; }
.dialog-body { padding: 22px 28px 28px; }
.entry-history { display: flex; flex-direction: column; gap: 15px; }
.history-card { border: 1px solid var(--border); border-radius: 9px; padding: 18px; background: #fcfdff; }
.history-card.is-invalid { background: #f8f9fc; }
.history-card header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.history-value { font-size: 20px; font-weight: 650; line-height: 1.5; letter-spacing: -.2px; }
.history-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.history-meta { margin: 14px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.history-meta dt { font-size: 10px; color: #8491a7; margin-bottom: 5px; }
.history-meta dd { margin: 0; font-size: 12px; line-height: 1.5; color: #5e708b; overflow-wrap: anywhere; }
.history-identifier { font: 10px/1.6 Consolas, monospace; color: #93a0b4; overflow-wrap: anywhere; }
.history-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.correction-form { border-top: 1px solid var(--border); margin-top: 24px; padding-top: 20px; display: flex; flex-direction: column; gap: 17px; }
.correction-form h3 { margin: 0; }
.dialog-footer { padding: 15px 28px; display: flex; justify-content: space-between; align-items: center; gap: 15px; border-top: 1px solid var(--border); background: #fafbfd; }
.dialog-footer > span { font-size: 10px; color: #8592a6; }
.chart-instruction { font-size: 11px; line-height: 1.7; color: #7a89a0; margin: 18px 3px; }
.trends-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.chart-card { padding: 21px; min-width: 0; }
.chart-card h3 { margin: 0 0 7px; font-size: 15px; color: #43546f; }
.chart-card .chart-unit { color: #8a97a9; font-size: 11px; margin: 0 0 18px; }
.chart-area { overflow-x: auto; }
.chart-svg { display: block; width: 100%; min-width: 300px; overflow: visible; }
.chart-svg:focus-visible { outline: 3px solid #8194ff; outline-offset: -3px; border-radius: 6px; }
.chart-grid-line { stroke: #e9edf5; stroke-width: 1; }
.chart-axis-text { fill: #7a89a0; font: 11px "Segoe UI", Arial, sans-serif; }
.chart-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart-line.series-0 { stroke: #5369d8; }
.chart-line.series-1 { stroke: #329c83; }
.chart-line.series-2 { stroke: #bd7c35; }
.chart-point { stroke: #fff; stroke-width: 1.5; cursor: pointer; }
.chart-point.series-0 { fill: #5369d8; }
.chart-point.series-1 { fill: #329c83; }
.chart-point.series-2 { fill: #bd7c35; }
.chart-point.is-selected { stroke: #263956; stroke-width: 2.5; }
.chart-reading { min-height: 40px; margin: 12px 0 14px; padding: 9px 11px; border-radius: 7px; background: #f5f7fc; color: #5f708a; font-size: 11px; line-height: 1.6; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 9px 16px; margin-top: 9px; color: #697b96; font-size: 11px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.series-marker { width: 15px; height: 3px; border-radius: 2px; display: inline-block; }
.series-marker.series-0 { background: #5369d8; }
.series-marker.series-1 { background: #329c83; }
.series-marker.series-2 { background: #bd7c35; }
.chart-data { border-top: 1px solid #e8edf5; padding-top: 13px; }
.chart-data summary { color: #6c7d98; font-size: 11px; }
.chart-empty { margin: 12px 0 0; min-height: 160px; display: grid; place-items: center; border-radius: 8px; background: #f8fafd; color: #8996aa; font-size: 12px; text-align: center; padding: 24px; line-height: 1.7; }
.data-table { border-collapse: collapse; width: 100%; margin-top: 13px; text-align: left; font-size: 11px; }
.data-table th { padding: 10px 7px; font-size: 10px; color: #7c8aa1; font-weight: 600; background: #f7f9fd; }
.data-table td { padding: 10px 7px; color: #60718b; border-top: 1px solid #edf0f6; line-height: 1.5; }
.data-table-scroll { overflow-x: auto; max-height: 300px; }
.export-body { display: flex; align-items: flex-start; gap: 23px; padding: 8px 26px 32px; max-width: 760px; }
.export-icon { flex-shrink: 0; width: 66px; height: 66px; display: grid; place-items: center; border-radius: 16px; background: #edf1fd; color: #7485cd; font-size: 34px; }
.export-body h3 { margin: 0 0 10px; color: #4d607d; }
.export-body .field-hint { margin-top: 14px; }
.export-body .button { margin-top: 22px; }
.message-card, .diagnostic-card { margin-bottom: 18px; border: 1px solid #e2e8f1; border-radius: 9px; overflow: hidden; }
.message-card > summary, .diagnostic-card > summary { display: flex; align-items: flex-start; gap: 13px; padding: 17px 18px; list-style: none; }
.message-card > summary::before, .diagnostic-card > summary::before { content: "›"; color: #8899b5; font-size: 22px; line-height: 22px; }
.message-card[open] > summary::before, .diagnostic-card[open] > summary::before { content: "⌄"; }
.message-card > summary::-webkit-details-marker, .diagnostic-card > summary::-webkit-details-marker { display: none; }
.message-card[open] > summary, .diagnostic-card[open] > summary { background: #f8faff; border-bottom: 1px solid #e7ecf5; }
.message-heading { flex: 1; min-width: 0; }
.message-subject { display: block; font-size: 13px; color: #4e607b; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.message-date { display: block; color: #8c99ab; font-size: 10px; line-height: 1.6; margin-top: 6px; }
.message-detail { padding: 18px; }
.message-detail .history-meta { margin-top: 0; }
.plain-text { white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; font: 12px/1.8 "Segoe UI", Arial, sans-serif; color: #536783; background: #f8fafd; border: 1px solid #edf0f6; border-radius: 8px; padding: 16px; margin: 17px 0 0; }
.diagnostic-text { max-height: 480px; overflow: auto; font-family: Consolas, "Courier New", monospace; font-size: 11px; }
.attachment-list { font-size: 11px; line-height: 1.8; color: #75869e; padding-left: 20px; margin: 15px 0; }
.message-detail .form-actions { margin-top: 17px; }
.rejected-reference { margin-bottom: 22px; }
.reference-body { padding: 0 25px 25px; }
.rejected-payload { max-height: 400px; overflow: auto; font-family: Consolas, "Courier New", monospace; font-size: 11px; }
.rejected-payload:focus-visible { outline: 3px solid #8194ff; outline-offset: 3px; }
@media (max-width: 1100px) {
  .app-shell { padding: 0 28px; }
  .stat-card { padding: 18px; }
  .device-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .heading-controls { gap: 10px; }
}
@media (max-width: 800px) {
  .app-shell { padding: 0 20px; }
  .topbar { min-height: 78px; }
  main { padding-top: 28px; }
  .page-heading { align-items: flex-start; }
  .heading-controls { flex-direction: column; align-items: flex-end; gap: 8px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .stat-card { padding: 18px 20px; }
  .two-columns { grid-template-columns: 1fr; }
  .device-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-section, .brand-divider { display: none; }
  .trends-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .app-shell { padding: 0 14px; }
  .topbar { min-height: 72px; gap: 10px; }
  .brand { font-size: 19px; gap: 9px; }
  .brand-mark { width: 31px; height: 31px; font-size: 19px; }
  .topbar-actions { gap: 4px; }
  .topbar-actions .source-badge { display: none; }
  .page-heading { display: block; margin-bottom: 23px; }
  h1 { font-size: 28px; }
  .page-description { font-size: 13px; }
  .heading-controls { flex-direction: row; justify-content: space-between; margin-top: 20px; }
  .profile-control { align-items: flex-start; flex-direction: column; gap: 6px; }
  .refresh-area { padding-top: 21px; }
  .update-time { font-size: 10px; }
  .stat-card { padding: 15px; }
  .stat-icon { width: 28px; height: 28px; font-size: 18px; }
  .stat-top { font-size: 11px; }
  .stat-value { font-size: 27px; }
  .stat-value-date { font-size: 18px; line-height: 32px; }
  .stat-note { font-size: 10px; }
  .panel-tab { padding: 12px 15px; }
  .panel-heading { padding: 20px 17px 18px; }
  .panel-heading p { font-size: 11px; }
  .toolbar { padding: 0 17px 18px; flex-wrap: wrap; gap: 10px; }
  .toolbar label { flex: 1; min-width: 120px; }
  .toolbar .button { width: 100%; }
  .legend { padding: 0 17px 17px; gap: 9px 14px; font-size: 10px; }
  .measurement-table td:first-child, .measurement-table th:first-child { padding-left: 13px; min-width: 103px; }
  .panel-form { padding: 0 17px 22px; }
  .panel-footer { padding: 13px 17px; flex-direction: column; gap: 7px; }
  .page-footer { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card-list { padding: 0 17px 1px; }
  .device-card { padding: 15px; }
  .device-card header { flex-wrap: wrap; }
  .device-meta { gap: 18px 12px; }
  fieldset { padding: 16px; }
  .settings-section { padding-left: 13px; padding-right: 13px; }
  .form-actions { align-items: stretch; }
  .form-actions .button { flex-grow: 1; }
  .login-card { margin: 20px auto; padding: 28px 24px; }
  dialog { width: calc(100vw - 20px); max-height: calc(100vh - 24px); border-radius: 12px; }
  .dialog-header { padding: 20px; }
  .dialog-body { padding: 18px 20px 22px; }
  .dialog-footer { padding: 14px 20px; }
  .history-meta { grid-template-columns: 1fr; }
  .button, .button-small, .icon-button { min-height: 44px; }
  .icon-button { width: 44px; }
  .check-label { font-size: 12px; }
  .chart-card { padding: 17px; }
  .export-body { padding: 5px 17px 25px; gap: 16px; }
  .export-icon { width: 47px; height: 47px; font-size: 28px; border-radius: 12px; }
  .message-card > summary, .diagnostic-card > summary { gap: 9px; padding: 15px 13px; flex-wrap: wrap; }
  .message-card > summary > .status-badge { margin-left: 20px; }
  .message-subject { font-size: 12px; }
  .message-detail { padding: 14px; }
  .reference-body { padding: 0 17px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
