@import url("/robot_video.css");
/* Ptero workspace: shared system type, graphite surfaces and warm-gold actions.
   Robot status and navigation retain their semantic colours. */
@import "./theme.css";

/* The monitoring workspace follows the Robotaxi reference: a quiet dark map,
   a docked information sheet, and restrained warm-gold selection. */
.monitor-page .facts-strip { grid-template-columns:repeat(4,minmax(0,1fr)); border:0; background:transparent; margin-bottom:22px; overflow:visible; }
.monitor-page .facts-strip > div { padding:0 24px; gap:3px; border-color:var(--border); }
.monitor-page .facts-strip > div:first-child { padding-left:0; }
.monitor-page .facts-strip span { font-size:var(--text-label); font-weight:500; color:var(--muted); }
.monitor-page .facts-strip b { font-size:28px; font-weight:550; letter-spacing:-.04em; }
.monitor-page .facts-strip b small { margin-left:5px; font-size:var(--text-label); letter-spacing:0; color:var(--muted); }
.monitor-page .monitor-grid { display:flex; flex-direction:column; gap:24px; }
.monitor-page .monitor-column { gap:12px; }
.monitor-page .fleet-map { border-color:var(--border); }
.monitor-page .fleet-map .card-head { padding:18px 22px; gap:12px; }
.monitor-page .fleet-map-title { display:flex; flex-direction:column; gap:3px; min-width:0; }
.monitor-page .eyebrow { color:var(--primary); font-size:var(--text-micro); font-weight:650; letter-spacing:.1em; }
.monitor-page .fleet-map-meta { font-size:17px; font-weight:600; overflow-wrap:anywhere; }
.monitor-page .fleet-map-note { font-size:var(--text-micro); color:var(--faint); }
.monitor-page .fleet-map-stage { display:grid; grid-template-columns:minmax(0,1fr) 350px; position:relative; background:var(--night-surface); border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
.monitor-page .fleet-map-host { width:100%; height:clamp(470px,58vh,650px); border:0; }
.monitor-page .fleet-map .fleet-map-canvas { width:100%; height:100%; }
.monitor-page .fleet-map-overlay { position:absolute; top:18px; left:20px; right:370px; display:flex; justify-content:space-between; pointer-events:none; }
.monitor-page .fleet-map-view,.monitor-page .fleet-map-compass { padding:7px 12px; border:1px solid #44484a; border-radius:10px; background:#1e2123df; color:#ced2d4; font-size:var(--text-micro); backdrop-filter:blur(14px); }
.monitor-page .fleet-map-tools { position:absolute; bottom:20px; left:20px; display:flex; align-items:center; gap:4px; padding:5px; border:1px solid #44484a; border-radius:13px; background:#1e2123e8; backdrop-filter:blur(16px); box-shadow:0 4px 18px #0004; }
.monitor-page .fleet-map .btn.small { height:36px; min-height:36px; padding:0 11px; font-size:var(--text-label); }
.monitor-page .fleet-map-tools .btn { border-color:transparent; background:transparent; }
.monitor-page .fleet-map-tools .btn.active { background:#494033; color:#ecd4aa; }
.monitor-page .fleet-select { height:36px; padding:0 8px; border:0; background:transparent; color:#c7cdcf; font-size:var(--text-label); }
.monitor-page .tool-divider { height:20px; width:1px; background:#45494d; margin:0 4px; }
.monitor-page .fleet-legend { padding:12px 20px; font-size:var(--text-micro); align-items:center; }
.monitor-page .fleet-navigation { display:flex; flex-direction:column; padding:16px; border-left:1px solid var(--border); background:var(--surface); min-width:0; }
.monitor-page .fleet-view-tabs { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; padding:4px; border:1px solid var(--line); border-radius:11px; background:var(--panel); }
.monitor-page .fleet-view-tabs button { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; padding:8px 2px; border:0; border-radius:7px; background:transparent; color:var(--muted); font-size:var(--text-micro); white-space:normal; line-height:1.25; }
.monitor-page .fleet-view-tabs small { font-size:9px; color:#9e9585; }
.monitor-page .fleet-view-tabs button[aria-pressed=true] { background:linear-gradient(110deg,#a88a56,#d5bd96); color:#141516; font-weight:700; }
.monitor-page .fleet-view-tabs button[aria-pressed=true] small { color:#443927; }
.monitor-page .fleet-categories { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:6px; margin:14px 0; }
.monitor-page .fleet-category { display:flex; flex-direction:column; align-items:center; gap:7px; padding:0; border:0; background:transparent; color:var(--muted); }
.monitor-page .fleet-category > span { display:grid; place-items:center; width:42px; height:42px; border-radius:50%; background:var(--panel); border:1px solid var(--line); }
.monitor-page .fleet-category svg { width:19px; height:19px; stroke:currentColor; fill:none; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.monitor-page .fleet-category b { font-size:var(--text-micro); font-weight:500; line-height:1.25; }
.monitor-page .fleet-category[aria-pressed=true] { color:var(--primary); }
.monitor-page .fleet-category[aria-pressed=true] > span { background:var(--primary-soft); border-color:#66563e; }
.monitor-page .fleet-navigation-body { min-width:0; display:flex; flex-direction:column; gap:12px; }
.monitor-page .fleet-trip-head h3 { margin:0; font-size:20px; font-weight:600; letter-spacing:-.03em; overflow-wrap:anywhere; }
.monitor-page .fleet-overview-robots { display:flex; flex-direction:column; margin:0; }
.monitor-page .fleet-overview-robots button { display:grid; grid-template-columns:54px minmax(0,1fr) auto; align-items:center; gap:12px; border:0; border-bottom:1px solid var(--border); background:transparent; padding:12px 0; text-align:left; }
.monitor-page .fleet-overview-robots button > span:nth-child(2) { display:flex; flex-direction:column; gap:4px; min-width:0; }
.monitor-page .fleet-overview-robots b { font-size:var(--text-label); font-weight:600; overflow-wrap:anywhere; }
.monitor-page .fleet-overview-robots small { color:var(--muted); font-size:var(--text-micro); overflow-wrap:anywhere; }
.monitor-page .monitor-robot-artwork { display:block; width:54px; height:48px; border-radius:10px; overflow:hidden; background:#282521; flex-shrink:0; }
.monitor-page .monitor-robot-artwork img { display:block; width:100%; height:100%; object-fit:cover; object-position:center 70%; }
.monitor-page .fleet-trip-head { display:flex; gap:12px; align-items:center; justify-content:space-between; }
.monitor-page .fleet-trip-head p { margin:7px 0 0; color:var(--primary); font-size:var(--text-label); }
.monitor-page .trip-artwork { width:92px; height:80px; }
.monitor-page .fleet-trip-progress { margin:0; }
.monitor-page .fleet-trip-progress > div { display:flex; align-items:baseline; justify-content:space-between; gap:12px; }
.monitor-page .fleet-trip-progress b { font-size:var(--text-label); color:var(--muted); font-weight:500; }
.monitor-page .fleet-trip-progress strong { font-size:24px; letter-spacing:-.04em; font-weight:550; }
.monitor-page .fleet-trip-progress progress { width:100%; height:6px; margin-top:10px; accent-color:var(--primary); }
.monitor-page .fleet-trip-progress.is-ring { position:relative; width:104px; height:104px; margin:0 auto; border-radius:50%; background:conic-gradient(#dbc292 var(--work-progress),var(--line) 0); display:grid; place-items:center; }
.monitor-page .fleet-trip-progress.is-ring::before { content:""; position:absolute; inset:3px; background:var(--surface); border-radius:50%; }
.monitor-page .fleet-trip-progress.is-ring > div { position:relative; flex-direction:column; align-items:center; gap:6px; }
.monitor-page .fleet-trip-progress.is-ring strong { font-size:32px; }
.monitor-page .fleet-trip-progress.is-ring progress { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.monitor-page .fleet-navigation .trip-artwork { width:72px; height:64px; }
.monitor-page .fleet-navigation[data-view=route] .fleet-trip-head p { color:var(--night-primary); }
.monitor-page .fleet-navigation[data-view=route] progress { accent-color:#6599ff; }
.monitor-page .fleet-trip-facts { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:10px; padding:12px; margin:0; background:var(--control); border:1px solid var(--line); border-radius:10px; font-size:var(--text-label); }
.monitor-page .fleet-trip-facts dt { color:var(--muted); }
.monitor-page .fleet-trip-facts dd { margin:0; text-align:right; overflow-wrap:anywhere; }
.monitor-page .fleet-trip-notice { margin:0; color:var(--warn); font-size:var(--text-micro); line-height:1.5; }
.monitor-page .monitor-roster-head { display:flex; align-items:baseline; gap:12px; }
.monitor-page .monitor-roster-head h2 { font-size:18px; letter-spacing:-.03em; margin:0; font-weight:600; }
.monitor-page .monitor-roster-head span { color:var(--faint); font-size:var(--text-label); }
.monitor-page .robot-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; align-items:start; }
.monitor-page .robot { border-radius:15px; background:var(--surface); overflow:hidden; }
.monitor-page .robot.selected { border-color:#a58c62; box-shadow:0 0 0 1px #a58c6233; }
.monitor-page .robot-summary { grid-template-columns:54px minmax(0,1fr) auto 32px; gap:10px; padding:16px 16px 10px; }
.monitor-page .robot-name { display:flex; flex-direction:column; gap:4px; min-width:0; }
.monitor-page .robot-name strong { font-size:14px; font-weight:650; overflow-wrap:anywhere; }
.monitor-page .robot-identity { font-size:var(--text-micro); color:var(--faint); }
.monitor-page .program-controls .power-button,.monitor-page .program-hmi { width:34px; height:36px; border-radius:9px; }
.monitor-page .program-hmi img { width:23px; height:23px; }
.monitor-page .robot-disclosure { width:32px; height:36px; }
.monitor-page .robot-overview { display:grid; grid-template-columns:.8fr .8fr 1.2fr; gap:10px; padding:12px 16px; }
.monitor-page .robot-overview .stat > b { font-size:18px; font-weight:550; letter-spacing:-.03em; }
.monitor-page .robot-overview .stat .chip { align-self:flex-start; font-size:var(--text-micro); margin:3px 0 0; }
.monitor-page .robot-overview .stat small { color:var(--warn); }
.monitor-page .robot-status-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 16px; border-top:1px solid var(--border); }
.monitor-page .program-status { flex-direction:row; align-items:center; gap:7px; font-size:var(--text-micro); }
.monitor-page .program-milestones { width:36px; margin:0; }
.monitor-page .robot-locate { padding:0; background:none; border:0; color:var(--primary); font-size:var(--text-micro); white-space:nowrap; min-height:28px; }
.monitor-page .robot-details { border-top-color:#36393b; padding:16px; }
.monitor-page .robot .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px; }
.monitor-page .robot-system-facts { display:grid; grid-template-columns:85px minmax(0,1fr); gap:10px; padding:14px 0 0; margin:0; border-top:1px solid var(--border); font-size:var(--text-micro); }
.monitor-page .robot-system-facts dt { color:var(--muted); }
.monitor-page .robot-system-facts dd { margin:0; overflow-wrap:anywhere; text-align:right; }
.monitor-page .robot .head { flex-wrap:wrap; font-size:var(--text-micro); }
.monitor-page .robot .head .seen { margin:0; }
.monitor-page .robot .head .model { font-size:var(--text-micro); }
.monitor-page .work-statistics { position:relative; margin-top:26px; padding:24px; background:var(--surface); }
.monitor-page .work-heading { display:flex; gap:12px; align-items:baseline; justify-content:space-between; margin-bottom:22px; }
.monitor-page .work-heading h2 { margin:0; font-size:19px; letter-spacing:-.03em; font-weight:600; }
.monitor-page .work-heading > span { color:var(--faint); font-size:var(--text-micro); }
.monitor-page .work-statistics-body { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:28px; }
.monitor-page .work-history { min-width:0; }
.monitor-page .work-range-summary { display:flex; gap:20px; align-items:center; margin-bottom:20px; }
.monitor-page .work-range-summary strong { font-size:34px; font-weight:550; letter-spacing:-.045em; margin-right:7px; }
.monitor-page .work-range-summary span { font-size:var(--text-label); color:var(--muted); }
.monitor-page .work-range-note { display:flex; flex-direction:column; gap:3px; font-size:var(--text-label); }
.monitor-page .work-range-note b { font-weight:550; }
.monitor-page .cal-picker { display:flex; gap:5px; overflow:auto; margin-bottom:20px; }
.monitor-page .cal-filter { flex-shrink:0; min-height:32px; border:1px solid var(--line); border-radius:8px; background:transparent; color:var(--muted); padding:5px 12px; font-size:var(--text-micro); }
.monitor-page .cal-filter[aria-pressed=true] { color:var(--primary-hover); background:var(--primary-soft); border-color:#796342; }
.monitor-page .calendar { overflow:auto; padding:2px 3px 8px; }
.monitor-page .work-calendar { display:grid; grid-template-columns:22px minmax(0,1fr); grid-template-rows:20px auto; gap:6px; min-width:470px; max-width:720px; width:100%; }
.monitor-page .calendar-months { grid-column:2; display:grid; grid-template-columns:repeat(var(--calendar-weeks),minmax(0,1fr)); color:var(--faint); font-size:var(--text-micro); }
.monitor-page .calendar-months span { white-space:nowrap; }
.monitor-page .calendar-weekdays { grid-column:1; display:grid; grid-template-rows:repeat(7,1fr); gap:4px; font-size:var(--text-micro); color:var(--faint); align-items:center; }
.monitor-page .calendar-cells { grid-column:2; display:grid; grid-auto-flow:column; grid-template-rows:repeat(7,1fr); grid-template-columns:repeat(var(--calendar-weeks),minmax(0,1fr)); gap:4px; }
.monitor-page .calendar-day,.monitor-page .calendar-padding { aspect-ratio:1; width:100%; min-width:0; min-height:0; padding:0; border:1px solid #ffffff05; border-radius:3px; background:var(--day-color); }
.monitor-page .calendar-padding { visibility:hidden; }
.monitor-page .calendar-day.has-failure { box-shadow:inset 0 0 0 1px #ef8781; }
.monitor-page .calendar-day[aria-pressed=true] { outline:2px solid var(--primary); outline-offset:1px; }
.monitor-page .calendar-day:hover { filter:brightness(1.3); }
.monitor-page .work-calendar-foot { display:flex; align-items:center; flex-wrap:wrap; justify-content:space-between; gap:12px; margin-top:12px; color:var(--faint); font-size:var(--text-micro); }
.monitor-page .cal-legend { display:flex; align-items:center; gap:4px; white-space:nowrap; }
.monitor-page .cal-legend i { width:10px; height:10px; border-radius:2px; }
.monitor-page .cal-legend i.failed { margin-left:5px; border:1px solid #ef8781; background:#292d2e; }
.monitor-page .work-day-detail { padding:0 0 0 26px; border-left:1px solid var(--border); }
.monitor-page .work-day-heading h3 { margin:5px 0 14px; font-size:17px; font-weight:550; letter-spacing:-.025em; }
.monitor-page .work-day-total { color:#c3cbc7; font-size:var(--text-label); }
.monitor-page .work-day-total strong { font-size:28px; color:#c4e2cd; font-weight:500; margin-right:6px; }
.monitor-page .work-day-total small { display:block; margin-top:3px; color:var(--muted); font-size:var(--text-micro); }
.monitor-page .work-day-outcomes { margin-top:8px; font-size:var(--text-micro); color:var(--muted); }
.monitor-page .work-contributors { margin-top:18px; display:flex; flex-direction:column; gap:14px; max-height:265px; overflow:auto; }
.monitor-page .work-contributor { display:grid; grid-template-columns:36px minmax(0,1fr) auto; gap:10px; align-items:center; }
.monitor-page .work-contributor .monitor-robot-artwork { width:36px; height:36px; border-radius:8px; }
.monitor-page .work-contributor-name { display:flex; flex-direction:column; gap:3px; min-width:0; }
.monitor-page .work-contributor b { font-size:var(--text-micro); font-weight:550; overflow-wrap:anywhere; }
.monitor-page .work-contributor strong { font-size:var(--text-label); font-weight:550; }
.monitor-page .work-contributor small { font-size:var(--text-micro); color:var(--faint); }
.monitor-page .work-contributor.selected b { color:var(--primary-hover); }
.monitor-page .contribution-bar { height:3px; width:100%; border-radius:2px; background:#2b3430; }
.monitor-page .contribution-bar i { display:block; height:100%; background:#77ba91; border-radius:2px; }
.monitor-page .work-day-empty,.monitor-page .work-calendar-empty { color:var(--muted); font-size:var(--text-label); padding:12px 0; }
.monitor-page .cal-tip { position:absolute; z-index:30; display:flex; flex-direction:column; gap:7px; max-width:min(350px,calc(100vw - 40px)); padding:14px 16px; border:1px solid #53514a; border-radius:12px; background:#272827; color:#d8dcd8; box-shadow:0 12px 38px #0006; font-size:var(--text-micro); pointer-events:none; }
.monitor-page .cal-tip b { color:var(--primary-hover); font-size:var(--text-label); }
.monitor-page .cal-tip-contributor { padding-top:6px; border-top:1px solid var(--line); }
@media (max-width:1200px) {
  .monitor-page .robot-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .monitor-page .work-statistics-body { grid-template-columns:minmax(0,1fr) 240px; gap:20px; }
}
@media (max-width:900px) {
  .monitor-page .fleet-map-stage { grid-template-columns:1fr; }
  .monitor-page .fleet-map-host { height:440px; }
  .monitor-page .fleet-map-overlay { right:20px; }
  .monitor-page .fleet-map-tools { top:380px; bottom:auto; }
  .monitor-page .fleet-navigation { border-left:0; border-top:1px solid var(--border); border-radius:20px 20px 0 0; margin-top:-16px; z-index:1; padding:16px 22px 22px; }
  .monitor-page .fleet-overview-robots { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0 20px; }
  .monitor-page .fleet-categories { max-width:420px; width:100%; align-self:center; }
  .monitor-page .work-statistics-body { grid-template-columns:1fr; }
  .monitor-page .work-day-detail { padding:20px 0 0; border-left:0; border-top:1px solid var(--border); }
  .monitor-page .work-contributors { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px; }
}
@media (max-width:600px) {
  .monitor-page .facts-strip { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px 0; margin-bottom:20px; }
  .monitor-page .facts-strip > div { padding:0 14px; }
  .monitor-page .facts-strip > div:nth-child(3) { border:0; padding-left:0; }
  .monitor-page .facts-strip b { font-size:26px; }
  .monitor-page .facts-strip b small { font-size:var(--text-micro); }
  .monitor-page .fleet-map .card-head { padding:16px; flex-wrap:wrap; }
  .monitor-page .fleet-map-title { width:100%; }
  .monitor-page .fleet-map-meta { font-size:15px; }
  .monitor-page .fleet-map .card-head .spacer { display:none; }
  .monitor-page .fleet-map-host { height:380px; }
  .monitor-page .fleet-map-overlay { top:14px; left:14px; right:14px; }
  .monitor-page .fleet-map-tools { top:316px; left:12px; gap:0; padding:3px; }
  .monitor-page .fleet-map-tools .btn.small { padding:0 8px; font-size:var(--text-micro); min-height:38px; }
  .monitor-page .fleet-navigation { padding:16px 16px 18px; }
  .monitor-page .fleet-category > span { width:40px; height:40px; }
  .monitor-page .fleet-overview-robots { display:flex; }
  .monitor-page .fleet-view-tabs button { font-size:var(--text-micro); min-height:44px; }
  .monitor-page .robot-list { grid-template-columns:1fr; }
  .monitor-page .robot-summary { grid-template-columns:54px minmax(0,1fr) auto 32px; grid-template-rows:1fr; }
  .monitor-page .program-controls,.monitor-page .robot-disclosure { grid-row:auto; grid-column:auto; }
  .monitor-page .program-status { grid-row:auto; grid-column:auto; font-size:var(--text-micro); }
  .monitor-page .work-statistics { padding:18px 14px; }
  .monitor-page .work-heading { flex-direction:column; gap:7px; margin-bottom:16px; }
  .monitor-page .work-heading > span { font-size:var(--text-micro); }
  .monitor-page .work-range-summary { gap:14px; }
  .monitor-page .work-range-summary strong { font-size:29px; }
  .monitor-page .work-range-note b,.monitor-page .work-range-note span { font-size:var(--text-micro); }
  .monitor-page .work-contributors { grid-template-columns:1fr; }
  .monitor-page .fleet-legend .hint { display:none; }
  .monitor-page .fleet-trip-progress strong { font-size:23px; }
}
@media (max-width:380px) {
  .monitor-page .robot-summary { grid-template-columns:44px minmax(0,1fr) 32px; grid-template-rows:auto auto; }
  .monitor-page .robot-summary .monitor-robot-artwork { width:44px; height:44px; }
  .monitor-page .robot-name { grid-column:2; grid-row:1; }
  .monitor-page .robot-disclosure { grid-column:3; grid-row:1; }
  .monitor-page .program-controls { grid-column:2 / 4; grid-row:2; justify-self:start; }
}

.customer-employees { margin-bottom: 20px; }
.customer-employee { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--border); }
.customer-employee > div { flex: 1; min-width: 240px; }
.customer-employee select { min-height: 44px; max-width: 240px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.customer-site-choices { margin: 18px 0; border: 1px solid var(--border); border-radius: 12px; }
.customer-site-choice { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.customer-site-choice input { width: 18px; height: 18px; }

@font-face {
  font-family: "Pretendard Variable";
  src: url("/static/fonts/pretendard-var.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --font: var(--app-font);
  --background: #101113;
  --surface: #191b1d;
  --panel: #222426;
  --elevated: #303335;
  --border: #343638;
  --line: #45484b;
  --foreground: #f4f2ed;
  --muted: #abb0b3;
  --faint: #92999d;
  --primary: #d3b781;
  --primary-hover: #ecd4aa;
  --primary-soft: #363027;
  --on-primary: #17191b;
  --control: #242628;
  --control-border: #484b4e;
  --destructive: #ff8d8b;
  --destructive-soft: #422729;
  --destructive-border: #854e4d;
  --run: #8bd6a8;
  --run-soft: #20362b;
  --warn: #e8bc70;
  --warn-soft: #3b3020;
  --syntax-violet: #c3a5fa;
  --rail: #101113;
  --rail-active: #28241e;
  --rail-material: rgb(16 17 19 / .94);
  --night-surface: #151719;
  --night-panel: #1c1e20;
  --night-elevated: var(--elevated);
  --night-line: var(--line);
  --night-foreground: var(--foreground);
  --night-muted: var(--muted);
  --night-primary: #8fb3ff;
  --night-run: var(--run);
  --night-warn: var(--warn);
  --radius-panel: var(--app-radius-panel);
  --radius-control: var(--app-radius-control);
  --text-micro: var(--app-text-micro);
  --text-label: var(--app-text-label);
  --text-body: var(--app-text-body);
  --text-title: var(--app-text-title);
  --shadow: none;
  --shadow-popover: 0 16px 48px rgb(0 0 0 / .35);
  --page-title: clamp(1.375rem, 2vw, 1.875rem);
  --motion-press: 100ms;
  --motion-state: 160ms;
}

* {
  box-sizing: border-box;
}

html { font-size: 100%; scroll-padding-block:24px; }

body {
  height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font);
  font-size: var(--text-body);
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
  opacity: 0.55;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-hover);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------ app --- */

.app {
  display: grid;
  grid-template-columns: var(--app-rail-width) minmax(0, 1fr);
  min-height: 100%;
}

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100vh;
  padding: 6px 0 14px;
  background: var(--rail-material);
  border-right: 1px solid var(--border);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  color: var(--night-muted);
}

.rail-brand {
  display: grid;
  place-items: center;
  width: var(--app-rail-item-width);
  min-height: 2.75rem;
  margin-bottom: 12px;
  border-radius: var(--app-rail-radius);
  color: var(--primary);
  font-size: var(--app-brand-size);
  font-weight: var(--app-brand-weight);
  letter-spacing: var(--app-brand-tracking);
}

.rail-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: var(--app-rail-item-width);
  min-height: var(--app-rail-item-height);
  justify-content: center;
  padding: 7px 0;
  border-radius: var(--app-rail-radius);
  color: var(--night-muted);
  text-align: center;
}

.rail-item span {
  font-size: var(--app-text-micro);
  line-height: 1.2;
}

.rail-item svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rail-item:hover {
  color: var(--night-foreground);
}

.rail-item.active {
  background: var(--rail-active);
  color: var(--primary-hover);
}

.rail-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.rail-bottom {
  margin-top: auto;
}

.rail-more, .rail-utilities { display:contents; }
.platform-language { width:var(--app-rail-item-width); margin-top:auto; padding:8px 0; }
.platform-language select { width:100%; min-height:44px; padding:6px 3px; border:1px solid var(--border); border-radius:var(--radius-control); background:var(--surface); color:var(--night-foreground); font:inherit; font-size:11px; cursor:pointer; appearance:none; text-align:center; }
.platform-language + .rail-bottom { margin-top:0; }
.rail-more-toggle { display:none; border:0; background:transparent; font:inherit; }
.skip-link { position:fixed; top:8px; left:12px; z-index:80; padding:12px 20px; border-radius:var(--radius-control); background:var(--primary); color:var(--on-primary); transform:translateY(-200%); }
.skip-link:focus { transform:none; }

.content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 28px 32px 44px;
}

.content.sandbox-page {
  height: 100vh;
  padding: 12px 14px 12px;
}

/* --------------------------------------------------------------- shared --- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow);
}

.card-body {
  padding: 20px;
}

.eyebrow {
  color: var(--primary);
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.page-head .titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.page-head h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: var(--page-title);
  font-weight: 650;
  letter-spacing: -0.035em;
  flex-wrap: wrap;
}

.page-head .crumb {
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 400;
}

.page-head .sub {
  color: var(--muted);
  font-size: var(--text-label);
}

.page-head .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 2.75rem;
  padding: .625rem 1rem;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--control);
  color: var(--foreground);
  font-size: var(--text-label);
  font-weight: 600;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--elevated);
  color: var(--foreground);
}

.btn.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
}

.btn.primary:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  color: var(--on-primary);
}

.btn.danger {
  border-color: var(--destructive-border);
  color: var(--destructive);
}
.btn.danger:hover:not(:disabled) { background:var(--destructive-soft); }

.btn.small {
  min-height: 2.75rem;
  padding: .5rem .75rem;
  font-weight: 500;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--primary);
  font-size: var(--text-label);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--elevated);
  color: var(--muted);
  font-size: var(--text-micro);
  font-weight: 600;
  white-space: nowrap;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.chip.ok {
  background: var(--run-soft);
  color: var(--run);
}

.chip.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.chip.bad {
  background: var(--destructive-soft);
  color: var(--destructive);
}

.chip.info {
  background: var(--primary-soft);
  color: var(--primary);
}

.placeholder {
  color: var(--warn);
  font-weight: 500;
}

.muted {
  color: var(--muted);
}

.empty {
  padding: 28px 18px;
  color: var(--muted);
  font-size: var(--text-label);
  text-align: center;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 36px));
}

.toast {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  box-shadow: var(--shadow-popover);
  font-size: var(--text-label);
}

.toast.error {
  border-color: var(--destructive-border);
  color: var(--destructive);
}

/* ---------------------------------------------------------------- login --- */

.login {
  display: grid;
  place-items: center;
  min-height: 70vh;
}

.login-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(400px, 100%);
  padding: 30px;
}

.login-card h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-label);
  line-height: 1.55;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field > span {
  color: var(--muted);
  font-size: var(--text-micro);
  font-weight: 600;
}

.field > span em {
  margin-left: 6px;
  color: var(--faint);
  font-style: normal;
  font-weight: 400;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 44px;
  padding: 0 11px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--control);
  font-size: var(--text-label);
}

.field textarea {
  height: auto;
  min-height: 72px;
  padding: 9px 11px;
  resize: vertical;
}

.field input:user-invalid {
  border-color: var(--destructive-border);
}
.field input:read-only { background:var(--surface); color:var(--muted); }

.form-error {
  color: var(--destructive);
  font-size: var(--text-label);
}

.form-error:empty {
  display: none;
}

/* ---------------------------------------------------------------- sites --- */

.sites {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding-top: 32px;
}

.sites-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.sites-head .wordmark {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.sites-head .tagline {
  color: var(--muted);
  font-size: var(--text-label);
}

.sites-head h1 {
  margin: 8px 0 0;
  font-size: 1.25rem;
  font-weight: 600;
}

.sites-head p {
  margin: 0;
  color: var(--muted);
}

.site-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
}

.site-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 360px;
  padding: 18px 20px 20px;
}

.site-card .name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.125rem;
  font-weight: 700;
}

.site-card .facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--muted);
  font-size: var(--text-label);
}

.site-card .facts b {
  color: var(--foreground);
  font-weight: 600;
}

.site-card .actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.site-card .actions .btn:first-child {
  flex: 1;
}

.site-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 360px;
  min-height: 160px;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-panel);
  background: transparent;
  color: var(--muted);
}

.site-add b {
  font-weight: 600;
}

/* -------------------------------------------------------------- monitor --- */

.facts-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0;
  overflow: hidden;
}

.facts-strip > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 12px 18px;
  border-left: 1px solid var(--panel);
}

.facts-strip > div:first-child {
  border-left: 0;
}

.facts-strip span {
  color: var(--muted);
  font-size: var(--text-micro);
  font-weight: 600;
}

.facts-strip b {
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facts-strip b small {
  color: var(--muted);
  font-size: var(--text-micro);
  font-weight: 500;
}

.monitor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 14px;
}

.monitor-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.card-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 20px 20px 0;
}

.card-head b {
  font-size: var(--text-title);
  font-weight: 600;
}

.card-head span {
  color: var(--muted);
  font-size: var(--text-label);
}

.card-head .right {
  margin-left: auto;
  font-size: var(--text-micro);
}

.fleet {
  background: var(--night-surface);
  border-color: var(--night-elevated);
  color: var(--night-foreground);
  overflow: hidden;
}

.fleet .card-head b {
  color: var(--night-foreground);
}

.fleet .card-head span {
  color: var(--night-muted);
}

.fleet canvas {
  display: block;
  width: 100%;
  height: 340px;
}

.fleet-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  padding: 0 18px 10px;
  color: var(--night-muted);
  font-size: var(--text-micro);
}

.fleet-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 5px;
  border-radius: 50%;
}

.robot-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.robot {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
}

.robot .head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.robot .head b {
  font-size: var(--text-title);
  font-weight: 700;
}

.robot .head .model {
  color: var(--muted);
  font-size: var(--text-label);
}

.robot .head .seen {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--text-label);
}

.robot .head .seen b {
  color: var(--foreground);
  font-size: var(--text-label);
  font-weight: 600;
}

.robot-summary { display:grid; grid-template-columns:minmax(0,1fr) 108px auto 44px; align-items:center; gap:8px; min-height:70px; padding:10px 12px; }
.robot-summary > strong { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:var(--text-body); font-weight:650; }
.robot-details { display:flex; flex-direction:column; gap:14px; padding:14px 16px 16px; border-top:1px solid var(--border); }
.robot-telemetry { display:flex; flex-direction:column; gap:10px; }
.program-status { display:flex; flex-direction:column; gap:5px; min-width:0; color:var(--muted); font-size:12px; font-weight:600; }
.program-state-label { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.program-state-label::before { content:""; display:inline-block; width:6px; height:6px; margin:0 6px 1px 0; border-radius:50%; background:currentColor; }
.program-status[data-phase="ready"] { color:var(--run); }
.program-status[data-phase="starting"] { color:var(--primary); }
.program-status[data-phase="attention"] { color:var(--warn); }
.program-milestones { display:flex; gap:3px; margin-left:12px; max-width:72px; }
.program-milestones i { flex:1; height:3px; border-radius:2px; background:var(--border); }
.program-milestones i[data-complete="true"] { background:var(--run); }
.program-milestones i[data-current="true"] { background:var(--primary); animation:program-wait 1.2s ease-in-out infinite; }
@keyframes program-wait { 50% { opacity:.3; } }
.program-controls { display:flex; align-items:center; gap:4px; }
.program-controls .power-button, .program-hmi, .robot-disclosure { display:grid; place-items:center; flex-shrink:0; width:44px; height:44px; padding:0; border:1px solid var(--border); border-radius:var(--radius-control); background:var(--panel); color:var(--foreground); cursor:pointer; }
.program-controls .customer-icon, .robot-disclosure svg { width:21px; height:21px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round; }
.program-controls .power-button > span { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.program-controls .power-button[data-running="true"] { color:var(--run); background:var(--run-soft); border-color:var(--run); }
.program-hmi img { display:block; width:28px; height:28px; }
.program-hmi[data-ready="true"] { color:var(--primary); background:var(--primary-soft); border-color:var(--primary); }
.program-controls .power-button:disabled, .program-hmi[aria-disabled="true"] { opacity:.45; cursor:default; }
.program-hmi[aria-disabled="true"] { pointer-events:none; }
.robot-disclosure { border-color:transparent; background:transparent; color:var(--muted); }
.robot-disclosure[aria-expanded="true"] svg { transform:rotate(180deg); }
.robot-disclosure[data-animate="true"] svg { transition:transform 160ms cubic-bezier(0.23,1,0.32,1); }
@media (hover:hover) and (pointer:fine) {
  .robot-disclosure:hover { background:var(--panel); color:var(--foreground); }
  .program-controls button:not(:disabled):hover, .program-hmi[data-ready="true"]:hover { filter:brightness(.94); }
}
.program-panel { padding:12px; border:1px solid var(--border); border-radius:var(--radius-control); background:var(--panel); }
.program-panel .power-hint,.program-panel .power-message,.program-panel .program-report { margin:8px 0 0; font-size:12px; line-height:1.6; color:var(--muted); }
.program-panel .power-message:empty { display:none; }
.program-progress-label { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:12px; color:var(--muted); }
.program-panel progress { display:block; width:100%; height:6px; margin:10px 0; accent-color:var(--primary); }
.program-steps { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; padding:0; margin:0; list-style:none; font-size:12px; line-height:1.5; color:var(--muted); }
.program-steps li::before { content:"○ "; }
.program-steps li[data-complete="true"] { color:var(--run); }
.program-steps li[data-complete="true"]::before { content:"✓ "; }
.raptor-entry { width:min(100%,440px); margin:clamp(24px,12vh,120px) auto; padding:28px; display:flex; flex-direction:column; align-items:flex-start; gap:16px; }
.raptor-entry h1, .raptor-entry p { margin:0; }
.raptor-entry .actions { display:flex; flex-wrap:wrap; gap:8px; }
.raptor-entry-status { min-height:3em; line-height:1.6; }
@media (max-width:600px) {
  .monitor-head { flex-wrap:wrap; }
  .robot-summary { grid-template-columns:minmax(0,1fr) auto 36px; grid-template-rows:auto auto; align-content:center; gap:2px 4px; padding:8px; }
  .robot-summary > strong { grid-column:1; grid-row:1; font-size:13px; }
  .program-status { grid-column:1; grid-row:2; flex-direction:row; align-items:center; gap:6px; font-size:11px; }
  .program-milestones { flex-shrink:0; width:32px; margin-left:0; }
  .program-controls { grid-column:2; grid-row:1 / span 2; }
  .robot-disclosure { grid-column:3; grid-row:1 / span 2; width:36px; }
  .program-controls .power-button, .program-hmi { width:40px; }
  .robot .head { flex-wrap:wrap; }
  .robot .head .seen { flex-basis:100%; margin-left:0; }
  .program-steps { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:370px) {
  .robot-summary { grid-template-columns:minmax(0,1fr) auto 28px; }
  .robot-summary > strong { font-size:12px; }
  .program-controls .power-button, .program-hmi { width:32px; }
  .robot-disclosure { width:28px; }
  .program-milestones { display:none; }
}

.robot .stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat span {
  color: var(--muted);
  font-size: var(--text-micro);
  font-weight: 600;
}

.stat b {
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat small {
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-micro);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battery {
  height: 5px;
  margin-top: 3px;
  border-radius: 999px;
  background: var(--elevated);
  overflow: hidden;
}

.battery i {
  display: block;
  height: 100%;
  background: var(--run);
}

.battery i.low {
  background: var(--warn);
}

.robot .foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.robot .foot .note {
  margin-left: auto;
  color: var(--faint);
  font-size: var(--text-micro);
}

.btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ----------------------------------------------------------- parameters --- */

/* Left: search and the group index (one pictogram per group); right: one
   card per group, each table inside as a key/value grid. */
.param-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.param-side {
  position: sticky;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: calc(100vh - 36px);
  padding: 10px;
  overflow: auto;
}

.param-tools {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}

.param-tools input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-label);
}

.param-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.param-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 10px;
  color: var(--foreground);
  text-decoration: none;
}

.param-nav-item:hover {
  background: var(--panel);
  color: var(--foreground);
}

.param-nav-item.dim {
  opacity: 0.4;
}

.param-nav-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.param-nav-text b {
  font-size: var(--text-label);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.param-nav-text small {
  color: var(--faint);
  font-size: var(--text-micro);
}

.param-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
}

.param-icon svg {
  width: 16px;
  height: 16px;
}

.param-icon.large {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.param-icon.large svg {
  width: 22px;
  height: 22px;
}

.param-main {
  min-width: 0;
}

.param-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.param-group {
  scroll-margin-top: 18px;
}

.param-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.param-group-titles h2 {
  margin: 0;
  font-size: var(--text-title);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.param-group-titles p {
  margin: 1px 0 0;
  color: var(--muted);
  font-size: var(--text-label);
}

.param-group-meta {
  margin-left: auto;
  color: var(--faint);
  font-size: var(--text-micro);
  white-space: nowrap;
}

.param-tables {
  display: flex;
  flex-direction: column;
}

.param-table {
  padding: 12px 18px 14px;
  scroll-margin-top: 18px;
}

.param-table + .param-table {
  border-top: 1px solid var(--panel);
}

.param-table-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 8px;
}

.param-table-name {
  font-size: 0.8125rem;
}

.param-table-name b {
  color: var(--foreground);
  font-weight: 700;
}

.param-table-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: var(--text-label);
}

.param-count {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--elevated);
  color: var(--muted);
  font-size: var(--text-micro);
  font-weight: 600;
}

.param-rows {
  display: grid;
  grid-template-columns: minmax(160px, 34%) minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  font-size: var(--text-label);
}

.param-key,
.param-value {
  padding: 7px 12px;
  border-top: 1px solid var(--panel);
}

.param-row {
  display: contents;
}

.param-row:first-child .param-key,
.param-row:first-child .param-value {
  border-top: 0;
}

.param-row:nth-child(even) .param-key,
.param-row:nth-child(even) .param-value {
  background: var(--panel);
}

.param-key code {
  font-weight: 600;
}

.param-key small,
.param-value small {
  display: block;
  color: var(--faint);
  font-size: var(--text-micro);
}

.param-value code.value {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.param-value code.num {
  color: var(--primary);
}

.param-value code.bool {
  color: var(--run);
  font-weight: 600;
}

.param-value code.str {
  color: var(--warn);
}

.param-value code.list,
.param-value code.table {
  color: var(--syntax-violet);
}

.param-raw {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-panel);
  background: var(--surface);
  font-size: var(--text-label);
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .param-layout {
    grid-template-columns: 1fr;
  }

  .param-side {
    position: static;
    max-height: none;
  }
}

.legend {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: var(--text-micro);
}

.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 2px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-label);
}

.table th {
  padding: 8px 18px;
  border-top: 1px solid var(--panel);
  color: var(--muted);
  font-size: var(--text-micro);
  font-weight: 600;
  text-align: left;
}

.table td {
  padding: 8px 18px;
  border-top: 1px solid var(--panel);
}

.table td.num,
.table th.num {
  text-align: right;
}

.table tr.total td {
  font-weight: 600;
  background: var(--panel);
}

.map-card {
  overflow: hidden;
}

.map-stage {
  position: relative;
  height: 260px;
  background: var(--night-surface);
}

.map-stage .gmap {
  width: 100%;
  height: 100%;
}

.map-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 100%;
  padding: 20px;
  color: var(--muted);
  font-size: var(--text-label);
  text-align: center;
}

.map-fallback b {
  color: var(--foreground);
  font-weight: 600;
}

.map-address {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 12px;
  font-size: var(--text-label);
}

.map-address .right {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--text-micro);
}

/* ------------------------------------------------------------- settings --- */

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}

.form h2 {
  margin: 0;
  font-size: var(--text-title);
  font-weight: 600;
}

.form .row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 12px;
}

.form .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.form .actions .note {
  margin-left: auto;
  color: var(--faint);
  font-size: var(--text-micro);
}

.robot-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.robot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--panel);
}
.robot-row > div { min-width:0; overflow-wrap:anywhere; }

