/* CommandCentre phone UI — from Phone.dc.html, on the Aura tokens (aura/). */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg-aurora); overscroll-behavior: none; }
input, textarea, select, button { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.grow { flex: 1; min-width: 0; }
.no-bar { scrollbar-width: none; }
.no-bar::-webkit-scrollbar { display: none; }

#app {
  position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-aurora); color: var(--text-strong);
  font-family: var(--font-sans);
}

.aura-btn { transition: transform 140ms var(--ease-out), background 140ms var(--ease-out); }
.aura-btn:active { transform: scale(0.95); }
.aura-card:active { transform: scale(0.99); }

/* Header */
.top { flex: 0 0 auto; padding: calc(env(safe-area-inset-top) + 14px) 20px 12px; display: flex; align-items: flex-end; gap: 12px; }
.top-text { flex: 1; min-width: 0; }
.overline { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-subtle); }
.top h1 { margin: 4px 0 0; font-size: 28px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.add {
  width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 0; border-radius: 22px;
  background: var(--grad-brand); color: var(--white); box-shadow: var(--shadow-float);
}

.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pad-x { padding-left: 20px; padding-right: 20px; }

/* Shared bits */
.mono, .mono-meta, .mono-sub, .mono-body { font-family: var(--font-mono); }
.mono-meta { font-size: 12px; color: var(--text-muted); }
.mono-sub { font-size: 11px; color: var(--text-subtle); }
.mono-body { font-size: 14px; color: var(--text-body); }
.body-14 { font-size: 14px; color: var(--text-body); }
.muted-13 { font-size: 13px; color: var(--text-muted); text-wrap: pretty; }
.struck { text-decoration: line-through; color: var(--text-muted) !important; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 11px; font-weight: 600; flex: 0 0 auto; }
.pill.status { height: 21px; font-size: 10.5px; font-weight: 700; }
.pill.size { background: var(--ink-100); color: var(--text-muted); font-weight: 500; }
.glass-lite { background: var(--glass-fill); border: 1px solid var(--glass-border); }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px; display: grid; place-items: center;
  border-radius: 8px; background: #ef4444; color: #fff; font: 700 10px/1 var(--font-mono);
  box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(239, 68, 68, 0.45);
}
.ico { position: relative; display: grid; place-items: center; }

