:root {
  color-scheme: light;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #132530;
  background: #edf2f5;
  --bg: #edf2f5;
  --ink: #11232f;
  --ink-2: #193141;
  --muted: #566b77;
  --border: #dce5ea;
  --border-soft: rgba(19, 37, 48, .08);
  --teal: #0b7a6c;
  --teal-hover: #086357;
  --teal-soft: #e4f3ef;
  --danger: #b43630;
  --danger-soft: #fdeeed;
  --warn: #9a5d14;
  --warn-soft: #fef5e7;
  --surface: #ffffff;
  --surface-alt: #f4f8fa;
  --topbar-bg: rgba(255, 255, 255, .88);
  --input-bg: #ffffff;
  --input-border: #bfd0d8;
  --shadow-sm: 0 1px 2px rgba(14, 34, 48, .04), 0 4px 12px -4px rgba(14, 34, 48, .06);
  --shadow-md: 0 2px 6px rgba(14, 34, 48, .04), 0 12px 28px -10px rgba(14, 34, 48, .09);
  --radius-md: .85rem;
  --radius-sm: .55rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  color: #e6eff4;
  background: #0b151c;
  --bg: #0b151c;
  --ink: #edf5f8;
  --ink-2: #cfe0e9;
  --muted: #93aab7;
  --border: rgba(154, 184, 200, .18);
  --border-soft: rgba(154, 184, 200, .14);
  --teal: #34c7ac;
  --teal-hover: #2bb49b;
  --teal-soft: rgba(52, 199, 172, .16);
  --danger: #ff7e75;
  --danger-soft: rgba(255, 105, 97, .15);
  --warn: #f0b159;
  --warn-soft: rgba(240, 177, 89, .14);
  --surface: #12212b;
  --surface-alt: #162936;
  --topbar-bg: rgba(15, 29, 38, .86);
  --input-bg: #0f1c25;
  --input-border: rgba(154, 184, 200, .28);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .28), 0 4px 14px -4px rgba(0, 0, 0, .36);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, .32), 0 16px 32px -10px rgba(0, 0, 0, .48);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(60rem 28rem at 82% -6%, rgba(11, 122, 108, .09), transparent 65%),
    radial-gradient(48rem 24rem at 18% -4%, rgba(25, 49, 65, .05), transparent 60%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}
