@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  color-scheme: light;
  --ink: #122320;
  --muted: #647570;
  --faint: #8b9a96;
  --line: #dbe5e1;
  --line-soft: #eaf0ee;
  --surface: #ffffff;
  --canvas: #f3f7f5;
  --deep: #092f2b;
  --deep-2: #0f413a;
  --brand: #116b5b;
  --brand-2: #1b8a74;
  --mint: #68e0bd;
  --mint-soft: #e0f8f0;
  --blue: #3979d6;
  --blue-soft: #e9f1ff;
  --amber: #d98e19;
  --amber-soft: #fff4dc;
  --red: #c34e52;
  --red-soft: #ffeded;
  --shadow-sm: 0 1px 2px rgba(9, 47, 43, .05), 0 6px 16px rgba(9, 47, 43, .04);
  --shadow-lg: 0 30px 70px rgba(3, 29, 26, .18);
  --sidebar: 258px;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.eyebrow { margin: 0 0 9px; color: var(--brand); font: 800 .72rem/1 'Manrope', sans-serif; letter-spacing: .14em; }
.eyebrow--light { color: var(--mint); }

/* Login */
.login-view { min-height: 100svh; display: grid; grid-template-columns: minmax(420px, 1.08fr) minmax(420px, .92fr); background: var(--surface); }
.login-brand { position: relative; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; min-height: 100svh; padding: clamp(34px, 5vw, 72px); color: #fff; background: radial-gradient(circle at 72% 35%, rgba(104, 224, 189, .14), transparent 31%), linear-gradient(145deg, #0b3b34 0%, #062622 72%); }
.login-brand::before { content: ''; position: absolute; inset: auto -14% -42% 24%; aspect-ratio: 1; border: 1px solid rgba(104, 224, 189, .15); border-radius: 50%; box-shadow: 0 0 0 90px rgba(104, 224, 189, .025), 0 0 0 180px rgba(104, 224, 189, .018); }
.brand-lockup { position: relative; display: flex; align-items: center; gap: 12px; font: 800 1.38rem/1 'Manrope', sans-serif; letter-spacing: -.04em; }
.brand-lockup--light { color: #fff; }
.brand-mark { display: inline-grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: var(--deep); background: var(--mint); box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.brand-mark svg { width: 30px; height: 30px; stroke-width: 3.1; }
.login-message { position: relative; z-index: 1; max-width: 610px; margin: auto 0; padding: 72px 0 110px; }
.login-message h1 { margin: 0; max-width: 600px; font: 800 clamp(3.1rem, 6vw, 5.6rem)/.98 'Manrope', sans-serif; letter-spacing: -.065em; }
.login-message > p:last-child { max-width: 500px; margin: 30px 0 0; color: rgba(238,255,250,.69); font-size: 1.05rem; line-height: 1.65; }
.signal-visual { position: absolute; right: -110px; bottom: -112px; width: 470px; height: 470px; }
.signal-visual i { position: absolute; inset: calc(var(--n, 0) * 46px); border: 1px solid rgba(104,224,189,.18); border-radius: 50%; animation: signal 4s ease-out infinite; }
.signal-visual i:nth-child(1) { --n: 0; }
.signal-visual i:nth-child(2) { --n: 1; animation-delay: .6s; }
.signal-visual i:nth-child(3) { --n: 2; animation-delay: 1.2s; }
.signal-visual i:nth-child(4) { --n: 3; animation-delay: 1.8s; }
.signal-visual span { position: absolute; inset: 208px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 34px rgba(104,224,189,.8); }
@keyframes signal { 0%, 100% { opacity: .35; transform: scale(.97); } 50% { opacity: .95; transform: scale(1.03); } }
.login-panel { display: grid; place-items: center; padding: clamp(24px, 6vw, 80px); }
.login-card { width: min(100%, 430px); }
.mobile-brand { display: none; align-items: center; gap: 12px; margin-bottom: 44px; color: var(--deep); font: 800 1.38rem/1 'Manrope', sans-serif; }
.login-card h2 { margin: 0; font: 800 clamp(2.2rem, 4vw, 3.1rem)/1.05 'Manrope', sans-serif; letter-spacing: -.05em; }
.login-caption { margin: 13px 0 36px; color: var(--muted); line-height: 1.5; }
.field { display: block; margin-top: 20px; }
.field > span:first-child { display: block; margin-bottom: 8px; font-size: .84rem; font-weight: 700; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap > svg { position: absolute; left: 15px; width: 20px; height: 20px; color: var(--faint); }
.input-wrap input { width: 100%; min-height: 54px; padding: 0 48px 0 47px; border: 1px solid var(--line); border-radius: 14px; outline: 0; color: var(--ink); background: #fbfdfc; transition: .2s ease; }
.input-wrap input:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 4px rgba(27,138,116,.1); }
.icon-button { display: inline-grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border: 1px solid var(--line); border-radius: 12px; color: var(--brand); background: var(--surface); cursor: pointer; transition: .2s ease; }
.icon-button:hover { border-color: #b9cec8; background: var(--mint-soft); }
.icon-button svg { width: 20px; height: 20px; }
.icon-button--inside { position: absolute; right: 7px; width: 40px; height: 40px; border: 0; background: transparent; }
.form-error { margin-top: 18px; padding: 11px 13px; border: 1px solid #f3c5c7; border-radius: 11px; color: #963a3e; background: var(--red-soft); font-size: .85rem; }
.primary-button, .secondary-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; gap: 9px; border-radius: 12px; font-weight: 700; cursor: pointer; transition: .2s ease; }
.primary-button { width: 100%; min-height: 55px; margin-top: 24px; padding: 0 20px; border: 1px solid var(--deep); color: #fff; background: var(--deep); box-shadow: 0 9px 22px rgba(9,47,43,.16); }
.primary-button:hover { background: #0d443d; transform: translateY(-1px); }
.primary-button:disabled { opacity: .65; cursor: wait; transform: none; }
.primary-button svg { width: 20px; height: 20px; }
.secondary-button { padding: 0 15px; border: 1px solid var(--line); color: var(--deep); background: var(--surface); }
.secondary-button:hover { border-color: #b6cbc5; background: var(--mint-soft); }
.secondary-button svg { width: 18px; height: 18px; }
.secure-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 24px 0 0; color: var(--faint); font-size: .76rem; }
.secure-note svg { width: 17px; height: 17px; }

/* Shell */
.app-shell { min-height: 100svh; }
.sidebar { position: fixed; z-index: 20; inset: 0 auto 0 0; display: flex; width: var(--sidebar); flex-direction: column; padding: 25px 17px 18px; color: rgba(242,255,251,.72); background: linear-gradient(180deg, #092f2b, #062622); }
.sidebar-brand { padding: 0 8px 28px; }
.side-nav { display: grid; gap: 5px; }
.nav-button { position: relative; display: flex; width: 100%; min-height: 47px; align-items: center; gap: 12px; padding: 0 13px; border: 0; border-radius: 12px; color: rgba(242,255,251,.65); background: transparent; text-align: left; font-weight: 600; cursor: pointer; transition: .2s ease; }
.nav-button::after { content: ''; position: absolute; left: -17px; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: transparent; }
.nav-button:hover { color: #fff; background: rgba(255,255,255,.055); }
.nav-button.is-active { color: #fff; background: rgba(104,224,189,.1); }
.nav-button.is-active::after { background: var(--mint); }
.nav-button svg { width: 21px; height: 21px; }
.nav-badge { min-width: 24px; margin-left: auto; padding: 3px 6px; border-radius: 99px; color: var(--deep); background: var(--mint); text-align: center; font-size: .68rem; font-weight: 800; }
.sidebar-foot { display: grid; gap: 12px; margin-top: auto; }
.live-card { display: flex; align-items: center; gap: 11px; margin: 0 4px; padding: 13px; border: 1px solid rgba(104,224,189,.12); border-radius: 13px; background: rgba(104,224,189,.055); }
.live-card span:last-child, .account-button > span:nth-child(2), .sync-status > span:last-child { min-width: 0; }
.live-card strong, .account-button strong, .sync-status strong { display: block; color: #fff; font-size: .76rem; }
.live-card small, .account-button small, .sync-status small { display: block; overflow: hidden; margin-top: 3px; color: rgba(237,255,250,.5); text-overflow: ellipsis; white-space: nowrap; font-size: .65rem; }
.live-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 5px rgba(104,224,189,.1); animation: livePulse 2.2s ease-in-out infinite; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 8px rgba(104,224,189,0); } }
.account-button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 10px 8px; border: 0; border-radius: 12px; color: rgba(255,255,255,.62); background: transparent; text-align: left; cursor: pointer; }
.account-button:hover { background: rgba(255,255,255,.05); }
.account-button .avatar { display: grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; border-radius: 11px; color: var(--deep); background: var(--mint); font-weight: 800; }
.account-button > span:nth-child(2) { flex: 1; }
.account-button > svg { width: 18px; height: 18px; }
.main-column { min-height: 100svh; margin-left: var(--sidebar); }
.topbar { position: relative; display: flex; min-height: 96px; align-items: center; justify-content: space-between; gap: 22px; padding: 20px clamp(22px, 3vw, 45px); border-bottom: 1px solid var(--line-soft); background: rgba(255,255,255,.92); backdrop-filter: blur(16px); }
.topbar h1 { margin: 0; font: 800 clamp(1.45rem, 2vw, 2rem)/1.1 'Manrope', sans-serif; letter-spacing: -.045em; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.sync-status { display: flex; align-items: center; gap: 11px; margin-right: 4px; padding-right: 16px; border-right: 1px solid var(--line); }
.sync-status strong { color: var(--brand); }
.sync-status small { max-width: 145px; color: var(--muted); }
.filter-bar { position: relative; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 13px clamp(22px, 3vw, 45px); border-bottom: 1px solid var(--line-soft); background: rgba(255,255,255,.96); }
.search-box { position: relative; display: flex; flex: 1 1 310px; max-width: 520px; align-items: center; }
.search-box > svg { position: absolute; left: 13px; width: 19px; height: 19px; color: var(--faint); }
.search-box input { width: 100%; min-height: 42px; padding: 0 58px 0 42px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #f9fbfa; font-size: .85rem; }
.search-box input:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(27,138,116,.08); }
.search-box kbd { position: absolute; right: 10px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--faint); background: #fff; font-size: .65rem; }
.segmented-control { display: inline-flex; flex: 0 0 auto; padding: 3px; border: 1px solid var(--line); border-radius: 11px; background: #f7faf9; }
.segmented-control button { min-height: 34px; padding: 0 10px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: .75rem; font-weight: 700; cursor: pointer; }
.segmented-control button.is-active { color: var(--deep); background: #fff; box-shadow: 0 1px 5px rgba(9,47,43,.1); }
.filter-bar select { max-width: 195px; min-height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: #fff; font-size: .78rem; }
.clear-button { min-height: 38px; padding: 0 7px; border: 0; color: var(--brand); background: transparent; font-size: .75rem; font-weight: 700; cursor: pointer; }
.content { width: min(100%, 1680px); margin: 0 auto; padding: 27px clamp(20px, 3vw, 44px) 55px; }

/* Dashboard components */
.page-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 2px 0 20px; }
.page-intro h2 { margin: 0; font: 800 clamp(1.25rem, 2vw, 1.65rem)/1.2 'Manrope', sans-serif; letter-spacing: -.035em; }
.page-intro p { margin: 7px 0 0; color: var(--muted); font-size: .84rem; }
.context-badge { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; font-size: .72rem; font-weight: 700; }
.context-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-2); }
.metrics-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric-card, .panel { border: 1px solid var(--line-soft); background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-card { position: relative; overflow: hidden; min-height: 148px; padding: 19px; border-radius: 16px; }
.metric-card::after { content: ''; position: absolute; right: -25px; bottom: -37px; width: 85px; height: 85px; border-radius: 50%; background: var(--tone-soft, var(--mint-soft)); opacity: .72; }
.metric-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.metric-icon { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 11px; color: var(--tone, var(--brand)); background: var(--tone-soft, var(--mint-soft)); }
.metric-icon svg { width: 20px; height: 20px; }
.metric-trend { display: inline-flex; align-items: center; gap: 4px; color: var(--brand); font-size: .69rem; font-weight: 800; }
.metric-value { margin: 16px 0 3px; font: 800 clamp(1.75rem, 2.8vw, 2.4rem)/1 'Manrope', sans-serif; letter-spacing: -.06em; }
.metric-label { color: var(--muted); font-size: .78rem; font-weight: 600; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(320px, .85fr); gap: 14px; margin-top: 14px; }
.dashboard-grid--equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { overflow: hidden; border-radius: 16px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 19px 20px 15px; }
.panel-heading h3 { margin: 0; font: 800 1rem/1.25 'Manrope', sans-serif; letter-spacing: -.025em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: .75rem; }
.panel-heading select { max-width: 250px; min-height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #fff; font-size: .72rem; }
.panel-action { border: 0; color: var(--brand); background: transparent; font-size: .72rem; font-weight: 800; cursor: pointer; }
.panel-body { padding: 0 20px 20px; }
.chart-shell { position: relative; min-height: 255px; padding-top: 12px; }
.trend-chart { width: 100%; height: 250px; overflow: visible; }
.trend-chart .grid { stroke: #e7eeeb; stroke-width: 1; }
.trend-chart .area { fill: url(#areaGradient); stroke: none; }
.trend-chart .line { fill: none; stroke: var(--brand-2); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.trend-chart .point { fill: #fff; stroke: var(--brand-2); stroke-width: 2.5; }
.trend-chart text { fill: var(--faint); font: 11px 'DM Sans'; }
.chart-total { display: flex; align-items: baseline; gap: 8px; padding: 0 20px; }
.chart-total strong { font: 800 1.65rem/1 'Manrope'; letter-spacing: -.04em; }
.chart-total span { color: var(--muted); font-size: .76rem; }
.bar-list { display: grid; gap: 16px; }
.bar-row { display: grid; gap: 7px; }
.bar-meta { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: .78rem; }
.bar-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-meta span { flex: 0 0 auto; color: var(--muted); font-weight: 700; }
.bar-track { height: 8px; overflow: hidden; border-radius: 99px; background: #edf2f0; }
.bar-fill { height: 100%; min-width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #3cbf9d); transition: width .4s ease; }
.bar-row:nth-child(2n) .bar-fill { background: linear-gradient(90deg, #3979d6, #6aa2ee); }
.bar-row:nth-child(3n) .bar-fill { background: linear-gradient(90deg, #c57f17, #eba944); }
.bar-row:nth-child(4n) .bar-fill { background: linear-gradient(90deg, #8057b6, #a781d6); }
.panel-footnote { margin: 15px 0 0; padding-top: 13px; border-top: 1px solid var(--line-soft); color: var(--faint); font-size: .68rem; line-height: 1.5; }
.status-list, .ranking-list { display: grid; }
.status-row, .ranking-row { display: flex; align-items: center; gap: 12px; min-height: 59px; border-top: 1px solid var(--line-soft); }
.status-row:first-child, .ranking-row:first-child { border-top: 0; }
.status-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--faint); }
.status-dot.online { background: #2ebc91; box-shadow: 0 0 0 5px #e4f8f1; }
.status-dot.warning { background: var(--amber); box-shadow: 0 0 0 5px var(--amber-soft); }
.status-dot.offline { background: #a4afac; box-shadow: 0 0 0 5px #f0f3f2; }
.status-copy { min-width: 0; flex: 1; }
.status-copy strong, .ranking-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.status-copy small, .ranking-copy small { display: block; margin-top: 3px; color: var(--faint); font-size: .67rem; }
.status-side { text-align: right; }
.status-side strong { display: block; font-size: .71rem; }
.status-side small { color: var(--faint); font-size: .64rem; }
.rank-number { display: grid; flex: 0 0 auto; width: 28px; height: 28px; place-items: center; border-radius: 9px; color: var(--brand); background: var(--mint-soft); font-size: .72rem; font-weight: 800; }
.ranking-copy { min-width: 0; flex: 1; }
.ranking-value { font: 800 1rem/1 'Manrope'; }

/* Results */
.question-toolbar { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 13px; margin-bottom: 14px; }
.control-card { display: flex; align-items: center; gap: 12px; min-height: 68px; padding: 11px 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.control-card > svg { width: 22px; height: 22px; color: var(--brand); }
.control-card label { display: grid; flex: 1; gap: 3px; color: var(--faint); font-size: .67rem; font-weight: 800; letter-spacing: .05em; }
.control-card select { min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .82rem; font-weight: 700; }
.result-summary { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(290px, .5fr); gap: 14px; }
.hero-result { position: relative; overflow: hidden; padding: 24px; color: #fff; border-radius: 16px; background: linear-gradient(130deg, #0a3a34, #116b5b); box-shadow: var(--shadow-sm); }
.hero-result::after { content: ''; position: absolute; width: 250px; height: 250px; right: -110px; bottom: -170px; border: 45px solid rgba(104,224,189,.12); border-radius: 50%; }
.hero-result .eyebrow { color: var(--mint); }
.hero-result h3 { max-width: 650px; margin: 0; font: 800 clamp(1.35rem, 2.7vw, 2rem)/1.2 'Manrope'; letter-spacing: -.04em; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 24px; margin-top: 29px; }
.hero-stat strong { display: block; font: 800 1.65rem/1 'Manrope'; }
.hero-stat small { display: block; margin-top: 5px; color: rgba(255,255,255,.6); font-size: .7rem; }
.cross-table-wrap { overflow: auto; max-height: 570px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; white-space: nowrap; }
.data-table th { position: sticky; z-index: 1; top: 0; color: var(--muted); background: #f7faf9; font-size: .66rem; letter-spacing: .04em; text-transform: uppercase; }
.data-table td strong { font-weight: 700; }
.data-table tbody tr:hover { background: #f8fbfa; }
.cell-bar { display: inline-block; min-width: 55px; margin-right: 7px; }
.cell-bar i { display: block; height: 5px; border-radius: 10px; background: var(--brand-2); }

/* Field & map */
.field-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(320px, .65fr); gap: 14px; }
.map-panel { min-height: 620px; }
#map { height: 560px; background: #e8efec; }
.leaflet-container { font-family: 'DM Sans', sans-serif; }
.map-legend { display: flex; align-items: center; gap: 14px; padding: 12px 17px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: .68rem; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.map-legend i { width: 8px; height: 8px; border-radius: 50%; }
.device-marker { display: grid; width: 34px !important; height: 34px !important; place-items: center; border: 3px solid #fff; border-radius: 12px 12px 12px 3px; color: #fff; background: var(--brand); box-shadow: 0 4px 13px rgba(9,47,43,.28); transform: rotate(-45deg); }
.device-marker span { transform: rotate(45deg); font-size: 13px; font-weight: 800; }
.device-marker.offline { background: #84918d; }
.interview-marker { width: 11px !important; height: 11px !important; border: 2px solid #fff; border-radius: 50%; background: #3979d6; box-shadow: 0 1px 6px rgba(31,74,130,.35); }
.device-detail-list { display: grid; gap: 10px; padding: 0 16px 17px; }
.device-card { padding: 14px; border: 1px solid var(--line-soft); border-radius: 13px; background: #fff; }
.device-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.device-card h4 { margin: 0; font-size: .83rem; }
.device-card p { margin: 4px 0 0; color: var(--muted); font-size: .68rem; }
.device-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pill { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 0 8px; border-radius: 8px; color: var(--muted); background: #f1f5f3; font-size: .63rem; font-weight: 700; }
.pill--good { color: #087256; background: var(--mint-soft); }
.pill--warn { color: #9a640b; background: var(--amber-soft); }
.empty-map { display: grid; min-height: 540px; place-items: center; padding: 25px; color: var(--muted); text-align: center; }

/* Interviews */
.table-panel { overflow: hidden; }
.table-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-soft); }
.table-summary strong { font-size: .83rem; }
.table-summary span { color: var(--muted); font-size: .7rem; }
.interview-table-wrap { overflow: auto; max-height: calc(100svh - 300px); min-height: 430px; }
.location-link { border: 0; color: var(--brand); background: transparent; font-size: .72rem; font-weight: 700; cursor: pointer; }
.status-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; color: #087256; background: var(--mint-soft); font-size: .65rem; font-weight: 800; }
.status-tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #2ebc91; }
.mobile-cards { display: none; }

/* Administration */
.compatibility-banner { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 15px; padding: 16px 18px; border: 1px solid #bce8da; border-radius: 15px; color: #0b5f4e; background: linear-gradient(110deg, #e9fbf5, #f7fffc); box-shadow: var(--shadow-sm); }
.compatibility-icon { display: grid; flex: 0 0 auto; width: 39px; height: 39px; place-items: center; border-radius: 11px; color: #087256; background: #c9f3e5; }
.compatibility-icon svg { width: 21px; height: 21px; }
.compatibility-banner strong { display: block; font: 800 .88rem/1.3 'Manrope'; }
.compatibility-banner p { margin: 5px 0 0; color: #49746a; font-size: .76rem; line-height: 1.55; }
.admin-tabs { display: inline-flex; gap: 4px; margin-bottom: 15px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: #eaf1ee; }
.admin-tabs button { display: inline-flex; min-height: 39px; align-items: center; gap: 8px; padding: 0 14px; border: 0; border-radius: 9px; color: var(--muted); background: transparent; font-size: .77rem; font-weight: 800; cursor: pointer; }
.admin-tabs button svg { width: 18px; height: 18px; }
.admin-tabs button.is-active { color: var(--deep); background: #fff; box-shadow: 0 2px 8px rgba(9,47,43,.09); }
.admin-workspace { display: grid; grid-template-columns: minmax(250px, 310px) minmax(0, 1fr); align-items: start; gap: 14px; }
.survey-list-panel { position: sticky; top: 14px; max-height: calc(100svh - 170px); overflow: hidden; }
.admin-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px; border-bottom: 1px solid var(--line-soft); }
.admin-panel-head strong, .admin-panel-head small { display: block; }
.admin-panel-head strong { font: 800 .9rem/1.2 'Manrope'; }
.admin-panel-head small { margin-top: 3px; color: var(--faint); font-size: .67rem; }
.mini-icon-button { display: inline-grid; flex: 0 0 auto; width: 36px; height: 36px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--brand); background: #fff; cursor: pointer; }
.mini-icon-button svg { width: 17px; height: 17px; }
.survey-list { max-height: calc(100svh - 250px); overflow: auto; padding: 7px; }
.survey-list-item { display: block; width: 100%; margin: 0; padding: 12px; border: 1px solid transparent; border-radius: 11px; color: var(--ink); background: transparent; text-align: left; cursor: pointer; }
.survey-list-item:hover { background: #f6faf8; }
.survey-list-item.is-selected { border-color: #bce6da; background: var(--mint-soft); }
.survey-list-item strong, .survey-list-item small { display: block; }
.survey-list-item strong { overflow: hidden; margin: 8px 0 4px; text-overflow: ellipsis; white-space: nowrap; font-size: .77rem; }
.survey-list-item small { color: var(--muted); font-size: .63rem; line-height: 1.4; }
.status-badge { display: inline-flex; min-height: 22px; align-items: center; padding: 0 8px; border-radius: 7px; color: var(--muted); background: #edf2f0; font-size: .61rem; font-weight: 800; letter-spacing: .02em; }
.status-badge--active { color: #087256; background: var(--mint-soft); }
.status-badge--draft { color: #97600c; background: var(--amber-soft); }
.status-badge--archived { color: #687571; background: #edf1f0; }
.survey-editor-panel { min-width: 0; }
.survey-hero { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 18px 25px; padding: 22px; }
.survey-hero-main { min-width: 0; flex: 1 1 100%; }
.survey-status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--faint); font-size: .66rem; font-weight: 700; }
.survey-hero h3 { margin: 13px 0 6px; font: 800 clamp(1.25rem, 2.3vw, 1.8rem)/1.2 'Manrope'; letter-spacing: -.04em; }
.survey-hero p { max-width: 800px; margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.survey-stats { display: flex; gap: 20px; margin-top: 17px; }
.survey-stats span { color: var(--muted); font-size: .69rem; }
.survey-stats strong { margin-right: 4px; color: var(--ink); font: 800 1rem 'Manrope'; }
.survey-actions { display: flex; min-width: 0; flex: 1 1 100%; align-items: stretch; justify-content: flex-end; gap: 8px; }
.survey-actions svg, .compact-primary svg, .template-actions svg { width: 17px; height: 17px; }
.compact-primary { width: auto; min-height: 44px; margin: 0; padding: 0 15px; }
.inline-notice { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: #fff; font-size: .7rem; }
.inline-notice strong { color: var(--ink); }
.inline-notice--green { border-color: #c8eadf; color: #49746a; background: #f1fcf8; }
.inline-notice--green strong { color: #087256; }
.question-list-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin: 23px 2px 12px; }
.question-list-head h3 { margin: 0; font: 800 1.08rem 'Manrope'; }
.question-list-head p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; }
.question-filters, .template-toolbar { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.admin-search { position: relative; display: flex; min-width: 0; flex: 1; align-items: center; }
.admin-search svg { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--faint); }
.admin-search input, .question-filters select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 11px; outline: 0; background: #fff; font-size: .78rem; }
.admin-search input { padding: 0 13px 0 40px; }
.question-filters select { width: 180px; padding: 0 10px; }
.admin-search input:focus, .question-filters select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(27,138,116,.08); }
.question-list { display: grid; gap: 9px; }
.question-item { display: flex; align-items: flex-start; gap: 13px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 14px; background: #fff; box-shadow: var(--shadow-sm); }
.question-order { display: grid; flex: 0 0 auto; width: 31px; height: 31px; place-items: center; border-radius: 9px; color: var(--brand); background: var(--mint-soft); font-size: .72rem; font-weight: 800; }
.question-copy { min-width: 0; flex: 1; }
.question-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.question-tags span { padding: 3px 6px; border-radius: 6px; color: var(--muted); background: #f0f4f2; font-size: .57rem; font-weight: 800; }
.question-copy h4 { margin: 8px 0 0; font-size: .84rem; line-height: 1.4; }
.question-copy p { margin: 4px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.question-meta { margin-top: 7px; color: var(--faint); font-size: .63rem; line-height: 1.45; }
.question-actions { display: flex; flex: 0 0 auto; gap: 4px; }
.question-actions button { display: grid; width: 32px; height: 32px; place-items: center; border: 1px solid var(--line-soft); border-radius: 9px; color: var(--muted); background: #fff; cursor: pointer; }
.question-actions button:hover { color: var(--brand); border-color: #bde2d8; background: var(--mint-soft); }
.question-actions button svg { width: 15px; height: 15px; }
.danger-icon { color: var(--red) !important; }
.draft-foot { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 18px; padding: 12px 4px; color: var(--faint); font-size: .66rem; }
.text-danger-button { padding: 4px; border: 0; color: var(--red); background: transparent; font-size: .7rem; font-weight: 800; cursor: pointer; }
.empty-admin { display: grid; min-height: 220px; place-items: center; align-content: center; gap: 5px; padding: 25px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.empty-admin strong { color: var(--ink); font: 800 .9rem 'Manrope'; }
.empty-admin span { font-size: .72rem; }
.template-toolbar .admin-search { max-width: 620px; }
.template-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; color: var(--muted); font-size: .7rem; }
.template-summary strong { color: var(--ink); }
.template-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.template-card { display: flex; min-height: 240px; flex-direction: column; padding: 17px; }
.template-card-top { display: flex; align-items: center; justify-content: space-between; }
.template-icon { display: grid; width: 37px; height: 37px; place-items: center; border-radius: 10px; color: var(--brand); background: var(--mint-soft); }
.template-icon svg { width: 19px; height: 19px; }
.template-card h3 { margin: 15px 0 6px; font: 800 .9rem/1.35 'Manrope'; }
.template-card p { display: -webkit-box; overflow: hidden; margin: 0; color: var(--muted); font-size: .69rem; line-height: 1.5; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.template-metrics { display: flex; align-items: baseline; gap: 5px; margin-top: auto; padding-top: 17px; color: var(--faint); font-size: .66rem; }
.template-metrics strong { color: var(--ink); font: 800 1.25rem 'Manrope'; }
.template-actions { display: flex; gap: 7px; margin-top: 12px; }
.template-actions .secondary-button { min-height: 38px; font-size: .7rem; }
.admin-loading { min-height: 300px; }

/* Administration dialogs */
.admin-dialog { width: min(760px, calc(100vw - 28px)); max-height: min(900px, calc(100svh - 28px)); padding: 0; border: 0; border-radius: 19px; color: var(--ink); background: #fff; box-shadow: 0 30px 90px rgba(3,29,26,.3); }
.admin-dialog::backdrop { background: rgba(4,28,25,.58); backdrop-filter: blur(4px); }
.dialog-card { display: flex; max-height: min(900px, calc(100svh - 28px)); flex-direction: column; }
.dialog-head { display: flex; flex: 0 0 auto; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 22px 24px 17px; border-bottom: 1px solid var(--line-soft); }
.dialog-head h2 { margin: 0; font: 800 1.35rem/1.2 'Manrope'; letter-spacing: -.035em; }
.dialog-head p:last-child { margin: 6px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.45; }
.dialog-close { display: grid; flex: 0 0 auto; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: #fff; font-size: 1.4rem; cursor: pointer; }
.dialog-body { overflow: auto; padding: 20px 24px 24px; }
.dialog-actions { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: 9px; padding: 14px 24px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-soft); background: #fafcfb; }
.dialog-actions .primary-button { width: auto; min-height: 46px; margin: 0; }
.dialog-actions .secondary-button { min-height: 46px; }
.dialog-actions .danger-button { border-color: #a93d42; background: #a93d42; }
.form-stack { display: grid; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.admin-field { display: grid; gap: 7px; color: var(--ink); font-size: .75rem; font-weight: 700; }
.admin-field span em { color: var(--faint); font-style: normal; font-weight: 500; }
.admin-field input, .admin-field textarea, .admin-field select, .package-loader select { width: 100%; min-height: 45px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; outline: 0; color: var(--ink); background: #fbfdfc; font-size: .8rem; font-weight: 500; resize: vertical; }
.admin-field input:focus, .admin-field textarea:focus, .admin-field select:focus, .package-loader select:focus { border-color: var(--brand-2); background: #fff; box-shadow: 0 0 0 3px rgba(27,138,116,.08); }
.admin-field small { color: var(--faint); font-size: .64rem; font-weight: 500; line-height: 1.45; }
.check-field { display: flex; align-items: flex-start; gap: 10px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 11px; background: #f8fbfa; cursor: pointer; }
.check-field input { width: 18px; height: 18px; accent-color: var(--brand); }
.check-field strong, .check-field small { display: block; }
.check-field strong { font-size: .76rem; }
.check-field small { margin-top: 3px; color: var(--muted); font-size: .65rem; }
.editor-section { display: grid; gap: 11px; padding: 15px; border: 1px solid var(--line-soft); border-radius: 13px; }
.editor-section-head strong, .editor-section-head small { display: block; }
.editor-section-head strong { font: 800 .8rem 'Manrope'; }
.editor-section-head small { margin-top: 3px; color: var(--muted); font-size: .65rem; line-height: 1.4; }
.editor-safety-note { display: grid; gap: 3px; padding: 10px 12px; border: 1px solid #f0d69f; border-radius: 10px; color: #79520f; background: var(--amber-soft); }
.editor-safety-note strong { font-size: .7rem; }
.editor-safety-note span { font-size: .65rem; line-height: 1.45; }
.package-loader { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.package-loader .secondary-button { min-height: 45px; }
.code-textarea { min-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; font-size: .72rem !important; line-height: 1.55; white-space: pre; }
.confirmation-box { padding: 16px; border: 1px solid #f0d2d4; border-radius: 12px; color: #874247; background: var(--red-soft); font-size: .75rem; line-height: 1.5; }

/* Loading, errors, toasts */
.loading-state, .empty-state { display: grid; min-height: 420px; place-items: center; align-content: center; gap: 9px; color: var(--muted); text-align: center; }
.loading-state strong, .empty-state strong { color: var(--ink); font: 800 1rem 'Manrope'; }
.loading-state small, .empty-state small { max-width: 380px; line-height: 1.5; }
.spinner { width: 34px; height: 34px; margin-bottom: 5px; border: 3px solid #d8e8e3; border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; z-index: 1000; right: 18px; bottom: 18px; display: grid; gap: 8px; }
.toast { display: flex; width: min(360px, calc(100vw - 36px)); align-items: center; gap: 10px; padding: 13px 15px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; color: #fff; background: #0b322e; box-shadow: var(--shadow-lg); font-size: .8rem; animation: toastIn .25s ease both; }
.toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--mint); }
.toast > span { display: grid; min-width: 0; gap: 3px; }
.toast strong { font: 800 .78rem/1.25 'Manrope'; }
.toast > span > span { color: rgba(255,255,255,.76); font-size: .7rem; line-height: 1.4; }
.toast.error::before { background: #ff8c90; }
.toast.warning::before { background: #ffc45d; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.mobile-nav { display: none; }

@media (max-width: 1180px) {
  :root { --sidebar: 224px; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filter-bar { flex-wrap: wrap; }
  .search-box { max-width: none; }
  .dashboard-grid, .field-grid { grid-template-columns: 1fr; }
  .device-detail-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-panel { min-height: auto; }
  .result-summary { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .login-view { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-panel { min-height: 100svh; padding: 32px 22px; background: radial-gradient(circle at 90% 0, rgba(104,224,189,.13), transparent 34%), #fff; }
  .mobile-brand { display: flex; }
  .sidebar { display: none; }
  .main-column { margin-left: 0; padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 82px; padding: 17px 18px; }
  .topbar .eyebrow { margin-bottom: 7px; }
  .topbar h1 { font-size: 1.3rem; }
  .sync-status, .top-actions .secondary-button span { display: none; }
  .top-actions .secondary-button { width: 42px; padding: 0; }
  .filter-bar { position: sticky; top: 0; overflow-x: auto; flex-wrap: nowrap; padding: 10px 16px; box-shadow: 0 5px 16px rgba(9,47,43,.04); scrollbar-width: none; }
  .filter-bar::-webkit-scrollbar { display: none; }
  .search-box { flex: 0 0 min(78vw, 360px); }
  .search-box kbd { display: none; }
  .filter-bar select { flex: 0 0 auto; max-width: 190px; }
  .content { padding: 20px 15px 34px; }
  .page-intro { align-items: flex-start; }
  .context-badge { display: none; }
  .mobile-nav { position: fixed; z-index: 50; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, 1fr); min-height: calc(64px + env(safe-area-inset-bottom)); padding: 7px 7px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.97); box-shadow: 0 -10px 25px rgba(9,47,43,.07); backdrop-filter: blur(18px); }
  .mobile-nav .nav-button { display: grid; min-height: 53px; place-items: center; align-content: center; gap: 3px; padding: 3px; color: var(--muted); text-align: center; font-size: .62rem; }
  .mobile-nav .nav-button svg { width: 20px; height: 20px; }
  .mobile-nav .nav-button::after { inset: auto 25% -7px; width: 50%; height: 3px; border-radius: 4px 4px 0 0; }
  .mobile-nav .nav-button.is-active { color: var(--brand); background: transparent; }
  .mobile-nav .nav-button.is-active::after { background: var(--brand); }
  .mobile-nav .nav-badge { position: absolute; top: 1px; left: calc(50% + 7px); min-width: 18px; padding: 2px 5px; color: #fff; background: var(--red); }
  .question-toolbar { grid-template-columns: 1fr; }
  .device-detail-list { grid-template-columns: 1fr; }
  .admin-workspace { grid-template-columns: 1fr; }
  .survey-list-panel { position: static; max-height: none; }
  .survey-list { display: flex; max-height: none; overflow-x: auto; padding: 8px; scroll-snap-type: x mandatory; }
  .survey-list-item { min-width: min(78vw, 280px); scroll-snap-align: start; }
  .survey-hero { align-items: flex-start; flex-direction: column; }
  .survey-actions { width: 100%; }
  .survey-actions .primary-button, .survey-actions .secondary-button { flex: 1; }
  .template-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .survey-actions { flex-direction: column; }
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .metric-card { min-height: 132px; padding: 15px; border-radius: 14px; }
  .metric-icon { width: 34px; height: 34px; }
  .metric-value { margin-top: 14px; font-size: 1.65rem; }
  .metric-label { font-size: .7rem; }
  .metric-trend { display: none; }
  .dashboard-grid--equal { grid-template-columns: 1fr; }
  .panel-heading { padding: 16px 15px 13px; }
  .panel-heading select { max-width: 48%; }
  .panel-body { padding: 0 15px 17px; }
  .chart-shell { min-height: 215px; }
  .trend-chart { height: 210px; }
  .field-grid { display: block; }
  .field-grid > .panel + .panel { margin-top: 12px; }
  #map { height: 460px; }
  .map-legend { flex-wrap: wrap; }
  .interview-table-wrap { display: none; }
  .mobile-cards { display: grid; gap: 10px; padding: 12px; }
  .interview-card { padding: 14px; border: 1px solid var(--line-soft); border-radius: 13px; background: #fff; }
  .interview-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
  .interview-card h4 { margin: 0; font-size: .84rem; }
  .interview-card p { margin: 4px 0 0; color: var(--muted); font-size: .68rem; }
  .interview-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line-soft); }
  .interview-card-grid span { color: var(--faint); font-size: .62rem; }
  .interview-card-grid strong { display: block; margin-top: 3px; color: var(--ink); font-size: .71rem; }
  .table-summary { align-items: flex-start; flex-direction: column; }
  .hero-result { padding: 20px; }
  .hero-stats { gap: 18px; }
  .compatibility-banner { padding: 14px; }
  .compatibility-banner p { font-size: .7rem; }
  .admin-tabs { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
  .admin-tabs button { justify-content: center; padding: 0 8px; font-size: .68rem; }
  .question-list-head { align-items: flex-start; }
  .question-list-head .compact-primary { min-width: 44px; overflow: hidden; white-space: nowrap; }
  .question-filters, .template-toolbar { align-items: stretch; flex-direction: column; }
  .question-filters select, .template-toolbar .admin-search { width: 100%; max-width: none; }
  .template-toolbar .compact-primary { width: 100%; }
  .question-item { position: relative; padding-bottom: 53px; }
  .question-actions { position: absolute; right: 12px; bottom: 10px; }
  .template-summary { align-items: flex-start; flex-direction: column; }
  .template-grid { grid-template-columns: 1fr; }
  .template-card { min-height: 215px; }
  .inline-notice { align-items: flex-start; flex-direction: column; }
  .draft-foot { align-items: flex-start; flex-direction: column-reverse; }
  .admin-dialog { width: 100vw; max-width: none; max-height: calc(100svh - 10px); margin: 10px 0 0; border-radius: 20px 20px 0 0; }
  .dialog-card { max-height: calc(100svh - 10px); }
  .dialog-head, .dialog-body { padding-right: 17px; padding-left: 17px; }
  .dialog-actions { padding-right: 17px; padding-left: 17px; }
  .dialog-actions .primary-button, .dialog-actions .secondary-button { flex: 1; padding: 0 10px; }
  .form-grid { grid-template-columns: 1fr; }
  .package-loader { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