.robot-row b {
  font-weight: 600;
}

.robot-row .meta {
  color: var(--muted);
  font-size: var(--text-micro);
  word-break: break-all;
}

.robot-row .tools {
  display: flex;
  gap: 6px;
  align-items: start;
}

/* -------------------------------------------------------------- sandbox --- */

.sandbox-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  flex: none;
  padding: 8px 14px;
}

.sandbox-head > * {
  flex: none;
}

.sandbox-head .share {
  min-width: 0;
  max-width: 100%;
}

.sandbox-head .share code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sandbox-head h1 {
  margin: 0;
  font-size: var(--text-title);
  font-weight: 700;
  white-space: nowrap;
}

.sandbox-head .spacer {
  flex: 1;
}

.sandbox-head .links {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: var(--text-label);
  white-space: nowrap;
}

.sandbox-head .links a,
.sandbox-head .links .link {
  color: var(--primary);
}

.robot-strip {
  display: flex;
  align-items: center;
  gap: 6px;
}

.robot-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--foreground);
  font-size: var(--text-label);
  font-weight: 600;
  white-space: nowrap;
  transition: padding 160ms ease-out, background-color 160ms ease-out;
}

.robot-pick:not(.current) {
  padding: 0 8px;
  background: transparent;
}

.robot-pick:not(.current) .robot-name,
.robot-pick:not(.current) .tab-chip {
  display: none;
}

