:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", Inter, "Segoe UI", sans-serif;
  --ink: #111214;
  --muted: #85878b;
  --line: #e5e5e7;
  --surface: #ffffff;
  --canvas: #f7f7f8;
  --accent: #0878d1;
  --accent-soft: #e8f3fc;
  --danger: #d93d3d;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
.hidden { display: none !important; }

#app {
  min-height: 100dvh;
  padding: 0 0 calc(82px + env(safe-area-inset-bottom));
}

.shell { max-width: 760px; min-height: 100dvh; margin: 0 auto; background: #fff; }
.topbar {
  position: sticky; top: 0; z-index: 4;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(22px + env(safe-area-inset-top)) 20px 18px;
  background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 13px; text-transform: uppercase; }
h1 { margin: 0; font-size: 32px; line-height: 1.1; }
h2 { margin: 0; font-size: 20px; }
h3 { margin: 0; font-size: 17px; }
p { line-height: 1.45; }
.toolbar { display: flex; gap: 10px; }
.icon {
  width: 48px; height: 48px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface); font-size: 27px;
}
.icon.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.content { padding: 20px; display: grid; gap: 18px; }
.section-head { display: flex; align-items: center; justify-content: space-between; }
.section-head button { border: 0; background: none; color: var(--accent); font-weight: 600; }

