/* lifeos-omni.css — omnibar (>=760px), dock + sheet (<760px), capture, Today.
   Uses lifeos.css tokens only. Load after lifeos.css. */

/* ── Page offsets when the chrome is present ───────────────────── */
body.has-omni { padding-top: 76px; }
body.has-omni .back-link { display: none; }            /* the bar carries home/back */
body.has-omni-dock { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
body.omni-lock { overflow: hidden; }
/* author display rules would beat the UA's [hidden] — pin it */
.omni-scrim[hidden], .omni-drop[hidden], .omni-pop[hidden], .omni-badge[hidden] { display: none !important; }

kbd.omni-kbd, .omni-hints kbd, .omni-capture-row kbd {
  font-family: inherit; font-size: 11px; font-weight: 600; color: var(--text-light);
  padding: 2px 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--card);
}

/* ── Desktop bar ───────────────────────────────────────────────── */
.omni-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 150; height: 60px;
  display: grid; grid-template-columns: minmax(200px, 1fr) minmax(320px, 520px) minmax(200px, 1fr);
  align-items: center; gap: 16px; padding: 0 clamp(16px, 2.5vw, 28px);
  background: var(--card); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
}
.omni-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.omni-title { font-size: 17px; font-weight: 800; letter-spacing: -.3px; color: var(--text); white-space: nowrap; }
.omni-title span { color: var(--primary); }
.omni-title:hover { text-decoration: none; }
.omni-page { font-size: 15px; font-weight: 600; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.omni-center { position: relative; display: flex; justify-content: center; min-width: 0; }
.omni-right { display: flex; align-items: center; gap: 10px; justify-self: end; }

.omni-icon {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-full); flex-shrink: 0;
  background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); cursor: pointer;
  transition: all .15s var(--motion);
}
.omni-icon:hover { background: var(--primary-container); color: var(--on-primary-container); text-decoration: none; }
.omni-icon svg { width: 18px; height: 18px; }
.omni-plus {
  display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
  border-radius: var(--radius-full); background: var(--primary); color: #fff; border: none; cursor: pointer;
  transition: all .2s var(--motion); flex-shrink: 0;
}
.omni-plus:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(61,122,80,.25); }
.omni-plus svg { width: 18px; height: 18px; }
.omni-badge {
  position: absolute; top: -5px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--radius-full); background: var(--wood); color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* The box itself — shared by the bar and the phone sheet */
.omni-box {
  width: 100%; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 14px;
  background: var(--bg); border: 1.5px solid var(--border); border-radius: var(--radius-full);
  transition: all .15s var(--motion);
}
.omni-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(61,122,80,.12); background: var(--card); }
.omni-box-ic { display: inline-flex; color: var(--text-muted); flex-shrink: 0; }
.omni-box-ic svg { width: 18px; height: 18px; }
.omni-box input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-family: inherit;
  font-size: 14px; color: var(--text); padding: 0; -webkit-appearance: none;
}
.omni-box input::placeholder { color: var(--text-light); }
.omni-box input::-webkit-search-cancel-button { display: none; }
.omni-box.in-sheet { height: 46px; }

/* Dropdown under the bar */
.omni-drop {
  position: absolute; top: 46px; left: 0; right: 0; max-height: min(70vh, 560px); overflow-y: auto;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(31,42,33,.22); z-index: 160;
}

/* Rows, groups, hints (shared with the sheet) */
.omni-group { padding: 12px 18px 6px; font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--text-muted); }
.omni-group + .omni-group, .omni-row + .omni-group, .omni-pop-list + .omni-group { border-top: 1px solid var(--border); }
.omni-row, .omni-capture-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 18px; text-align: left;
  color: var(--text); background: none; border: none; font-family: inherit; cursor: pointer; text-decoration: none;
}
.omni-row:hover, .omni-row.sel { background: var(--primary-container); text-decoration: none; }
.omni-row-ic { width: 22px; text-align: center; font-size: 15px; flex-shrink: 0; display: inline-flex; justify-content: center; }
.omni-row-ic.wood { color: var(--wood); }
.omni-row-ic svg { width: 16px; height: 16px; }
.omni-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.omni-row-label { font-size: 14px; font-weight: 500; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omni-row-detail { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omni-capture-row { background: var(--bg); border-top: 1px solid var(--border); }
.omni-capture-row:hover { background: var(--wood-container); }
.omni-capture-row .omni-row-label { color: var(--wood-dark); font-weight: 600; }
.omni-empty { padding: 18px; font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.omni-empty.warn { color: var(--red); }
.omni-empty.small { padding: 8px 18px 12px; }
.omni-hints { display: flex; gap: 14px; padding: 10px 18px; font-size: 12px; color: var(--text-muted); border-top: 1px solid var(--border); }
.omni-hints span { display: inline-flex; align-items: center; gap: 5px; }

/* Today pill + popover */
.omni-today-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; max-width: 320px;
  background: var(--primary-container); color: var(--on-primary-container); border: none; cursor: pointer;
  border-radius: var(--radius-full); font-family: inherit; font-size: 12px; font-weight: 600; white-space: nowrap;
  overflow: hidden; transition: all .15s var(--motion);
}
.omni-today-pill:hover { box-shadow: 0 0 0 3px rgba(61,122,80,.12); }
.omni-today-pill span { overflow: hidden; text-overflow: ellipsis; }
.omni-pill-date { font-weight: 800; }
.omni-pill-due { color: #C0392B; font-weight: 700; }
.omni-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--secondary); flex-shrink: 0; }
.omni-pop {
  position: fixed; top: 66px; right: clamp(16px, 2.5vw, 28px); width: 372px; z-index: 160;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 24px 64px rgba(31,42,33,.22); overflow: hidden; animation: omni-in .2s var(--motion);
}
.omni-pop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 20px 12px; }
.omni-pop-title { font-size: 18px; font-weight: 800; letter-spacing: -.3px; }
.omni-pop-sub { font-size: 12px; color: var(--text-muted); font-weight: 600; text-align: right; }
.omni-pop-list { display: flex; flex-direction: column; padding: 0 20px; }
.omni-pop-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.omni-pop-row:first-child { border-top: none; }
a.omni-pop-row:hover { color: var(--primary); text-decoration: none; }
.omni-pop-time { width: 52px; font-size: 12px; font-weight: 800; color: var(--text-muted); flex-shrink: 0; }
.omni-pop-time.next { color: var(--primary); }
.omni-pop-text { flex: 1; font-size: 13.5px; font-weight: 500; min-width: 0; }
.omni-check { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--primary); flex-shrink: 0; }
.omni-check.p1 { border-color: #C0392B; } .omni-check.p2 { border-color: #E07A5F; }
.omni-chips { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px 20px 18px; }
.omni-chip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 6px 12px;
  border-radius: var(--radius-full); background: var(--surface-tint); color: var(--text-muted); font-weight: 700; text-decoration: none;
}
.omni-chip.wood { background: var(--wood-container); color: var(--wood-dark); }
.omni-chip.gold { background: var(--gold-light); color: var(--wood-dark); }
a.omni-chip:hover { text-decoration: none; filter: brightness(.97); }

