  /* ---------- Glass & surfaces ---------- */
  .glass {
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(var(--glass-blur)) saturate(140%);
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  }
  @supports not (backdrop-filter: blur(1px)) {
    .glass { background: var(--surface-solid); }
  }
  .card {
    background: var(--surface-solid);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: var(--sp-5);
  }
  .card.glass { background: var(--surface); }

  /* ---------- App shell ---------- */
  .shell { min-height: 100vh; }
  .sidebar {
    position: fixed; inset: 16px auto 16px 16px;
    width: 232px;
    border-radius: var(--r-xl);
    padding: var(--sp-4);
    display: flex; flex-direction: column; gap: var(--sp-4);
    overflow-y: auto; scrollbar-width: none;
    z-index: 30;
  }
  .brand { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2); }
  .brand-mark {
    width: 36px; height: 36px; border-radius: 12px;
    background: var(--primary-grad); color: #fff;
    display: grid; place-items: center;
    box-shadow: 0 8px 20px -6px rgb(99 102 241 / .7);
  }
  .brand-name { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; }
  .brand-sub { font-size: var(--fs-xs); color: var(--text-muted); }
  .nav { display: flex; flex-direction: column; gap: 2px; }
  .nav-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: var(--sp-3) var(--sp-3) var(--sp-1); }
  .nav a {
    display: flex; align-items: center; gap: var(--sp-3);
    padding: 9px var(--sp-3);
    border-radius: var(--r-md);
    color: var(--text-muted);
    font-weight: 500;
    transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  }
  .nav a:hover { background: var(--surface-hover); color: var(--text); }
  .nav a[aria-current="page"] { background: var(--primary-soft); color: var(--text); box-shadow: inset 0 0 0 1px rgb(99 102 241 / .35); }
  .nav a[aria-current="page"] .icon { color: var(--primary); }
  .sidebar-foot { margin-top: auto; }

  .main { margin-left: 264px; padding: 16px 24px 96px 8px; }
  .topbar {
    position: sticky; top: 16px; z-index: 20;
    display: flex; align-items: center; gap: var(--sp-3);
    padding: 10px 12px 10px 16px;
    border-radius: var(--r-pill);
    margin-bottom: var(--sp-6);
  }
  .search {
    flex: 1; display: flex; align-items: center; gap: var(--sp-2);
    color: var(--text-muted);
  }
  .search input { flex: 1; background: none; border: 0; outline: 0; min-width: 0; }
  .kbd { font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border: 1px solid var(--border-strong); border-radius: 7px; color: var(--text-muted); }
  .icon-btn {
    width: 38px; height: 38px; border-radius: var(--r-pill);
    display: grid; place-items: center;
    background: transparent; border: 1px solid transparent; cursor: pointer; color: var(--text-muted);
    transition: all var(--t-fast) var(--ease);
  }
  .icon-btn:hover { background: var(--surface-hover); color: var(--text); }
  .avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--primary-grad); color: #fff;
    display: grid; place-items: center; font-weight: 700; font-size: 13px;
    border: 2px solid var(--surface-solid);
    flex: none;
  }
  .avatar-stack { display: inline-flex; }
  .avatar-stack .avatar { margin-left: -8px; width: 30px; height: 30px; font-size: 11px; }
  .avatar-stack .avatar:first-child { margin-left: 0; }
  .avatar.a2 { background: linear-gradient(135deg, #22d3ee, #6366f1); }
  .avatar.a3 { background: linear-gradient(135deg, #34d399, #22d3ee); }
  .avatar.a4 { background: linear-gradient(135deg, #f59e0b, #ef4444); }

  .page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-6); }
  .eyebrow { font-size: var(--fs-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); font-weight: 600; margin-bottom: var(--sp-2); }
  .lede { color: var(--text-muted); max-width: 62ch; margin-top: var(--sp-3); font-size: var(--fs-md); }

  .section { margin-bottom: var(--sp-7); scroll-margin-top: 90px; }
  .section > header { margin-bottom: var(--sp-4); }
  .section > header p { color: var(--text-muted); margin-top: 6px; }

  /* ---------- Grids ---------- */
  .grid { display: grid; gap: var(--sp-4); }
  .g-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
  .g-3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .g-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  .bento { display: grid; gap: var(--sp-4); grid-template-columns: repeat(4, 1fr); }
  .bento .span-2 { grid-column: span 2; }
  .row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }

  /* ---------- Buttons ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
    padding: 10px 18px; border-radius: var(--r-md);
    border: 1px solid transparent; cursor: pointer; font-weight: 600; font-size: var(--fs-base);
    transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease);
  }
  .btn:hover { transform: translateY(-1px); }
  .btn:active { transform: scale(.98); }
  .btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 10px 24px -10px rgb(99 102 241 / .85); }
  .btn-primary:hover { box-shadow: 0 14px 30px -10px rgb(99 102 241 / 1); }
  .btn-secondary { background: var(--surface); border-color: var(--border-strong); backdrop-filter: blur(12px); }
  .btn-secondary:hover { background: var(--surface-hover); }
  .btn-ghost { background: transparent; color: var(--text-muted); }
  .btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
  .btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgb(248 113 113 / .3); }
  .btn-sm { padding: 6px 12px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
  .btn[disabled] { opacity: .45; pointer-events: none; }

  /* ---------- Inputs ---------- */
  .field { display: flex; flex-direction: column; gap: 6px; }
  .field label { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; }
  .input, .select, .textarea {
    width: 100%; padding: 11px 14px; border-radius: var(--r-md);
    background: var(--surface-solid-2); border: 1px solid var(--border);
    outline: none; transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  }
  .textarea { min-height: 84px; resize: vertical; }
  .input::placeholder, .textarea::placeholder { color: var(--text-muted); opacity: .7; }
  .input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
  .input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
  .hint { font-size: var(--fs-xs); color: var(--text-muted); }
  .hint.err { color: var(--danger); }
  .toggle { position: relative; width: 44px; height: 26px; flex: none; }
  .toggle input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
  .toggle span { position: absolute; inset: 0; border-radius: var(--r-pill); background: var(--surface-solid-2); border: 1px solid var(--border-strong); transition: background var(--t-fast); pointer-events: none; }
  .toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: transform var(--t-fast) var(--ease); }
  .toggle input:checked + span { background: var(--primary); border-color: transparent; }
  .toggle input:checked + span::after { transform: translateX(18px); background: #fff; }

  /* segmented tabs */
  .segmented { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--surface-solid-2); border: 1px solid var(--border); }
  .segmented button, .segmented a { padding: 7px 16px; border-radius: var(--r-pill); border: 0; background: none; cursor: pointer; color: var(--text-muted); font-weight: 600; transition: all var(--t-fast) var(--ease); text-decoration: none; display: inline-block; }
  .segmented button[aria-pressed="true"], .segmented a[aria-pressed="true"] { background: var(--primary-grad); color: #fff; box-shadow: 0 6px 16px -8px rgb(99 102 241 / .9); }

  /* ---------- Pills / chips ---------- */
  .pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 600; border: 1px solid var(--border); background: var(--surface-solid-2); white-space: nowrap; }
  .pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
  .pill.new { color: var(--text-muted); }
  .pill.assigned { color: #a5b4fc; }
  .pill.sent { color: var(--stage-connect); }
  .pill.accepted { color: var(--stage-accepted); }
  .pill.chat { color: var(--stage-chat); }
  .pill.contact { color: var(--stage-close); }
  .pill.sales { color: var(--warning); }
  .pill.won { color: var(--success); background: var(--success-soft); }
  .pill.lost { color: var(--danger); background: var(--danger-soft); }
  .pill.due { color: var(--warning); background: var(--warning-soft); }
  .chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: var(--r-pill); font-family: var(--font-mono); font-size: 12px; background: var(--primary-soft); color: var(--text); border: 1px dashed rgb(99 102 241 / .5); cursor: pointer; }

  /* ---------- Stage stepper ---------- */
  .stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; list-style: none; padding: 0; margin: 0; counter-reset: s; }
  .stepper li { position: relative; padding-top: 22px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); text-align: center; }
  .stepper li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; border-radius: var(--r-pill); background: var(--surface-solid-2); border: 1px solid var(--border); }
  .stepper li.done { color: var(--text); }
  .stepper li.done::before { background: var(--primary-grad); border-color: transparent; }
  .stepper li.current { color: var(--text); }
  .stepper li.current::before { background: var(--primary-grad); border-color: transparent; box-shadow: 0 0 0 4px var(--primary-soft); }

  /* ---------- KPI / bento tiles ---------- */
  .kpi { display: flex; flex-direction: column; gap: 6px; }
  .kpi .label { font-size: var(--fs-sm); color: var(--text-muted); display: flex; align-items: center; gap: 8px; }
  .kpi .value { font-family: var(--font-mono); font-size: var(--fs-3xl); font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
  .kpi .delta { font-size: var(--fs-xs); font-weight: 600; color: var(--success); }
  .kpi .delta.down { color: var(--danger); }
  .spark { width: 100%; height: 36px; margin-top: 6px; }
  .spark path { fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; }
  .spark .area { fill: var(--primary-soft); stroke: none; }
  .bar-list { display: flex; flex-direction: column; gap: 12px; margin-top: var(--sp-3); }
  .bar-row { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 10px; font-size: var(--fs-sm); }
  .bar { height: 10px; border-radius: var(--r-pill); background: var(--surface-solid-2); overflow: hidden; }
  .bar i { display: block; height: 100%; border-radius: inherit; background: var(--primary-grad); }

  /* ---------- Kanban card ---------- */
  .kan-col { display: flex; flex-direction: column; gap: var(--sp-3); }
  .kan-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-family: var(--font-display); }
  .lead-card { padding: var(--sp-4); border-radius: var(--r-lg); background: var(--surface-solid); border: 1px solid var(--border); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: transform var(--t-fast) var(--ease), border-color var(--t-fast); }
  .lead-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
  .lead-card .name { font-weight: 600; }
  .lead-card .meta { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-xs); color: var(--text-muted); }

  /* ---------- Chat bubbles with versions ---------- */
  .chat-thread { display: flex; flex-direction: column; gap: var(--sp-4); }
  .msg { max-width: 82%; display: flex; flex-direction: column; gap: 6px; }
  .msg .who { font-size: var(--fs-xs); color: var(--text-muted); display: flex; gap: 8px; align-items: center; }
  .bubble { padding: 12px 16px; border-radius: 18px; background: var(--surface-solid-2); border: 1px solid var(--border); }
  .msg.lead .bubble { border-bottom-left-radius: 6px; }
  .msg.out { align-self: flex-end; align-items: flex-end; }
  .msg.out .bubble { border-bottom-right-radius: 6px; background: var(--primary-soft); border-color: rgb(99 102 241 / .4); }
  .bubble.draft { border-style: dashed; border-color: var(--stage-chat); background: rgb(139 92 246 / .10); }
  .tag { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: var(--r-pill); background: var(--surface-solid-2); border: 1px solid var(--border); }
  .tag.ai { color: var(--stage-chat); }
  .tag.sent { color: var(--success); }
  .msg-actions { display: flex; gap: 6px; flex-wrap: wrap; }
  .version-tabs { display: inline-flex; gap: 4px; }
  .version-tabs button { border: 1px solid var(--border); background: var(--surface-solid-2); color: var(--text-muted); border-radius: var(--r-pill); padding: 2px 10px; font-size: 11px; font-weight: 600; cursor: pointer; }
  .version-tabs button[aria-pressed="true"] { color: #fff; background: var(--primary); border-color: transparent; }

  /* ---------- Calendar ---------- */
  .cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
  .cal .dow { font-size: 11px; text-align: center; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; padding-bottom: 4px; }
  .cal .day { aspect-ratio: 1; min-height: 40px; border-radius: 12px; background: var(--surface-solid-2); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: var(--fs-sm); position: relative; cursor: pointer; transition: transform var(--t-fast) var(--ease); }
  .cal .day:hover { transform: scale(1.06); }
  .cal .day small { font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); }
  .cal .day.empty { visibility: hidden; }
  .cal .day.h1 { background: rgb(99 102 241 / .16); }
  .cal .day.h2 { background: rgb(99 102 241 / .32); }
  .cal .day.h3 { background: rgb(99 102 241 / .55); color: #fff; }
  .cal .day.h3 small { color: rgb(255 255 255 / .8); }
  .cal .day.today { outline: 2px solid var(--accent); }

  /* ---------- Table ---------- */
  .table-wrap { overflow: auto; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface-solid); }
  table { width: 100%; border-collapse: collapse; }
  th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 12px 16px; position: sticky; top: 0; background: var(--surface-solid-2); }
  td { padding: 12px 16px; border-top: 1px solid var(--border); }
  tbody tr { transition: background var(--t-fast); }
  tbody tr:hover { background: var(--surface-hover); }
  td .person { display: flex; align-items: center; gap: 10px; }

  /* ---------- Timeline ---------- */
  .timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border-strong); display: flex; flex-direction: column; gap: 14px; }
  .timeline li { position: relative; }
  .timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
  .timeline .t { font-size: var(--fs-xs); color: var(--text-muted); }

  /* ---------- Toast / modal / drawer ---------- */
  .toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 100; }
  .toasts[popover] { inset: auto 20px 20px auto; margin: 0; padding: 0; border: 0; background: none; color: inherit; overflow: visible; width: auto; height: auto; }
  .toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md); animation: toast-in var(--t-med) var(--ease); }
  .toast .icon { color: var(--success); }
  @keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }

  dialog { border: 1px solid var(--border-strong); border-radius: var(--r-xl); padding: var(--sp-5); color: var(--text); background: var(--surface-solid); box-shadow: 0 30px 80px -20px rgb(0 0 0 / .6); width: min(480px, calc(100vw - 32px)); }
  dialog::backdrop { background: rgb(5 7 14 / .55); backdrop-filter: blur(6px); }
  dialog[open] { animation: toast-in var(--t-med) var(--ease); }
  .drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(460px, 100vw); border-radius: var(--r-xl) 0 0 var(--r-xl); }
  .drawer[open] { animation: drawer-in 300ms var(--ease); }
  @keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }
  .modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-5); }

  /* ---------- Color swatches ---------- */
  .swatch { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); background: var(--surface-solid); }
  .swatch i { display: block; height: 56px; }
  .swatch div { padding: 8px 12px; font-size: var(--fs-xs); }
  .swatch b { display: block; font-size: var(--fs-sm); }
  .swatch code { color: var(--text-muted); }

  .skeleton { border-radius: var(--r-sm); background: linear-gradient(90deg, var(--surface-solid-2), var(--surface-hover), var(--surface-solid-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
  @keyframes shimmer { to { background-position: -200% 0; } }

  .type-row { display: grid; grid-template-columns: 120px 1fr; gap: var(--sp-4); align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--border); }
  .type-row:last-child { border: 0; }

  /* ---------- Responsive ---------- */
  @media (max-width: 1100px) { .bento { grid-template-columns: repeat(2, 1fr); } }
  @media (max-width: 900px) {
    .sidebar { inset: auto 12px 12px 12px; width: auto; flex-direction: row; padding: 8px; border-radius: var(--r-pill); gap: 0; justify-content: center; }
    .sidebar .brand, .sidebar .nav-label, .sidebar-foot { display: none; }
    .nav { flex-direction: row; gap: 4px; overflow-x: auto; }
    .nav a { padding: 10px 12px; border-radius: var(--r-pill); }
    .nav a span { display: none; }
    .main { margin-left: 0; padding: 12px 16px 110px; }
    .topbar { top: 12px; }
    .bar-row { grid-template-columns: 90px 1fr 32px; }
  }
  @media (max-width: 560px) { .bento { grid-template-columns: 1fr; } .bento .span-2 { grid-column: auto; } .msg { max-width: 94%; } }

/* ---------- Popovers / menus (shell) ---------- */
.has-pop { position: relative; }
.pop { position: absolute; top: calc(100% + 12px); right: 0; min-width: 300px; max-height: 70vh; overflow: auto; border-radius: var(--r-lg); padding: 8px; z-index: 50; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: 0 24px 60px -20px rgb(0 0 0 / .55); animation: toast-in var(--t-fast) var(--ease); }
.pop[hidden] { display: none; }
.search-pop { left: -8px; right: -8px; min-width: 0; top: calc(100% + 16px); }
.pop-head { padding: 10px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.pop-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 8px 12px 4px; }
.pop-sep { height: 1px; background: var(--border); margin: 6px 0; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; cursor: pointer; background: none; border: 0; text-align: left; color: var(--text); }
.pop-item:hover { background: var(--surface-hover); }
a.pop-item { text-decoration: none; }
.icon-btn { position: relative; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface-solid); }
.avatar-btn { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
.nav-foot-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-md); color: var(--text-muted); font-size: var(--fs-sm); }
.nav-foot-link:hover { background: var(--surface-hover); color: var(--text); }
@media (max-width: 900px) { .search-pop { position: fixed; left: 12px; right: 12px; top: 76px; } .pop { max-width: calc(100vw - 24px); } }

