:root {
  color-scheme: light;
  --app-viewport-height: 100dvh;
  --app-viewport-top: 0px;
  --paper: #f3f0e8;
  --paper-raised: #faf8f2;
  --ink: #20251f;
  --muted: #747a70;
  --line: #dcd8cc;
  --heart: #317653;
  --heart-ink: #285f42;
  --heart-soft: #dfeadf;
  --warn: #ad6b2d;
  --danger: #a5483f;
  --task: #82501e;
  --task-soft: #f3e6d3;
  --todo: #624b78;
  --todo-soft: #ebe4f1;
  --area: #304c78;
  --area-soft: #e3e9f2;
  --shadow: 0 18px 50px rgb(38 48 39 / 8%);
  font-family: "Avenir Next", Avenir, "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { min-height: 100%; }
body.app-active { height: 100vh; overflow: hidden; overscroll-behavior: none; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 10% 0%, rgb(255 255 255 / 78%), transparent 32rem),
    var(--paper);
  color: var(--ink);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(100%, 390px);
  padding: 42px 36px 36px;
  background: rgb(250 248 242 / 88%);
  border: 1px solid rgb(220 216 204 / 75%);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  margin-bottom: 28px;
}

.brand-mark span, .status-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--heart);
  box-shadow: 0 0 0 6px var(--heart-soft);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .14em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(28px, 7vw, 38px); font-weight: 560; letter-spacing: -.04em; }
h2 { margin-bottom: 3px; font-size: 16px; font-weight: 650; }
.login-copy { margin-bottom: 28px; color: var(--muted); line-height: 1.7; }

.login-card label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.login-card input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 15px;
  background: var(--paper-raised);
  color: var(--ink);
  outline: none;
}

.login-card input:focus { border-color: var(--heart); box-shadow: 0 0 0 3px var(--heart-soft); }

.login-card button {
  width: 100%;
  height: 52px;
  margin-top: 14px;
  border: 0;
  border-radius: 14px;
  background: var(--ink);
  color: white;
  font-weight: 650;
}

.form-error, .app-error { min-height: 20px; color: var(--danger); font-size: 13px; }
.form-error { margin: 13px 0 0; }

.app-shell {
  width: min(100%, 760px);
  height: var(--app-viewport-height);
  min-height: 0;
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 20px;
  overflow: hidden;
  transform: translateY(var(--app-viewport-top));
  transform-origin: top center;
}

.topbar { display: flex; align-items: start; justify-content: space-between; padding: 10px 4px 4px; }
.topbar h1 { margin: 0; font-size: 29px; }
.text-button { border: 0; padding: 8px 0 8px 12px; background: transparent; color: var(--muted); font-size: 13px; }
.text-button:hover { color: var(--ink); }

