:root {
  --bg: #f4f0e8;
  --card: #fffdf8;
  --ink: #1a1714;
  --muted: #6b645b;
  --line: #e6dfd4;
  --urgent: #9b1c1c;
  --ok: #0b6b45;
  --ok-ink: #f4f0e8;
  --shadow: 0 1px 2px rgba(26, 23, 20, 0.06), 0 8px 24px rgba(26, 23, 20, 0.06);
  --radius: 24px;
  --btn: 56px;
  --max: 640px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  font-family: "Segoe UI", "Avenir Next", "Helvetica Neue", "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 100% -10%, #efe7d8 0%, transparent 60%),
    var(--bg);
  min-height: 100dvh;
  line-height: 1.45;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

.app { max-width: var(--max); margin: 0 auto; padding: 20px 16px 96px; }

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.brand h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.brand .date { color: var(--muted); font-size: 15px; margin-top: 4px; }
.badge {
  display: inline-flex;
  align-items: center;
  background: #efe7d8;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.live { background: var(--ok); color: var(--ok-ink); }

.login {
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 15px;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.login p { margin: 0; }
.login strong { color: var(--ink); }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px 18px;
}
.card.focus { min-height: 280px; }
.kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}
.kicker .tag {
  background: #efe7d8;
  color: var(--ink);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
}
.kicker .tag.hot { background: #fdecea; color: var(--urgent); }
.kicker .tag.ok { background: #dcfce7; color: var(--ok); }

.who {
  margin: 0 0 6px;
  font-size: 30px;
  letter-spacing: -0.03em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.channel {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px;
}
.channel bdi { unicode-bidi: isolate; }

.body {
  background: #f7f3ec;
  border-radius: 16px;
  padding: 16px 16px;
  font-size: 20px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 14px;
  min-height: 4.5em;
}
.body a { color: var(--ok); font-weight: 700; }
.body bdi {
  font-weight: 700;
  unicode-bidi: isolate;
  background: #efe7d8;
  border-radius: 6px;
  padding: 0 4px;
}

.meta { color: var(--muted); font-size: 15px; margin: 0 0 18px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
button, .btn {
  appearance: none;
  border: 0;
  background: #efe7d8;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 17px;
  min-height: var(--btn);
  padding: 0 16px;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  flex: 1 1 auto;
}
button:disabled, .btn.disabled { opacity: 0.45; cursor: not-allowed; }
button.primary, .btn.primary { background: var(--ok); color: var(--ok-ink); }
button.danger { background: var(--urgent); color: #fff; }
button.ghost, .btn.ghost { background: transparent; border: 1.5px solid var(--line); }

.queue {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  margin: 22px 0 0;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 16px;
}

.toast {
  position: fixed;
  inset-inline: 16px;
  bottom: 20px;
  background: var(--ink);
  color: #fff;
  padding: 14px 16px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  z-index: 40;
  display: none;
}
.toast.show { display: block; }

.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(26, 23, 20, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.modal-back.show { display: flex; }
.modal {
  background: var(--card);
  width: min(520px, 100%);
  border-radius: 24px 24px 20px 20px;
  padding: 22px 20px 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal h3 { margin: 0 0 8px; font-size: 24px; }
.modal p { margin: 0 0 16px; color: var(--muted); }
.modal textarea {
  width: 100%;
  min-height: 120px;
  font: inherit;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: #fff;
  margin-bottom: 14px;
  resize: vertical;
}

@media (min-width: 800px) {
  body { font-size: 17px; }
  .app { padding-top: 48px; }
  .brand h1 { font-size: 40px; }
  .who { font-size: 36px; }
}

.head-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.badge.demo {
  background: #7a2e0e;
  color: #fff7e8;
  font-size: 14px;
}
.demo-banner {
  background: #7a2e0e;
  color: #fff7e8;
  text-align: center;
  font-weight: 700;
  font-size: 16px;
  padding: 10px 16px;
  letter-spacing: 0.02em;
}
button.logout {
  min-height: 40px;
  flex: 0 0 auto;
  font-size: 14px;
  padding: 0 12px;
}

.note { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.undo-msg { margin: 0; color: var(--muted); font-weight: 600; }

.undo {
  position: fixed;
  inset-inline: 16px;
  bottom: 20px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  border-radius: 14px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow);
}
.undo[hidden] { display: none !important; }
.undo button {
  flex: 0 0 auto;
  min-height: 44px;
  background: #fff;
  color: var(--ink);
}

body.busy button,
body.busy a.btn { pointer-events: none; }