.search { min-width: 0; }
@media (max-width: 900px) {
  .topbar { padding: 8px 8px 8px 14px; gap: 2px; }
  .topbar .kbd { display: none; }
  .topbar .icon-btn { width: 34px; height: 34px; }
  .sidebar { max-width: calc(100vw - 24px); }
  .sidebar .nav { max-width: 100%; }
}

/* ---------- PIN boxes (6 small boxes) ---------- */
.pin-boxes { display: flex; gap: 10px; width: 100%; }
.pin-box { flex: 1 1 0; min-width: 0; max-width: 60px; height: 56px; text-align: center; font-size: 22px; font-weight: 600; padding: 0; border-radius: var(--r-md); background: var(--surface-solid-2); border: 1px solid var(--border-strong); color: var(--text); outline: none; caret-color: var(--primary); transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.pin-box:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); transform: translateY(-1px); }
.pin-boxes.invalid .pin-box { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.pin-boxes.static .pin-box { display: grid; place-items: center; border-style: dashed; user-select: all; }
.pin-boxes.sm .pin-box { height: 46px; font-size: 18px; max-width: 46px; }
.pin-row { display: flex; align-items: center; gap: 8px; }
.pin-row > .pin-boxes { flex: 1; }
.pin-gen { display: flex; align-items: center; gap: 10px; }
.pin-gen > .pin-boxes { flex: 1; }
@media (max-width: 420px) { .pin-boxes { gap: 6px; } .pin-box { height: 50px; font-size: 20px; } }
.pin-gen > .pin-boxes, .pin-row > .pin-boxes { width: auto; min-width: 0; }
.pin-gen .pin-box { max-width: none; height: 48px; font-size: 20px; }
.pin-gen .btn { flex: none; }
dialog.drawer { overflow-x: hidden; }
.pin-box { width: 0; }
.field, .grid > * { min-width: 0; }

/* "Open this profile" icon shown first in every list row (owner request, 2026-10-01) */
.open-ic { display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-solid-2); color: var(--primary); text-decoration: none; transition: all var(--t-fast) var(--ease); vertical-align: middle; }
.open-ic:hover, .open-ic:focus-visible { border-color: var(--primary); background: var(--primary-soft); }
.open-ic .icon { width: 15px; height: 15px; }
.cell-open { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-open > div { min-width: 0; }
a.name-link { color: inherit; text-decoration: none; }
a.name-link:hover { color: var(--primary); text-decoration: underline; }

/* Top-bar reminders (backend-only, owner 2026-10-01) */
.icon-btn .badge-n { position: absolute; top: -4px; right: -5px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: var(--r-pill); background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; line-height: 15px; text-align: center; border: 2px solid var(--surface-solid); box-sizing: content-box; }
.memo-pop { width: min(360px, calc(100vw - 32px)); }
.memo-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.memo-item { cursor: default; align-items: flex-start; }
.memo-item .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.memo-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; background: var(--text-muted); }
.memo-dot.overdue { background: var(--danger); }
.memo-dot.today { background: var(--warning); }
.memo-dot.soon { background: var(--primary); }
.memo-dot.done { background: var(--success); }
/* Company logo from Settings > Company profile in place of the default mark */
.brand-mark.has-logo { background: var(--surface-solid); box-shadow: none; border: 1px solid var(--border); overflow: hidden; padding: 3px; }
.brand-mark.has-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 9px; }
.brand-name { overflow-wrap: anywhere; line-height: 1.2; }

/* phone number with a country picker (phone-input.js, owner 2026-10-02) */
.phone-wrap { display: flex; gap: 6px; width: 100%; min-width: 0; }
.phone-wrap .phone-cc { flex: 0 0 118px; width: 118px; padding-right: 26px; }
/* two phone fields side by side get too narrow in a drawer column — stack them */
.f2:has(.phone-wrap) { grid-template-columns: 1fr; }
.phone-wrap > input { flex: 1 1 auto; min-width: 0; }