.robot-pick:not(.current):hover,
.robot-pick:not(.current):focus-visible {
  padding: 0 10px;
  background: var(--surface);
}

.robot-pick:not(.current):hover .robot-name,
.robot-pick:not(.current):hover .tab-chip,
.robot-pick:not(.current):focus-visible .robot-name,
.robot-pick:not(.current):focus-visible .tab-chip {
  display: inline-flex;
}

.robot-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
}

.robot-dot.ok { background: var(--run); }
.robot-dot.bad { background: var(--destructive); }

.tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-control);
  background: var(--elevated);
  gap: 3px;
}

.tabs a,
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: var(--text-label);
  font-weight: 500;
  line-height: 30px;
  cursor: pointer;
}

.tabs a.active,
.tabs button.active {
  background: var(--surface);
  color: var(--foreground);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.tab-chip .chip {
  height: 18px;
  padding: 0 7px;
  font-size: 0.625rem;
}

.share {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: var(--text-micro);
  white-space: nowrap;
}

.share code {
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--foreground);
  font-family: inherit;
  font-size: var(--text-micro);
}

.frame {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--surface);
}

@media (max-width: 1100px) {
  .monitor-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .robot .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ---------------------------------------------------------------- admin --- */

.admin-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-tables {
  position: sticky;
  top: 18px;
}

.admin-table-list {
  display: flex;
  flex-direction: column;
  padding: 6px 8px 10px;
}

.admin-tools {
  border-top: 1px solid var(--panel);
}

.admin-table {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
}

.admin-table:hover {
  background: var(--panel);
}

.admin-table.active {
  background: var(--primary-soft);
}

.admin-table b {
  font-size: var(--text-label);
  font-weight: 600;
}

.admin-table span {
  color: var(--muted);
  font-size: var(--text-micro);
}

.admin-main {
  min-width: 0;
  padding-bottom: 12px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 18px 6px;
}

.admin-toolbar input,
.admin-toolbar select {
  height: 44px;
  padding: 0 10px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--control);
  font-size: var(--text-label);
}