/* Home */
.home { padding: 8px 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.glass { background: var(--glass-fill-strong); border: 1px solid var(--glass-border); border-radius: 22px; box-shadow: var(--shadow-glass); }
.habits { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.habit {
  flex: 1; min-height: 44px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 18px;
  background: var(--white); color: var(--text-placeholder);
}
.habit.on { border-color: transparent; background: var(--grad-brand); color: var(--white); box-shadow: var(--shadow-xs); }
.card { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-md); overflow: hidden; }
.card-head { display: flex; align-items: baseline; gap: 10px; padding: 18px 18px 8px; }
.card-head h2 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }
.card-body { padding: 0 10px 12px; display: flex; flex-direction: column; }
.myday-row { display: flex; align-items: center; gap: 12px; padding: 0 8px; min-height: 52px; border-radius: 18px; }
.myday-title { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; text-wrap: pretty; }
.check {
  width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border: 1.5px solid var(--border);
  border-radius: 13px; background: var(--white); color: var(--white); padding: 0;
}
.check.sm { width: 20px; height: 20px; flex-basis: 20px; border-radius: 10px; }
.check.on { border-color: var(--mint-500); background: var(--mint-500); }
.empty-block { padding: 6px 8px 4px; display: flex; flex-direction: column; gap: 10px; }
.suggest { display: flex; align-items: center; gap: 10px; padding: 0 12px; min-height: 52px; border: 1px dashed var(--border); border-radius: 18px; }
.suggest-title { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-chip { min-height: 34px; padding: 0 14px; border: 0; border-radius: 17px; background: var(--lavender-100); color: var(--brand); font-size: 13px; font-weight: 700; }

/* Tasks */
.tasks { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.count { padding-bottom: 10px; font: 12.5px var(--font-mono); color: var(--text-muted); }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 20px; margin-bottom: 10px; }
.search svg { color: var(--text-placeholder); flex: 0 0 15px; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; color: var(--text-body); outline: none; -webkit-appearance: none; }
.chips { flex: 0 0 auto; display: flex; gap: 8px; padding: 0 20px 10px; overflow-x: auto; }
.chips + .chips { padding-bottom: 14px; }
.chip {
  min-height: 36px; padding: 0 15px; border: 1px solid var(--glass-border); border-radius: 18px; white-space: nowrap;
  font-size: 13px; font-weight: 500; background: var(--glass-fill); color: var(--text-body);
}
.chip.on { border-color: transparent; font-weight: 700; background: var(--grad-brand); color: var(--white); box-shadow: var(--shadow-float); }
.schip {
  min-height: 34px; padding: 0 14px; border: 1px solid var(--border); border-radius: 17px; white-space: nowrap;
  font-size: 12.5px; font-weight: 500; background: var(--ink-50); color: var(--text-muted);
}
.schip.on { border-color: transparent; font-weight: 700; background: var(--brand); color: var(--white); }
.controls { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding-bottom: 14px; }
.seg { display: flex; gap: 3px; padding: 3px; background: var(--ink-100); border-radius: 17px; }
.seg-btn {
  flex: 1; min-width: 66px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 14px; background: transparent;
  color: var(--text-muted); font-size: 12.5px; font-weight: 500; white-space: nowrap;
}
.seg-btn.on { background: var(--white); color: var(--brand); font-weight: 700; box-shadow: var(--shadow-xs); }
.hide-done {
  display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 0 12px; border: 1px solid var(--glass-border);
  border-radius: 19px; font-size: 12.5px; white-space: nowrap; background: var(--glass-fill); color: var(--text-body);
}
.hide-done.on { border-color: transparent; background: var(--white); color: var(--brand); font-weight: 700; box-shadow: var(--shadow-xs); }
.switch { position: relative; display: inline-block; width: 32px; height: 19px; border-radius: 10px; flex: 0 0 32px; background: var(--ink-200); transition: background 140ms var(--ease-out); }
.hide-done.on .switch { background: var(--brand); }
.knob { position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 8px; background: var(--white); box-shadow: var(--shadow-xs); transition: left 140ms var(--ease-out); }
.hide-done.on .knob { left: 15px; }

.list { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.empty { padding: 40px 24px; text-align: center; font-size: 13px; color: var(--text-muted); text-wrap: pretty; }
.task-card {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 15px; border-radius: 22px;
  background: var(--glass-fill-strong); border: 1px solid var(--glass-border); box-shadow: var(--shadow-glass);
}
.task-card.done { background: rgba(255, 255, 255, 0.45); box-shadow: none; opacity: 0.5; }
.task-main { flex: 1; min-width: 0; }
.task-meta { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.task-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.32; margin-bottom: 9px; text-wrap: pretty; overflow-wrap: anywhere; }
.task-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.due { font: 12px var(--font-mono); }
.due-none { color: var(--text-placeholder); font-weight: 500; }
.due-over { color: #d94f4f; font-weight: 700; }
.due-today { color: #c4881f; font-weight: 700; }
.due-soon { color: var(--text-muted); font-weight: 600; }
.task-actions { display: flex; flex-direction: column; gap: 8px; flex: 0 0 44px; }
.round {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 22px;
  background: var(--white); color: var(--text-placeholder);
}
.round.mint { border-color: var(--mint-500); background: var(--mint-100); color: var(--mint-700); }
.round.lav { border-color: transparent; background: var(--lavender-100); color: var(--brand); }
.placeholder { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px; text-align: center; }
.ph-ico { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 26px; background: var(--ink-100); color: var(--text-placeholder); }
.ph-title { font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }

/* Tab bar + menus */
.bar { position: relative; flex: 0 0 auto; z-index: 16; }
.tabs {
  display: flex; align-items: stretch; gap: 4px; padding: 8px 12px calc(env(safe-area-inset-bottom) + 6px);
  background: var(--glass-fill-strong); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  border-top: 1px solid var(--glass-border);
}
.tab {
  flex: 1; min-height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 0; border-radius: 18px; background: transparent; color: var(--text-muted); padding: 0;
}
.tab.on { background: var(--white); color: var(--brand); box-shadow: var(--shadow-xs); }
.tab-label { font-size: 10.5px; font-weight: 700; letter-spacing: -0.005em; }
.tab.more { flex: 0 0 54px; }
.menu-scrim { position: fixed; inset: 0; z-index: 15; }
.menu {
  position: absolute; bottom: 100%; margin-bottom: 10px; z-index: 16; display: flex; flex-direction: column; gap: 3px;
  padding: 8px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-xl); min-width: 180px;
}
.menu-left { left: 12px; }
.menu-right { right: 12px; }
.menu-item { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border: 0; border-radius: 14px; background: transparent; color: var(--text-body); font-size: 14px; font-weight: 500; text-align: left; }
.menu-item.on { background: var(--lavender-100); color: var(--brand); font-weight: 700; }

/* Detail + settings sheets */
.detail-scrim {
  position: fixed; inset: 0; z-index: 20; background: rgba(45, 46, 68, 0.22); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; flex-direction: column; justify-content: flex-end;
}
.detail {
  height: 100%; display: flex; flex-direction: column; background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 36px 36px 0 0; box-shadow: var(--shadow-xl); overflow: hidden;
}
.detail-top { flex: 0 0 auto; padding: calc(env(safe-area-inset-top) + 14px) 18px 12px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border-soft); }
.back {
  height: 36px; padding: 0 14px 0 10px; display: flex; align-items: center; gap: 5px; border: 0; border-radius: 18px;
  background: var(--white); color: var(--brand); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-xs);
}
.detail-body { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 20px; }
.d-title {
  width: 100%; flex: 0 0 auto; border: 1px solid transparent; border-radius: 16px; padding: 8px 12px; font-size: 23px; font-weight: 800;
  letter-spacing: -0.035em; line-height: 1.25; text-wrap: pretty; cursor: text; outline: none; overflow-wrap: anywhere;
}
.d-title:focus { border-color: var(--border); background: var(--ink-50); }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-row { display: flex; align-items: baseline; gap: 8px; }
.field-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-subtle); }
.status-name { font-size: 13px; font-weight: 700; color: var(--brand); }
.field textarea, .field select, .field input {
  width: 100%; border: 1px solid var(--border); border-radius: 18px; background: var(--white); color: var(--text-body);
  font-size: 16px; -webkit-appearance: none; appearance: none; outline: none;
}
.field textarea { padding: 12px 14px; background: var(--ink-50); line-height: 1.55; resize: none; }
.field select, .field input { height: 46px; padding: 0 14px; }
.field input[type="date"] { font-family: var(--font-mono); }
.field :is(textarea, select, input):focus { border-color: var(--brand); box-shadow: var(--ring-brand); }
.seg-lg { height: 46px; padding: 4px; border-radius: 19px; }
.seg-lg .seg-btn { min-height: 38px; font-size: 13px; }
.status-seg { padding: 4px; border-radius: 19px; gap: 4px; }
.seg-btn.icon { display: grid; place-items: center; min-width: 0; min-height: 44px; border-radius: 16px; padding: 0; }
.link-btn { align-self: flex-start; border: 0; background: transparent; padding: 4px 2px; color: var(--text-subtle); font-size: 12.5px; font-weight: 500; min-height: 32px; }
.link-btn.danger { align-self: center; min-height: 44px; font-size: 13px; padding: 0 12px; }
.link-btn.danger:active { color: var(--danger); }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.person { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px 0 10px; border-radius: 16px; background: var(--white); border: 1px solid var(--border); color: var(--text-body); font-size: 13px; font-weight: 500; }
.person svg { color: var(--text-subtle); }
.parent-btn { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; max-width: 100%; height: 34px; padding: 0 14px; border: 0; border-radius: 17px; background: var(--lavender-100); color: var(--brand); font-size: 13.5px; font-weight: 600; text-align: left; }
.subtasks { display: flex; flex-direction: column; gap: 6px; }
.sub-row { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--white); }
.sub-title { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-body); }
.detail-foot { flex: 0 0 auto; border-top: 1px solid var(--border-soft); padding: 14px 20px calc(env(safe-area-inset-bottom) + 14px); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.done-btn {
  width: 100%; height: 52px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 26px;
  background: var(--grad-mint); color: var(--white); font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; box-shadow: var(--shadow-float);
}
.done-btn.brand { background: var(--grad-brand); margin-top: 6px; }
.settings .detail-body { gap: 16px; }

/* Errors */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(env(safe-area-inset-bottom) + 90px); z-index: 40; padding: 12px 16px;
  border-radius: 16px; background: var(--ink-900); color: var(--white); font-size: 13px; line-height: 1.4; box-shadow: var(--shadow-lg);
  overflow-wrap: anywhere;
}
