:root {
  color-scheme: light;
  --ink: #102726;
  --ink-2: #405251;
  --paper: #f5f3ee;
  --white: #fffefa;
  --line: #d9d8d1;
  --bronze: #a66d36;
  --bronze-soft: #eee1d2;
  --sea: #e1ece9;
  --red: #b64a43;
  --green: #48745d;
  --shadow: 0 20px 60px rgb(16 39 38 / 12%);
  font-family: "Helvetica Neue", Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 0; overflow-x: hidden; }
body {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
}
body.detail-open {
  position: fixed;
  top: var(--page-scroll-lock, 0);
  right: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, select { touch-action: manipulation; }
[hidden] { display: none !important; }

.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 15%, rgb(166 109 54 / 18%), transparent 28rem),
    linear-gradient(135deg, #0e2827, #173c39);
}
.login__card {
  width: min(100%, 390px);
  padding: 36px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 30px 100px rgb(0 0 0 / 30%);
}
.login h1 { margin: 4px 0 8px; font-size: 2rem; letter-spacing: -.04em; }
.login label { display: grid; gap: 8px; margin-top: 28px; font-size: .78rem; color: var(--ink-2); }
.login input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  outline: none;
  color: var(--ink);
  background: white;
}
.login input:focus { border-color: var(--bronze); box-shadow: 0 0 0 3px rgb(166 109 54 / 12%); }
.button { border: 0; border-radius: 12px; padding: 14px 18px; cursor: pointer; }
.button--primary { width: 100%; margin-top: 14px; color: white; background: var(--ink); font-weight: 700; }
.form-error { min-height: 20px; color: var(--red); font-size: .82rem; }

.shell { min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 5;
  width: 248px;
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  color: white;
  background: var(--ink);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 28px; color: inherit; text-decoration: none; }
.brand b, .brand small { display: block; }
.brand small { color: rgb(255 255 255 / 55%); margin-top: 2px; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; }
.mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  color: white;
  background: var(--bronze);
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: -.06em;
}
.sidebar nav { display: grid; gap: 6px; }
.nav {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  color: rgb(255 255 255 / 65%);
  background: transparent;
}
.nav span { width: 22px; text-align: center; font-size: 1.1rem; }
.nav:hover, .nav.is-active { color: white; background: rgb(255 255 255 / 9%); }
.sidebar__foot {
  margin-top: auto;
  padding: 14px 10px 0;
  border-top: 1px solid rgb(255 255 255 / 12%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 9px;
  align-items: center;
}
.sidebar__foot b, .sidebar__foot small { display: block; font-size: .72rem; }
.sidebar__foot small { margin-top: 2px; color: rgb(255 255 255 / 45%); }
.sidebar__foot button { border: 0; color: rgb(255 255 255 / 55%); background: transparent; cursor: pointer; }
.system-dot { width: 8px; height: 8px; border-radius: 50%; background: #70bd82; box-shadow: 0 0 0 4px rgb(112 189 130 / 13%); }

.main { min-width: 0; margin-left: 248px; padding: 32px clamp(20px, 4vw, 56px) 80px; }
.topbar { display: flex; align-items: center; justify-content: space-between; }
.eyebrow { margin: 0; color: var(--bronze); font-size: .68rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.topbar h1 { margin: 5px 0 0; font-size: clamp(1.75rem, 4vw, 2.7rem); letter-spacing: -.055em; }
.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  cursor: pointer;
  font-size: 1.25rem;
}
.icon-button:hover { border-color: var(--bronze); }

.stats { margin: 28px 0 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats article {
  min-height: 100px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgb(255 254 250 / 70%);
}
.stats span { color: var(--ink-2); font-size: .78rem; }
.stats strong { font-size: 1.8rem; letter-spacing: -.05em; }

.toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) auto; gap: 10px; margin-bottom: 14px; }
.toolbar.is-search-only { grid-template-columns: 1fr; }
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--white);
}
.search span { color: var(--ink-2); font-size: 1.2rem; }
.search input { width: 100%; min-width: 0; padding: 13px 0; border: 0; outline: 0; color: var(--ink); background: transparent; }
.toolbar select { border: 1px solid var(--line); border-radius: 13px; padding: 0 38px 0 14px; color: var(--ink); background: var(--white); }