.admin-toolbar input {
  min-width: 220px;
}

.grid-scroll {
  overflow-x: auto;
  padding: 0 18px;
}

.table.grid th,
.table.grid td {
  padding: 6px 10px;
  white-space: nowrap;
  font-size: var(--text-micro);
}

.table.grid td.null {
  color: var(--faint);
}

.table.grid tr.clickable {
  cursor: pointer;
}

.table.grid tr.clickable:hover td {
  background: var(--primary-soft);
}

.row-editor,
.admin-query {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--panel);
}

.row-editor-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  font-size: var(--text-label);
}

.row-editor textarea,
.admin-query textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: var(--text-label);
  line-height: 1.5;
  resize: vertical;
}

.row-editor .actions,
.admin-query .actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 1100px) {
  .admin-grid {
    grid-template-columns: 1fr;
  }
  .admin-tables { position:static; }
}


/* ------------------------------------------------------------ fleet map --- */

.fleet-map .card-head {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding-bottom: 10px;
}

.fleet-map .card-head .spacer {
  flex: 1;
}

.fleet-map-meta,
.fleet-map-stamp {
  font-size: var(--text-label);
}

.fleet-map-tools {
  display: flex;
  gap: 6px;
}

.fleet .btn.ghost {
  border-color: var(--night-line);
  background: var(--night-panel);
  color: var(--night-foreground);
}

