:root {
  --ink: #26213a;
  --ink-2: #3a3452;
  --lift: #f25c3b;
  --lift-soft: #fde6df;
  --paper: #fbf4ea;
  --card: #fff;
  --line: #ebe3d6;
  --mute: #6f6a7d;
  --ok: #2f8a5b;
  --warn: #c98a12;
  --bad: #c2412d;
  --r: 16px;
  --r-sm: 10px;
  --side: 264px;
  --tabs: 64px;
  font-family:
    -apple-system, system-ui, "Segoe UI", Roboto, "Noto Sans Hebrew", Arial,
    sans-serif;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
}
[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: overrides component display, intended */
  display: none !important;
}
:focus-visible {
  outline: 2px solid var(--lift);
  outline-offset: 2px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--lift);
  box-shadow: 0 0 0 4px #f25c3b22;
}

/* login */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--ink);
  color: #fff;
}
.login-card {
  width: min(380px, 100%);
  background: #fff1;
  border: 1px solid #fff2;
  border-radius: 22px;
  padding: 28px;
}
.login-card p {
  color: #fffc;
}
.login form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.login input {
  flex: 1;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid #fff3;
  background: #0003;
  padding: 12px 14px;
  color: #fff;
}
.login button {
  border: 0;
  border-radius: 12px;
  background: var(--lift);
  color: #fff;
  font-weight: 700;
  padding: 0 18px;
}
.err {
  /* biome-ignore lint/complexity/noImportantStyles: overrides component display, intended */
  color: #ffb4a4 !important;
  min-height: 1.5em;
}

/* shell */
.app {
  min-height: 100dvh;
}
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top h1 {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.icon-btn {
  border: 0;
  background: transparent;
  padding: 8px;
  border-radius: 10px;
  display: grid;
}
.icon-btn:hover {
  background: #26213a0d;
}
.me {
  border: 0;
  background: transparent;
  padding: 2px;
  border-radius: 999px;
}
.av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  background: var(--ink);
  position: relative;
  flex: none;
}
.av.agent {
  background: var(--lift);
}
.av[data-s]::after {
  content: "";
  position: absolute;
  inset-inline-end: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--paper);
  background: #aaa;
}
.av[data-s="working"]::after {
  background: var(--ok);
}
.av[data-s="blocked"]::after {
  background: var(--bad);
}
.av[data-s="away"]::after {
  background: var(--warn);
}
.av.sm {
  width: 26px;
  height: 26px;
  font-size: 11px;
}
.av.sm[data-s]::after {
  width: 9px;
  height: 9px;
}
.side .av:not(.agent) {
  background: #4d4766;
}
.side .av[data-s]::after {
  border-color: var(--ink);
}

.side {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--side);
  background: var(--ink);
  color: #fff;
  z-index: 40;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow-y: auto;
  padding: max(16px, env(safe-area-inset-top)) 12px 24px;
}
.side.open {
  transform: none;
}
.side-head {
  padding: 4px 8px 16px;
}
.side nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 9px 10px;
  border-radius: 10px;
  color: #ffffffd0;
}
.side nav a:hover {
  background: #ffffff12;
}
.side nav a.on {
  background: #ffffff1f;
  color: #fff;
  font-weight: 600;
}
.side-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 10px 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffffff80;
}
.mini {
  border: 1px solid #ffffff40;
  background: transparent;
  color: #fff;
  border-radius: 8px;
  width: 24px;
  height: 24px;
  line-height: 1;
  padding: 0;
}
.scrim {
  position: fixed;
  inset: 0;
  background: #0006;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.scrim.on {
  opacity: 1;
  pointer-events: auto;
}
.badge {
  margin-inline-start: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--lift);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
}
.badge:empty {
  display: none;
}

.view {
  padding: 16px 14px calc(var(--tabs) + 24px + env(safe-area-inset-bottom));
  max-width: 860px;
  margin: 0 auto;
  outline: none;
}
.tabs {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fffffff2;
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabs a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  color: var(--mute);
}
.tabs a svg {
  width: 24px;
  height: 24px;
}
.tabs a.on {
  color: var(--lift);
}
.tabs .badge {
  position: absolute;
  top: 6px;
  inset-inline-start: calc(50% + 6px);
  margin: 0;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
}

@media (min-width: 900px) {
  .side {
    transform: none;
  }
  .scrim,
  #menu-btn,
  .tabs {
    display: none;
  }
  .top,
  .view {
    margin-inline-start: var(--side);
  }
  .view {
    padding-bottom: 40px;
    max-width: calc(860px + var(--side));
    padding-inline: 28px;
  }
  .chat-wrap {
    /* biome-ignore lint/complexity/noImportantStyles: overrides component display, intended */
    height: calc(100dvh - 140px) !important;
  }
}