:root[data-theme="dark"] body {
  background:
    radial-gradient(60rem 28rem at 82% -6%, rgba(52, 199, 172, .11), transparent 65%),
    radial-gradient(48rem 24rem at 18% -4%, rgba(28, 70, 96, .24), transparent 60%),
    var(--bg);
}
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; }
button:enabled { cursor: pointer; }
button:disabled { opacity: .52; cursor: not-allowed; }
:focus-visible { outline: 2px solid #0b8a79; outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.72rem, 2.5vw, 2.35rem); font-weight: 750; line-height: 1.15; letter-spacing: -.035em; color: var(--ink); }
h2 { font-size: 1.04rem; font-weight: 700; line-height: 1.3; letter-spacing: -.015em; color: var(--ink); }
section[id], #history { scroll-margin-top: 5rem; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 30; padding: .65rem .9rem; border-radius: .5rem; background: #fff; box-shadow: var(--shadow-md); }
.skip-link:focus { top: 1rem; }

.shell { display: grid; grid-template-columns: 15.2rem minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; z-index: 4; height: 100dvh;
  display: flex; flex-direction: column; gap: 2.1rem;
  padding: 1.5rem .95rem 1.05rem;
  color: #eef5f7;
  background: linear-gradient(180deg, #0e1e28 0%, #152a37 55%, #122531 100%);
  border-right: 1px solid rgba(255, 255, 255, .06);
}
.brand {
  display: inline-flex; align-items: center; gap: .75rem; width: fit-content;
  text-decoration: none; font-size: 1.32rem; font-weight: 750; letter-spacing: -.035em;
}
.sidebar > .brand { margin-left: .3rem; }
.brand small { display: block; margin-top: .14rem; font-size: .74rem; font-weight: 500; color: #9eb5c1; letter-spacing: 0; }
.brand-icon {
  display: grid; place-items: center; flex: none; width: 2.5rem; height: 2.5rem;
  border-radius: .75rem;
  background: linear-gradient(135deg, #d6faee 0%, #98ebd1 100%);
  box-shadow: 0 4px 12px rgba(17, 179, 149, .26);
}
.brand-icon img, .brand-icon svg { display: block; width: 1.75rem; height: 1.75rem; object-fit: contain; }
.sidebar nav { display: grid; gap: .32rem; }
.sidebar nav a {
  display: flex; align-items: center; gap: .72rem; min-height: 2.8rem;
  padding: .58rem .82rem; border-radius: .55rem;
  color: #b7cad4; text-decoration: none; font-size: .92rem; font-weight: 550;
  transition: background-color .16s ease, color .16s ease, transform .16s ease;
}
.sidebar nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.sidebar nav a.nav-active {
  background: linear-gradient(90deg, rgba(79, 209, 181, .19), rgba(79, 209, 181, .06));
  color: #f0fffb; font-weight: 650;
  box-shadow: inset 3px 0 #5be0c2;
}
.sidebar nav a:focus-visible, .sidebar summary:focus-visible, .sidebar .brand:focus-visible { outline-color: #7ee3cb; }
.sidebar-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: .8rem; }
.profile { position: relative; }
.profile summary {
  display: flex; align-items: center; gap: .65rem; min-height: 3.1rem;
  padding: .42rem .5rem; border-radius: .55rem; cursor: pointer; list-style: none;
  transition: background-color .16s ease;
}
.profile summary::-webkit-details-marker { display: none; }
.profile summary::after {
  content: ""; flex: 0 0 .44rem; block-size: .44rem; margin-left: auto; margin-right: .28rem;
  border: solid #a9bfc9; border-width: 0 1.5px 1.5px 0; transform: rotate(225deg);
}
.profile summary:hover, .profile[open] summary { background: rgba(255, 255, 255, .09); }
.profile-avatar {
  flex: none; display: grid; place-items: center; width: 2.1rem; height: 2.1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #d7f4eb, #9fe0cb);
  color: #134a41; font-weight: 750; font-size: .92rem;
}
.profile-name { display: grid; min-width: 0; gap: .12rem; line-height: 1.15; }
.profile-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.profile-name small { color: #9eb4bf; font-size: .77rem; }
.topbar {
  position: sticky; top: 0; z-index: 3;
  min-height: 4.1rem; display: flex; align-items: center; justify-content: space-between; gap: .65rem;
  border-bottom: 1px solid var(--border-soft);
  padding: .55rem clamp(1rem, 3vw, 2.5rem);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
}
.top-label { color: var(--ink-2); font-size: .92rem; font-weight: 700; letter-spacing: -.01em; }
.top-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: .42rem;
  min-height: 2.5rem; padding: .48rem .9rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  font-size: .89rem; font-weight: 650; line-height: 1.2; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.button:not(:disabled):active { transform: translateY(1px); }
.primary { color: #fff; background: linear-gradient(180deg, #0d8979 0%, #096f62 100%); box-shadow: 0 1px 2px rgba(9, 105, 95, .25); }
.primary:not(:disabled):hover { background: linear-gradient(180deg, #0b7a6c 0%, #075b50 100%); box-shadow: 0 4px 12px -2px rgba(9, 105, 95, .34); }
.secondary { color: var(--ink-2); background: var(--surface); border-color: var(--input-border); box-shadow: 0 1px 2px rgba(15, 35, 48, .04); }
.secondary:not(:disabled):hover { background: var(--surface-alt); border-color: var(--teal); }
.profile-menu {
  position: absolute; inset: auto 0 calc(100% + .5rem) 0; z-index: 8;
  padding: .38rem; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: .7rem;
  box-shadow: 0 14px 32px rgba(12, 34, 46, .22);
}
.profile-menu-caption { display: none; }
.profile-menu a, .text-button {
  display: block; width: 100%; padding: .58rem .72rem; border: 0; border-radius: .45rem;
  background: transparent; text-align: left; text-decoration: none; color: inherit;
  font-size: .9rem; font-weight: 550; transition: background-color .14s ease;
}
.profile-menu a:hover, .text-button:hover { background: var(--teal-soft); color: var(--teal); }

.pf-icon { display: inline-block; flex: none; inline-size: 1.24rem; block-size: 1.24rem; object-fit: contain; color: inherit; }
.sidebar nav a .pf-icon { inline-size: 1.32rem; block-size: 1.32rem; }
.metric-icon .pf-icon { inline-size: 1.92rem; block-size: 1.92rem; }
.metric-icon .pf-icon-vibration { inline-size: 2.15rem; block-size: 2.15rem; }
.theme-icon { display: inline-flex; align-items: center; }
.card-heading { display: inline-flex; align-items: center; gap: .5rem; }
.card-heading .pf-icon { inline-size: 1.35rem; block-size: 1.35rem; }

.content { width: min(100%, 92rem); margin: 0 auto; padding: 1.85rem clamp(1rem, 3vw, 2.5rem) 3.2rem; }
.intro { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.55rem; }
.intro p { margin-top: .34rem; color: var(--muted); line-height: 1.45; font-size: .94rem; }
.live-summary { display: grid; justify-items: end; gap: .4rem; }
.connection {
  display: inline-flex; align-items: center; gap: .5rem; width: fit-content;
  padding: .34rem .78rem; border-radius: 999px;
  background: var(--surface-alt); border: 1px solid var(--border);
  color: var(--muted); font-size: .84rem; font-weight: 700;
}
.connection i { width: .52rem; height: .52rem; flex: none; border-radius: 50%; background: currentColor; }
.connection[data-state="online"] { color: #0b6e56; background: #dff4ec; border-color: #b7e5d4; }
:root[data-theme="dark"] .connection[data-state="online"] { color: #6ae6ca; background: rgba(52, 199, 172, .16); border-color: rgba(52, 199, 172, .32); }
.connection[data-state="online"] i { box-shadow: 0 0 0 0 rgba(11, 110, 86, .45); animation: live-pulse 2s infinite; }
.connection[data-state="stale"] { color: var(--warn); background: var(--warn-soft); border-color: rgba(240, 177, 89, .36); }
.connection[data-state="offline"] { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 105, 97, .36); }
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(11, 110, 86, .45); }
  70% { box-shadow: 0 0 0 6px rgba(11, 110, 86, 0); }
  100% { box-shadow: 0 0 0 0 rgba(11, 110, 86, 0); }
}
.last-reading, .section-heading span { color: var(--muted); font-size: .85rem; }
.last-reading time { color: var(--ink-2); font-weight: 600; font-variant-numeric: tabular-nums; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .35rem .7rem; margin-bottom: .75rem; }
.section-heading span { overflow-wrap: anywhere; }
.readings-section { margin-bottom: 1.35rem; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .9rem; }
.metric {
  position: relative; display: flex; align-items: center; gap: .9rem; min-width: 0;
  padding: 1.1rem 1.15rem; overflow: hidden;
  border: 1px solid var(--border-soft); border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.metric::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 2.5px;
  background: var(--metric-accent, var(--teal)); opacity: .72;
}
.metric[data-metric="temp"] { --metric-accent: #c85231; }
.metric[data-metric="hum"] { --metric-accent: #1880a5; }
.metric[data-metric="lux"] { --metric-accent: #c98a18; }
.metric[data-metric="vibration"] { --metric-accent: #0e8b77; }
.metric-body { flex: 1; min-width: 0; }
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.metric.is-alarm { border-color: #eab3ae; background: linear-gradient(180deg, #fff9f8 0%, #fff1ef 100%); }
:root[data-theme="dark"] .metric.is-alarm { border-color: rgba(255, 126, 117, .5); background: linear-gradient(180deg, rgba(122, 34, 29, .28) 0%, rgba(92, 24, 21, .34) 100%); }
.metric h3 { color: var(--muted); font-size: .84rem; font-weight: 650; line-height: 1.3; margin-bottom: .15rem; }
.metric-icon {
  display: grid; flex: none; place-items: center; width: 3.1rem; height: 3.1rem;
  border-radius: .78rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}
.metric-heat { color: #b54524; background: #fcebe4; }
.metric-water { color: #126a8a; background: #e2f1f8; }
.metric-light { color: #9a6914; background: #fbf1da; }
.metric-motion { color: #2f6556; background: #e3f1ec; }
:root[data-theme="dark"] .metric-heat { color: #ff9c7e; background: rgba(200, 82, 49, .18); }
:root[data-theme="dark"] .metric-water { color: #67c4e8; background: rgba(24, 128, 165, .18); }
:root[data-theme="dark"] .metric-light { color: #f6c76b; background: rgba(201, 138, 24, .18); }
:root[data-theme="dark"] .metric-motion { color: #5ae0c5; background: rgba(14, 139, 119, .18); }
.reading { display: flex; align-items: baseline; gap: .28rem; font-variant-numeric: tabular-nums; }
.reading strong { font-size: clamp(1.6rem, 2.45vw, 2.15rem); font-weight: 750; line-height: 1.14; letter-spacing: -.04em; color: var(--ink); }
.reading span { color: var(--muted); font-size: .88rem; font-weight: 650; }
.reading:is(.vibration, .light) strong { font-size: clamp(1.25rem, 2vw, 1.58rem); line-height: 1.4; letter-spacing: -.025em; }
.metric-meter {
  display: block; width: 100%; height: .3rem; margin-top: .48rem;
  border: 0; border-radius: 999px; overflow: hidden;
  background: var(--border-soft);
}
.metric-meter::-webkit-meter-bar { background: var(--border-soft); border-radius: 999px; border: 0; }
.metric-meter::-webkit-meter-optimum-value { background: var(--metric-accent, var(--teal)); border-radius: 999px; }
.metric-meter::-webkit-meter-suboptimum-value { background: #d4891c; border-radius: 999px; }
.metric-meter::-webkit-meter-even-less-good-value { background: var(--danger); border-radius: 999px; }
.metric-meter::-moz-meter-bar { background: var(--metric-accent, var(--teal)); border-radius: 999px; }
#temperature.active, #vibration.active { color: var(--danger); }
.vibration-limit { display: block; margin-top: .28rem; color: var(--muted); font-size: .77rem; line-height: 1.35; }
.machine-alert {
  margin-top: .85rem; padding: .75rem 1rem;
  border: 1px solid rgba(180, 54, 48, .35); border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  color: var(--danger); background: var(--danger-soft); font-weight: 650; font-size: .91rem;
}

.panel-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: .95rem; margin-bottom: 1.4rem; }
.history-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.panel {
  min-width: 0; padding: 1.25rem;
  border: 1px solid var(--border-soft); border-radius: var(--radius-md);
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: .75rem; margin-bottom: .9rem; }
.panel p, .login > p { color: var(--muted); font-size: .89rem; line-height: 1.48; margin-top: .22rem; }
.chart-panel { display: flex; flex-direction: column; min-height: 19.5rem; margin-bottom: 1.4rem; }
.segmented {
  display: inline-flex; flex: none; gap: .15rem; padding: .22rem;
  border: 1px solid var(--border); border-radius: .55rem; background: var(--surface-alt);
}
.segmented button {
  min-height: 2.1rem; border: 1px solid transparent; border-radius: .38rem;
  padding: .28rem .6rem; background: transparent;
  color: var(--muted); font-weight: 650; font-size: .84rem;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.segmented button:hover { color: var(--ink); }
.segmented button[aria-pressed="true"] {
  background: var(--surface); border-color: var(--border-soft); color: var(--teal);
  box-shadow: 0 1px 3px rgba(14, 34, 48, .08);
}
.chart-wrap { flex: 1; position: relative; min-height: 13.5rem; }
#chart { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
#chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: var(--surface-alt); border: 1px dashed var(--border); border-radius: var(--radius-sm);
  margin: 0; color: var(--muted); font-size: .9rem;
}

.camera-panel { display: flex; flex-direction: column; }
.camera-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .26rem .65rem; border-radius: 999px;
  font-size: .79rem; font-weight: 700; white-space: nowrap;
  color: #096857; background: #def3ec; border: 1px solid #b5e4d4;
}
.camera-badge::before { content: ""; width: .44rem; height: .44rem; border-radius: 50%; background: currentColor; }
.camera-badge.is-demo { color: #566b77; background: #eef3f6; border-color: #d7e1e6; }
:root[data-theme="dark"] .camera-badge { color: #6ae6ca; background: rgba(52, 199, 172, .16); border-color: rgba(52, 199, 172, .3); }
:root[data-theme="dark"] .camera-badge.is-demo { color: var(--muted); background: var(--surface-alt); border-color: var(--border); }
.camera-stage {
  flex: 1; display: grid; place-items: center; min-height: 15.5rem;
  border-radius: .7rem; overflow: hidden;
  background: linear-gradient(180deg, #0d1a23 0%, #132531 100%);
  border: 1px solid #1f3645;
}
.camera-waiting {
  display: grid; justify-items: center; gap: .65rem; padding: 1.5rem 1.25rem; text-align: center;
}
.camera-waiting-art { color: #73d7be; opacity: .78; }
.camera-stage p {
  margin: 0; padding: 0; text-align: center;
  color: #b5c7d1; font-size: .88rem; line-height: 1.5; max-width: 22rem;
}
.camera-stage img {
  display: block; width: 100%; height: 100%; max-height: 22rem; object-fit: contain;
}
.inspection-panel { display: flex; flex-direction: column; }
.inspection-panel .panel-heading p { font-size: .86rem; }
.tray-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem;
  margin-block: .35rem; padding: .85rem;
  border: 1px solid #223b46; border-radius: .75rem;
  background: linear-gradient(180deg, #1d333d 0%, #243d48 100%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .2);
}
.tray-grid span {
  display: grid; place-items: center; min-height: 2.75rem;
  border: 1.5px solid #596f7a; border-radius: 46% / 30%;
  background: #364b56; color: #edf4f6; font-size: .9rem; font-weight: 700;
  transition: transform .15s ease;
}
.tray-grid .present { border-color: #79cfb4; background: linear-gradient(180deg, #d6f5ea 0%, #b5e7d5 100%); color: #0f4b3f; }
.tray-grid .missing { border-color: #e89f95; border-style: dashed; background: linear-gradient(180deg, #fde8e4 0%, #f7cdc5 100%); color: #8c2721; }
.result-tag { display: inline-flex; align-items: center; padding: .3rem .65rem; white-space: nowrap; border-radius: 999px; font-size: .82rem; font-weight: 700; }
.result-tag.ok { color: #096857; background: #def3ec; border: 1px solid #b5e4d4; }
.result-tag.ng { color: #a12e27; background: #fdeae7; border: 1px solid #f4c7c2; }
.tray-summary {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: .3rem .6rem; margin-top: .45rem; padding-top: .55rem; font-size: .92rem;
}
.tray-summary strong { font-size: 1.05rem; color: var(--ink); }
.tray-summary span { color: var(--muted); }
.inspection-stats {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  margin-top: .65rem; padding-top: .65rem; border-top: 1px dashed var(--border);
  font-size: .82rem; color: var(--muted);
}
.stat-pill { padding: .16rem .55rem; border-radius: 999px; font-weight: 700; font-size: .78rem; }
.stat-pill.ok { color: #096857; background: #e3f5ef; }
.stat-pill.ng { color: #a12e27; background: #fdecea; }
:root[data-theme="dark"] .stat-pill.ok, :root[data-theme="dark"] .result-tag.ok { color: #6ae6ca; background: rgba(52, 199, 172, .16); border-color: rgba(52, 199, 172, .3); }
:root[data-theme="dark"] .stat-pill.ng, :root[data-theme="dark"] .result-tag.ng { color: #ff8e86; background: rgba(255, 105, 97, .16); border-color: rgba(255, 105, 97, .3); }

.table-wrap { overflow: auto; max-height: 21rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; text-align: left; color: var(--ink-2); font-variant-numeric: tabular-nums; font-size: .86rem; }
th, td { padding: .66rem .72rem; border-bottom: 1px solid var(--border-soft); white-space: nowrap; }
th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-alt); color: var(--ink); font-weight: 700; font-size: .82rem;
  border-bottom: 1px solid var(--border);
}
tbody tr:hover { background: var(--surface-alt); }
tr:last-child td { border-bottom: 0; }
.table-status.ng { color: var(--danger); font-weight: 700; }
.table-status.ok { color: var(--teal); font-weight: 700; }
.csv-button { min-height: 2.15rem; padding: .35rem .72rem; white-space: nowrap; font-size: .83rem; }
.buzzer-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-alt) 100%);
}

.login-page {
  position: relative; display: grid; place-items: center; min-height: 100dvh; padding: 1.25rem; overflow-x: hidden;
  background:
    radial-gradient(54rem 32rem at 14% 10%, rgba(16, 158, 136, .13), transparent 62%),
    radial-gradient(48rem 28rem at 88% 92%, rgba(25, 65, 88, .10), transparent 60%),
    #eaf1f4;
}
.login { width: min(100%, 26.5rem); padding: 1.8rem; }
.login h1 { margin-top: 1.15rem; }
.login form, .login label { display: grid; gap: .5rem; }
.login form { margin-top: 1.2rem; gap: .9rem; }
.login input, .login select, .account-card input:not([type="hidden"]), .account-card select {
  width: 100%; min-width: 0; min-height: 2.75rem; padding: .6rem .78rem;
  border: 1px solid var(--input-border); border-radius: var(--radius-sm);
  color: var(--ink); background: var(--input-bg);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.login input:focus, .login select:focus, .account-card input:focus, .account-card select:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(11, 122, 108, .16);
}
.password-wrap { position: relative; display: grid; }
.password-wrap input { padding-right: 2.9rem; }
.password-toggle {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  display: inline-grid; place-items: center; min-width: 2.05rem; min-height: 2.05rem;
  padding: .2rem; border: 0; border-radius: .38rem;
  background: transparent; color: var(--muted); font-size: .78rem; font-weight: 700;
  transition: background-color .14s ease, color .14s ease;
}
.password-toggle:hover { background: var(--teal-soft); color: var(--teal); }
.otp-input {
  text-align: center; letter-spacing: .3em; font-size: 1.28rem !important; font-weight: 750;
  font-variant-numeric: tabular-nums; padding-left: 1.05rem !important;
}
.auth-divider {
  display: flex; align-items: center; gap: .75rem; margin: 1.05rem 0 .8rem;
  color: var(--muted); font-size: .8rem; font-weight: 600;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.forgot-link { justify-self: end; color: var(--teal); font-size: .87rem; font-weight: 650; text-decoration: none; }
.forgot-link:hover { text-decoration: underline; }
.recovery-card { grid-column: 1 / -1; }
.contact-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .95rem 1.6rem; }
.contact-options button { align-self: end; }
.account-card .contact-verify { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.login .form-error { color: var(--danger); font-weight: 600; font-size: .88rem; }
.login > .button { margin-top: 1rem; }
.login-entry { padding: clamp(.85rem, 2.5vw, 1.8rem); }
.login-shell {
  display: grid; grid-template-columns: minmax(19rem, 1.02fr) minmax(0, .98fr);
  width: min(100%, 66rem); padding: .7rem; border-radius: 1.65rem;
  background: #ffffff; border: 1px solid rgba(19, 37, 48, .08);
  box-shadow: 0 24px 64px -16px rgba(14, 34, 48, .16);
}
.login-entry .login { width: 100%; max-width: 28rem; margin: auto; padding: clamp(1.35rem, 3vw, 2.3rem); }
.login-entry .login h1 { margin: 0 0 .38rem; }
.login-entry .login form { margin-top: 1.25rem; }
.login-entry .primary { min-height: 2.85rem; }
.login .entry-link { margin-top: 1.15rem; font-size: .91rem; text-align: center; }
.entry-link a { color: var(--teal); font-weight: 700; text-underline-offset: .16em; }
.field-help { color: var(--muted); font-size: .82rem; line-height: 1.38; }
.login-product {
  place-self: stretch; display: flex; flex-direction: column; justify-content: space-between;
  border-radius: 1.15rem; color: #f4fafa; overflow: hidden;
  background:
    radial-gradient(34rem 24rem at 90% 90%, rgba(16, 158, 136, .28), transparent 64%),
    radial-gradient(24rem 18rem at 15% 15%, rgba(91, 224, 194, .14), transparent 58%),
    linear-gradient(155deg, #0c1c26 0%, #142b39 58%, #0f2430 100%);
  padding: clamp(1.4rem, 3.2vw, 2.5rem);
}
.login-product-copy { width: 100%; margin-block: auto; padding-block: 1.4rem; }
.login-hero-frame {
  position: relative; padding: clamp(1.2rem, 2.6vw, 1.85rem);
  border-radius: 1rem; border: 1px solid rgba(160, 232, 212, .16);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04) 0%, rgba(11, 27, 36, .28) 100%);
}
.hero-corners {
  position: absolute; inset: .65rem; pointer-events: none;
  background:
    linear-gradient(#7ee3cb, #7ee3cb) 0 0 / 16px 2px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 0 0 / 2px 16px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 100% 0 / 16px 2px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 100% 0 / 2px 16px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 0 100% / 16px 2px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 0 100% / 2px 16px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 100% 100% / 16px 2px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 100% 100% / 2px 16px no-repeat;
  opacity: .55;
}
.hero-kicker {
  margin: 0 0 .6rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #7ee3cb;
}
.login-product h2 { max-width: 13ch; font-size: clamp(1.85rem, 3.35vw, 3.1rem); line-height: 1.07; letter-spacing: -.04em; color: #f6fbfb; }
.hero-highlights {
  margin: 1.15rem 0 0; padding: .95rem 0 0; list-style: none;
  border-top: 1px solid rgba(255, 255, 255, .12); display: grid; gap: .48rem;
  color: #c2d7df; font-size: .86rem; line-height: 1.4;
}
.hero-highlights li { display: flex; align-items: center; gap: .55rem; }
.hero-highlights li::before {
  content: ""; width: .42rem; height: .42rem; flex: none; border-radius: 50%;
  background: #69dfb9; box-shadow: 0 0 0 3px rgba(105, 223, 185, .18);
}

.notice { padding: .68rem .85rem; background: var(--teal-soft); border: 1px solid rgba(11, 122, 108, .28); border-radius: var(--radius-sm); color: var(--ink); font-size: .9rem; }
.notice.form-error { color: var(--danger); background: var(--danger-soft); border-color: rgba(180, 54, 48, .32); }
.account-top { gap: .8rem; }
.account-content { width: min(74rem, 100%); margin: 0 auto; padding: 1.85rem clamp(1rem, 4vw, 2.5rem) 3rem; }
.account-content > .notice { margin-bottom: .9rem; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .95rem; margin-bottom: .95rem; }
.account-card form, .account-card label { display: grid; gap: .5rem; }
.account-card form { margin-top: .85rem; gap: .8rem; }
.account-card button { justify-self: start; }
.account-card .password-toggle { justify-self: auto; }
.passkey-item { margin-top: .65rem; padding: .75rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); }
.passkey-item summary { cursor: pointer; line-height: 1.45; overflow-wrap: anywhere; font-weight: 550; }
.otp-qr { display: block; width: 11rem; height: 11rem; max-width: 100%; margin-top: .7rem; border-radius: .5rem; border: 1px solid var(--border); padding: .35rem; background: #fff; }
.otp-seed { display: block; overflow-wrap: anywhere; color: var(--teal); font-weight: 700; margin-top: .25rem; }

.face-login-box { margin-top: 0; }
.face-toggle {
  width: 100%; list-style: none;
  color: #0b6859; background: #edf8f5; border-color: #bee3d7;
}
.face-toggle:hover { background: #e1f4ee; border-color: #8ccdb9; }
.face-toggle::-webkit-details-marker { display: none; }
.face-panel-body { margin-top: .75rem; padding: .9rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); display: grid; gap: .7rem; }
.face-verify-block, .face-enroll-box { margin-top: .85rem; display: grid; gap: .65rem; }
.face-stage {
  position: relative; display: grid; place-items: center; min-height: 12.5rem;
  border-radius: .65rem; overflow: hidden;
  background: linear-gradient(180deg, #0e1c25 0%, #162b38 100%);
  border: 1px solid #243e4f;
}
.face-stage[data-active="true"] .face-placeholder { display: none; }
.face-placeholder { color: #a9bec9; font-size: .86rem; }
.face-video { display: block; width: 100%; max-height: 16rem; object-fit: cover; transform: scaleX(-1); }
.face-guide {
  position: absolute; inset: 12% 24%; pointer-events: none;
  background:
    linear-gradient(#7ee3cb, #7ee3cb) 0 0 / 20px 2.5px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 0 0 / 2.5px 20px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 100% 0 / 20px 2.5px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 100% 0 / 2.5px 20px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 0 100% / 20px 2.5px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 0 100% / 2.5px 20px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 100% 100% / 20px 2.5px no-repeat,
    linear-gradient(#7ee3cb, #7ee3cb) 100% 100% / 2.5px 20px no-repeat;
  opacity: .85;
}
.face-stage[data-active="false"] .face-guide { display: none; }
.face-camera-picker { display: grid; gap: .38rem; font-size: .85rem; color: var(--muted); font-weight: 600; }
.face-progress { width: 100%; height: .48rem; accent-color: var(--teal); }
.face-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.face-confirm { padding-top: .65rem; border-top: 1px solid var(--border); display: grid; gap: .55rem; }

.summary-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem; margin-bottom: .95rem; }
.summary-card { display: grid; gap: .25rem; }
.summary-card span { color: var(--muted); font-size: .84rem; font-weight: 600; }
.summary-card strong { font-size: 1.65rem; font-weight: 750; color: var(--ink); font-variant-numeric: tabular-nums; }
.account-search { min-width: 11rem; max-width: 15rem; min-height: 2.3rem !important; padding: .4rem .68rem !important; font-size: .86rem; }
.account-meta { color: var(--muted); font-size: .84rem; margin-top: .32rem; }
.status-dot { display: inline-block; width: .52rem; height: .52rem; border-radius: 50%; margin-right: .35rem; vertical-align: middle; background: #9db0ba; }
.status-dot.online { background: #0b8a6c; box-shadow: 0 0 0 3px rgba(11, 138, 108, .18); }
.danger-card { border-color: rgba(180, 54, 48, .35); }
.danger-button { color: var(--danger); border-color: rgba(180, 54, 48, .4); }
.danger-button:not(:disabled):hover { background: var(--danger-soft); border-color: var(--danger); }

@media (max-width: 1060px) {
  .shell { grid-template-columns: 12.8rem minmax(0, 1fr); }
  .tray-grid { gap: .32rem; padding: .65rem; }
  .metric { gap: .68rem; padding: .95rem; }
}

@media (max-width: 850px) {
  .shell { display: block; padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
  .sidebar { position: relative; height: auto; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: .55rem; padding: .7rem 1rem; }
  .sidebar > .brand { margin: 0; }
  .sidebar nav {
    position: fixed; z-index: 5; inset: auto 0 0;
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .25rem;
    padding: .28rem .5rem max(.4rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--topbar-bg); backdrop-filter: blur(12px);
    box-shadow: 0 -4px 16px rgba(14, 34, 48, .08);
  }
  .sidebar nav a { flex-direction: column; justify-content: center; gap: .22rem; min-height: 3.45rem; padding: .35rem .2rem; color: var(--muted); font-size: .81rem; text-align: center; }
  .sidebar nav a:hover, .sidebar nav a.nav-active { background: var(--teal-soft); color: var(--teal); box-shadow: none; }
  .sidebar nav a:focus-visible { outline-color: #0b8a79; outline-offset: -2px; }
  .sidebar-foot { margin: 0; padding: 0; border: 0; }
  .profile summary { padding: .32rem; }
  .profile summary::after { transform: rotate(45deg); margin-right: .2rem; }
  .profile-name { display: none; }
  .profile-menu { inset: calc(100% + .35rem) 0 auto auto; min-width: 12.5rem; }
  .profile-menu-caption { display: grid; gap: .1rem; padding: .55rem .72rem; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
  .profile-menu-caption small { color: var(--muted); }
  .content { padding-top: 1.35rem; }
  .login-shell { grid-template-columns: minmax(0, 1fr); }
  .hero-highlights { display: none; }
}

@media (max-width: 1020px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-panel .panel-heading { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .account-grid, .contact-options, .summary-strip { grid-template-columns: minmax(0, 1fr); }
  .live-summary { justify-items: start; }
  .intro { margin-bottom: 1.15rem; }
  .login-entry { padding: .65rem; }
  .login-shell { padding: .45rem; border-radius: 1.15rem; }
  .login-product { width: 100%; padding: .85rem 1rem; border-radius: .85rem; }
  .login-product-copy { width: 100%; padding: .35rem 0 0; }
  .login-hero-frame { padding: .85rem 1rem; }
  .hero-corners { display: none; }
  .login-product h2 { font-size: 1.35rem; max-width: none; }
  .login-entry .login { padding: 1.2rem .9rem 1.65rem; }
}

@media (max-width: 420px) {
  .topbar { min-height: 3.55rem; }
  .top-label { font-size: .82rem; }
  .top-actions { gap: .35rem; }
  .top-actions .button { min-height: 2.45rem; padding-inline: .6rem; font-size: .82rem; }
  .top-actions .pf-icon { display: none; }
  .content { padding-inline: .85rem; }
  .panel { padding: 1rem .9rem; }
  .metric-grid { gap: .65rem; }
  .metric { gap: .55rem; padding: .85rem .75rem; }
  .metric-icon { width: 2.2rem; height: 2.2rem; }
  .reading strong { font-size: 1.5rem; }
  .segmented { flex: 0 1 auto; flex-wrap: wrap; }
  .segmented button { min-height: 2.35rem; }
  th, td { padding-inline: .45rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .connection[data-state="online"] i { animation: none; }
  .metric, .button, .sidebar nav a { transition: none; }
}