.fleet .btn.ghost:hover:not(:disabled),
.fleet .btn.ghost.active {
  background: var(--night-elevated);
}

.fleet-map-host {
  position: relative;
  height: clamp(360px, 54vh, 680px);
  border-top: 1px solid var(--night-elevated);
  border-bottom: 1px solid var(--night-elevated);
}

.fleet-map-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.fleet-legend .hint {
  margin-left: auto;
}

.map-manager {
  padding: 12px 18px;
  border-bottom: 1px solid var(--night-elevated);
  background: var(--night-panel);
}

.map-manager-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-bottom: 10px;
  font-size: var(--text-label);
  color: var(--night-muted);
}

.map-manager-head b {
  color: var(--night-foreground);
}

.map-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
}

.map-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--night-line);
  border-radius: 10px;
}

.map-row.active {
  border-color: rgb(59 167 255 / 0.5);
  background: rgb(59 167 255 / 0.06);
}

.map-name b {
  display: block;
  font-size: 0.8125rem;
}

.map-name small,
.map-facts {
  color: var(--night-muted);
  font-size: var(--text-micro);
}

.map-row .chip.primary {
  background: rgb(59 167 255 / 0.18);
  color: var(--night-primary);
}

.fleet .btn.small {
  height: 28px;
}


/* ---------------------------------------------------------- sites page --- */
/* One screen: the header, the table (scrolls inside itself past ~40 vh) and
   the map of every site filling the rest. */