.lead-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.kanban-board {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  padding: 2px;
  touch-action: pan-y;
}
.kanban-column {
  min-width: 0;
  min-height: 190px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 254 250 / 58%);
  touch-action: pan-y;
  transition: border-color .16s ease, background .16s ease;
}
.kanban-column.is-dragover { border-color: var(--bronze); background: var(--bronze-soft); }
.kanban-column__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 2px 3px 13px;
}
.kanban-column__head h2 { margin: 0; font-size: .86rem; letter-spacing: -.01em; }
.kanban-column__head h2 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-column__head strong {
  min-width: 26px;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--ink-2);
  background: var(--paper);
  text-align: center;
  font-size: .72rem;
}
.stage-dot { width: 8px; height: 8px; border-radius: 50%; background: #8f9b99; }
.stage-dot[data-status="new"] { background: var(--bronze); }
.stage-dot[data-status="contacted"] { background: #53859b; }
.stage-dot[data-status="estimating"] { background: #8c74a6; }
.stage-dot[data-status="proposal"] { background: #c4933d; }
.stage-dot[data-status="won"] { background: var(--green); }
.stage-dot[data-status="lost"] { background: #92918b; }
.kanban-column__cards { display: grid; gap: 9px; }
.kanban-empty {
  margin: 0;
  padding: 24px 12px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  color: #7b8886;
  text-align: center;
  font-size: .76rem;
}
.kanban-card {
  width: 100%;
  min-width: 0;
  padding: 13px;
  border: 1px solid #e1dfd8;
  border-radius: 14px;
  outline: none;
  background: var(--white);
  box-shadow: 0 7px 20px rgb(16 39 38 / 5%);
  cursor: pointer;
  touch-action: pan-y;
}
.kanban-card:focus-visible { border-color: var(--bronze); box-shadow: 0 0 0 3px rgb(166 109 54 / 13%); }
.kanban-card.is-linked {
  border-color: var(--bronze);
  box-shadow: 0 0 0 3px rgb(166 109 54 / 18%), 0 14px 36px rgb(16 39 38 / 13%);
  animation: linked-lead 1.2s ease 2;
}
@keyframes linked-lead {
  50% { transform: translateY(-3px); box-shadow: 0 0 0 5px rgb(166 109 54 / 22%), 0 18px 42px rgb(16 39 38 / 16%); }
}
.kanban-card.is-dragging { opacity: .45; }
.kanban-card__top, .kanban-card__person, .kanban-card footer { display: flex; align-items: center; }
.kanban-card__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  color: var(--ink-2);
  font-size: .68rem;
}
.kanban-card__top .kind {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-card__top time { white-space: nowrap; }
.kanban-card__person { gap: 9px; margin-top: 12px; }
.kanban-card__person .avatar { width: 36px; height: 36px; font-size: .72rem; }
.kanban-card__person div { min-width: 0; }
.kanban-card__person strong, .kanban-card__person div span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kanban-card__person strong { font-size: .88rem; }
.kanban-card__person div span { margin-top: 2px; color: var(--ink-2); font-size: .7rem; }
.kanban-card > p {
  margin: 13px 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-2);
  font-size: .78rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.kanban-card footer {
  justify-content: space-between;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid #eceae4;
}
.kanban-card footer > span {
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .68rem;
}
.stage-move {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  font-size: 1rem;
}
.stage-move:disabled { opacity: .28; cursor: default; }
.lead-card {
  min-height: 230px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  cursor: pointer;
  text-align: left;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.lead-card:hover { transform: translateY(-2px); border-color: #c2b7a9; box-shadow: 0 12px 30px rgb(16 39 38 / 8%); }
.lead-card.is-selected { border-color: var(--bronze); box-shadow: 0 0 0 2px rgb(166 109 54 / 13%); }
.lead-card__top, .lead-card__person, .lead-card__meta { display: flex; align-items: center; }
.lead-card__top { justify-content: space-between; color: var(--ink-2); font-size: .72rem; }
.kind { padding: 5px 9px; border-radius: 999px; color: var(--green); background: var(--sea); font-weight: 700; }
.kind[data-kind="call"] { color: var(--bronze); background: var(--bronze-soft); }
.lead-card__person { gap: 11px; margin-top: 17px; }
.avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--ink); font-size: .82rem; font-weight: 800; }
.lead-card__person div { min-width: 0; }
.lead-card__person strong, .lead-card__person .phone { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-card__person strong { font-size: 1rem; }
.lead-card__person .phone { margin-top: 3px; color: var(--ink-2); font-size: .78rem; }
.priority { margin-left: auto; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.priority[data-priority="high"] { background: var(--red); box-shadow: 0 0 0 4px rgb(182 74 67 / 12%); }
.summary {
  min-height: 43px;
  margin: 18px 0;
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-2);
  font-size: .86rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.lead-card__meta { justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px solid #eceae4; color: var(--ink-2); font-size: .72rem; }
.object { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage { flex: 0 0 auto; color: var(--ink); font-weight: 700; }
.empty { padding: 64px 20px; display: grid; place-items: center; gap: 7px; color: var(--ink-2); text-align: center; }
.empty b { color: var(--ink); }

.detail {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 20;
  width: min(100%, 520px);
  height: 100vh;
  height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 112px;
  padding: 32px 28px 80px;
  border-left: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow);
}
#detail-content { min-width: 0; }
.detail__close { position: sticky; top: 0; float: right; z-index: 2; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: var(--white); cursor: pointer; font-size: 1.4rem; }
.detail-head { padding: 10px 48px 24px 0; border-bottom: 1px solid var(--line); }
.detail-head h2 { margin: 7px 0; font-size: 1.8rem; letter-spacing: -.04em; }
.detail-head a { color: var(--ink-2); overflow-wrap: anywhere; text-decoration: none; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 18px; }
.detail-actions a { padding: 11px 14px; border-radius: 11px; color: white; background: var(--ink); text-align: center; font-weight: 700; }
.detail-actions a:last-child { color: var(--ink); background: var(--sea); }
.mobile-callbar { display: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.field-row label { display: grid; gap: 6px; color: var(--ink-2); font-size: .72rem; }
.field-row select { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); }
.lead-editor {
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #faf9f5;
}
.lead-editor summary {
  min-height: 54px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font-weight: 800;
}
.lead-editor summary small { color: var(--ink-2); font-size: .68rem; font-weight: 400; }
.lead-editor form { padding: 0 14px 14px; display: grid; gap: 11px; }
.voice-entry {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid #cddbd7;
  border-radius: 12px;
  background: var(--sea);
}
.voice-button {
  min-height: 52px !important;
  padding: 8px 10px !important;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgb(16 39 38 / 14%) !important;
  border-radius: 11px !important;
  color: var(--ink) !important;
  background: white !important;
  text-align: left;
  font-weight: 400 !important;
}
.voice-button__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  color: white;
  background: var(--ink);
  font-size: 1rem;
}
.voice-button b, .voice-button small { display: block; }
.voice-button b { font-size: .8rem; }
.voice-button small { margin-top: 2px; color: var(--ink-2); font-size: .67rem; line-height: 1.3; }
.voice-button.is-recording {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgb(182 74 67 / 12%);
}
.voice-button.is-recording .voice-button__icon {
  background: var(--red);
  animation: voice-pulse 1.2s ease-in-out infinite;
}
.voice-button.is-processing { cursor: wait; opacity: .7; }
.voice-status {
  color: var(--ink-2);
  font-size: .7rem;
  line-height: 1.45;
}
.voice-status:empty { display: none; }
.voice-transcript {
  margin: 0;
  padding-top: 7px;
  border-top: 1px solid rgb(16 39 38 / 12%);
  color: var(--ink-2);
  font-size: .68rem;
  line-height: 1.4;
}
@keyframes voice-pulse {
  50% { transform: scale(.9); box-shadow: 0 0 0 7px rgb(182 74 67 / 12%); }
}
.lead-editor__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.lead-editor label { display: grid; gap: 6px; color: var(--ink-2); font-size: .72rem; }
.lead-editor input, .lead-editor textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: white;
}
.lead-editor input:focus, .lead-editor textarea:focus { border-color: var(--bronze); box-shadow: 0 0 0 3px rgb(166 109 54 / 10%); }
.lead-editor textarea { min-height: 112px; resize: vertical; line-height: 1.45; }
.lead-editor form button {
  min-height: 46px;
  border: 0;
  border-radius: 11px;
  color: white;
  background: var(--ink);
  cursor: pointer;
  font-weight: 800;
}
.lead-editor form button:disabled { opacity: .55; cursor: wait; }
.section { padding: 20px 0; border-bottom: 1px solid var(--line); }
.section h3 { margin: 0 0 12px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; }
.section p { margin: 0; overflow-wrap: anywhere; color: var(--ink-2); font-size: .88rem; line-height: 1.55; white-space: pre-wrap; }
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-title h3 { margin: 0; }
.copy-button {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: white;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
}
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { max-width: 100%; padding: 7px 10px; overflow-wrap: anywhere; border-radius: 999px; color: var(--ink-2); background: var(--paper); font-size: .75rem; }
.next-step { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: .84rem; }
.next-step span { min-width: 0; overflow-wrap: anywhere; }
.next-step small { color: var(--bronze); }
.call { padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #faf9f5; }
.call + .call { margin-top: 9px; }
.call__top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; overflow-wrap: anywhere; font-size: .75rem; }
.call audio { width: 100%; height: 36px; margin: 12px 0; }
.transcript { max-height: 250px; overflow: auto; padding: 12px; border-radius: 9px; background: white; font-size: .8rem !important; }
.processing { color: var(--bronze) !important; }
.note-form { display: grid; gap: 8px; }
.note-form textarea { width: 100%; min-height: 82px; resize: vertical; padding: 11px; border: 1px solid var(--line); border-radius: 10px; }
.note-form button { justify-self: end; border: 0; border-radius: 10px; padding: 9px 14px; color: white; background: var(--ink); cursor: pointer; }
.note { margin-top: 9px; padding: 11px; overflow-wrap: anywhere; border-radius: 10px; background: var(--paper); }
.note time { display: block; margin-top: 5px; color: var(--ink-2); font-size: .68rem; }
.muted { color: var(--ink-2); }
.bottom-nav { display: none; }
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 50;
  transform: translateX(-50%);
  padding: 11px 16px;
  border-radius: 999px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: .82rem;
  font-weight: 700;
}

@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .main {
    margin-left: 0;
    padding:
      calc(18px + env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      calc(88px + env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
  }
  .topbar h1 { font-size: clamp(1.6rem, 7vw, 2.15rem); }
  .stats {
    margin: 18px 0 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .stats article {
    min-width: 0;
    min-height: 60px;
    padding: 10px 12px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .stats span { min-width: 0; font-size: .7rem; line-height: 1.15; }
  .stats strong { flex: 0 0 auto; font-size: 1.4rem; }
  .lead-list { grid-template-columns: 1fr; }
  .kanban-board {
    width: auto;
    margin: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 0;
  }
  .kanban-column {
    min-height: 0;
    padding: 8px;
    border-radius: 14px;
  }
  .kanban-column__head { gap: 6px; padding: 2px 1px 9px; }
  .kanban-column__head h2 { font-size: .76rem; }
  .kanban-column__head strong { min-width: 23px; padding: 3px 5px; font-size: .66rem; }
  .kanban-column__cards { gap: 7px; }
  .kanban-empty { min-height: 70px; padding: 16px 6px; font-size: .68rem; }
  .kanban-card { padding: 9px; border-radius: 11px; }
  .kanban-card__person { gap: 7px; margin-top: 9px; }
  .kanban-card__person .avatar { width: 30px; height: 30px; font-size: .62rem; }
  .kanban-card__person strong { font-size: .78rem; }
  .kanban-card__person div span { font-size: .64rem; }
  .kanban-card > p {
    min-height: 0;
    margin: 9px 0;
    font-size: .7rem;
    line-height: 1.35;
    -webkit-line-clamp: 2;
  }
  .kanban-card footer { gap: 5px; padding-top: 7px; }
  .kanban-card footer > span { font-size: .62rem; }
  .stage-move { width: 40px; height: 40px; border-radius: 9px; }
  .lead-card { min-height: 0; padding: 14px; border-radius: 14px; }
  .lead-card__person { margin-top: 12px; }
  .summary { min-height: 0; margin: 12px 0; font-size: .8rem; -webkit-line-clamp: 2; }
  .lead-card__meta { padding-top: 10px; }
  .bottom-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding:
      5px max(6px, env(safe-area-inset-right))
      calc(5px + env(safe-area-inset-bottom))
      max(6px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgb(255 254 250 / 94%);
    backdrop-filter: blur(16px);
  }
  .bottom-nav button { min-width: 0; min-height: 50px; display: grid; gap: 2px; place-items: center; border: 0; color: var(--ink-2); background: transparent; font-size: .62rem; }
  .bottom-nav button span { font-size: 1.05rem; }
  .bottom-nav button.is-active { color: var(--bronze); }
  .detail {
    width: 100%;
    padding:
      calc(12px + env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      calc(112px + env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
  }
  .detail-head { padding-top: 4px; }
  .mobile-callbar {
    position: fixed;
    inset: auto 0 0;
    z-index: 30;
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 9px;
    padding:
      10px max(14px, env(safe-area-inset-right))
      calc(10px + env(safe-area-inset-bottom))
      max(14px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: rgb(255 254 250 / 96%);
    backdrop-filter: blur(18px);
  }
  .mobile-callbar a {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 14px;
    color: white;
    background: var(--ink);
    text-decoration: none;
    font-weight: 800;
  }
  .mobile-callbar a:last-child { color: var(--ink); background: var(--sea); }
  .detail-actions { display: none; }
  .detail__close { width: 44px; height: 44px; }
  .toast {
    max-width: calc(100vw - 24px);
    bottom: calc(72px + env(safe-area-inset-bottom));
    text-align: center;
  }
}

@media (max-width: 559px) {
  .kanban-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kanban-card__person .avatar { display: none; }
  .kanban-card footer > span { display: none; }
  .kanban-card footer { justify-content: space-between; }
}

@media (max-width: 520px) {
  .toolbar { grid-template-columns: minmax(0, 1fr) minmax(118px, 42%); gap: 8px; }
  .toolbar.is-search-only { grid-template-columns: 1fr; }
  .toolbar select { height: 44px; padding-right: 26px; padding-left: 10px; }
  .lead-card { padding: 12px; }
  .lead-card__top time { font-size: .64rem; }
  .lead-card__person { margin-top: 9px; }
  .lead-card__person .avatar { display: none; }
  .summary { margin: 9px 0; font-size: .76rem; line-height: 1.35; }
  .lead-card__meta { justify-content: flex-end; padding-top: 8px; }
  .lead-card__meta .object { display: none; }
  .lead-editor input,
  .lead-editor textarea,
  .lead-editor form button { scroll-margin-bottom: 104px; }
  .field-row { grid-template-columns: 1fr; }
  .lead-editor__grid { grid-template-columns: 1fr; }
  .login__card { padding: 28px 22px; }
}

@media (max-width: 359px) {
  .main {
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }
  .stats { gap: 6px; }
  .stats article { min-height: 56px; padding: 8px 9px; }
  .stats span { font-size: .64rem; }
  .stats strong { font-size: 1.25rem; }
  .kanban-board { gap: 6px; }
  .kanban-column { padding: 6px; }
  .kanban-card__top time { display: none; }
  .stage-move { width: 38px; height: 38px; }
  .bottom-nav button { font-size: .58rem; }
}

@media (min-width: 600px) and (max-width: 900px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1600px) {
  .kanban-board { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