.card {
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); padding: 18px;
}
.hero { display: grid; gap: 14px; }
.hero strong { font-size: 23px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 8px; }
.stat { padding: 14px; min-width: 0; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat strong { display: block; font-size: 23px; }
.stat span { color: var(--muted); font-size: 13px; }

.list { display: grid; gap: 10px; }
.task, .project, .event {
  display: grid; gap: 8px; padding: 15px 0; border-bottom: 1px solid var(--line);
}
.task { border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.task.is-done { opacity: .68; }
.task.is-done .title { text-decoration: line-through; }
.task:last-child, .project:last-child, .event:last-child { border-bottom: 0; }
.task-row { display: flex; align-items: flex-start; gap: 12px; }
.check {
  flex: 0 0 24px; width: 24px; height: 24px; padding: 0;
  border: 1px solid #b9bbc0; border-radius: 50%; background: #fff;
}
.check.done { background: var(--accent); border-color: var(--accent); color: #fff; }
.grow { flex: 1; min-width: 0; }
.title { overflow-wrap: anywhere; font-weight: 600; }
.meta { display: flex; flex-wrap: wrap; gap: 7px; color: var(--muted); font-size: 13px; }
.chip { padding: 3px 7px; background: var(--accent-soft); color: var(--accent); border-radius: 5px; }
.urgent { color: var(--danger); }
.project header { display: flex; justify-content: space-between; gap: 12px; }
.project p { margin: 4px 0 0; color: var(--muted); }
.project small { color: var(--muted); }
.event { grid-template-columns: 72px 1fr; }
.event time { color: var(--accent); font-weight: 600; }
.meeting-row { align-items: start; }
.meeting-row h3 { overflow-wrap: anywhere; }
.meeting-details { margin-top: 8px; }
.meeting-details summary { color: var(--accent); font-size: 12px; cursor: pointer; }
.meeting-open { width: fit-content; margin-top: 9px; }

.empty {
  padding: 34px 20px; text-align: center; color: var(--muted);
  border: 1px dashed #c9cbd0; border-radius: 8px; background: #fff;
}
.empty strong { display: block; color: var(--ink); margin-bottom: 7px; }
.primary {
  min-height: 46px; border: 1px solid var(--ink); border-radius: 8px;
  padding: 10px 16px; background: var(--ink); color: white; font-weight: 600;
}
.compact { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.task-actions { display: flex; flex-wrap: wrap; gap: 7px; padding-left: 36px; }
.hero-actions, .dialog-actions { display: grid; grid-template-columns: 1.3fr 1fr; gap: 9px; }
.secondary {
  min-height: 42px; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 14px; background: white; color: var(--ink);
}
.danger {
  min-height: 42px; border: 1px solid #efcaca; border-radius: 8px;
  padding: 9px 14px; background: #fff; color: var(--danger);
}
.calendar-nav { display: grid; grid-template-columns: 46px 1fr 46px; gap: 8px; align-items: center; }
.calendar-nav button { height: 42px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.calendar-nav strong { text-align: center; }
.notice { padding: 12px; border-radius: 6px; background: #fff5dc; color: #6b5100; }
.back-button { width: fit-content; padding: 4px 0; border: 0; background: none; color: var(--accent); }
.segmented {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px; padding: 3px; border-radius: 8px; background: #f0f0f1;
}
.segmented button {
  min-height: 38px; border: 0; border-radius: 6px; background: transparent; color: var(--muted);
}
.segmented button.active { background: #fff; color: var(--ink); font-weight: 650; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.progress-track { height: 8px; overflow: hidden; border-radius: 4px; background: #e4e5e7; }
.progress-fill { height: 100%; border-radius: inherit; background: var(--ink); transition: width .2s ease; }
.progress-panel p { margin-bottom: 0; }
.muted { color: var(--muted); }
.next-card { border-color: #d9dadd; }
.assistant-card { text-align: left; }
.assistant-mark {
  display: grid; place-items: center; width: 48px; height: 48px;
  margin-bottom: 18px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 23px;
}
.recommendations { display: grid; gap: 10px; margin-top: 18px; }
.recommendation { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.recommendation strong { overflow-wrap: anywhere; }
.recommendation span { font-size: 12px; }
.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.quota-strip {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid #cfe1f1; border-radius: 8px;
  background: var(--accent-soft);
}
.quota-strip span { font-size: 12px; text-align: right; }
.prompt-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.ai-form { display: grid; gap: 9px; margin-top: 14px; }
.ai-output {
  margin-top: 14px; padding: 14px; border: 1px solid #cfe1f1;
  border-radius: 8px; background: #f7fbff; white-space: pre-wrap;
}
.ai-output p { margin: 0; overflow-wrap: anywhere; }
.ai-output p + p { margin-top: 7px; }
.consent-check {
  display: grid; grid-template-columns: 22px 1fr; align-items: start;
  gap: 10px; color: var(--ink); line-height: 1.4;
}
.consent-check input { width: 20px; height: 20px; margin: 0; }
.meeting-actions { grid-template-columns: 1fr 1fr; }

.checklist,
.preview-list,
.pulse-section {
  display: grid;
  gap: 10px;
}

.checklist-row {
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.checklist-row input {
  width: 20px;
  height: 20px;
  margin: 1px 0 0;
}

.preview-panel,
.pulse-summary,
.pulse-section {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.preview-panel strong,
.decision strong,
.pulse-link {
  overflow-wrap: anywhere;
}

.preview-list {
  padding-left: 24px;
}

.pulse-summary .stats {
  margin-top: 14px;
}

.pulse-section {
  margin-top: 12px;
}

.pulse-link {
  width: 100%;
  padding: 10px 0;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.decision {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.pulse-attention { color: var(--danger); }
.pulse-active { color: var(--accent); }
.pulse-quiet { color: var(--muted); }
.menu-list { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.menu-row {
  display: grid; grid-template-columns: 42px minmax(0,1fr) 18px; align-items: center;
  width: 100%; gap: 10px; padding: 15px; border: 0; border-bottom: 1px solid var(--line); background: #fff; text-align: left;
}
.menu-row:last-child { border-bottom: 0; }
.menu-row small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.35; }
.menu-icon { color: var(--accent); font-size: 24px; text-align: center; }
.analytics-row { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.analytics-row:last-child { border-bottom: 0; }
.info-card p { margin-bottom: 0; color: var(--muted); }

.nav {
  position: fixed; z-index: 6; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: rgba(255,255,255,.97);
}
.nav button { border: 0; background: none; color: var(--muted); font-size: 12px; padding: 4px; }
.nav button span { display: block; font-size: 21px; margin-bottom: 2px; }
.nav button.active { color: var(--ink); font-weight: 700; }

.lock { min-height: 100dvh; display: grid; align-content: center; gap: 10px; max-width: 360px; margin: auto; padding: 30px; }
.lock .brand { width: 58px; height: 58px; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 8px; font-size: 30px; font-weight: 700; }
.lock p { color: var(--muted); }
.onboarding { max-width: 460px; }
.privacy-points { margin: 4px 0 12px; padding-left: 20px; color: #55575b; }
.privacy-points li { margin: 8px 0; line-height: 1.4; }
.privacy-link { color: var(--accent); text-underline-offset: 3px; }
.policy {
  width: min(680px, calc(100% - 36px)); margin: 0 auto; padding: 56px 0;
}
.policy h1 { margin-bottom: 24px; }
.policy h2 { margin-top: 30px; }
.policy li { margin: 8px 0; line-height: 1.5; }

dialog { width: min(520px, calc(100% - 24px)); border: 0; border-radius: 8px; padding: 0; }
dialog::backdrop { background: rgba(0,0,0,.42); }
dialog form { display: grid; gap: 16px; padding: 20px; }
dialog header { display: flex; justify-content: space-between; align-items: center; }
dialog header button { width: 36px; height: 36px; border: 0; background: none; font-size: 25px; }
label { display: grid; gap: 7px; color: #55575b; font-size: 14px; }
input, textarea, select {
  width: 100%; border: 1px solid #cfd0d4; border-radius: 7px;
  background: #fff; color: var(--ink); padding: 11px 12px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.focus-dialog { max-width: 520px; background: #101214; color: #fff; }
.focus-dialog form { min-height: 520px; align-content: space-between; }
.focus-dialog .eyebrow { color: #a7aaae; }
.focus-dialog header button { color: #fff; }
.focus-ring {
  display: grid; place-items: center; align-content: center; width: 230px; height: 230px;
  margin: 22px auto; border: 10px solid #2a80cc; border-radius: 50%;
}
.focus-ring strong { font-size: 46px; font-variant-numeric: tabular-nums; }
.focus-ring span { margin-top: 5px; color: #b9bdc2; }
.focus-dialog .secondary { border-color: #414449; background: #202327; color: #fff; }
#toast {
  position: fixed; z-index: 10; left: 50%; bottom: 92px; transform: translateX(-50%);
  max-width: calc(100% - 28px); padding: 10px 14px; border-radius: 7px;
  background: #17181a; color: #fff; opacity: 0; pointer-events: none; transition: opacity .2s;
}
#toast.show { opacity: 1; }

@media (min-width: 760px) {
  .content { padding: 28px; }
  .topbar { padding-left: 28px; padding-right: 28px; }
}
