:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --text: #15171a;
  --muted: #5b6470;
  --border: #d9dde3;
  --primary: #1a58be;
  --primary-text: #ffffff;
  --danger: #b3261e;
  --ok: #1e7a3c;
  --warn: #8a5a00;
  --rec: #d32f2f;
  --radius: 14px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --surface: #1a1d23;
    --text: #eef0f3;
    --muted: #a3acb8;
    --border: #2d323b;
    --primary: #6ea1ff;
    --primary-text: #0b1220;
    --danger: #ff8a80;
    --ok: #7bd491;
    --warn: #ffcf6b;
    --rec: #ff6b6b;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Hebrew", Arial, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
}

.top h1 { margin: 0; font-size: 1.25rem; }

.banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 0.85rem;
  color: var(--warn);
}

main { padding: 0 16px 16px; max-width: 640px; margin: 0 auto; }

h2 { font-size: 1.05rem; margin: 18px 0 8px; color: var(--muted); font-weight: 600; }

.lead { font-size: 1.1rem; margin: 24px 0; }

.view[hidden], [hidden] { display: none !important; }

.stack { display: flex; flex-direction: column; gap: 12px; }

.row { display: flex; gap: 8px; align-items: center; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.card.proposal { border-color: var(--primary); }
.card.refused { border-color: var(--danger); }
.card.warn { border-color: var(--warn); }

.card p { margin: 0 0 8px; }
.card p:last-child { margin-bottom: 0; }

.label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 6px; }

.sr {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

input[type="text"], textarea, select {
  flex: 1;
  min-height: 48px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

textarea { resize: vertical; margin-bottom: 10px; }

:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }

.btn {
  min-height: 48px;
  min-width: 48px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary { background: var(--primary); color: var(--primary-text); border-color: var(--primary); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.big { min-height: 56px; font-size: 1.1rem; width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: default; }

.mic-wrap { display: flex; flex-direction: column; align-items: center; margin: 18px 0; gap: 8px; }

.mic {
  inline-size: 132px;
  block-size: 132px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: var(--primary-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.mic.recording { background: var(--rec); animation: pulse 1s ease-in-out infinite; }
.mic.busy { opacity: 0.6; }
.mic-icon { inline-size: 60px; block-size: 60px; fill: currentColor; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.5); }
  50% { box-shadow: 0 0 0 18px rgba(211, 47, 47, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .mic.recording { animation: none; }
}

.hint { color: var(--muted); margin: 0; min-height: 1.5em; text-align: center; }

.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item .meta { color: var(--muted); font-size: 0.85rem; }
.item .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.item .actions .btn { min-height: 44px; padding: 6px 14px; }

.briefing-line { margin: 0 0 6px; }
.briefing-line:last-child { margin: 0; color: var(--muted); font-size: 0.92rem; }

.ok { color: var(--ok); }
.err { color: var(--danger); }
.muted { color: var(--muted); }

.tabs {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab {
  min-height: 60px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tab[aria-current="page"] { color: var(--primary); box-shadow: inset 0 3px 0 var(--primary); }

.kv { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.danger-zone { border-top: 1px solid var(--border); padding-top: 12px; }
