/* kpi v2 — time-first matchmaking. Teal/ink, timeline + sheets + floor plan. */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --ink: #10201e; --mut: #5b6b68; --line: #dde7e4; --bg: #eef4f2;
  --acc: #0d7d6c; --acc-soft: #d9efe9; --acc-ink: #0a5f53;
  --gold: #a16207; --gold-soft: #fef3c7; --red: #b91c1c; --red-soft: #fee2e2;
  --rail: 76px;
}
body.kpi { font-family: ui-rounded, -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; }

/* --- chrome: bottom bar (mobile) / left rail (desktop) --- */
.rail { position: fixed; z-index: 30; bottom: 0; left: 0; right: 0; display: flex; background: #fff; border-top: 1px solid var(--line); }
.rail a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); font-size: 10px; font-weight: 700; color: var(--mut); position: relative; }
.rail .ic { font-size: 18px; }
.rail a.on { color: var(--acc); }
.dot { position: absolute; top: 6px; right: calc(50% - 18px); min-width: 16px; height: 16px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.dot:empty { display: none; }
.stage { padding: 0 0 84px; }
#kpi-app { max-width: 720px; margin: 0 auto; padding: 16px; }

@media (min-width: 900px) {
  .rail { top: 0; bottom: 0; right: auto; width: var(--rail); flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding-top: 12px; }
  .rail a { flex: none; padding: 12px 0; }
  .dot { right: 10px; top: 8px; }
  .stage { padding: 0 0 0 var(--rail); }
  #kpi-app { padding: 24px; }
}

/* --- shared --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 700; font-size: 14px; }
.btn-acc { background: var(--acc); border-color: var(--acc); color: #fff; }
.btn-red { background: #fff; border-color: var(--red); color: var(--red); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: default; }
.logo { width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 17px; flex: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #cfdcd9; color: #33413f; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; flex: none; }
.tag { display: inline-block; background: var(--acc-soft); color: var(--acc-ink); border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 700; margin: 2px 4px 2px 0; }
.muted { color: var(--mut); font-size: 13px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.st { font-size: 11px; font-weight: 800; border-radius: 999px; padding: 3px 10px; text-transform: uppercase; letter-spacing: .04em; }
.st-pending { background: var(--gold-soft); color: var(--gold); }
.st-accepted { background: var(--acc-soft); color: var(--acc-ink); }
.st-declined, .st-cancelled { background: var(--red-soft); color: var(--red); }
.st-joining { background: var(--acc-soft); color: var(--acc-ink); }
.st-sitting_out { background: #e6edeb; color: var(--mut); }
.st-invited { background: var(--gold-soft); color: var(--gold); }
.empty { text-align: center; padding: 48px 16px; color: var(--mut); }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.pagehead { margin: 4px 0 16px; }
.pagehead h1 { font-size: 24px; letter-spacing: -.01em; }
.pagehead p { margin-top: 2px; }

/* --- agenda (home) --- */
.dayseg { display: flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin-bottom: 18px; }
.dayseg button { flex: 1; border: 0; background: none; padding: 8px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--mut); }
.dayseg button.on { background: var(--ink); color: #fff; }
.tl { position: relative; }
.tl-row { display: grid; grid-template-columns: 52px 1fr; gap: 10px; min-height: 44px; }
.tl-time { font-size: 12px; color: var(--mut); font-weight: 700; text-align: right; padding-top: 2px; }
.tl-cell { border-left: 2px solid var(--line); padding: 0 0 8px 12px; }
.tl-free button { width: 100%; border: 1.5px dashed var(--line); background: transparent; color: var(--mut); border-radius: 12px; padding: 8px; font-size: 13px; font-weight: 700; }
.tl-free button:hover { border-color: var(--acc); color: var(--acc); }
.tl-meet { display: block; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--acc); border-radius: 12px; padding: 10px 12px; }
.tl-meet.pending { border-left-color: var(--gold); }
.tl-meet .row1 { display: flex; align-items: center; gap: 8px; }
.tl-meet .co { font-weight: 800; font-size: 14px; flex: 1; }
.tl-meet .meta { font-size: 12px; color: var(--mut); margin-top: 2px; }
.now-pill { display: inline-block; background: var(--ink); color: #fff; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 700; margin-bottom: 14px; }

/* --- find (company picker) --- */
.searchrow { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 4px 0 10px; }
.searchrow input { width: 100%; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 14px; font-size: 13px; font-weight: 700; color: var(--mut); }
.chip.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.co-row { display: flex; gap: 12px; align-items: center; padding: 14px 4px; border-bottom: 1px solid var(--line); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.co-row .nm { font-weight: 800; font-size: 15px; }
.co-row .mt { font-size: 13px; color: var(--mut); margin: 1px 0 4px; }
.co-row .go { margin-left: auto; color: var(--acc); font-weight: 800; font-size: 13px; flex: none; }

/* --- sheets (company card + compose) --- */
.sheet-veil { position: fixed; inset: 0; background: rgba(16,32,30,.45); z-index: 40; }
.sheet { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 22px 22px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; }
@media (min-width: 900px) {
  .sheet { left: auto; right: 24px; top: 24px; bottom: 24px; width: 460px; border-radius: 22px; max-height: none; }
}
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet-x { position: absolute; top: 14px; right: 14px; border: 0; background: var(--bg); width: 32px; height: 32px; border-radius: 50%; font-size: 15px; color: var(--mut); }
.sum { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.sum b { text-align: right; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg .chip { flex: 1; text-align: center; }
.locgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; max-height: 180px; overflow-y: auto; }
.loc { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 4px; font-size: 12px; font-weight: 700; }
.loc.on { background: var(--acc); color: #fff; border-color: var(--acc); }
.loc.booth { grid-column: 1 / -1; padding: 10px; }
textarea.msg { width: 100%; min-height: 76px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
h3.sh { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--mut); margin: 16px 0 8px; }

/* --- inbox threads --- */
.thread { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; }
.thread .nm { font-weight: 800; font-size: 14px; }
.thread .pv { font-size: 13px; color: var(--mut); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.thread .tx { flex: 1; min-width: 0; }
.bubble { background: var(--bg); border-radius: 14px 14px 14px 4px; padding: 10px 14px; font-size: 14px; max-width: 90%; margin: 10px 0; }
.replybar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.joiners { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.joiner { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px 4px 4px; font-size: 12px; font-weight: 700; background: #fff; }
.chatmock { display: flex; gap: 8px; margin-top: 14px; }
.chatmock input { flex: 1; border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; }
.decline-opts label { display: block; font-size: 14px; padding: 7px 0; }
.decline-opts textarea { width: 100%; min-height: 64px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 6px; }

/* --- my company --- */
.mc-field { margin-bottom: 14px; }
.mc-field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.mc-field input[type=text], .mc-field textarea { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.mc-field textarea { min-height: 96px; }
.banner { border-radius: 14px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; background: var(--gold-soft); color: var(--gold); font-weight: 600; }

/* --- floor plan --- */
.slot-rail { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.floor-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (min-width: 700px) { .floor-grid { grid-template-columns: repeat(6, 1fr); } }
.tbl { aspect-ratio: 1; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 800; font-size: 15px; }
.tbl small { font-size: 10px; font-weight: 700; color: var(--mut); }
.tbl.c { background: var(--acc-soft); border-color: var(--acc); color: var(--acc-ink); }
.tbl.p { background: var(--gold-soft); border-color: var(--gold); color: var(--gold); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--mut); margin: 12px 0; flex-wrap: wrap; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: 90px; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 700; z-index: 60; }
@media (min-width: 900px) { .toast { bottom: 28px; } }