/* blocks */
h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--mute);
  margin: 26px 2px 10px;
  font-weight: 700;
}
h2:first-child {
  margin-top: 4px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.card.click {
  cursor: pointer;
  transition:
    border-color 0.15s,
    transform 0.1s;
}
.card.click:hover {
  border-color: #d8ccb8;
}
.card.click:active {
  transform: scale(0.995);
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.grow {
  flex: 1;
  min-width: 0;
}
.muted {
  color: var(--mute);
  font-size: 14px;
}
.small {
  font-size: 13px;
}
.empty {
  text-align: center;
  color: var(--mute);
  padding: 28px 12px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 2px 9px;
  background: #26213a12;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill.todo {
  background: #26213a12;
}
.pill.doing {
  background: #e3f0ff;
  color: #1f5fa8;
}
.pill.blocked {
  background: #fde2dc;
  color: var(--bad);
}
.pill.review {
  background: #fff1d6;
  color: #8a5d00;
}
.pill.done {
  background: #dff3e8;
  color: var(--ok);
}
.pill.dropped {
  background: #eee;
  color: #888;
}
.pill.lift {
  background: var(--lift-soft);
  color: #b33a1d;
}
.btn {
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
}
.btn.lift {
  background: var(--lift);
}
.btn.ghost,
.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
}
.btn.sm {
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 10px;
}
.btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.seg {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.seg button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.seg button.on {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* markdown */
.md {
  overflow-wrap: anywhere;
}
.md p {
  margin: 0 0 8px;
}
.md p:last-child {
  margin-bottom: 0;
}
.md ul {
  margin: 4px 0 8px;
  padding-inline-start: 20px;
}
.md code {
  font:
    13.5px ui-monospace,
    Menlo,
    Consolas,
    monospace;
  background: #26213a0f;
  padding: 1px 5px;
  border-radius: 6px;
}
.md pre {
  background: var(--ink);
  color: #f3eee6;
  padding: 12px;
  border-radius: 12px;
  overflow-x: auto;
  font-size: 13px;
}
.md pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.md h1,
.md h2,
.md h3 {
  font-size: 17px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  margin: 14px 0 6px;
}
.md a {
  color: #b33a1d;
}
.at {
  color: #b33a1d;
  font-weight: 700;
}

/* chat */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 120px - var(--tabs) - env(safe-area-inset-bottom));
}
.msgs {
  flex: 1;
  overflow-y: auto;
  padding: 4px 2px 12px;
}
.msg {
  display: flex;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 12px;
}
.msg:hover {
  background: #ffffff8c;
}
.msg .who {
  font-weight: 700;
  font-size: 14.5px;
}
.msg .when {
  color: var(--mute);
  font-size: 12px;
  margin-inline-start: 6px;
}
.msg.handoff .bubble {
  border-inline-start: 0;
  background: #fff;
  border: 1px solid #f3c8bb;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 4px;
}
.msg.digest .bubble {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 4px;
}
.thread-link {
  border: 0;
  background: none;
  color: #b33a1d;
  font-weight: 700;
  font-size: 13px;
  padding: 4px 0 0;
}
.composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.composer textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 160px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
}
.composer .btn {
  height: 44px;
}
.thread-head {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 4px;
  margin-bottom: 8px;
}

/* forms */
label.f {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--mute);
  margin: 12px 0 4px;
}
.f-in,
dialog input,
dialog textarea,
dialog select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
}
dialog textarea {
  min-height: 110px;
  resize: vertical;
}
dialog {
  border: 0;
  border-radius: 20px;
  padding: 18px;
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 40px);
  box-shadow: 0 30px 80px -20px #26213a66;
}
dialog::backdrop {
  background: #26213a80;
}
dialog h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.dlg-acts {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.dlg-acts button {
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 700;
}
#dlg-ok {
  border: 0;
  background: var(--ink);
  color: #fff;
}

/* decisions */
.dec-q {
  font-weight: 700;
  font-size: 16.5px;
}
.opts {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.opts button {
  text-align: start;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
}
.opts button:hover {
  border-color: var(--lift);
}

.toast {
  position: fixed;
  inset-inline: 0;
  bottom: calc(var(--tabs) + 16px + env(safe-area-inset-bottom));
  margin: 0 auto;
  width: fit-content;
  max-width: calc(100vw - 32px);
  background: var(--ink);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.2s;
  pointer-events: none;
  z-index: 60;
}
.toast.on {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    /* biome-ignore lint/complexity/noImportantStyles: overrides component display, intended */
    transition: none !important;
  }
}
