:root {
  color-scheme: light;
  --visual-viewport-height: 100dvh;
  --visual-viewport-offset-top: 0px;
  --ink: #18213b;
  --muted: #6f7689;
  --navy: #142149;
  --navy-2: #203467;
  --blue: #315dd8;
  --blue-soft: #edf2ff;
  --gold: #f2b84b;
  --paper: #f5f7fb;
  --surface: #ffffff;
  --line: #e5e8f0;
  --danger: #d64d57;
  --shadow: 0 18px 45px rgba(25, 35, 67, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
html { font-size: 16px; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  line-height: 1.55;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 30px 22px 24px;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, #111b3c 0%, #182957 70%, #122044 100%);
  color: white;
}
.brand { display: flex; align-items: center; gap: 13px; color: inherit; text-decoration: none; margin: 0 8px 42px; }
.brand-mark {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--gold); color: var(--navy); font-size: 1.25rem; font-weight: 800;
  box-shadow: 0 10px 24px rgba(242,184,75,.22);
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.18rem; letter-spacing: .08em; }
.brand small { margin-top: 1px; color: #aeb9d8; font-size: .75rem; }
.main-nav { display: grid; gap: 8px; }
.main-nav a {
  display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 12px;
  color: #c2cae0; text-decoration: none; font-weight: 650; transition: .2s ease;
}
.main-nav a:hover { background: rgba(255,255,255,.07); color: white; }
.main-nav a.active { background: white; color: var(--navy); box-shadow: 0 10px 25px rgba(0,0,0,.14); }
.nav-icon { width: 25px; text-align: center; font-size: 1.2rem; }
.sidebar-foot {
  margin-top: auto; padding: 15px 11px 5px; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; gap: 10px;
}
.sidebar-foot strong, .sidebar-foot small { display: block; }
.sidebar-foot strong { color: #e8ecf8; font-size: .78rem; }
.sidebar-foot small { color: #98a4c5; font-size: .7rem; margin-top: 2px; }
.local-dot { width: 9px; height: 9px; border-radius: 50%; background: #78d7a7; box-shadow: 0 0 0 4px rgba(120,215,167,.12); }

.main-content { min-width: 0; padding: 40px clamp(24px, 4vw, 64px) 64px; }
.topbar { max-width: 1180px; margin: 0 auto 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.topbar h1 { margin: 1px 0 0; font-size: clamp(1.8rem, 3vw, 2.45rem); line-height: 1.2; letter-spacing: -.035em; }
.eyebrow { margin: 0; color: var(--blue); font-size: .72rem; font-weight: 800; letter-spacing: .15em; }
.top-actions { display: flex; gap: 10px; }
.top-actions [hidden] { display: none; }
.button {
  min-height: 43px; border: 0; border-radius: 11px; padding: 9px 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button.primary { background: var(--navy); color: white; box-shadow: 0 10px 24px rgba(20,33,73,.2); }
.button.primary:hover { background: var(--navy-2); }
.button.ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.button.danger { background: var(--danger); color: white; }
.button.small { min-height: 36px; padding: 6px 12px; font-size: .84rem; }
.button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(49,93,216,.25); outline-offset: 2px; }

.view { max-width: 1180px; margin: 0 auto; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .8fr); gap: 22px; }
.stack { display: grid; align-content: start; gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 9px 28px rgba(29,41,75,.045); }
.card-pad { padding: 24px; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.section-head h2 { margin: 0; font-size: 1.08rem; }
.section-head p { margin: 3px 0 0; color: var(--muted); font-size: .82rem; }
.text-link { color: var(--blue); font-weight: 700; font-size: .83rem; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.progress-card {
  position: relative; overflow: hidden; padding: 27px;
  background: linear-gradient(135deg, #192a5b 0%, #2d4f9f 100%); color: white; border: 0;
}
.progress-card::after { content: ""; position: absolute; width: 190px; height: 190px; right: -60px; bottom: -110px; border: 26px solid rgba(255,255,255,.06); border-radius: 50%; }
.progress-card h2 { margin: 0; font-size: 1.05rem; }
.progress-summary { display: flex; align-items: center; gap: 22px; margin-top: 19px; }
.progress-ring { width: 98px; height: 98px; flex: 0 0 auto; position: relative; display: grid; place-items: center; }
.progress-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 8; }
.progress-ring .track { stroke: rgba(255,255,255,.13); }
.progress-ring .value { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .5s ease; }
.progress-ring strong { font-size: 1.35rem; }
.progress-copy strong { display: block; font-size: 1.35rem; }
.progress-copy span { color: #c8d2eb; font-size: .82rem; }
.stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }
.mini-stat { padding: 13px 14px; background: rgba(255,255,255,.08); border-radius: 11px; }
.mini-stat strong, .mini-stat span { display: block; }
.mini-stat strong { font-size: 1.05rem; }
.mini-stat span { color: #bcc7e2; font-size: .74rem; }

.task-list { display: grid; gap: 9px; }
.task-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 13px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 13px; background: white; transition: opacity .28s ease, transform .28s ease, border-color .25s ease, background-color .35s ease, box-shadow .18s ease; }
.task-item:hover { border-color: #ccd5eb; box-shadow: 0 8px 22px rgba(32,50,93,.06); }
.task-item.completed { opacity: .66; }
.task-item.completing { border-color: #bcdccd; background: #f5fbf8; }
.task-item.reopening { border-color: #c9d5ef; background: #f7f9fe; }
.task-item.task-relocating { opacity: 0; transform: translateY(7px) scale(.985); pointer-events: none; }
.task-item.task-arriving { animation: task-arrive .38s cubic-bezier(.2,.75,.28,1) both; }
.check-button { position: relative; margin-top: 2px; width: 22px; height: 22px; border-radius: 7px; border: 2px solid #c7cddb; background: white; display: grid; place-items: center; padding: 0; color: white; transition: background-color .24s ease, border-color .24s ease, transform .2s ease; }
.check-button::after { content: "✓"; font-size: .75rem; font-weight: 900; line-height: 1; opacity: 0; transform: scale(.25) rotate(-24deg); transition: opacity .18s ease, transform .3s cubic-bezier(.2,1.55,.35,1); }
.check-button::before { content: ""; position: absolute; inset: -7px; border: 2px solid rgba(49,93,216,.32); border-radius: 12px; opacity: 0; transform: scale(.55); pointer-events: none; }
.check-button.checked { background: var(--blue); border-color: var(--blue); }
.check-button.checked::after { opacity: 1; transform: scale(1) rotate(0); }
.check-button.is-toggling { animation: check-button-pop .38s cubic-bezier(.2,1.45,.35,1); }
.check-button.is-toggling::before { animation: check-ring .48s ease-out; }
.check-button:disabled { cursor: default; }
.task-title { position: relative; display: inline; margin: 0; font-size: .95rem; font-weight: 750; overflow-wrap: anywhere; }
.task-title::after { content: ""; position: absolute; left: 0; right: 0; top: 55%; height: 1.5px; border-radius: 2px; background: #778096; transform: scaleX(0); transform-origin: left; transition: transform .32s ease; }
.task-item.completed .task-title::after { transform: scaleX(1); }
.task-item > div:nth-child(2) { transition: color .28s ease, opacity .28s ease; }
@keyframes check-button-pop { 0% { transform: scale(1); } 45% { transform: scale(1.16); } 100% { transform: scale(1); } }
@keyframes check-ring { 0% { opacity: .7; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.35); } }
@keyframes task-arrive { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: translateY(0) scale(1); } }
.task-notes { margin: 4px 0 0; color: var(--muted); font-size: .8rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.pill { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 8px; border-radius: 999px; background: #f0f2f7; color: #646c7e; font-size: .7rem; font-weight: 650; }
.pill.high { background: #fff0ef; color: #c94e54; }
.pill.medium { background: #fff6e2; color: #a56e12; }
.pill.low { background: #edf7f4; color: #39806b; }
.pill.overdue { background: #fff0ef; color: var(--danger); }
.item-actions { display: flex; gap: 3px; }
.ai-entry { align-self: flex-start; flex-shrink: 0; border: 0; border-radius: 8px; padding: 7px; color: #426fa6; background: #edf5fc; font-size: 12px; cursor: pointer; white-space: nowrap; }
.modal.decomposition-modal { max-width: min(1080px, calc(100vw - 24px)); }
.decomposition-modal .decomposition-card { display: flex; flex-direction: column; padding: 22px; height: min(88vh, 900px); max-height: calc(var(--visual-viewport-height, 100dvh) - 24px); overflow: hidden; background: #f8fbff; }
.decomposition-head, .decomposition-footer, .decomposition-tabs, .decomposition-error, .ai-usage, .decomposition-composer { flex-shrink: 0; }
.decomposition-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.decomposition-head h2 { margin: 5px 0; font-size: 18px; overflow-wrap: anywhere; }
.ai-usage { color: #66788d; font-size: 12px; margin: 4px 0 14px; }
.decomposition-tabs { display: none; }
.decomposition-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 0; flex: 1; gap: 18px; }
.decomposition-chat { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.decomposition-thread { overflow: auto; flex: 1; min-height: 0; padding: 4px 6px; }
.ai-user-message, .ai-coach-message { padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.ai-user-message { background: #deedf9; margin-left: 28px; }
.ai-coach-message { background: white; margin-right: 12px; border: 1px solid #e4edf5; }
.ai-user-message p, .ai-coach-message p { white-space: pre-wrap; margin: 6px 0; }
.ai-coach-message ul { padding-left: 20px; }
.ai-sources { font-size: 12px; color: #66788d; }
.decomposition-composer { padding-top: 12px; border-top: 1px solid #dce6f0; }
.decomposition-composer .draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 5px; margin: 6px 0 0; font-size: 11px; }
.decomposition-composer .draft-bar button { font-size: 11px; padding: 4px 6px; }
.decomposition-composer textarea { width: 100%; min-height: 78px; max-height: 140px; resize: vertical; font-size: 16px; background: white; }
.ai-journal-choice { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #66788d; margin-bottom: 7px; }
.ai-journal-choice input, .ai-step input { width: 17px; height: 17px; flex-shrink: 0; accent-color: #426fa6; }
.decomposition-send-row { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
.decomposition-draft { min-width: 0; overflow: auto; padding: 16px; border: 1px solid #dce6f0; border-radius: 16px; background: white; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
.ai-draft-head { display: flex; justify-content: space-between; gap: 10px; color: #426fa6; }
.decomposition-draft h3 { font-size: 14px; margin: 0 0 6px; }
.decomposition-draft section { margin: 16px 0; }
.decomposition-draft ul { margin: 0; padding-left: 20px; }
.ai-draft-head span, .ai-step small { font-size: 12px; color: #66788d; }
.ai-goal { font-weight: 600; }
.ai-next-action { border-radius: 10px; padding: 12px; background: #eef6fd; }
.ai-next-action p { margin: 0; }
.ai-step { display: flex; align-items: flex-start; gap: 10px; padding: 14px 0; border-top: 1px solid #e6edf4; }
.ai-step input { margin-top: 5px; }
.ai-step p { margin: 5px 0; white-space: pre-wrap; }
.ai-step .ai-done-when { color: #426849; font-size: 13px; }
.ai-apply-controls { display: grid; gap: 10px; padding-top: 14px; }
.ai-apply-controls select { display: block; width: 100%; margin-top: 5px; }
.ai-welcome { padding: 16px 4px; color: #66788d; font-size: 14px; line-height: 1.8; }
.ai-welcome h3 { font-size: 16px; color: var(--ink); }
.decomposition-error { background: #fff3e9; color: #8b481d; border-radius: 9px; padding: 10px; font-size: 13px; margin: 4px 0 10px; }
.decomposition-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 12px; font-size: 11px; color: #66788d; }
.decomposition-footer button { white-space: nowrap; }
.decomposition-card #connection-notice { position: static; flex-shrink: 0; max-height: 100px; overflow: auto; margin-top: 6px; }
@media (max-width: 720px) and (max-height: 550px) {
  .decomposition-footer { display: none; }
  .decomposition-composer textarea { min-height: 55px; height: 55px; }
  .decomposition-head h2 { max-height: 25px; }
  .decomposition-composer .draft-status { margin: 3px 0; font-size: 10px; }
}
@media (max-width: 720px) {
  .modal.decomposition-modal { max-width: calc(100vw - 12px); margin: auto; }
  .decomposition-modal .decomposition-card { padding: 16px 12px; height: calc(var(--visual-viewport-height, 100dvh) - 20px); max-height: calc(var(--visual-viewport-height, 100dvh) - 20px); }
  .decomposition-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
  .decomposition-tabs button { border: 1px solid #dce6f0; background: white; border-radius: 9px; padding: 9px 15px; color: #66788d; }
  .decomposition-tabs button[aria-selected=true] { background: #deedf9; color: #294f7c; }
  .decomposition-layout { display: flex; }
  .decomposition-chat, .decomposition-draft { width: 100%; }
  .decomposition-modal[data-tab=chat] .decomposition-draft, .decomposition-modal[data-tab=draft] .decomposition-chat { display: none; }
  .decomposition-footer { font-size: 10px; }
  .decomposition-head h2 { font-size: 16px; max-height: 48px; overflow: auto; }
  .ai-usage { font-size: 11px; margin-bottom: 9px; }
}
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 1.25rem; display: grid; place-items: center; }
.icon-button:hover { background: #f0f2f7; color: var(--ink); }
.icon-button.delete:hover { background: #fff0f0; color: var(--danger); }

.recent-list { display: grid; gap: 12px; }
.journal-preview { cursor: pointer; padding: 14px 0; border-bottom: 1px solid var(--line); }
.journal-preview:first-child { padding-top: 0; }
.journal-preview:last-child { border-bottom: 0; padding-bottom: 0; }
.journal-preview time { color: var(--blue); font-size: .72rem; font-weight: 750; }
.journal-preview h3 { margin: 4px 0; font-size: .95rem; }
.journal-preview p { margin: 0; color: var(--muted); font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mood { margin-left: 6px; }

.toolbar { padding: 15px; margin-bottom: 17px; display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(130px, .35fr)); gap: 10px; }
.search-box { position: relative; }
.search-box::before { content: "⌕"; position: absolute; left: 13px; top: 50%; transform: translateY(-52%); color: var(--muted); font-size: 1.2rem; }
.toolbar input, .toolbar select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfe; padding: 8px 12px; color: var(--ink); }
.toolbar .search-box input { padding-left: 39px; }
.task-toolbar, .plan-toolbar, .journal-toolbar { padding: 11px; margin-bottom: 15px; }
.task-toolbar-main { display: block; }
.task-toolbar input, .task-toolbar select, .plan-toolbar input, .plan-toolbar select, .journal-toolbar input, .journal-toolbar select { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfe; padding: 8px 12px; color: var(--ink); }
.task-toolbar .search-box input { padding-left: 39px; }
.plan-toolbar .search-box input { padding-left: 39px; }
.journal-toolbar .search-box input { padding-left: 39px; }
.filter-toggle { width: 100%; min-height: 42px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid transparent; border-radius: 10px; background: #f7f9fd; color: #46516b; font-weight: 750; }
.filter-toggle:hover, .filter-toggle[aria-expanded="true"] { border-color: #b9c9e8; background: var(--blue-soft); color: var(--blue); }
.filter-toggle small { min-width: 0; color: var(--blue); font-size: .68rem; }
.filter-toggle-title, .filter-toggle-side { display: inline-flex; align-items: center; gap: 8px; }
.filter-toggle-title > span { width: 21px; color: #78849b; font-size: 1.12rem; font-weight: 500; }
.filter-chevron { font-size: 1rem; line-height: 1; transition: transform .18s ease; }
.filter-toggle[aria-expanded="true"] .filter-chevron { transform: rotate(180deg); }
.filter-panel { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.task-filter-panel { grid-template-columns: minmax(220px, 1.5fr) repeat(3, minmax(125px, .6fr)); }
.plan-filter-panel { grid-template-columns: minmax(150px, .42fr) minmax(220px, 1fr) minmax(150px, .42fr); }
.journal-filter-panel { grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(140px, .42fr)); }
.filter-panel[hidden] { display: none; }
.task-page-list .task-item { padding: 12px 14px; border: 0; border-radius: 0; box-shadow: none; background: transparent; }
.task-page-list .task-item + .task-item { border-top: 1px solid #edf0f5; }
.task-page-list .task-item:hover { background: #fafbfe; box-shadow: none; }
.task-page-list .task-item.completing { background: #f5fbf8; }
.task-page-list .task-item.reopening { background: #f7f9fe; }
.task-page-list .task-notes { -webkit-line-clamp: 1; }
.task-page-list .meta-row { margin-top: 6px; }
.result-summary { display: flex; justify-content: space-between; align-items: center; margin: 0 2px 12px; color: var(--muted); font-size: .8rem; }
.load-more-row { display: flex; justify-content: center; padding: 14px 0 2px; }
.load-more-row .button { min-width: min(100%, 250px); }
.inline-loading, .lazy-group-note { margin: 0; padding: 24px 16px; color: var(--muted); text-align: center; font-size: .78rem; }
.task-groups { display: grid; gap: 13px; }
.task-group { display: grid; gap: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; box-shadow: 0 7px 24px rgba(30,46,85,.045); }
.task-group-head { width: 100%; min-height: 46px; padding: 9px 14px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 0; border-bottom: 1px solid #edf0f5; border-radius: 0; background: #fbfcfe; color: var(--ink); text-align: left; }
.task-group.collapsed .task-group-head { border-bottom-color: transparent; }
.task-group-head:hover { background: #f5f7fb; }
.task-group-head > div { display: flex; align-items: center; gap: 8px; }
.task-group-copy { display: flex; align-items: baseline; gap: 9px; }
.task-group-chevron { width: 20px; color: #72809e; font-size: 1rem; text-align: center; transition: transform .18s ease; }
.task-group.collapsed .task-group-chevron { transform: rotate(-90deg); }
.task-group-head h2 { margin: 0; font-size: .91rem; letter-spacing: .01em; }
.task-group-copy > span { color: var(--muted); font-size: .72rem; }
.task-group-head strong { min-width: 24px; height: 24px; display: grid; place-items: center; border-radius: 999px; background: #e9eef9; color: #4c628d; font-size: .69rem; }
.task-list[hidden] { display: none; }

.notification-card { margin-bottom: 17px; padding: 18px 20px; }
.notification-card-head { display: flex; align-items: center; gap: 12px; }
.notification-mark { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 13px; background: var(--blue-soft); color: var(--blue); font-size: 1.2rem; font-weight: 850; }
.notification-copy { min-width: 0; flex: 1; }
.notification-copy h2 { margin: 0; font-size: .98rem; }
.notification-copy p { margin: 2px 0 0; color: var(--muted); font-size: .73rem; }
.notification-switch { position: relative; width: 49px; height: 29px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 999px; background: #cbd1dc; transition: background-color .2s ease; }
.notification-switch > span:first-child { position: absolute; width: 23px; height: 23px; left: 3px; top: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 7px rgba(24,33,59,.22); transition: transform .22s ease; }
.notification-switch.on { background: var(--blue); }
.notification-switch.on > span:first-child { transform: translateX(20px); }
.notification-switch:disabled { opacity: .45; cursor: not-allowed; }
.notification-hint { margin: 12px 0 0 54px; color: #778096; font-size: .7rem; line-height: 1.6; }
.notification-options { margin: 15px 0 0 54px; padding-top: 14px; display: grid; grid-template-columns: minmax(150px, .7fr) minmax(180px, 1fr) minmax(210px, 1.2fr) auto; align-items: center; gap: 11px 18px; border-top: 1px solid var(--line); }
.notification-options > label:first-child { display: grid; gap: 5px; color: #4e566a; font-size: .7rem; font-weight: 700; }
.notification-options input[type="time"] { width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfe; color: var(--ink); }
.notification-check { display: inline-flex; align-items: center; gap: 7px; color: #4e566a; font-size: .76rem; }
.notification-check input { width: 17px; height: 17px; accent-color: var(--blue); }

.my-section-tabs { display: flex; gap: 7px; margin-bottom: 17px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: #eef2f8; }
.my-section-tabs button { min-height: 40px; padding: 8px 16px; border: 0; border-radius: 10px; background: transparent; color: #697389; font-weight: 750; }
.my-section-tabs button:hover { color: var(--ink); background: rgba(255,255,255,.6); }
.my-section-tabs button.active { color: var(--navy); background: white; box-shadow: 0 4px 13px rgba(25,39,76,.09); }
.password-vault { padding: 20px; }
#connection-notice { position: fixed; z-index: 10000; inset: auto 16px 90px; margin-inline: auto; max-width: 600px; padding: 16px; border: 1px solid #d7a952; border-radius: 14px; background: #fff9ec; color: #473a20; box-shadow: 0 8px 28px #17264a26; }
#connection-notice p { margin: 0 0 10px; }
#connection-notice > div { display: flex; flex-wrap: wrap; gap: 10px; }
.draft-bar { margin: 12px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.draft-status { color: #677387; line-height: 1.5; }
.password-warning { color: #835c24; font-size: .85rem; }
.password-form { display: grid; gap: 10px; margin: 18px 0; }
.password-form input, .password-form textarea { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 9px; font: inherit; }
.password-form .password-notepad { min-height: 50vh; resize: vertical; padding: 18px; line-height: 1.8; background: #fffdf7; }
.password-entry { padding: 14px 0; border-top: 1px solid var(--line); }
.password-entry p { margin: 6px 0; overflow-wrap: anywhere; }
.password-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.password-details { margin-top: 10px; overflow-wrap: anywhere; }
.data-tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.data-model-card { grid-column: 1 / -1; padding: 24px; display: grid; gap: 18px; }
.data-model-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.data-model-head h2 { margin: 3px 0 6px; font-size: 1.18rem; }
.data-model-head p, .data-model-note { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.7; }
.data-schema-badge { flex: 0 0 auto; padding: 7px 11px; border-radius: 999px; background: #edf3ff; color: #315fae; font-size: .72rem; font-weight: 700; }
.data-model-flow { display: grid; grid-template-columns: repeat(9, auto); align-items: center; gap: 10px; }
.data-model-flow > div { min-width: 0; padding: 13px 15px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-soft); }
.data-model-flow strong, .data-model-flow span { display: block; }
.data-model-flow strong { font-size: .8rem; }
.data-model-flow span { margin-top: 4px; color: var(--muted); font-size: .69rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.data-model-flow > i { color: #8ca0c1; font-style: normal; text-align: center; }
.data-model-stats { display: flex; flex-wrap: wrap; gap: 9px; }
.data-model-stats span { padding: 7px 10px; border-radius: 9px; background: #f5f7fb; color: var(--muted); font-size: .72rem; }
.data-model-stats b { color: var(--ink); }
.behavior-dashboard { display: grid; gap: 17px; }
.behavior-dashboard-head { padding: 3px 2px 1px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.behavior-dashboard-head h2 { margin: 3px 0 1px; color: var(--navy); font-size: 1.45rem; }
.behavior-dashboard-head p { margin: 0; color: var(--muted); font-size: .72rem; }
.behavior-range { padding: 4px; display: flex; gap: 3px; border: 1px solid var(--line); border-radius: 12px; background: #eef2f8; }
.behavior-range button { min-width: 54px; padding: 7px 10px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: .72rem; font-weight: 750; }
.behavior-range button.active { background: white; color: var(--blue); box-shadow: 0 3px 10px rgba(25,39,76,.09); }
.behavior-top-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); gap: 17px; }
.checkin-card, .behavior-summary-card { padding: 22px; }
.behavior-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.behavior-heading h2 { margin: 3px 0 0; font-size: 1.12rem; }
.behavior-heading time, .summary-period { color: var(--muted); font-size: .72rem; }
.energy-field { margin: 0 0 17px; padding: 0; border: 0; }
.energy-field legend { margin-bottom: 8px; color: #4e566a; font-size: .8rem; font-weight: 700; }
.energy-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.energy-scale label { min-width: 0; padding: 10px 4px; display: grid; justify-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 12px; background: #f9fbfe; color: var(--muted); cursor: pointer; transition: .18s ease; }
.energy-scale label.selected { border-color: #6b8ce4; background: #edf2ff; color: var(--blue); box-shadow: 0 0 0 2px rgba(49,93,216,.08); }
.energy-scale input { position: absolute; opacity: 0; pointer-events: none; }
.energy-scale strong { font-size: 1.05rem; }
.energy-scale small { font-size: .61rem; white-space: nowrap; }
.checkin-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.checkin-actions > span { color: var(--muted); font-size: .7rem; }
.behavior-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.behavior-stats > div { padding: 17px 14px; display: grid; gap: 3px; border-radius: 13px; background: #f4f7fc; }
.behavior-stats strong { color: var(--navy); font-size: 1.45rem; }
.behavior-stats span { color: var(--muted); font-size: .7rem; }
.behavior-summary-note { margin: 16px 2px 0; color: var(--muted); font-size: .75rem; line-height: 1.65; }
.behavior-chart-card { min-width: 0; padding: 20px 22px; }
.behavior-card-title { min-height: 44px; margin-bottom: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.behavior-card-title h2 { margin: 3px 0 0; color: var(--navy); font-size: 1rem; }
.chart-legend { display: flex; align-items: center; gap: 13px; color: var(--muted); font-size: .66rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 16px; height: 3px; border-radius: 4px; }
.chart-legend i.energy { background: #315dd8; }
.chart-legend i.tasks { height: 9px; background: #bcd0f4; }
.trend-chart-wrap { width: 100%; overflow-x: auto; }
.trend-chart { width: 100%; min-width: 520px; height: auto; display: block; }
.trend-grid line { stroke: #e6eaf2; stroke-width: 1; }
.trend-grid text, .trend-labels text { fill: #9aa1b1; font-size: 10px; }
.trend-bars rect { fill: #bfd0f2; opacity: .85; }
.energy-line { fill: none; stroke: #315dd8; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.energy-dots circle { fill: white; stroke: #315dd8; stroke-width: 3; }
.chart-empty { min-height: 180px; display: grid; place-items: center; color: var(--muted); font-size: .76rem; text-align: center; }
.chart-empty.compact { min-height: 140px; }
.behavior-visual-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.mood-visual { min-height: 190px; display: grid; grid-template-columns: 150px minmax(0, 1fr); align-items: center; gap: 22px; }
.mood-donut { --mood-segments: conic-gradient(#e8ebf2 0 100%); width: 145px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--mood-segments); position: relative; }
.mood-donut::after { content: ""; position: absolute; inset: 27px; border-radius: 50%; background: white; }
.mood-donut > div { position: relative; z-index: 1; display: grid; justify-items: center; }
.mood-donut strong { color: var(--navy); font-size: 1.35rem; }
.mood-donut span { color: var(--muted); font-size: .62rem; }
.mood-legend { display: grid; gap: 8px; }
.mood-legend > div { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; }
.mood-legend i { width: 8px; height: 8px; border-radius: 50%; }
.mood-legend strong { color: var(--ink); }
.heatmap-shell { min-height: 190px; display: grid; align-content: center; gap: 8px; }
.heatmap-weekdays, .heatmap-grid { display: grid; grid-template-columns: repeat(7, minmax(12px, 1fr)); gap: 5px; }
.heatmap-weekdays span { color: var(--muted); font-size: .58rem; text-align: center; }
.heatmap-cell { min-width: 12px; aspect-ratio: 1; border-radius: 4px; background: #edf0f5; }
.heatmap-cell.level-1, .heatmap-caption i.level-1 { background: #6b8ce4; }
.heatmap-cell.level-2 { background: #4e70d1; }
.heatmap-cell.level-3 { background: #3153b6; }
.heatmap-cell.placeholder { background: transparent; }
.heatmap-caption { display: flex; justify-content: flex-end; align-items: center; gap: 5px; color: var(--muted); font-size: .58rem; }
.heatmap-caption i { width: 10px; height: 10px; border-radius: 3px; background: #edf0f5; }
.behavior-plan-list { display: grid; gap: 15px; }
.behavior-plan-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px 12px; }
.behavior-plan-row > div:first-child { display: grid; gap: 2px; }
.behavior-plan-row strong { color: var(--ink); font-size: .78rem; }
.behavior-plan-row span { color: var(--muted); font-size: .64rem; }
.behavior-plan-row > b { color: var(--blue); font-size: .75rem; }
.behavior-plan-track { grid-column: 1 / -1; height: 6px; overflow: hidden; border-radius: 999px; background: #edf0f6; }
.behavior-plan-track i { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #6b8ce4, #315dd8); }
.behavior-events { max-height: 250px; overflow: auto; display: grid; gap: 0; }
.behavior-event { min-height: 46px; display: grid; grid-template-columns: 13px minmax(0, 1fr); gap: 9px; position: relative; }
.behavior-event > i { width: 9px; height: 9px; margin-top: 5px; border: 2px solid white; border-radius: 50%; background: #6b8ce4; box-shadow: 0 0 0 1px #9cb0e8; position: relative; z-index: 1; }
.behavior-event:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 13px; bottom: -4px; width: 1px; background: #dfe4ef; }
.behavior-event > div { min-width: 0; display: grid; align-content: start; gap: 2px; }
.behavior-event strong { color: var(--ink); font-size: .75rem; }
.behavior-event span { overflow: hidden; color: var(--muted); font-size: .63rem; white-space: nowrap; text-overflow: ellipsis; }
.behavior-mode-switch { width: min(330px, 100%); padding: 4px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; border: 1px solid var(--line); border-radius: 13px; background: #eef2f8; }
.behavior-mode-switch button { padding: 8px 13px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: .74rem; font-weight: 750; }
.behavior-mode-switch button.active { background: white; color: var(--navy); box-shadow: 0 3px 10px rgba(25,39,76,.09); }
.graph-controls { padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.graph-controls p { margin: 0; color: var(--muted); font-size: .69rem; }
.graph-type-filters { display: flex; flex-wrap: wrap; gap: 7px; }
.graph-type-filters button { padding: 7px 10px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; color: var(--muted); font-size: .7rem; font-weight: 720; }
.graph-type-filters button i { width: 8px; height: 8px; border-radius: 50%; opacity: .45; }
.graph-type-filters button.active { border-color: #c8d3eb; background: #f0f4fc; color: var(--ink); }
.graph-type-filters button.active i { opacity: 1; box-shadow: 0 0 0 3px rgba(66,103,213,.08); }
.graph-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 255px; gap: 17px; align-items: stretch; }
.graph-canvas-card { min-width: 0; min-height: 590px; padding: 0; overflow: hidden; position: relative; background: radial-gradient(circle at 50% 44%, #fff 0, #f8faff 62%, #f2f5fb 100%); }
.behavior-graph { width: 100%; height: 560px; display: block; touch-action: none; user-select: none; }
.graph-edge { stroke: #cbd2df; stroke-width: 1.2; opacity: .75; }
.graph-edge.parent { stroke: #7589bc; stroke-width: 2; }
.graph-edge.same_day { stroke: #b8bdc9; stroke-dasharray: 5 6; }
.graph-edge.explicit { stroke: #476ad0; stroke-width: 2.4; opacity: .82; }
.graph-node { cursor: grab; outline: none; }
.graph-node:active { cursor: grabbing; }
.graph-node circle { stroke: white; stroke-width: 3; filter: url(#node-shadow); transition: transform .16s ease, stroke-width .16s ease; }
.graph-node:hover circle, .graph-node:focus circle { transform: scale(1.22); stroke-width: 4; }
.graph-node text { fill: #31394b; font-size: 11px; font-weight: 700; paint-order: stroke; stroke: rgba(255,255,255,.94); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; }
.graph-node.plan circle { fill: #4267d5; }.graph-node.task circle { fill: #e6a72b; }.graph-node.journal circle { fill: #46a47b; }.graph-node.checkin circle { fill: #8a6ac8; }
.graph-legend { position: absolute; left: 13px; bottom: 12px; padding: 7px 9px; display: flex; flex-wrap: wrap; gap: 10px; border: 1px solid rgba(216,221,232,.8); border-radius: 9px; background: rgba(255,255,255,.86); backdrop-filter: blur(10px); color: var(--muted); font-size: .61rem; }
.graph-legend span { display: inline-flex; align-items: center; gap: 5px; }
.graph-legend i { width: 19px; height: 0; border-top: 2px solid #7589bc; }.graph-legend i.same-day { border-top: 1px dashed #aeb4c0; }.graph-legend i.explicit { border-color: #476ad0; border-width: 3px; }
.graph-side { min-width: 0; display: grid; grid-template-rows: minmax(210px, auto) auto; align-content: start; gap: 17px; }
.graph-node-detail { min-height: 210px; padding: 18px; }
.graph-detail-empty { min-height: 172px; display: grid; place-content: center; justify-items: center; gap: 7px; text-align: center; }
.graph-detail-empty > span { color: #758bd1; font-size: 1.7rem; }.graph-detail-empty strong { font-size: .85rem; }.graph-detail-empty p { max-width: 180px; margin: 0; color: var(--muted); font-size: .68rem; line-height: 1.6; }
.graph-detail-card h3 { margin: 12px 0 4px; color: var(--navy); font-size: 1rem; line-height: 1.45; }
.graph-type-badge { padding: 4px 7px; display: inline-block; border-radius: 7px; background: #eef2fb; color: #4267d5; font-size: .61rem; font-weight: 750; }
.graph-type-badge.task { background: #fff5dd; color: #9a6810; }.graph-type-badge.journal { background: #eaf7f1; color: #307a5b; }.graph-type-badge.checkin { background: #f1ecfa; color: #6d50a5; }
.graph-detail-meta { margin: 0; color: var(--muted); font-size: .64rem; }.graph-detail-excerpt { margin: 14px 0 0; color: #535c70; font-size: .73rem; line-height: 1.7; overflow-wrap: anywhere; }.graph-detail-excerpt.muted { color: var(--muted); }
.graph-detail-progress { margin-top: 15px; display: grid; grid-template-columns: 1fr auto; gap: 6px 9px; color: var(--muted); font-size: .63rem; }.graph-detail-progress strong { color: var(--blue); }.graph-detail-progress i { grid-column: 1 / -1; height: 5px; overflow: hidden; border-radius: 99px; background: #e9edf5; }.graph-detail-progress b { height: 100%; display: block; border-radius: inherit; background: #4267d5; }
.graph-relation-builder { padding: 0; overflow: hidden; }
.graph-relation-builder summary { padding: 14px 16px; color: var(--navy); font-size: .76rem; font-weight: 780; cursor: pointer; list-style: none; }.graph-relation-builder summary::-webkit-details-marker { display: none; }.graph-relation-builder[open] summary { border-bottom: 1px solid var(--line); }
.graph-relation-builder form { padding: 14px; display: grid; gap: 10px; }.graph-relation-builder label { display: grid; gap: 5px; color: var(--muted); font-size: .64rem; }.graph-relation-builder select, .graph-relation-builder input { min-width: 0; width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 9px; background: #fafbfd; color: var(--ink); font-size: .7rem; }
.graph-relations { padding: 20px 22px; }.graph-relations > div:last-child { display: grid; gap: 7px; }.graph-relations article { padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) 28px; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfd; font-size: .71rem; }.graph-relations article span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.graph-relations article b { padding: 3px 7px; border-radius: 6px; background: #eaf0ff; color: #4267d5; font-size: .6rem; }.graph-relations article button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-size: 1rem; }.graph-relations article button:hover { background: #fff0f1; color: var(--danger); }
.graph-relations-empty, .graph-privacy-note { margin: 0; color: var(--muted); font-size: .7rem; line-height: 1.65; }.graph-privacy-note { padding: 0 3px 10px; text-align: center; }.graph-empty { min-height: 560px; display: grid; place-items: center; color: var(--muted); font-size: .76rem; }
.data-tool-card { min-height: 250px; padding: 25px; display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.data-tool-card > div:nth-child(2) { flex: 1; }
.data-tool-card h2 { margin: 0 0 7px; font-size: 1.05rem; }
.data-tool-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.7; }
.trash-panel { grid-column: 1 / -1; padding: 22px; }
.trash-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.trash-panel-head h2 { margin: 0 0 5px; font-size: 1.05rem; }
.trash-panel-head p { margin: 0; color: var(--muted); font-size: .78rem; }
.trash-list { display: grid; gap: 9px; }
.trash-groups { display: grid; gap: 18px; }
.trash-group { display: grid; gap: 9px; }
.trash-group + .trash-group { padding-top: 18px; border-top: 1px solid var(--line); }
.trash-group-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.trash-group-head > span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: #edf2ff; color: var(--blue); font-weight: 800; }
.trash-group.journals .trash-group-head > span { background: #eaf7f1; color: #307a5b; }
.trash-group.plans .trash-group-head > span { background: #f1ecfa; color: #6d50a5; }
.trash-group-head h3 { margin: 0; font-size: .9rem; }
.trash-group-head b { min-width: 25px; padding: 3px 7px; border-radius: 99px; background: #eef1f6; color: var(--muted); font-size: .64rem; text-align: center; }
.trash-group-empty { margin: 0; padding: 13px 14px; border: 1px dashed var(--line); border-radius: 11px; color: var(--muted); font-size: .72rem; text-align: center; }
.trash-item { padding: 13px 14px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.trash-item-copy { min-width: 0; display: grid; gap: 3px; }
.trash-item-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.trash-item-copy small { color: var(--muted); font-size: .68rem; }
.trash-item-actions { display: flex; flex: 0 0 auto; gap: 7px; }
.button.danger-ghost { border: 1px solid #efc9ce; background: #fff7f8; color: var(--danger); }
.button.danger-ghost:hover { background: #ffedef; }
.data-tool-mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 15px; background: var(--blue-soft); color: var(--blue); font-size: 1.35rem; font-weight: 800; }

.journal-result-summary { min-height: 39px; }
.view-toggle { display: flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #f5f6fa; }
.view-toggle button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; color: var(--muted); font-weight: 700; }
.view-toggle button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(25,35,67,.08); }
.timeline { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.journal-row { position: relative; padding: 24px clamp(19px, 3vw, 32px); }
.journal-row + .journal-row { border-top: 1px solid var(--line); }
.journal-card-head { min-height: 34px; display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.journal-entry-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.journal-entry-meta time { color: var(--muted); font-size: .78rem; font-weight: 700; }
.journal-tag { padding: 2px 8px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: .69rem; font-weight: 750; }
.journal-body { margin: 8px 0 0; color: #3f4759; font-size: .9rem; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.journal-card .media-gallery { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 16px; }
.journal-card .media-tile { max-height: 420px; border-radius: 12px; }

.calendar-card { padding: 20px; }
.calendar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.calendar-head h2 { margin: 0; font-size: 1.1rem; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.weekday { padding: 5px; text-align: center; color: var(--muted); font-size: .75rem; font-weight: 700; }
.calendar-day { min-height: 92px; padding: 9px; border: 1px solid var(--line); border-radius: 11px; background: white; text-align: left; color: var(--ink); }
.calendar-day:not(.blank):hover { border-color: var(--blue); }
.calendar-day.blank { opacity: 0; pointer-events: none; }
.calendar-day.today { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.calendar-day.has-entry { background: var(--blue-soft); cursor: default; }
.calendar-number { font-weight: 750; font-size: .83rem; }
.calendar-entry { display: block; margin-top: 8px; color: var(--blue); font-size: .72rem; font-weight: 650; line-height: 1.35; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.plan-list { overflow: hidden; }
.plan-list[hidden] { display: none; }
.plan-row { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 11px; padding: 16px 17px 16px calc(17px + var(--plan-depth, 0) * 28px); transition: background-color .18s ease; position: relative; }
.plan-row + .plan-row { border-top: 1px solid var(--line); }
.plan-row:hover { background: #fbfcfe; }
.plan-row.child-plan::before { content: ''; position: absolute; left: calc(19px + (var(--plan-depth, 0) - 1) * 28px); top: 0; width: 15px; height: 28px; border-left: 1px solid #cbd6e8; border-bottom: 1px solid #cbd6e8; border-radius: 0 0 0 8px; }
.plan-row-marker { width: 18px; height: 18px; margin-top: 3px; border: 2px solid #bfc7d6; border-radius: 50%; background: white; }
.plan-row-marker.active { border-color: var(--blue); box-shadow: inset 0 0 0 4px white; background: var(--blue); }
.plan-row-marker.paused { border-color: #d1a34d; }
.plan-row-marker.completed { border-color: #66a58f; background: #66a58f; box-shadow: inset 0 0 0 4px white; }
.plan-row-content { min-width: 0; }
.plan-parent-label { display: inline-block; margin-left: 7px; color: #71809a; font-size: 11px; font-weight: 500; }
.field-help { display: block; margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.plan-card-head { display: flex; justify-content: space-between; gap: 15px; }
.plan-card-head > div:first-child { min-width: 0; }
.plan-card-head h2 { margin: 2px 0 0; font-size: .96rem; line-height: 1.45; overflow-wrap: anywhere; }
.status-label { font-size: .66rem; font-weight: 750; color: var(--blue); }
.status-label.paused { color: #a56e12; }
.status-label.completed { color: #39806b; }
.plan-description { margin: 7px 0 0; color: #596174; font-size: .78rem; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.plan-progress-block { margin-top: 9px; }
.plan-progress-head { display: flex; justify-content: space-between; color: var(--muted); font-size: .68rem; font-weight: 700; }
.progress-track { height: 8px; overflow: hidden; border-radius: 999px; background: #e9edf5; }
.progress-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #6585e6); }
.plan-progress { width: 100%; height: 6px; display: block; border: 0; border-radius: 999px; overflow: hidden; background: #e9edf5; }
.plan-progress::-webkit-progress-bar { background: #e9edf5; border-radius: 999px; }
.plan-progress::-webkit-progress-value { background: linear-gradient(90deg, var(--blue), #6585e6); border-radius: 999px; }
.plan-progress::-moz-progress-bar { background: linear-gradient(90deg, var(--blue), #6585e6); border-radius: 999px; }
.plan-dates { display: flex; gap: 12px; margin-top: 7px; color: var(--muted); font-size: .68rem; }
.plan-row .meta-row { margin-top: 7px; }
.plan-row .media-gallery { grid-template-columns: repeat(auto-fill, minmax(90px, 120px)); margin-top: 9px; }

.media-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; margin-top: 10px; }
.media-tile { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 10px; background: #e9edf5; border: 1px solid var(--line); }
.media-preview { width: 100%; height: 100%; display: block; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.media-tile img, .media-tile video { width: 100%; height: 100%; display: block; object-fit: cover; }
.media-preview:hover img { transform: scale(1.025); }
.media-preview img { transition: transform .18s ease; }
.media-tile video { background: #12182a; }
.attachment-field { margin-top: 1px; padding: 14px; border: 1px dashed #cfd6e5; border-radius: 12px; background: #fafbfe; }
.field-caption { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; margin-bottom: 10px; }
.field-caption span { font-size: .8rem; font-weight: 700; color: #4e566a; }
.field-caption small { color: var(--muted); font-size: .68rem; }
.file-picker { display: inline-flex; cursor: pointer; }
.file-picker input { position: absolute; opacity: 0; pointer-events: none; }
.file-picker span { padding: 7px 11px; border: 1px solid #d7ddeb; border-radius: 9px; background: white; color: var(--blue); font-size: .76rem; font-weight: 750; }
.selected-files { display: grid; gap: 5px; margin-top: 8px; }
.selected-file { display: flex; justify-content: space-between; gap: 8px; padding: 6px 9px; border-radius: 8px; background: #eef2fa; color: #566078; font-size: .72rem; }
.media-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-bottom: 8px; }
.media-editor:empty { display: none; }
.media-editor .media-tile { aspect-ratio: 1; }
.remove-media { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(16,25,48,.78); color: white; font-weight: 800; z-index: 2; }

.agent-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .65fr); gap: 18px; align-items: start; }
.agent-hero { padding: 25px; background: linear-gradient(145deg, #18295a, #2d55ad); color: white; border: 0; overflow: hidden; position: relative; }
.agent-hero::after { content: "✦"; position: absolute; right: 24px; top: 4px; color: rgba(255,255,255,.08); font-size: 9rem; line-height: 1; }
.agent-hero h2 { margin: 0 0 7px; font-size: 1.25rem; position: relative; z-index: 1; }
.agent-hero > p { margin: 0; color: #cad5f1; font-size: .84rem; max-width: 580px; position: relative; z-index: 1; }
.agent-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; position: relative; z-index: 1; }
.agent-controls select { min-height: 42px; padding: 8px 33px 8px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; background: rgba(255,255,255,.1); color: white; }
.agent-controls select option { color: var(--ink); background: white; }
.agent-controls .button { background: var(--gold); color: var(--navy); box-shadow: none; }
.agent-status { display: flex; align-items: center; gap: 9px; padding: 13px 14px; border-radius: 11px; background: #f5f7fb; font-size: .78rem; }
.agent-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #b8bfce; flex: 0 0 auto; }
.agent-status.ready .agent-status-dot { background: #39a678; box-shadow: 0 0 0 4px rgba(57,166,120,.12); }
.agent-status.warn .agent-status-dot { background: #db9532; }
.privacy-note { padding: 18px; }
.privacy-note h3 { margin: 0 0 8px; font-size: .92rem; }
.privacy-note p { margin: 0; color: var(--muted); font-size: .78rem; }
.report-card { padding: 25px; }
.report-card + .report-card { margin-top: 16px; }
.report-top { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.report-top h2 { margin: 1px 0 0; font-size: 1.18rem; }
.report-top time { color: var(--muted); font-size: .72rem; }
.report-overview { margin: 0 0 21px; padding: 15px 17px; border-left: 4px solid var(--gold); border-radius: 0 11px 11px 0; background: #fff9eb; color: #4d5363; font-size: .88rem; }
.report-section { margin-top: 22px; }
.report-section h3 { margin: 0 0 10px; font-size: .9rem; }
.insight-list { display: grid; gap: 9px; }
.insight-item { padding: 13px 14px; border: 1px solid var(--line); border-radius: 11px; background: #fbfcfe; }
.insight-item strong { display: block; font-size: .84rem; }
.insight-item p { margin: 4px 0 0; color: var(--muted); font-size: .77rem; }
.confidence { float: right; margin-left: 8px; color: var(--blue); font-size: .68rem; }
.report-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.report-chip { padding: 7px 10px; border-radius: 9px; background: var(--blue-soft); color: #3853a2; font-size: .76rem; }
.report-disclaimer { margin: 21px 0 0; color: var(--muted); font-size: .7rem; }
.agent-thinking { padding: 45px 20px; text-align: center; }
.agent-thinking .spinner { margin: 0 auto 14px; }
.agent-thinking h3 { margin: 0 0 6px; font-size: 1rem; }
.agent-thinking p { margin: 0; color: var(--muted); font-size: .8rem; }

.chat-shell { height: clamp(560px, calc(100vh - 190px), 820px); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; border-color: #d5e8f3; background: #f4fbff; }
.chat-head { min-height: 74px; padding: 15px 20px; display: flex; align-items: center; gap: 11px; border-bottom: 1px solid #d6e9f3; background: #eef8fd; }
.chat-head > div:nth-child(2) { min-width: 0; display: grid; }
.chat-head strong { font-size: .9rem; }
.chat-head .button { margin-left: auto; }
.chat-model-mark, .chat-avatar { display: grid; place-items: center; flex: 0 0 auto; background: linear-gradient(145deg, #69a6ca, #91c5df); color: white; font-weight: 800; }
.chat-model-mark { width: 39px; height: 39px; border-radius: 13px; }
.chat-model-state { color: var(--muted); font-size: .7rem; }
.chat-model-state::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #b8bfce; vertical-align: 1px; }
.chat-model-state.ready::before { background: #39a678; box-shadow: 0 0 0 3px rgba(57,166,120,.1); }
.chat-thread { min-height: 0; padding: 28px clamp(18px, 4vw, 48px); overflow-y: auto; scroll-behavior: smooth; background: linear-gradient(180deg, #f5fbff, #eaf6fc); }
.chat-message { display: flex; align-items: flex-end; gap: 9px; max-width: 78%; margin-bottom: 20px; }
.chat-message.user { margin-left: auto; justify-content: flex-end; }
.chat-message > div:last-child { min-width: 0; }
.chat-avatar { width: 31px; height: 31px; border-radius: 10px; font-size: .72rem; }
.chat-bubble { padding: 11px 14px; border: 1px solid #d1e6f1; border-radius: 15px 15px 15px 4px; background: rgba(255,255,255,.92); box-shadow: 0 6px 16px rgba(49,102,132,.055); font-size: .86rem; line-height: 1.72; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message.user .chat-bubble { border-color: #91bdd6; border-radius: 15px 15px 4px 15px; background: #a8d1e7; color: #153b52; }
.chat-message time { display: block; margin: 4px 4px 0; color: #9299aa; font-size: .63rem; }
.chat-message.user time { text-align: right; }
.chat-pending .chat-bubble { min-width: 58px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.chat-pending .chat-bubble span { width: 6px; height: 6px; border-radius: 50%; background: #9ba7c4; animation: chat-dot 1s ease-in-out infinite; }
.chat-pending .chat-bubble span:nth-child(2) { animation-delay: .15s; }
.chat-pending .chat-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat-welcome { min-height: 100%; display: grid; place-content: center; justify-items: center; text-align: center; }
.chat-welcome > span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px; background: var(--blue-soft); color: var(--blue); font-size: 1.4rem; }
.chat-welcome h2 { margin: 13px 0 4px; font-size: 1.15rem; }
.chat-welcome p { margin: 0; color: var(--muted); font-size: .8rem; }
.chat-suggestions { max-width: 600px; margin-top: 20px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chat-suggestions button { padding: 8px 11px; border: 1px solid #cfe4ef; border-radius: 10px; background: rgba(255,255,255,.82); color: #47677a; font-size: .74rem; }
.chat-suggestions button:hover { border-color: #8fbdd6; color: #327ca7; background: white; }
.chat-composer { padding: 14px 18px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; border-top: 1px solid #d4e8f2; background: #eef8fd; }
.chat-composer textarea { max-height: 150px; resize: none; padding: 11px 13px; border: 1px solid #cfe3ee; border-radius: 12px; background: rgba(255,255,255,.88); color: var(--ink); line-height: 1.55; }
.chat-composer textarea:focus { outline: 3px solid rgba(92,157,194,.13); border-color: #6ea8c9; background: white; }
.chat-send { width: 43px; height: 43px; border: 0; border-radius: 12px; background: #5f9fc5; color: white; font-size: 1.2rem; font-weight: 800; }
.chat-send:disabled { opacity: .45; cursor: not-allowed; }
.chat-composer p { grid-column: 1 / -1; margin: 0 2px; color: #9399a8; font-size: .64rem; }

.empty-state { padding: 46px 20px; text-align: center; color: var(--muted); }
.empty-mark { width: 52px; height: 52px; margin: 0 auto 13px; display: grid; place-items: center; border-radius: 17px; background: var(--blue-soft); color: var(--blue); font-size: 1.4rem; }
.empty-state h3 { margin: 0 0 5px; color: var(--ink); font-size: 1rem; }
.empty-state p { margin: 0 auto 16px; max-width: 350px; font-size: .82rem; }
.loading-state { min-height: 360px; display: grid; place-content: center; justify-items: center; color: var(--muted); }
.spinner { width: 30px; height: 30px; border: 3px solid #dce2f1; border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal { padding: 0; border: 0; border-radius: 20px; background: transparent; max-width: min(640px, calc(100vw - 28px)); width: 100%; box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(12, 20, 43, .58); backdrop-filter: blur(3px); }
.modal-card { padding: 26px; background: white; border-radius: 20px; max-height: min(88vh, 850px); overflow: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 22px; }
.modal-header h2 { margin: 1px 0 0; font-size: 1.35rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.field { display: grid; gap: 6px; margin-bottom: 15px; }
.field > span { font-size: .8rem; font-weight: 700; color: #4e566a; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid #dce1ea; border-radius: 10px; padding: 10px 12px; background: #fbfcfe; color: var(--ink); }
.field textarea { resize: vertical; line-height: 1.65; }
.field input:focus, .field textarea:focus, .field select:focus { border-color: var(--blue); background: white; outline: 3px solid rgba(49,93,216,.1); }
.full { grid-column: 1 / -1; }
.check-field { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: #4e566a; }
.check-field input { width: 17px; height: 17px; accent-color: var(--blue); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 23px; }
.journal-modal { max-width: min(720px, calc(100vw - 28px)); }
.journal-head-fields { margin-bottom: 0; }
.task-compose-title { margin-bottom: 7px; }
.task-compose-title input { min-height: 56px; padding-inline: 2px; border-width: 0 0 1px; border-radius: 0; background: transparent; font-size: 1.25rem; font-weight: 650; }
.task-compose-title input:focus { border-color: #d8dee9; background: transparent; outline: 0; }
.task-compose-notes textarea { min-height: 72px; padding-inline: 2px; border: 0; background: transparent; }
.task-compose-notes textarea:focus { background: transparent; outline: 0; }
.task-compose-toolbar { display: flex; align-items: center; justify-content: flex-start; gap: 20px; padding: 8px 0 10px; border-top: 1px solid #edf0f5; }
.task-compose-toolbar button, .task-compose-toolbar .task-image-picker { min-width: 48px; padding: 5px 4px; display: grid; justify-items: center; gap: 2px; border: 0; border-radius: 10px; background: transparent; color: #8c93a2; cursor: pointer; }
.task-compose-toolbar button:hover, .task-compose-toolbar .task-image-picker:hover { background: #fff7e7; color: #d79500; }
.task-compose-toolbar button > span, .task-compose-toolbar .task-image-picker > span { height: 26px; display: grid; place-items: center; font-size: 1.35rem; line-height: 1; }
.task-compose-toolbar button > small, .task-compose-toolbar .task-image-picker > small { font-size: .61rem; font-weight: 700; }
.task-compose-options { padding-top: 4px; }
.task-schedule-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.task-schedule-fields .field, .task-schedule-fields input { min-width: 0; }
.task-schedule-error { margin: 0 0 12px; color: #a63d47; font-size: .82rem; }
.task-compose-options > .check-field { margin-top: 13px; }
.task-compose-media { margin-top: 5px; }
.task-image-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.journal-compose-card { display: flex; flex-direction: column; }
.journal-compose-heading { display: flex; align-items: center; gap: 12px; }
.journal-compose-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #5b8df1, #315dd8); color: white; font-weight: 850; box-shadow: 0 8px 18px rgba(49,93,216,.22); }
.journal-compose-body { flex: 1; min-height: 270px; margin-bottom: 8px; }
.journal-compose-body textarea { height: 100%; min-height: 270px; padding: 8px 2px; border: 0; border-radius: 0; background: transparent; font-size: 1rem; line-height: 1.85; }
.journal-compose-body textarea:focus { background: transparent; outline: 0; }
.journal-compose-footer { border-top: 1px solid var(--line); padding-top: 15px; }
.journal-compose-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.journal-compose-meta .field { margin-bottom: 10px; }
.journal-compose-attachments { padding: 10px 0; border: 0; border-radius: 0; background: transparent; }
.journal-photo-picker { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--blue); }
.journal-photo-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.journal-photo-picker > span { width: 34px; height: 34px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 9px; font-size: 1rem; }
.journal-photo-picker strong { font-size: .78rem; }
.journal-save-button { background: #57c769; color: white; box-shadow: 0 10px 22px rgba(62,171,83,.2); }
.journal-save-button:hover { background: #46b85a; }
.confirm-modal { max-width: 410px; text-align: center; }
.confirm-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%; background: #fff0f1; color: var(--danger); font-weight: 900; }
.confirm-modal h2 { margin: 0 0 7px; font-size: 1.15rem; }
.confirm-modal p { margin: 0; color: var(--muted); font-size: .85rem; }
.centered { justify-content: center; }
.image-viewer { width: min(96vw, 1400px); height: min(94vh, 1000px); max-width: none; max-height: none; padding: 0; border: 0; border-radius: 18px; overflow: hidden; background: #0c1020; color: white; box-shadow: 0 28px 90px rgba(0,0,0,.45); }
.image-viewer::backdrop { background: rgba(3,7,18,.9); backdrop-filter: blur(5px); }
.image-viewer-shell { height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.image-viewer-bar { min-height: 54px; padding: 9px 11px 9px 18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: rgba(255,255,255,.055); }
.image-viewer-bar span { min-width: 0; overflow: hidden; color: #dfe5f3; font-size: .8rem; white-space: nowrap; text-overflow: ellipsis; }
.image-viewer-close { width: 38px; height: 38px; flex: 0 0 auto; border: 0; border-radius: 11px; background: rgba(255,255,255,.1); color: white; font-size: 1.45rem; line-height: 1; }
.image-viewer-close:hover { background: rgba(255,255,255,.18); }
.image-viewer-stage { min-height: 0; overflow: auto; display: grid; place-items: center; padding: 14px; }
.image-viewer-stage img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; }
.image-viewer-stage img.zoomed { width: 200%; max-width: none; max-height: none; cursor: zoom-out; }
.image-viewer-tip { margin: 0; padding: 9px 14px 12px; color: #aeb8cf; font-size: .7rem; text-align: center; }
.toast-region { position: fixed; right: 24px; bottom: 24px; display: grid; gap: 8px; z-index: 100; }
.toast { min-width: 230px; max-width: 340px; padding: 12px 15px; border-radius: 11px; background: var(--navy); color: white; box-shadow: 0 14px 35px rgba(10,19,43,.25); font-size: .82rem; animation: toast-in .25s ease both; }
.toast.error { background: #a63d47; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
.mobile-nav { display: none; }

@media (max-width: 980px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .dashboard-grid > .stack:nth-child(2) { grid-template-columns: 1fr 1fr; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar .search-box { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { padding: 25px 16px 92px; }
  .topbar { margin-bottom: 21px; }
  .desktop-only { display: none; }
  .mobile-nav { position: fixed; display: grid; grid-template-columns: repeat(4, 1fr); left: 12px; right: 12px; bottom: 11px; z-index: 20; padding: 7px; border: 1px solid rgba(255,255,255,.12); border-radius: 17px; background: rgba(18,31,67,.96); backdrop-filter: blur(12px); box-shadow: 0 12px 35px rgba(13,23,52,.28); }
  .mobile-nav a { padding: 6px; border-radius: 11px; color: #aeb8d4; text-decoration: none; text-align: center; font-size: .7rem; font-weight: 700; }
  .mobile-nav a span { display: block; font-size: 1.08rem; line-height: 1.2; }
  .mobile-nav a.active { color: white; background: rgba(255,255,255,.1); }
  .dashboard-grid > .stack:nth-child(2) { grid-template-columns: 1fr; }
  .toolbar { grid-template-columns: 1fr; }
  .toolbar .search-box { grid-column: auto; }
  .toolbar select { min-width: 0; }
  .filter-panel, .task-filter-panel, .plan-filter-panel, .journal-filter-panel { grid-template-columns: 1fr; }
  .notification-card { padding: 15px; }
  .notification-mark { width: 38px; height: 38px; }
  .notification-hint { margin-left: 0; }
  .notification-options { margin-left: 0; grid-template-columns: 1fr; align-items: stretch; }
  .notification-options .button { justify-self: start; }
  .task-group-copy { display: grid; gap: 1px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .modal-card { padding: 22px 18px; }
  #task-dialog { position: fixed; inset: auto 0 auto 0; top: calc(var(--visual-viewport-offset-top) + var(--visual-viewport-height)); width: 100%; max-width: none; max-height: var(--visual-viewport-height); margin: 0; overflow: hidden; transform: translateY(-100%); isolation: isolate; border-radius: 28px 28px 0 0; background: #fff; color: var(--ink); box-shadow: 0 -14px 40px rgba(14,22,44,.16); }
  #task-dialog::backdrop { background: rgba(24,29,40,.48); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .task-compose-card { width: 100%; max-height: min(calc(var(--visual-viewport-height) - 8px), 720px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 16px 20px max(18px, env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: #fff; color: var(--ink); }
  .task-compose-header { min-height: 36px; justify-content: flex-end; margin-bottom: 0; }
  .task-compose-header > div { display: none; }
  .task-compose-header .icon-button { width: 32px; height: 32px; font-size: 1.1rem; }
  .task-compose-title input { min-height: 62px; font-size: 1.28rem; }
  .task-compose-notes { margin-bottom: 4px; }
  .task-compose-notes textarea { min-height: 58px; }
  .task-compose-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 8px 0 10px; border-top: 1px solid #edf0f5; }
  .task-compose-toolbar { justify-content: flex-start; gap: 20px; }
  .task-compose-toolbar button, .task-compose-toolbar .task-image-picker { min-width: 48px; padding: 5px 4px; display: grid; justify-items: center; gap: 2px; border: 0; border-radius: 10px; background: transparent; color: #8c93a2; cursor: pointer; }
  .task-compose-toolbar button:hover, .task-compose-toolbar .task-image-picker:hover { background: #fff7e7; color: #d79500; }
  .task-compose-toolbar button > span, .task-compose-toolbar .task-image-picker > span { height: 26px; display: grid; place-items: center; font-size: 1.35rem; line-height: 1; }
  .task-compose-toolbar button > small, .task-compose-toolbar .task-image-picker > small { font-size: .61rem; font-weight: 700; }
  .task-compose-options { max-height: 0; padding-top: 0; overflow: hidden; opacity: 0; visibility: hidden; transform: translateY(5px); transition: max-height .34s ease, opacity .22s ease, transform .28s ease, visibility 0s linear .34s; }
  .task-compose-options.expanded { max-height: 48dvh; padding-top: 10px; overflow: auto; opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s; }
  .task-compose-media .media-editor { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 5px 0; }
  .task-compose-actions { margin-top: 7px; }
  .task-compose-actions .primary { min-width: 112px; }
  #journal-dialog { inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0; }
  #journal-dialog::backdrop { background: white; }
  .journal-compose-card { width: 100%; height: 100dvh; max-height: none; padding: max(18px, env(safe-area-inset-top)) 18px max(14px, env(safe-area-inset-bottom)); border-radius: 0; overflow: hidden; }
  .journal-compose-header { flex: 0 0 auto; align-items: center; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid #eef0f4; }
  .journal-compose-header .eyebrow { display: none; }
  .journal-compose-header h2 { color: #646b7b; font-size: 1rem; font-weight: 650; }
  .journal-compose-mark { width: 40px; height: 40px; }
  .journal-compose-body { min-height: 0; margin: 0; overflow: hidden; }
  .journal-compose-body textarea { min-height: 100%; height: 100%; padding: 8px 3px; font-size: 1.05rem; }
  .journal-compose-footer { flex: 0 0 auto; padding-top: 10px; background: white; }
  .journal-compose-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .journal-compose-meta .field { margin-bottom: 6px; }
  .journal-compose-meta .field > span { font-size: .64rem; }
  .journal-compose-meta .field input, .journal-compose-meta .field select { min-width: 0; padding: 8px 6px; font-size: .75rem; }
  .journal-compose-attachments { padding: 7px 0 3px; }
  .journal-photo-picker strong { font-size: .72rem; }
  .journal-compose-actions { align-items: center; margin-top: 4px; }
  .journal-compose-actions .ghost { display: none; }
  .journal-save-button { min-width: 116px; margin-left: auto; }
  .task-item { grid-template-columns: auto minmax(0, 1fr); }
  .task-item .item-actions { grid-column: 2; justify-content: flex-end; margin-top: -5px; }
  .task-page-list .task-item { grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; padding: 11px 12px; }
  .task-page-list .task-item .item-actions { grid-column: auto; justify-content: flex-end; margin-top: -4px; }
  .task-page-list .task-item .icon-button { width: 28px; height: 28px; font-size: 1.05rem; }
  .task-page-list .task-title { font-size: .88rem; line-height: 1.45; }
  .task-page-list .task-notes { font-size: .73rem; }
  .task-page-list .pill { min-height: 20px; padding: 1px 6px; font-size: .63rem; }
  .calendar-card { padding: 12px; overflow-x: auto; }
  .calendar-grid { min-width: 620px; }
  .calendar-day { min-height: 78px; }
  .journal-row { padding: 20px 17px; }
  .journal-card .media-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top-actions .button { padding: 8px 13px; }
  .top-actions { gap: 7px; }
  .plan-row { gap: 9px; padding: 14px 13px 14px calc(13px + var(--plan-depth, 0) * 20px); }
  .plan-row.child-plan::before { left: calc(15px + (var(--plan-depth, 0) - 1) * 20px); width: 11px; height: 25px; }
  .plan-card-head h2 { font-size: .9rem; }
  .plan-description { font-size: .74rem; line-height: 1.62; }
  .field-caption { align-items: flex-start; flex-direction: column; gap: 2px; }
  .agent-layout { grid-template-columns: 1fr; }
  .chat-shell { height: calc(100vh - 155px); min-height: 500px; border-radius: 15px; }
  .chat-head { min-height: 64px; padding: 11px 13px; }
  .chat-head .button { padding: 6px 9px; font-size: .72rem; }
  .chat-thread { padding: 20px 13px; }
  .chat-message { max-width: 90%; }
  .chat-composer { padding: 11px 12px 9px; }
  .my-section-tabs { display: grid; grid-template-columns: repeat(4, 1fr); }
  .my-section-tabs button { padding-inline: 6px; font-size: .74rem; }
  .data-tools-grid { grid-template-columns: 1fr; }
  .data-model-head { display: grid; }
  .data-schema-badge { justify-self: start; }
  .data-model-flow { grid-template-columns: 1fr; gap: 7px; }
  .data-model-flow > i { line-height: 1; }
  .behavior-top-grid, .behavior-visual-grid { grid-template-columns: 1fr; }
  .behavior-dashboard-head { align-items: flex-start; flex-direction: column; }
  .behavior-range { width: 100%; }
  .behavior-range button { flex: 1; }
  .checkin-card, .behavior-summary-card { padding: 17px; }
  .energy-scale { gap: 5px; }
  .behavior-stats { grid-template-columns: repeat(3, 1fr); }
  .behavior-stats > div { padding: 13px 9px; }
  .behavior-stats strong { font-size: 1.22rem; }
  .behavior-chart-card { padding: 17px; }
  .trend-chart { min-width: 470px; }
  .mood-visual { grid-template-columns: 125px minmax(0, 1fr); gap: 16px; }
  .mood-donut { width: 120px; }
  .mood-donut::after { inset: 23px; }
  .graph-controls { align-items: flex-start; flex-direction: column; }
  .graph-workspace { grid-template-columns: 1fr; }
  .graph-canvas-card { min-height: 500px; }
  .behavior-graph { height: 470px; }
  .graph-side { grid-template-columns: 1fr; grid-template-rows: auto; }
  .graph-node-detail { min-height: 160px; }
  .graph-detail-empty { min-height: 125px; }
  .graph-relations { padding: 17px; }
  .graph-relations article { grid-template-columns: minmax(0, 1fr) auto 28px; }
  .graph-relations article span:last-of-type { grid-column: 1; }
  .graph-relations article button { grid-column: 3; grid-row: 1 / span 2; }
  .trash-item { align-items: flex-start; flex-direction: column; }
  .trash-item-actions { width: 100%; }
  .trash-item-actions .button { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


.status-label.abandoned, .pill.abandoned { color: var(--muted); background: #f0eeeb; }
.plan-row-marker.abandoned { background: #aaa39b; }
.task-item.abandoned .task-title { color: var(--muted); text-decoration: line-through; }
.task-item.abandoned .check-button { opacity: .35; cursor: default; }
.task-compose-toolbar { flex-wrap: wrap; }