/* The whole page fits the viewport: the customer list on the left scrolls on
   its own, the map on the right takes the rest. */
.content.sites-page {
  height: 100dvh;
  overflow: hidden;
}

.sites-stage {
  display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.sites-rail {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.site-list {
  flex: 1;
  min-height: 0;
  margin: 10px 0 0;
  padding: 0 8px 8px;
  overflow: auto;
  list-style: none;
}

.site-list .empty {
  padding: 28px 12px;
}

.site-item {
  border-radius: var(--radius-control);
}

.site-item:hover,
.site-item.lit {
  background: var(--panel);
}

.site-item.selected {
  background: var(--primary-soft);
}

.site-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-control);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.site-item.selected .site-item-head {
  color: var(--primary);
}

.site-customer {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-state {
  flex: none;
  color: var(--faint);
  font-size: var(--text-micro);
  font-weight: 500;
}

.site-dot,
.map-pin-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--faint);
}

.site-dot.ok,
.map-pin.ok .map-pin-dot {
  background: var(--run);
}

.site-dot.bad,
.map-pin.bad .map-pin-dot {
  background: var(--destructive);
}

/* The selected site's details, docked under the list; a fixed place, so
   choosing another site never moves the list. */
.site-detail-panel {
  flex: none;
  border-top: 1px solid var(--border);
  padding: 20px;
  font-size: var(--text-label);
}