/* Capture (sheet on phone, centred card on desktop) */
.omni-scrim { position: fixed; inset: 0; z-index: 170; background: rgba(31,42,33,.32); display: flex; align-items: flex-end; justify-content: center; }
.omni-sheet {
  width: 100%; max-height: 88vh; overflow-y: auto; background: var(--card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: 0 -12px 40px rgba(31,42,33,.18);
  padding: 12px 18px calc(18px + env(safe-area-inset-bottom, 0px)); animation: omni-up .25s var(--motion);
}
.omni-grab { width: 36px; height: 4px; border-radius: var(--radius-full); background: var(--border); margin: 0 auto 14px; }
.omni-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.omni-sheet-title { font-size: 16px; font-weight: 800; letter-spacing: -.3px; }
.omni-sheet-sub { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.omni-sheet-results { margin: 10px -18px 0; }
.omni-x { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-full); border: none; background: var(--surface-tint); color: var(--text-muted); cursor: pointer; flex-shrink: 0; }
.omni-x svg { width: 16px; height: 16px; }
.omni-textarea {
  width: 100%; min-height: 96px; padding: 12px 14px; font-family: inherit; font-size: 15px; line-height: 1.45; color: var(--text);
  border: 1.5px solid var(--primary); border-radius: var(--radius-sm); background: var(--card); box-shadow: 0 0 0 3px rgba(61,122,80,.12);
  outline: none; resize: vertical;
}
.omni-kinds { display: flex; gap: 6px; margin: 12px 0 14px; flex-wrap: wrap; }
.omni-kind {
  font-size: 12px; padding: 7px 13px; border-radius: var(--radius-full); background: var(--card); color: var(--text-muted);
  border: 1px solid var(--border); font-weight: 600; font-family: inherit; cursor: pointer; transition: all .15s var(--motion);
}
.omni-kind:hover { background: var(--primary-container); border-color: var(--primary-light); }
.omni-kind.active { background: var(--wood-container); color: var(--wood-dark); border-color: var(--wood-light); font-weight: 700; }
.omni-sheet-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.omni-btn-primary, .omni-btn-secondary {
  height: 44px; padding: 0 22px; border-radius: var(--radius-full); font-size: 14px; font-weight: 700; font-family: inherit;
  border: none; cursor: pointer; transition: all .2s var(--motion);
}
.omni-btn-primary { background: var(--primary); color: #fff; flex: 1; }
.omni-btn-primary:hover { background: var(--primary-hover); }
.omni-btn-secondary { background: var(--surface-tint); color: var(--text); }

@media (min-width: 760px) {
  .omni-scrim { align-items: center; }
  .omni-sheet { width: 100%; max-width: 520px; border-radius: var(--radius-lg); padding: 24px 24px 22px; animation: omni-in .2s var(--motion); }
  .omni-grab { display: none; }
  .omni-btn-primary { flex: 0 0 auto; }
}

/* ── Phone dock ────────────────────────────────────────────────── */
.omni-dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 150; height: calc(84px + env(safe-area-inset-bottom, 0px));
  padding: 10px 8px env(safe-area-inset-bottom, 0px); background: var(--card); border-top: 1px solid var(--border);
  display: flex; align-items: flex-start; justify-content: space-around;
}
.omni-dock-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 64px; min-height: 44px;
  color: var(--text-muted); font-size: 10px; font-weight: 700; background: none; border: none; font-family: inherit; text-decoration: none; cursor: pointer;
}
.omni-dock-item svg { width: 22px; height: 22px; }
.omni-dock-item.active { color: var(--primary); }
.omni-dock-item .omni-badge { top: -6px; right: 12px; }
.omni-dock-plus {
  display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-top: -22px;
  border-radius: var(--radius-full); background: var(--primary); color: #fff; border: none; cursor: pointer;
  box-shadow: 0 6px 18px rgba(61,122,80,.35);
}
.omni-dock-plus svg { width: 24px; height: 24px; }

@keyframes omni-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes omni-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
