body {
  margin: 0;
  background: #edf1f6;
  color: #18243a;
  font-family: system-ui, sans-serif;
  overflow: auto;
}
body::after { content: none; }
main {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(12px, 3vw, 32px);
}
header { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
h1, header p { margin: 0; }
h1 { font-size: 2rem; }
header p { color: #526079; font-size: .86rem; }
#viewer {
  position: relative;
  order: 0;
  width: 100%;
  height: clamp(360px, 65vh, 660px);
  overflow: hidden;
  border-radius: 18px;
  background: #1b2130;
  color: white;
  box-shadow: 0 8px 22px #17243b1a;
}
#model-state { position: absolute; inset-inline: 1rem; top: 2.5rem; }
.cell-tools { direction: ltr; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#controls {
  min-inline-size: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid #d1d9e6;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px #17243b0c;
}
.command-dock { position: sticky; top: 0; z-index: 1; padding-block: 2px 10px; background: #fff; }
#autonomy-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-block-end: 12px; }
#autonomy-status { flex: 1 1 0; min-inline-size: 0; color: #526079; font-size: .83rem; }
#command-form { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px; }
#controls button, #controls select, #controls input { min-height: 42px; font: inherit; }
#controls button, #controls select, #controls input {
  padding: 6px 10px;
  border: 1px solid #c4cfdf;
  border-radius: 8px;
  background: #fff;
  color: #17243b;
}
#controls button { cursor: pointer; font-weight: 560; }
#controls button:enabled:hover { border-color: #687aaa; background: #f3f6fc; }
#controls button:disabled { opacity: .55; cursor: default; }
#controls #mic, #controls #autonomy-toggle[aria-pressed="true"],
#controls #start-show, #controls #automatic-show {
  border-color: #344288;
  background: #344288;
  color: #fff;
}
#controls :is(#mic, #autonomy-toggle[aria-pressed="true"], #start-show, #automatic-show):enabled:hover {
  background: #27366f;
}
#controls button[data-command="עצור"] {
  margin-inline-start: auto;
  border-color: #e0b0ac;
  background: #fff3f2;
  color: #942928;
}
#controls button[data-command="עצור"]:enabled:hover { background: #ffe4e1; border-color: #b43e38; }
#command, #landmark-name, #controls select { min-width: 0; width: 100%; }
#controls p { margin: 0; }
.live-feedback p:not(:empty) { margin-block: 5px; }
.live-feedback button { margin-block: 5px; }
#reply { font-weight: 600; }
#show-status, #navigation-status { color: #374577; }
#mic-status, #audio-status, #model-wait, #map-status { color: #526079; font-size: .9rem; }
#action-drawer, #conversation, #exploration-controls { margin-block-start: 8px; }
#action-drawer { border-block-start: 1px solid #e0e6f0; padding-block-start: 10px; }
summary { cursor: pointer; font-weight: 600; }
#actions { margin-block-start: 10px; }
#actions [role="tablist"] {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 4px;
  border-radius: 9px;
  background: #edf1f7;
}
#controls [role="tab"] {
  flex: 1 0 auto;
  min-height: 37px;
  border-color: transparent;
  background: transparent;
  white-space: nowrap;
}
#controls [role="tab"][aria-selected="true"] {
  border-color: #c4cfdf;
  background: #fff;
  color: #28376e;
}
[role="tabpanel"] { padding-block-start: 10px; }
.action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.action-grid button { text-align: start; }
.dance-filters { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 6px; }
#controls #dance-count { margin-block: 8px 6px; color: #526079; font-size: .84rem; }
#controls #dance-search { min-width: 0; width: 100%; }
#dance-results { max-height: min(36vh, 275px); overflow: auto; padding: 3px; }
#israeli-medley { margin-block-start: 8px; }
.setting-grid { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; }
.setting-grid button { grid-column: 1 / -1; }
.exploration-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; padding-block: 4px; }
#landmark-name { width: auto; flex: 1 1 120px; }
#conversation-turns { margin-block: 6px 0; padding-inline-start: 1.5rem; }
#conversation-turns li { padding-block: 4px; }
#conversation-turns p { color: #526079; }
@media (max-width: 850px) {
  main { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  #viewer { height: clamp(240px, 40vh, 500px); }
}
@media (max-width: 420px) {
  #controls { padding: 10px; }
  #controls button { padding-inline: 8px; }
  #autonomy-controls { gap: 6px; }
}