.site-detail-hint {
  color: var(--faint);
}

.site-detail-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.site-detail-title b {
  font-size: var(--text-title);
}

.site-detail-title small {
  color: var(--faint);
  font-size: var(--text-micro);
}

.site-fact {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 0;
}

.site-fact span {
  color: var(--muted);
}

.site-fact b {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.site-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.sites-map-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.sites-map {
  flex: 1;
  min-height: 0;
  margin-top: 10px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-panel) var(--radius-panel);
  overflow: hidden;
  background: var(--night-surface);
}

.sites-map .empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--muted);
  font-size: var(--text-label);
}
.sites-map .empty h2 { margin:8px 0 0; color:var(--foreground); font-size:1.125rem; font-weight:600; }
.sites-map .empty p { max-width:32ch; margin:0 0 8px; line-height:1.7; }
.map-empty-icon { display:grid; place-items:center; width:64px; height:64px; border:1px solid var(--border); border-radius:18px; background:var(--panel); color:var(--primary); }
.map-empty-icon svg { width:28px; height:28px; stroke:currentColor; fill:none; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }

/* A pin: the dot on the place, the customer's name beside it, the site in a
   tip while the pointer rests on it. Lit from the list line it belongs to. */
.map-pin {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--foreground);
  font-family: var(--font);
  font-size: var(--text-label);
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgb(22 32 43 / 0.18);
  transform: translateY(-50%);
  cursor: pointer;
}

.map-pin:hover,
.map-pin.hot,
.map-pin.selected {
  border-color: var(--primary);
  box-shadow: var(--shadow-popover);
}

.map-pin-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  display: none;
  min-width: 220px;
  max-width: 320px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  box-shadow: 0 6px 18px rgb(22 32 43 / 0.2);
  transform: translateX(-50%);
}

.map-pin-tip b {
  display: block;
  font-size: 0.84375rem;
}

.map-pin-tip small {
  color: var(--primary);
  font-weight: 600;
}

.map-pin:hover .map-pin-tip {
  display: block;
}

@media (max-width: 900px) {
  .content.sites-page {
    height: auto;
    overflow: auto;
  }

  .sites-stage {
    grid-template-columns: 1fr;
  }

  .sites-map-card {
    min-height: 60vh;
  }
}

/* ---------------------------------------------------------------- docs --- */

.docs-grid {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.docs-nav {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  padding: 12px;
  overflow: auto;
}

.docs-nav > b {
  display: block;
  margin-bottom: 8px;
  font-size: var(--text-label);
}

.docs-nav-group {
  margin-bottom: 10px;
}

.docs-nav-tag {
  display: block;
  padding: 4px 8px;
  color: var(--muted);
  font-size: var(--text-micro);
  font-weight: 600;
  text-transform: uppercase;
}

.docs-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--foreground);
  font-size: var(--text-label);
  text-decoration: none;
}

.docs-nav a:hover {
  background: var(--panel);
}

.docs-nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.docs-head .docs-facts {
  margin-top: 10px;
}

.docs-detail .docs-section h2 {
  margin-top: 0;
}

.docs-nav code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.docs-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px 18px;
  padding: 10px 18px 14px;
  font-size: var(--text-label);
}

.docs-facts span {
  display: block;
  color: var(--muted);
  font-size: var(--text-micro);
}

.docs-facts code {
  word-break: break-all;
}

/* One base URL per environment under the "서버" fact; the paths never change. */
.docs-server {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin-top: 2px;
}

.docs-server small {
  color: var(--muted);
  font-size: var(--text-micro);
}

.docs-intro {
  margin: 0;
  padding: 0 18px 14px;
  color: var(--muted);
  font-size: var(--text-label);
  line-height: 1.6;
}

.docs-section h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  margin: 8px 0 10px;
  font-size: var(--text-title);
}

.docs-section h2 span {
  color: var(--muted);
  font-size: var(--text-label);
  font-weight: 400;
}

.docs-section .op + .op {
  margin-top: 10px;
}

.op {
  padding: 14px 18px 16px;
}

.op-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.op-head .path {
  font-size: 0.8125rem;
  font-weight: 600;
}

.op-head b {
  color: var(--muted);
  font-weight: 500;
}

.method {
  display: inline-block;
  min-width: 46px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  color: #ffffff;
}

.method.get { background:var(--panel); color:var(--night-primary); }
.method.post { background:var(--run-soft); color:var(--run); }
.method.put { background:var(--warn-soft); color:var(--warn); }
.method.patch { background:var(--panel); color:var(--syntax-violet); }
.method.delete { background:var(--destructive-soft); color:var(--destructive); }

.op-desc {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: var(--text-label);
  line-height: 1.6;
}

.op-section {
  margin-top: 12px;
}

.op-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: var(--text-label);
}

.schema-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-label);
}

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

.schema-table th {
  color: var(--muted);
  font-size: var(--text-micro);
  font-weight: 600;
}

.schema-table td small {
  display: block;
  color: var(--faint);
  font-size: var(--text-micro);
}

.schema-table .schema-table {
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.required {
  margin-left: 6px;
  color: var(--destructive);
  font-size: var(--text-micro);
  font-style: normal;
}

.schema-inline > .schema-link {
  display: inline-block;
  margin-bottom: 6px;
}

.schema-link {
  color: var(--primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 600;
}

.schema-array,
.schema-option {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: var(--text-label);
}

pre.example {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--panel);
  font-size: 0.75rem;
  line-height: 1.5;
  overflow: auto;
}

.response {
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.response:first-of-type {
  border-top: 0;
}

.response-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: var(--text-label);
}

.status {
  padding: 1px 7px;
  border-radius: 6px;
  font-size: var(--text-micro);
  font-weight: 700;
  background: var(--elevated);
}

.status.s2 { background: var(--run-soft); color: var(--run); }
.status.s4 { background: var(--warn-soft); color: var(--warn); }
.status.s5 { background: var(--destructive-soft); color: var(--destructive); }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}


/* -------------------------------------------------------- admin editing --- */

.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 10px 14px;
  padding: 10px 0;
}

.field-grid .field > span {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.field-grid .field .type {
  color: var(--faint);
  font-size: var(--text-micro);
  font-style: normal;
}

.field-grid .null-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: var(--muted);
  font-size: var(--text-micro);
  font-weight: 500;
}

.field-grid .field.locked input {
  background: var(--panel);
  color: var(--muted);
}

.field-grid input.is-null,
.field-grid textarea.is-null {
  background: repeating-linear-gradient(135deg, var(--panel) 0 6px, var(--surface) 6px 12px);
  color: var(--faint);
}

.field-grid textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
}