.today-tasks {
  min-width: 0;
  min-height: 0;
  max-height: min(64dvh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 13px;
  border: 1px solid rgb(49 118 83 / 18%);
  border-radius: 16px;
  background: rgb(223 234 223 / 45%);
}
.task-response { width: 100%; }
.task-response .bubble { width: 100%; max-width: 100%; padding: 0; }
.today-tasks.attention { border-color: rgb(165 72 63 / 24%); background: rgb(165 72 63 / 7%); }
.today-tasks-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.today-tasks-heading strong { font-size: 13px; font-weight: 650; }
.today-tasks-heading span { color: var(--muted); font-size: 11px; text-align: right; }
.today-tasks ul {
  display: flex;
  gap: 7px;
  margin: 10px 0 0;
  padding: 0 2px 1px 0;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.today-tasks ul::-webkit-scrollbar { display: none; }
.today-tasks li {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  border: 1px solid rgb(220 216 204 / 78%);
  border-radius: 999px;
  background: rgb(250 248 242 / 76%);
  color: var(--ink);
  font-size: 11px;
  white-space: nowrap;
}
.today-task-status { color: var(--muted); }
.today-task-status.done { color: var(--heart-ink); }
.today-task-status.failed { color: var(--danger); }
.today-task-status.running { color: var(--warn); }
.attendance-reports { display: grid; gap: 10px; margin-top: 12px; }
.attendance-reports:empty { display: none; }
.attendance-report {
  display: grid;
  gap: 11px;
  padding: 11px 11px 11px 13px;
  border: 1px solid rgb(49 118 83 / 16%);
  border-radius: 13px;
  background: rgb(250 248 242 / 76%);
}
.attendance-report.failed { border-color: rgb(165 72 63 / 22%); }
.attendance-report > div { min-width: 0; }
.attendance-report strong { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 650; }
.attendance-log { display: grid; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.attendance-log li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; align-items: start; padding: 0; border: 0; border-radius: 0; background: transparent; white-space: normal; }
.attendance-log span { color: var(--muted); font-size: 10px; font-weight: 650; }
.attendance-log span.done { color: var(--heart-ink); }
.attendance-log span.failed { color: var(--danger); }
.attendance-log p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.attendance-event-heading { display: block; margin: 12px 0 6px; color: var(--ink); font-size: 10px; font-weight: 650; letter-spacing: .04em; }
.attendance-events { display: grid !important; gap: 5px !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; }
.attendance-events li { display: block; padding: 7px 8px; border: 1px solid rgb(49 118 83 / 12%); border-radius: 8px; background: var(--heart-soft); color: var(--heart-ink); font-size: 10px; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.attendance-report a { position: relative; display: block; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: var(--paper-raised); }
.attendance-report img { display: block; width: 100%; height: 132px; object-fit: contain; object-position: center; }
.attendance-report a > span { position: absolute; right: 7px; bottom: 7px; padding: 4px 7px; border-radius: 999px; background: rgb(32 37 31 / 82%); color: #fff; font-size: 9px; }

.heartbeat-card {
  padding: 21px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgb(250 248 242 / 72%);
}

.heartbeat-main { display: flex; align-items: center; gap: 16px; }
.heartbeat-main p { margin: 0; color: var(--muted); font-size: 13px; }
.status-dot { flex: 0 0 auto; width: 9px; height: 9px; }
.status-dot.running { animation: breathe 1.8s ease-in-out infinite; }
.status-dot.attention { background: var(--danger); box-shadow: 0 0 0 6px rgb(165 72 63 / 12%); }
.status-dot.unknown { background: var(--warn); box-shadow: 0 0 0 6px rgb(173 107 45 / 12%); }
.heartbeat-summary { margin: 17px 0 0 25px; color: var(--ink); font-size: 14px; line-height: 1.6; }
.long-tasks { margin: 19px 0 0 25px; padding-top: 16px; border-top: 1px solid var(--line); }
.long-tasks-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.long-tasks-heading h3 { margin-bottom: 9px; font-size: 13px; font-weight: 650; }
.long-tasks-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.long-tasks-meta button { border: 0; padding: 2px 0; background: transparent; color: var(--heart-ink); font-size: 11px; cursor: pointer; }
.long-tasks-meta button:disabled { color: var(--muted); cursor: default; }
.long-tasks ul { margin: 0; padding: 0; list-style: none; }
.long-task-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 8px 0; }
.long-task-item + .long-task-item { border-top: 1px solid rgb(220 216 204 / 58%); }
.long-task-item div { min-width: 0; display: grid; gap: 2px; }
.long-task-item strong { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 560; text-overflow: ellipsis; white-space: nowrap; }
.long-task-item div span, .long-task-empty { color: var(--muted); font-size: 11px; line-height: 1.5; }
.task-status { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; background: var(--heart-soft); color: var(--heart-ink); font-size: 10px; font-weight: 650; }
.task-status.failed { background: rgb(165 72 63 / 12%); color: var(--danger); }
.task-status.running { animation: breathe 1.3s ease-in-out infinite; }
.task-status.skipped { background: var(--line); color: var(--muted); }
.task-status.inactive { background: var(--line); color: var(--muted); }
details { margin: 14px 0 0 25px; color: var(--muted); font-size: 12px; }
summary { cursor: pointer; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.65 "SFMono-Regular", Consolas, monospace; color: var(--muted); }

.messages { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px 4px 20px; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.empty-message { margin: 42px auto; max-width: 340px; color: var(--muted); text-align: center; line-height: 1.75; }
.message { display: flex; align-items: flex-start; gap: 9px; margin: 14px 0; }
.date-divider { display: flex; align-items: center; gap: 12px; margin: 25px 0 18px; color: var(--muted); font-size: 11px; }
.date-divider::before, .date-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.date-divider span { flex: 0 0 auto; }
.message.user { justify-content: flex-end; }
.bubble { min-width: 0; max-width: min(calc(86% - 58px), 590px); padding: 12px 15px; border-radius: 17px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; font-size: 15px; }
.assistant .bubble { padding-left: 0; background: transparent; }
.message-avatar { position: relative; flex: 0 0 34px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; overflow: hidden; user-select: none; }
.message-avatar img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.agent-avatar { flex-basis: 52px; width: 52px; height: 52px; margin-top: -3px; border-radius: 15px; overflow: visible; }
.agent-avatar img { filter: drop-shadow(0 4px 8px rgb(28 69 47 / 13%)); }
.user-avatar { border: 1px solid rgb(130 80 30 / 18%); background: rgb(243 230 211 / 76%); color: var(--ink); font-size: 13px; font-weight: 680; letter-spacing: -.02em; }
.assistant.pending .agent-avatar { filter: drop-shadow(0 0 7px rgb(97 170 90 / 18%)); }
.assistant.area-response { width: 100%; }
.assistant.area-response .bubble {
  width: auto;
  flex: 1;
  max-width: 100%;
  padding: 15px 16px 14px;
  border-left: 3px solid var(--heart);
  border-radius: 4px 16px 16px 4px;
  background: linear-gradient(100deg, rgb(223 234 223 / 58%), rgb(250 248 242 / 32%) 78%);
}
.area-response .markdown-body h4:first-child {
  margin: 0 0 15px;
  font-size: 20px;
  font-weight: 620;
  letter-spacing: -.025em;
}
.area-response .markdown-body p { margin-bottom: 9px; }
.area-response .markdown-body strong { color: var(--heart-ink); font-weight: 650; }
.area-response .markdown-body ul,
.area-response .markdown-body ol { margin: 3px 0 13px; padding-left: 19px; }
.area-response .markdown-body li { margin: 5px 0; line-height: 1.55; }
.area-response .markdown-body hr { margin: 13px 0; border-color: rgb(49 118 83 / 18%); }
.assistant.area-finance .bubble {
  border-left-color: var(--task);
  background: linear-gradient(105deg, rgb(243 230 211 / 68%), rgb(250 248 242 / 38%) 82%);
}
.area-finance .markdown-body > h3:first-child {
  margin: 0 0 5px;
  font-size: 21px;
  font-weight: 630;
  letter-spacing: -.03em;
}
.area-finance .markdown-body h4 {
  margin: 16px 0 7px;
  padding-top: 12px;
  border-top: 1px solid rgb(166 103 40 / 16%);
  color: var(--task);
  font-size: 12px;
  font-weight: 680;
  letter-spacing: .06em;
}
.area-finance .markdown-body blockquote {
  margin: 11px 0 2px;
  padding: 0;
  border: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}
.area-finance .markdown-body strong { color: var(--task); }
.area-finance .markdown-body li { margin: 7px 0; }
.area-finance .markdown-body li::marker { color: rgb(166 103 40 / 58%); }
.user .bubble { background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.assistant.pending .bubble { min-height: 32px; }
.markdown-body { white-space: normal; }
.markdown-body > :first-child { margin-top: 0; }
.markdown-body > :last-child { margin-bottom: 0; }
.markdown-body p { margin: 0 0 10px; white-space: pre-line; }
.markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 17px 0 7px; color: var(--ink); font-size: 15px; line-height: 1.4; }
.markdown-body ul, .markdown-body ol { margin: 4px 0 12px; padding-left: 22px; }
.markdown-body li { margin: 3px 0; }
.markdown-body blockquote { margin: 8px 0 12px; padding: 7px 12px; border-left: 3px solid var(--line); color: var(--muted); white-space: pre-line; }
.markdown-body pre { margin: 10px 0 13px; padding: 12px; overflow-x: auto; border-radius: 12px; background: var(--ink); color: var(--paper-raised); white-space: pre; }
.markdown-body code { padding: 2px 5px; border-radius: 5px; background: var(--heart-soft); color: var(--heart-ink); font: 12px/1.5 "SFMono-Regular", Consolas, monospace; }
.markdown-body pre code { padding: 0; background: transparent; color: inherit; }
.markdown-body a { color: var(--heart-ink); text-underline-offset: 3px; }
.markdown-body hr { margin: 14px 0; border: 0; border-top: 1px solid var(--line); }

.composer-dock {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.quick-prompts {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 2px 2px;
}
.quick-prompt {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgb(250 248 242 / 76%);
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  touch-action: manipulation;
}
.quick-prompt.prompt-overview { border-color: rgb(49 118 83 / 25%); background: var(--heart-soft); color: var(--heart-ink); }
.quick-prompt.prompt-task { border-color: rgb(166 103 40 / 25%); background: var(--task-soft); color: var(--task); }
.quick-prompt.prompt-task.attention { box-shadow: inset 0 0 0 1px rgb(165 72 63 / 28%); color: var(--danger); }
.quick-prompt.prompt-todo { border-color: rgb(98 75 120 / 22%); background: var(--todo-soft); color: var(--todo); }
.quick-prompt.prompt-todo.attention { box-shadow: inset 0 0 0 1px rgb(173 107 45 / 34%); color: var(--warn); }
.quick-prompt span:empty { display: none; }
.quick-prompt span { margin-left: 3px; font-size: 11px; font-variant-numeric: tabular-nums; opacity: .72; }
.quick-prompt.prompt-area { border-color: rgb(82 106 145 / 22%); background: var(--area-soft); color: var(--area); }
.quick-prompt.prompt-area::after { content: "⌃"; display: inline-block; margin-left: 5px; font-size: 11px; transition: transform .18s ease; }
.quick-prompt.prompt-area[aria-expanded="true"]::after { transform: rotate(180deg); }
.quick-prompt:hover, .quick-prompt:focus-visible { filter: saturate(1.2) brightness(.97); }
.quick-prompt:active { transform: translateY(1px); }
.quick-prompt:disabled { cursor: wait; opacity: .45; }

.area-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgb(82 106 145 / 18%);
  border-radius: 18px;
  background: rgb(250 248 242 / 96%);
  box-shadow: 0 12px 35px rgb(38 48 39 / 8%);
  animation: area-picker-rise .18s ease-out;
}
.area-picker[hidden] { display: none; }
.area-picker button {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--area-option-fg) 20%, transparent);
  border-radius: 13px;
  background: var(--area-option-bg);
  color: var(--area-option-fg);
  font-size: 13px;
  font-weight: 550;
  touch-action: manipulation;
}
.area-picker button svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.area-option-health { --area-option-bg: #dfeee5; --area-option-fg: #255d45; }
.area-option-mind { --area-option-bg: #e8e2f1; --area-option-fg: #5d467c; }
.area-option-home { --area-option-bg: #f3ead7; --area-option-fg: #76551f; }
.area-option-finance { --area-option-bg: #e1ebf0; --area-option-fg: #345a70; }
.area-option-relationships { --area-option-bg: #f3e1e4; --area-option-fg: #7b4350; }
.area-option-career { --area-option-bg: #e1e8f4; --area-option-fg: #3e5680; }
.area-option-contribution { --area-option-bg: #e8eddb; --area-option-fg: #50672f; }
.area-option-lifestyle { --area-option-bg: #f0e4d7; --area-option-fg: #765138; }
.area-picker button:hover, .area-picker button:focus-visible { filter: saturate(1.2) brightness(.97); }
.area-picker button:active { transform: translateY(1px); }
.area-picker button:disabled { cursor: wait; opacity: .45; }

.todo-response { width: 100%; }
.todo-response .bubble { width: 100%; max-width: 100%; padding: 0; }
.todo-panel {
  min-width: 0;
  max-height: min(64dvh, 560px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 15px 13px;
  border: 1px solid rgb(98 75 120 / 18%);
  border-radius: 16px;
  background: rgb(235 228 241 / 48%);
  -webkit-overflow-scrolling: touch;
}
.todo-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.todo-heading strong { font-size: 13px; font-weight: 680; }
.todo-heading span { color: var(--muted); font-size: 11px; }
.confirmation-section { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgb(173 107 45 / 18%); }
.confirmation-section h3 { margin: 0 2px 8px; color: var(--warn); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.confirmation-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.confirmation-item { padding: 11px; border: 1px solid rgb(173 107 45 / 20%); border-radius: 13px; background: rgb(255 250 239 / 88%); }
.confirmation-item.answered { opacity: .68; }
.confirmation-meta { color: var(--warn); font-size: 10px; font-weight: 650; }
.confirmation-item p { margin: 5px 0 0; color: var(--ink); font-size: 12px; line-height: 1.55; overflow-wrap: anywhere; }
.confirmation-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.confirmation-actions button { min-height: 40px; padding: 0 12px; border: 1px solid rgb(173 107 45 / 24%); border-radius: 10px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 650; touch-action: manipulation; }
.confirmation-actions button.confirmation-explain { background: transparent; color: var(--warn); }
.confirmation-actions button:disabled { cursor: wait; opacity: .46; }
.confirmation-state { margin-top: 9px; color: var(--heart); font-size: 11px; font-weight: 620; }
.todo-list { display: grid; gap: 8px; margin: 11px 0 0; padding: 0; list-style: none; }
.todo-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px 10px 8px 6px;
  border: 1px solid rgb(98 75 120 / 13%);
  border-radius: 13px;
  background: rgb(250 248 242 / 82%);
}
.todo-complete {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--todo);
  touch-action: manipulation;
}
.todo-complete::before { content: ""; width: 17px; height: 17px; border: 1.7px solid currentColor; border-radius: 50%; }
.todo-complete:hover, .todo-complete:focus-visible { background: var(--todo-soft); }
.todo-complete:disabled { cursor: wait; opacity: .42; }
.todo-copy { min-width: 0; display: grid; gap: 4px; }
.todo-open {
  width: 100%;
  min-height: 44px;
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: inherit;
  text-align: left;
  touch-action: manipulation;
}
.todo-open:hover strong, .todo-open:focus-visible strong { color: var(--todo); }
.todo-copy strong { overflow-wrap: anywhere; font-size: 13px; font-weight: 620; line-height: 1.45; }
.todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; color: var(--muted); font-size: 10px; }
.todo-meta span { display: inline-flex; align-items: center; gap: 4px; }
.todo-meta .todo-area::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--todo-area-color, var(--todo)); }
.todo-area.area-health { --todo-area-color: #3f8664; }
.todo-area.area-mind { --todo-area-color: #765b96; }
.todo-area.area-home { --todo-area-color: #98702b; }
.todo-area.area-finance { --todo-area-color: #477a91; }
.todo-area.area-relationships { --todo-area-color: #9a5665; }
.todo-area.area-career { --todo-area-color: #536fa0; }
.todo-area.area-contribution { --todo-area-color: #687f3f; }
.todo-area.area-lifestyle { --todo-area-color: #946849; }
.todo-next { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.todo-empty { margin: 18px 0 8px; color: var(--muted); font-size: 12px; text-align: center; }
.todo-completed { margin: 11px 2px 0; color: var(--muted); font-size: 11px; }
.todo-completed summary { min-height: 32px; display: flex; align-items: center; }
.todo-completed ul { display: grid; gap: 5px; margin: 3px 0 0; padding-left: 18px; }
.todo-hint { margin: 11px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.todo-detail-response { width: 100%; }
.todo-detail-response .bubble { width: 100%; max-width: 100%; padding: 0; }
.todo-detail-card {
  padding: 15px 16px 16px;
  border: 1px solid rgb(98 75 120 / 18%);
  border-radius: 16px;
  background: rgb(235 228 241 / 48%);
}
.todo-back {
  min-height: 44px;
  border: 0;
  padding: 0 6px 0 0;
  background: transparent;
  color: var(--todo);
  font-size: 11px;
  font-weight: 620;
}
.todo-detail-card h3 { margin: 5px 0 14px; font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.todo-detail-card dl { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 9px 10px; margin: 0; }
.todo-detail-card dt { color: var(--muted); font-size: 11px; }
.todo-detail-card dd { margin: 0; color: var(--ink); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.todo-detail-complete {
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
  border: 1px solid rgb(98 75 120 / 20%);
  border-radius: 12px;
  background: var(--todo);
  color: white;
  font-size: 12px;
  font-weight: 650;
  touch-action: manipulation;
}
.todo-detail-complete:disabled { cursor: wait; opacity: .45; }

.composer {
  display: grid;
  grid-template-columns: 38px 1fr 38px 42px;
  gap: 10px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 21px;
  background: var(--paper-raised);
  box-shadow: 0 12px 35px rgb(38 48 39 / 7%);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.composer:focus-within {
  border-color: rgb(49 118 83 / 22%);
  box-shadow: 0 10px 30px rgb(38 48 39 / 6%);
}

.image-preview {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 10px;
  padding: 7px 8px 8px;
  border-bottom: 1px solid var(--line);
}
.image-preview img { width: 48px; height: 48px; border-radius: 11px; object-fit: cover; background: var(--paper); }
.image-preview div { min-width: 0; display: grid; gap: 2px; }
.image-preview strong { overflow: hidden; font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.image-preview span { color: var(--muted); font-size: 11px; }
.image-preview .image-remove { width: 30px; height: 30px; border-radius: 10px; background: transparent; color: var(--muted); font-size: 21px; font-weight: 300; }

.composer textarea {
  width: 100%;
  max-height: 150px;
  resize: none;
  border: 0;
  outline: 0;
  padding: 10px 8px 9px;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
.composer textarea:focus-visible { outline: none; }

.composer button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: var(--heart);
  color: white;
  font-size: 20px;
}
.composer.voice-unavailable { grid-template-columns: 38px 1fr 42px; }
.composer .image-button {
  position: relative;
  width: 38px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  overflow: hidden;
}
.image-native-input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.image-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.composer .image-button:hover, .composer .image-button:focus-visible { color: var(--ink); }
.composer .image-button[aria-disabled="true"] { pointer-events: none; opacity: .45; }
.composer .voice-button { width: 38px; background: transparent; color: var(--muted); }
.voice-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.composer .voice-button:hover { color: var(--ink); }
.composer .voice-button.listening { background: var(--heart-soft); color: var(--heart-ink); animation: breathe 1.3s ease-in-out infinite; }
.composer button:disabled { cursor: wait; opacity: .45; }
.composer .stop-button { background: var(--ink); font-size: 13px; }
.app-error { margin: 0 8px; }
.app-error:empty { display: none; }
.message-image { display: block; width: min(100%, 320px); max-height: 320px; margin-bottom: 9px; border-radius: 13px; object-fit: contain; background: rgb(255 255 255 / 12%); }
.message-text { margin: 0; white-space: pre-wrap; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--heart); outline-offset: 2px; }
.toast-region { position: fixed; z-index: 10; right: max(18px, env(safe-area-inset-right)); bottom: max(22px, env(safe-area-inset-bottom)); display: grid; gap: 8px; width: min(320px, calc(100vw - 36px)); pointer-events: none; }
.task-toast { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--ink); box-shadow: var(--shadow); color: white; font-size: 13px; line-height: 1.5; }
.task-toast.failed { background: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes breathe { 0%, 100% { opacity: .45; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes area-picker-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 560px) {
  .app-shell {
    padding: max(12px, env(safe-area-inset-top)) 12px max(8px, env(safe-area-inset-bottom));
    gap: 10px;
  }
  .bubble { max-width: calc(100% - 61px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; }
}