.table.grid th .key {
  margin-left: 4px;
  color: var(--faint);
  font-size: var(--text-micro);
  font-style: normal;
}

.table.grid td.editing {
  padding: 2px 4px;
}

.table.grid td.editing input {
  width: 100%;
  min-width: 120px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  font-size: var(--text-label);
}


/* ---------------------------------------------------- platform settings --- */

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 20px;
  align-items: start;
}

.settings-body {
  padding: 12px 20px 20px;
}

.settings-form .field-grid {
  padding-top: 4px;
}

.settings-fact {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 2px 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  font-size: var(--text-label);
}

.settings-fact:first-child {
  border-top: 0;
}

.settings-fact > span {
  color: var(--muted);
}

.settings-fact > b {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.settings-fact > small {
  grid-column: 2;
  color: var(--faint);
  font-size: var(--text-micro);
}

.settings-body > .actions {
  margin-top: 10px;
}


/* ------------------------------------------------------------ fleet live --- */

.fleet .chip.warn {
  background: rgb(255 176 32 / 0.18);
  color: var(--night-warn);
}

.fleet .chip.ok {
  background: rgb(53 217 124 / 0.18);
  color: var(--night-run);
}

.fleet-select {
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--night-line);
  border-radius: 8px;
  background: var(--night-panel);
  color: var(--night-foreground);
  font-size: var(--text-label);
}


/* -------------------------------------------------------- target queue --- */

.robot .queue {
  margin: 10px 18px 0;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.queue-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  font-size: var(--text-label);
}

.queue-head span {
  color: var(--muted);
}

.queue-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: var(--text-label);
}

.queue-row .rank {
  min-width: 26px;
  font-weight: 700;
  color: var(--primary);
}

.queue-row.selected {
  color: var(--warn);
}

.robot .stat.warn b,
.robot .stat.warn small {
  color: var(--warn);
}

.chip.primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.robot .stat.map {
  grid-column: 1 / -1;
}

.robot .stat.map b {
  overflow-wrap: anywhere;
}


/* -------------------------------------------------------- docs: guide --- */

.docs-prose {
  padding: 0 18px 16px;
  font-size: var(--text-label);
  line-height: 1.65;
}

.docs-prose h3 {
  margin: 14px 0 4px;
  font-size: 0.8125rem;
}

.docs-prose p,
.docs-prose ol {
  margin: 0 0 6px;
}

.docs-prose ol {
  padding-left: 20px;
}

.docs-prose li {
  margin: 2px 0;
}

.guide-table td small {
  display: block;
  color: var(--faint);
  font-size: var(--text-micro);
}

.op-guide {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--primary-soft);
  border-radius: 0 10px 10px 0;
  background: var(--panel);
  font-size: var(--text-label);
  line-height: 1.6;
}

.op-guide p {
  margin: 0 0 6px;
}

.op-guide-short {
  font-weight: 600;
}

.op-guide .guide-table {
  margin: 6px 0;
  background: var(--surface);
}

.op-notes {
  margin: 6px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.op-notes li {
  margin: 2px 0;
}

/* Platform-native control feedback and keyboard focus share one treatment. */
h1, h2, h3 { letter-spacing: -.02em; line-height: 1.25; }
button, a, select, summary { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, .btn, .rail-item { transition:filter var(--motion-press) ease-out, background-color var(--motion-state) ease-out, border-color var(--motion-state) ease-out; }
button:not(:disabled):not([aria-disabled="true"]):active { filter: brightness(.86); }
input, select, textarea { accent-color: var(--primary); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
:where(button, a, summary) { min-height: 2.75rem; }
:where(button, input, select, textarea, a, summary):focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }

@media (max-width:1200px) {
  .content { padding:24px; }
}
@media (max-width:900px) {
  .page-head { flex-wrap:wrap; align-items:flex-start; }
  .page-head .actions { margin-left:0; }
  .docs-grid { grid-template-columns:minmax(0,1fr); }
  .docs-nav { position:static; max-height:18rem; overflow:auto; }
}
@media (max-width:600px) {
  html { scroll-padding-block:16px calc(90px + env(safe-area-inset-bottom)); }
  .app { grid-template-columns:minmax(0,1fr); }
  .content { padding:20px 16px calc(100px + env(safe-area-inset-bottom)); gap:16px; }
  .content.sandbox-page { height:calc(100dvh - 76px - env(safe-area-inset-bottom)); padding:12px; }
  .robot-strip { flex-wrap:wrap; max-width:100%; }
  .robot-pick { min-width:44px; }
  .robot-pick:not(.current) .robot-name { display:inline-flex; }
  .page-head { gap:12px; margin-bottom:8px; }
  .page-head h1 { gap:7px; }
  .page-head .titles { min-width:0; }
  .page-head .sub { line-height:1.65; }
  .page-head .actions { width:100%; }
  .rail { position:fixed; z-index:50; top:auto; bottom:0; left:0; right:0; height:auto; min-height:72px; padding:6px 8px calc(6px + env(safe-area-inset-bottom)); flex-direction:row; gap:4px; border-right:0; border-top:1px solid var(--border); }
  .rail-brand { display:none; }
  .rail > .rail-item, .rail-more { flex:1; min-width:0; width:auto; }
  .rail-item { min-height:60px; width:auto; padding:6px 2px; border-radius:10px; }
  .rail-item span { font-size:11px; line-height:1.25; }
  .rail-item svg { width:20px; height:20px; }
  .rail-bottom { margin-top:0; }
  .rail-more { display:block; }
  .rail-more-toggle { display:flex; width:100%; }
  .rail-utilities { display:none; position:absolute; right:12px; bottom:calc(100% + 10px); width:min(260px, calc(100vw - 24px)); padding:8px; border:1px solid var(--control-border); border-radius:var(--radius-panel); background:var(--surface); box-shadow:var(--shadow-popover); }
  .rail-more:has([aria-expanded=true]) .rail-utilities { display:flex; flex-direction:column; gap:4px; }
  .rail-utilities .rail-item { flex-direction:row; justify-content:flex-start; gap:12px; min-height:48px; padding:10px 14px; }
  .rail-utilities .rail-item span { font-size:var(--text-label); }
  .rail-utilities .platform-language { width:100%; padding:4px; }
  .rail-utilities .platform-language select { padding:10px 14px; font-size:var(--text-label); }
  .toast-region { bottom:calc(88px + env(safe-area-inset-bottom)); }
  .sites-stage { gap:16px; }
  .card-head { flex-wrap:wrap; gap:6px 12px; }
  .form, .settings-body { padding:16px; }
  .form .actions .note { flex-basis:100%; margin:4px 0 0; }
  .settings-fact { grid-template-columns:minmax(90px, .7fr) minmax(0, 1fr); }
  .robot-row { grid-template-columns:minmax(0,1fr); }
  .admin-toolbar input { min-width:0; width:100%; }
  .admin-table-list:not(.admin-tools) { max-height:14rem; overflow:auto; }
  .map-address { flex-wrap:wrap; }
}

@media (pointer: coarse) {
  button, select, summary, .btn, .btn.small { min-height: 2.75rem; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { min-height: 2.75rem; font-size: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .rail { background: var(--rail); }
  .topbar { background: var(--surface); }
  *, *::before, *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-contrast: more) {
  :root { --border:#7e8489; --line:#a8afb5; --control-border:#a8afb5; --muted:#e1e5e7; --faint:#c6cccf; }
  button:not(:disabled), input, select, textarea { outline: 1px solid currentColor; outline-offset: -1px; }
  :is(button, input, select, textarea, a, summary):focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
}

/* Company sandbox navigation returns through the account-aware workspace entry. */
body[data-workspace="company"] .rail-item:not([data-nav="customers"]):not([data-nav="sites"]):not([data-nav="sandbox"]) { display: none; }
body[data-workspace="company"] .rail-more { display:none; }
body[data-workspace="sandbox"] .rail-item:not([data-nav="sandbox"]),
body[data-workspace="sandbox"] .rail-more { display: none; }
