:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --ink: #252522;
  --muted: #77766f;
  --line: #e7e6e1;
  --soft: #f1f1ee;
  --accent: #327866;
  --accent-soft: #e8f1ed;
  --blue: #4d70a8;
  --warm: #b77548;
  --danger: #a34a4a;
  --shadow: 0 18px 55px rgba(36, 36, 32, .14);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 12px 14px; background: #f1f1ef; border-right: 1px solid var(--line); }
.brand-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px 18px; }
.brand-row > div:first-child, .profile > div:nth-child(2) { display: grid; gap: 2px; flex: 1; min-width: 0; }
.brand-row strong, .profile strong { font-size: 14px; }
.profile span { color: var(--muted); font-size: 11px; }
.main-nav { display: grid; gap: 3px; }
.nav-item { display: flex; gap: 10px; align-items: center; width: 100%; min-height: 36px; padding: 8px 10px; border: 0; border-radius: 5px; background: transparent; color: #55544e; font-size: 13px; text-align: left; cursor: pointer; }
.nav-item:hover, .nav-item.active { background: #e4e4e0; color: var(--ink); }
.nav-count { margin-left: auto; min-width: 20px; padding: 1px 6px; border-radius: 10px; background: #deddd8; font-size: 11px; text-align: center; }
.sidebar-section { margin-top: 28px; padding: 0 8px; }
.sidebar-heading { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; font-weight: 700; }
.page-list { display: grid; gap: 3px; margin-top: 9px; }
.page-link { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 7px 8px; border: 0; border-radius: 5px; background: transparent; color: #5c5b55; font-size: 12px; text-align: left; cursor: pointer; }
.page-link:hover, .page-link.active { background: #e4e4e0; color: var(--ink); }
.page-link .page-symbol { width: 18px; color: var(--muted); text-align: center; }
.page-link .page-symbol[data-page-symbol="♦"], .page-link .page-symbol[data-page-symbol="♥"] { color: #a34a4a; }
.page-link .page-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-add-button { width: 100%; margin-top: 5px; padding: 7px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 11px; text-align: left; cursor: pointer; }
.sidebar-add-button:hover { background: #e4e4e0; color: var(--ink); }
.archive-nav-button { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 14px; padding: 8px; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 11px; text-align: left; cursor: pointer; }
.archive-nav-button:hover, .archive-nav-button.active { color: var(--ink); background: #e4e4e0; }
.archive-nav-button .nav-count { margin-left: auto; }
.archive-page-list { display: grid; gap: 3px; margin-top: 4px; }
.trash-nav-button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border: 0; background: transparent; color: var(--muted); font-size: 11px; text-align: left; cursor: pointer; }
.trash-nav-button:hover, .trash-nav-button.active { color: var(--ink); background: #e4e4e0; }
.trash-nav-button .nav-count { margin-left: auto; }
.data-transfer { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.data-transfer button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 5px; background: transparent; color: var(--muted); font-size: 10px; font-weight: 500; cursor: pointer; }
.data-transfer button:hover { border-color: #c7c6c0; background: #e4e4e0; color: var(--ink); }
.data-transfer button span { font-size: 14px; }
.profile { display: flex; gap: 9px; align-items: center; margin-top: 8px; padding: 12px 8px 0; border-top: 1px solid var(--line); }
.avatar { width: 28px; height: 28px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 50%; background: #d8ddd8; font-size: 12px; font-weight: 700; }
.icon-button { width: 32px; height: 32px; display: inline-grid; flex: 0 0 auto; place-items: center; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); cursor: pointer; }
.icon-button:hover { border-color: var(--line); background: var(--soft); color: var(--ink); }
.icon-button:disabled { border-color: transparent; background: transparent; color: #c4c3bd; cursor: not-allowed; }
.mobile-menu, .menu-button { display: none; }
.main-content { min-width: 0; }
.topbar { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 34px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.82); backdrop-filter: blur(14px); }
.history-controls { display: flex; flex: 0 0 auto; gap: 2px; margin-right: 10px; }
.breadcrumb { display: flex; gap: 8px; min-width: 0; color: var(--muted); font-size: 12px; }
.topbar .breadcrumb { flex: 1; }
.breadcrumb strong { overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.saved-state { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 11px; }
.saved-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.workspace { max-width: 1500px; margin: 0 auto; padding: 42px 40px 50px; }
.page-heading { display: flex; justify-content: space-between; gap: 24px; align-items: end; }
.page-actions { display: flex; gap: 8px; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 0; font-size: clamp(28px, 3.2vw, 42px); font-weight: 600; line-height: 1.28; overflow-wrap: anywhere; }
h2 { margin-bottom: 0; font-size: 16px; letter-spacing: 0; }
.primary-button, .secondary-button, .text-button, .add-button { min-height: 38px; border-radius: 5px; padding: 0 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.primary-button, .add-button { border: 1px solid var(--accent); background: var(--accent); color: white; }
.primary-button:hover, .add-button:hover { border-color: #286554; background: #286554; }
.primary-button:active, .add-button:active { border-color: #214f43; background: #214f43; }
.primary-button:focus-visible, .add-button:focus-visible { outline: 3px solid #bcdacf; outline-offset: 2px; }
.primary-button:disabled, .add-button:disabled { border-color: #bdc9c4; background: #bdc9c4; color: #f4f6f5; cursor: not-allowed; }
.on-dark .primary-button, .on-dark .add-button { border-color: #d9eee6; background: #d9eee6; color: #214f43; }
.secondary-button { border: 1px solid #d7d5ce; background: white; }
.secondary-button:hover { border-color: var(--accent); color: var(--accent); }
.text-button { border: 0; background: transparent; color: var(--muted); }
.text-button:hover { background: var(--soft); color: var(--ink); }
.status-strip { display: flex; align-items: center; gap: 28px; margin: 28px 0 18px; padding: 13px 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.status-strip > div { display: flex; gap: 7px; align-items: center; }
.status-strip strong { color: var(--ink); }
.status-icon { color: var(--accent); }
.status-icon.open { color: var(--blue); }
.status-icon.waiting { color: var(--warm); }
.achievement-banner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; margin: 0 0 18px; padding: 16px 18px; border: 1px solid #9fc3b8; background: var(--accent-soft); }
.achievement-banner > div:first-child { display: flex; gap: 11px; align-items: center; }
.achievement-banner p { margin: 3px 0 0; color: #527568; font-size: 10px; }
.achievement-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.achievement-icon { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: white; font-weight: 800; }
.archive-history { grid-column: 1 / -1; display: grid; gap: 5px; padding-top: 12px; border-top: 1px solid #bed6ce; color: #527568; font-size: 10px; }
.archive-history-row { display: flex; justify-content: space-between; gap: 12px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 38%); border: 1px solid var(--line); background: var(--surface); }
.tree-panel { position: relative; min-width: 0; border-right: 1px solid var(--line); }
.panel-heading { min-height: 72px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.zoom-controls { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 5px; }
.zoom-controls .icon-button { border: 0; }
.zoom-controls span { min-width: 42px; color: var(--muted); font-size: 10px; text-align: center; }
.center-view-button { align-self: stretch; border: 0; border-left: 1px solid var(--line); background: transparent; color: var(--muted); padding: 0 9px; font-size: 9px; cursor: pointer; }
.center-view-button:hover { background: var(--soft); color: var(--ink); }
.fullscreen-toggle { border-left: 1px solid var(--line) !important; border-radius: 0 5px 5px 0; }
.tree-viewport { position: relative; height: clamp(500px, 64vh, 620px); min-height: 0; overflow: auto; padding: 38px 24px 42px; background-image: radial-gradient(#dcdbd6 .7px, transparent .7px); background-size: 20px 20px; overscroll-behavior: contain; touch-action: none; cursor: grab; }
.tree-viewport.panning { cursor: grabbing; user-select: none; }
.tree-viewport.space-pan .node-button, .tree-viewport.panning .node-button { cursor: grabbing; }
.tree-viewport.today-remove-target { box-shadow: inset 0 0 0 3px var(--accent); background-color: #eef7f3; }
.tree-viewport.today-remove-target::after { position: sticky; z-index: 20; top: 16px; left: 50%; display: block; width: max-content; padding: 7px 10px; border-radius: 4px; background: var(--accent); color: white; content: '今日やることから外す'; font-size: 11px; font-weight: 600; transform: translateX(-50%); pointer-events: none; }
.tree { position: relative; min-width: 100%; min-height: 440px; }
.tree-scene { position: absolute; top: 0; left: 0; transform-origin: top left; }
.tree-lines { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.tree-line { fill: none; stroke: #c7c6c0; stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; }
.tree-line-hit { fill: none; stroke: rgba(50,120,102,.001); stroke-width: 24; vector-effect: non-scaling-stroke; pointer-events: none; }
.tree-line.placement-target { stroke: var(--accent); stroke-width: 5; }
.tree-line-hit.placement-target { stroke: rgba(50,120,102,.12); stroke-width: 28; }
.tree-lines.placing .tree-line-hit { pointer-events: stroke; cursor: copy; }
.tree-preview-line { stroke: var(--accent); stroke-dasharray: 4 4; }
.node-button { position: absolute; z-index: 2; width: 190px; min-height: 58px; display: grid; align-content: center; gap: 5px; padding: 9px 12px; border: 1px solid #d9d8d2; border-radius: 5px; background: white; box-shadow: 0 1px 1px rgba(0,0,0,.02); font-size: 11px; line-height: 1.45; text-align: left; white-space: normal; overflow-wrap: anywhere; word-break: normal; cursor: grab; }
.node-button:hover { border-color: #9d9c94; background: #fafaf8; }
.node-button:active { cursor: grabbing; }
.node-button.dragging { opacity: .42; }
.node-button.type-goal { border-color: var(--ink); background: var(--ink); color: white; font-weight: 700; }
.node-button.type-direction { border-left: 3px solid var(--blue); }
.node-button.type-task { border-left: 3px solid var(--accent); }
.node-button.in-today:not(.completed) { border-color: var(--accent); background: #eef7f3; }
.node-button.in-progress:not(.completed) { border-color: #318064; box-shadow: 0 0 0 2px #cfe8de; }
.node-button.placement-valid { outline: 1px dashed #8caf9f; outline-offset: 5px; }
.node-button.placement-child-target { box-shadow: 0 0 0 3px var(--accent-soft); }
.node-button.placement-before::before, .node-button.placement-after::after { position: absolute; top: -8px; bottom: -8px; width: 3px; border-radius: 2px; background: var(--accent); content: ''; }
.node-button.placement-before::before { left: -12px; }
.node-button.placement-after::after { right: -12px; }
.placement-ghost { position: fixed; z-index: 100; width: 180px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 5px; background: rgba(238,247,243,.9); box-shadow: var(--shadow); pointer-events: none; opacity: .82; }
.placement-ghost strong, .placement-ghost span { display: block; overflow-wrap: anywhere; }
.placement-ghost span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.placement-hint { position: fixed; z-index: 101; max-width: 240px; padding: 5px 8px; border-radius: 4px; background: var(--ink); color: white; font-size: 10px; pointer-events: none; }
.placement-zone { position: absolute; z-index: 6; cursor: copy; }
.placement-zone[data-placement-kind="before"]:hover { border-left: 3px solid var(--accent); }
.placement-zone[data-placement-kind="after"]:hover { border-right: 3px solid var(--accent); }
.placement-zone[data-placement-kind="child"]:hover, .placement-zone[data-placement-kind="below"]:hover { background: rgba(64,124,102,.08); }
.node-button.completed { border-color: #246653; background: #2f7562; color: white; }
.node-button.completed .node-kind, .node-button.completed .node-due { color: #dcece6; }
.node-button.selected { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.node-button.valid-drop-parent { outline: 1px dashed #86ad9f; outline-offset: 4px; }
.node-button.tree-drop-target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.node-button.tree-drop-target::after { position: absolute; top: -20px; left: 50%; padding: 2px 6px; border-radius: 3px; background: var(--accent); color: white; content: '真下に新しい階層'; font-size: 9px; font-weight: 700; transform: translateX(-50%); white-space: nowrap; }
.node-button.just-added { animation: node-highlight 1.8s ease-out; }
.node-kind { color: var(--muted); font-size: 9px; font-weight: 700; }
.type-goal .node-kind { color: #d8ddd9; }
.node-title { display: block; }
.node-due { color: var(--muted); font-size: 9px; font-weight: 500; }
.node-state-label { display: inline-flex; width: max-content; align-items: center; gap: 3px; padding: 2px 5px; border-radius: 3px; background: #dceee7; color: #286b58; font-size: 8px; font-weight: 800; }
.node-button.completed .node-state-label { background: rgba(255,255,255,.16); color: white; }
.node-progress { color: var(--muted); font-size: 9px; font-weight: 500; }
.node-button.completed .node-progress { color: #dcece6; }
.node-button.subtree-source { opacity: .28; }
.tree-line.subtree-source { opacity: .2; }
.subtree-drag-preview { position: fixed; top: -2000px; left: -2000px; z-index: 9999; min-width: 210px; max-width: 300px; padding: 10px; border: 1px solid #9fc3b8; border-radius: 6px; background: white; box-shadow: var(--shadow); color: var(--ink); pointer-events: none; }
.drag-preview-summary { display: grid; gap: 3px; padding: 7px 9px; border-left: 3px solid var(--accent); background: #f7faf8; font-size: 10px; }
.drag-preview-summary strong { overflow-wrap: anywhere; }
.drag-preview-summary span { color: var(--muted); font-size: 9px; }
.drag-preview-tree { display: grid; gap: 5px; }
.drag-preview-node { position: relative; max-width: 230px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 4px; background: white; font-size: 9px; line-height: 1.35; overflow-wrap: anywhere; }
.drag-preview-node:not([data-level="0"])::before { position: absolute; top: -6px; left: -10px; width: 9px; height: 16px; border-bottom: 1px solid #b9b8b2; border-left: 1px solid #b9b8b2; content: ''; }
@keyframes node-highlight { 0%, 35% { box-shadow: 0 0 0 5px rgba(50,120,102,.25); } 100% { box-shadow: 0 0 0 0 rgba(50,120,102,0); } }
.selection-bar { position: sticky; z-index: 18; bottom: 0; min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-top: 1px solid var(--line); background: rgba(250,250,248,.96); box-shadow: 0 -8px 22px rgba(36,36,32,.06); backdrop-filter: blur(12px); }
.selection-bar > div:first-child { display: grid; gap: 3px; min-width: 0; }
.selection-label { color: var(--muted); font-size: 9px; font-weight: 800; }
.selection-bar strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.selection-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.day-panel { min-width: 0; }
.today-panel-actions { display: flex; align-items: center; gap: 6px; }
.today-drawer-button, .today-drawer-close, .today-drawer-backdrop { display: none; }
.today-total { min-width: 28px; padding: 3px 7px; border-radius: 10px; background: var(--soft); color: var(--muted); font-size: 10px; text-align: center; white-space: nowrap; }
.today-dropzone { position: relative; min-height: 560px; padding: 14px; transition: background .15s, box-shadow .15s; }
.today-dropzone.drop-target { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.today-dropzone.drop-target::before { position: absolute; z-index: 4; top: 12px; left: 50%; padding: 6px 10px; border-radius: 4px; background: var(--accent); color: white; content: 'ここへドロップして追加'; font-size: 10px; font-weight: 600; transform: translateX(-50%); white-space: nowrap; pointer-events: none; }
.today-dropzone.drop-target .today-empty { border-color: var(--accent); background: rgba(255,255,255,.5); }
.today-list { display: grid; gap: 9px; }
.today-empty { min-height: 200px; display: grid; place-content: center; gap: 7px; border: 1px dashed #d8d6cf; color: var(--muted); text-align: center; }
.today-empty strong { color: var(--ink); font-size: 16px; font-weight: 500; }
.today-empty span { font-size: 10px; }
.today-card { position: relative; border: 1px solid var(--line); border-radius: 6px; background: white; cursor: grab; }
.today-card:hover { border-color: #cfcec8; }
.today-card.dragging { opacity: .45; }
.today-card.reorder-target { box-shadow: 0 -3px 0 var(--accent); }
.today-card-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 12px; }
.task-check { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); cursor: pointer; }
.parent-progress-check { width: 17px; height: 17px; margin: 1px 0 0; accent-color: var(--accent); opacity: 1; cursor: pointer; }
.today-card-copy { min-width: 0; }
.today-card-detail, .today-node-detail { display: block; color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.5; overflow-wrap: anywhere; }
.today-card-detail { margin-top: 3px; }
.today-node-detail { margin-top: -1px; }
.today-card-title { display: block; margin-bottom: 4px; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.today-card-meta { display: flex; flex-wrap: wrap; gap: 5px 9px; color: var(--muted); font-size: 9px; }
.today-card.completed .today-card-title, .bundle-leaf.completed .bundle-leaf-title { color: var(--muted); text-decoration: line-through; }
.today-card.todo { border-color: var(--accent); background: #f2f8f5; }
.today-card.in-progress { border: 2px solid #318064; background: #eef7f3; }
.today-card.completed { border-color: #285f4c; background: #346f5a; color: white; }
.today-card.completed .today-card-title { color: #f4faf7; }
.today-card.completed .today-card-meta, .today-card.completed .icon-button { color: #e5f2ed; }
.status-badge { padding: 2px 5px; border-radius: 3px; background: #d8eee5; color: #285f4c; font-weight: 700; }
.card-actions { display: flex; gap: 2px; }
.card-actions .icon-button { width: 26px; height: 26px; font-size: 12px; }
.bundle-count { color: var(--muted); font-size: 10px; }
.bundle-children { display: none; padding: 0 12px 11px 39px; }
.today-card.expanded .bundle-children { display: grid; gap: 2px; }
.bundle-leaf { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; padding: 8px 0; border-top: 1px solid var(--line); }
.bundle-leaf.today-highlight { margin-inline: -6px; padding-inline: 6px; border-radius: 4px; background: #dceee7; box-shadow: inset 3px 0 var(--accent); }
.bundle-leaf-copy { min-width: 0; }
.bundle-leaf-title { display: block; font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.bundle-leaf-due { color: var(--muted); font-size: 9px; }
.bundle-toggle { transform: rotate(0deg); transition: transform .15s; }
.today-card.expanded .bundle-toggle { transform: rotate(90deg); }
.today-tree-body { padding: 0 10px 10px; background: white; color: var(--ink); }
.today-card.recursive-bundle { border: 0; border-left: 2px solid #9ec8b7; border-radius: 0; background: white; }
.today-card.recursive-bundle > .today-card-main { background: #f3f8f5; }
.today-card.recursive-bundle.completed > .today-card-main { background: #346f5a; }
.recursive-bundle.collapsed .today-tree-body { display: none; }
.recursive-bundle:not(.collapsed) > .today-card-main .nested-toggle, .today-nested-group:not(.collapsed) > .today-nested-header .nested-toggle { transform: rotate(90deg); }
.today-sibling-frame { min-width: 0; display: grid; gap: 0; }
.today-leaf-tile { min-width: 0; display: grid; grid-template-columns: 12px auto minmax(0,1fr); gap: 7px; align-items: start; padding: 9px 8px 9px calc(6px + var(--tree-depth) * 12px); border-top: 1px solid #eeefec; background: transparent; color: var(--ink); cursor: grab; }
.today-leaf-tile:hover { background: #f6faf8; }
.today-leaf-tile.in-progress { background: #f0f8f4; box-shadow: inset 3px 0 #318064; }
.today-leaf-tile.completed strong { color: #285f4c; text-decoration: line-through; }
.today-leaf-tile.completed .nested-status-label { background: #346f5a; color: white; }
.today-leaf-tile.today-highlight, .today-nested-group.today-highlight > .today-nested-header { background: #e8f4ef; }
.outline-marker { color: #aaa9a3; font-size: 12px; line-height: 17px; text-align: center; }
.today-leaf-copy { min-width: 0; display: grid; gap: 4px; }
.today-leaf-copy strong { font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.today-leaf-copy small { color: var(--muted); font-size: 9px; line-height: 1.4; overflow-wrap: anywhere; }
.nested-status-label { width: max-content; padding: 1px 4px; border-radius: 3px; color: #286b58; font-size: 8px; font-weight: 600; }
.today-nested-group { min-width: 0; color: var(--ink); }
.today-nested-header { min-width: 0; display: grid; grid-template-columns: 12px auto minmax(0,1fr) auto auto; gap: 7px; align-items: center; padding: 9px 8px 9px calc(6px + var(--tree-depth) * 12px); border-top: 1px solid #eeefec; }
.today-nested-header:hover { background: #f8faf9; }
.today-nested-group.in-progress > .today-nested-header { background: #f0f8f4; box-shadow: inset 3px 0 #318064; }
.today-nested-group.completed > .today-nested-header .nested-title-button strong { color: #285f4c; }
.today-nested-group.completed > .today-nested-header .outline-marker, .today-nested-group.completed > .today-nested-header .nested-progress { color: #318064; }
.nested-title-button { min-width: 0; display: grid; gap: 2px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.nested-title-button span { color: var(--muted); font-size: 8px; }
.nested-title-button strong { font-size: 11px; line-height: 1.4; overflow-wrap: anywhere; }
.nested-progress { color: var(--muted); font-size: 8px; white-space: nowrap; }
.nested-toggle { transition: transform .15s; }
.today-nested-content { min-width: 0; padding: 0; }
.today-nested-group.collapsed > .today-nested-content { display: none; }
.scrim { position: fixed; inset: 0; z-index: 20; visibility: hidden; background: rgba(31,31,29,.24); opacity: 0; transition: opacity .2s, visibility .2s; }
.scrim.visible { visibility: visible; opacity: 1; }
.task-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
.task-dialog::backdrop { background: rgba(31,31,29,.28); }
.task-dialog form { padding: 24px; }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 24px; }
.task-dialog label { display: grid; gap: 7px; margin: 17px 0; font-size: 12px; font-weight: 700; }
.task-dialog label > span { margin-left: 4px; color: var(--muted); font-size: 9px; font-weight: 500; }
.symbol-picker { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 17px 0; padding: 0; border: 0; }
.symbol-picker legend { grid-column: 1 / -1; margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.task-dialog .symbol-picker label { position: relative; display: grid; place-items: center; gap: 2px; min-width: 0; min-height: 58px; margin: 0; padding: 6px 3px; border: 1px solid var(--line); border-radius: 5px; background: white; cursor: pointer; }
.symbol-picker input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.symbol-picker label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: #285f4c; }
.symbol-picker label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.symbol-picker label > span { margin: 0; color: inherit; font-size: 21px; line-height: 1; }
.symbol-picker label:nth-of-type(3) > span, .symbol-picker label:nth-of-type(4) > span { color: #a34a4a; }
.symbol-picker small { min-width: 0; color: var(--muted); font-size: 8px; font-weight: 500; white-space: nowrap; }
.task-dialog input, .task-dialog textarea, .task-dialog select { width: 100%; border: 1px solid var(--line); border-radius: 5px; padding: 10px 11px; background: #fbfbfa; color: var(--ink); font-size: 13px; resize: vertical; }
.task-dialog input:focus, .task-dialog textarea:focus, .task-dialog select:focus { border-color: var(--accent); background: white; }
.placement-method, .status-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin: 18px 0; padding: 0; border: 0; }
.placement-method legend, .status-options legend { margin-bottom: 8px; font-size: 12px; font-weight: 700; }
.placement-method label { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 5px; font-weight: 500; cursor: pointer; }
.placement-method input { width: auto; }
.parent-picker > label { margin-bottom: 8px; }
.parent-options { max-height: 230px; overflow: auto; border: 1px solid var(--line); border-radius: 5px; }
.parent-group-title { position: sticky; top: 0; padding: 6px 10px; background: #f3f3f1; color: var(--muted); font-size: 9px; font-weight: 700; }
.parent-option { display: grid; grid-template-columns: auto 1fr; gap: 8px; align-items: start; width: 100%; padding: 9px 10px; border: 0; border-top: 1px solid var(--line); background: white; color: var(--ink); text-align: left; cursor: pointer; }
.parent-option.selected { background: var(--accent-soft); box-shadow: inset 3px 0 var(--accent); }
.parent-option-kind { color: var(--muted); font-size: 9px; }
.parent-option strong, .parent-option small { display: block; overflow-wrap: anywhere; }
.parent-option small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.parent-preview { display: flex; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 12px; background: var(--soft); font-size: 11px; }
.parent-preview span { color: var(--muted); }
.parent-preview strong { text-align: right; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 24px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 110; visibility: hidden; display: flex; align-items: center; gap: 14px; padding: 11px 15px; border-radius: 5px; background: var(--ink); color: white; box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translateY(8px); transition: .2s; }
.toast.show { visibility: visible; opacity: 1; transform: translateY(0); }
.toast button { border: 0; background: transparent; color: #bfe3d5; font-weight: 700; cursor: pointer; }
.carryover-panel { margin-bottom: 18px; border: 1px solid #cdded7; background: #f5faf8; }
.carryover-heading { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #dce8e3; }
.carryover-heading p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.carryover-row { display: grid; grid-template-columns: minmax(130px,1fr) auto; gap: 12px; align-items: center; padding: 11px 16px; border-top: 1px solid #e1e9e5; }
.carryover-row:first-child { border-top: 0; }
.carryover-row small { display: block; color: var(--muted); margin-top: 3px; }
.carryover-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.carryover-actions button, .carryover-actions label { margin: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 4px; background: white; font-size: 9px; font-weight: 500; cursor: pointer; }
.carryover-actions input { width: 115px; margin-left: 5px; border: 0; padding: 0; font-size: 9px; }
.dialog-kicker { color: var(--muted); font-size: 9px; }
.detail-panel { padding: 24px; }
.confirm-panel { padding: 24px; }
.detail-dialog { width: min(560px, calc(100vw - 32px)); }
.detail-description { margin: -8px 0 18px; color: var(--ink); font-size: 12px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-description.empty { color: var(--muted); }
.detail-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.detail-facts div { min-width: 0; padding-bottom: 9px; border-bottom: 1px solid #efeee9; }
.detail-facts dt { margin-bottom: 3px; color: var(--muted); font-size: 9px; font-weight: 500; }
.detail-facts dd { margin: 0; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.detail-edit-form { padding: 0!important; }
.detail-main-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 20px; }
.status-options { grid-template-columns: repeat(3,1fr); }
.status-options button { min-height: 58px; border: 1px solid var(--line); border-radius: 5px; background: white; cursor: pointer; }
.status-options button.active { border-color: var(--accent); background: var(--accent-soft); color: #285f4c; font-weight: 700; }
.status-options button:disabled { cursor: not-allowed; opacity: .48; }
.status-options button.blocked { border-style: dashed; cursor: not-allowed; }
.detail-feedback { margin: -8px 0 14px; padding: 9px 10px; border-left: 3px solid var(--accent); background: var(--accent-soft); color: #285f4c; font-size: 11px; }
.status-options button span { display: block; margin-bottom: 3px; }
.detail-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 11px; }
.planned-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: end; margin-top: 9px; }
.date-action { margin: 0!important; font-weight: 500!important; }
.date-action input { padding: 7px!important; }
.detail-danger { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; }
.danger-text-button { border: 0; background: transparent; color: #ad3e35; cursor: pointer; }
.delete-dialog p { margin: 18px 0; line-height: 1.6; }
.delete-options { display: grid; gap: 8px; }
.delete-options button { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: white; text-align: left; cursor: pointer; }
.delete-options .destructive { border-color: #e2b8b3; color: #a52d24; background: #fff8f7; }
.trash-view { min-height: 560px; }
.trash-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.trash-heading p { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.trash-heading-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.trash-list { display: grid; gap: 8px; }
.trash-item { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 16px; align-items: center; padding: 14px 15px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.trash-item-title { display: block; margin-bottom: 5px; overflow-wrap: anywhere; }
.trash-item-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; color: var(--muted); font-size: 10px; }
.trash-item-actions { display: flex; gap: 6px; }
.restore-button, .danger-outline-button { min-height: 34px; padding: 0 11px; border-radius: 5px; background: white; font-size: 11px; font-weight: 600; cursor: pointer; }
.restore-button { border: 1px solid var(--accent); color: var(--accent); }
.restore-button:hover { background: var(--accent-soft); }
.danger-outline-button { border: 1px solid #d6aaa5; color: #9d332b; }
.danger-outline-button:hover { background: #fff5f4; }
.trash-empty { padding: 70px 20px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
@media (max-width: 1180px) {
  .content-grid { grid-template-columns: 1fr; }
  .tree-panel { border-right: 0; }
  .saved-state { display: none; }
  .today-drawer-button { position: fixed; z-index: 45; top: 9px; right: 62px; display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 13px; border: 1px solid var(--accent); border-radius: 5px; background: var(--accent); box-shadow: 0 7px 24px rgba(36,36,32,.16); color: white; font-size: 12px; font-weight: 600; cursor: pointer; }
  .today-drawer-button span { min-width: 21px; padding: 1px 6px; border-radius: 10px; background: rgba(255,255,255,.2); text-align: center; }
  .today-drawer-backdrop { position: fixed; inset: 0; z-index: 59; display: block; visibility: hidden; background: rgba(31,31,29,.28); opacity: 0; transition: opacity .2s, visibility .2s; }
  .today-drawer-backdrop.visible { visibility: visible; opacity: 1; }
  .day-panel { position: fixed; z-index: 60; top: 0; right: 0; width: min(420px, 92vw); height: 100dvh; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); transform: translateX(105%); transition: transform .22s ease; }
  .day-panel.drawer-open { transform: translateX(0); }
  .day-panel .panel-heading { flex: 0 0 auto; background: var(--surface); }
  .today-drawer-close { display: inline-grid; }
  .today-dropzone { min-height: 0; flex: 1; overflow-y: auto; }
  body.today-drawer-active { overflow: hidden; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 50; width: 248px; transform: translateX(-105%); transition: transform .22s ease; }
  .sidebar.open { transform: translateX(0); }
  .mobile-menu, .menu-button { display: inline-grid; }
  .topbar { padding: 0 14px; }
  .workspace { padding: 30px 16px; }
  .page-heading { align-items: flex-start; }
  h1 { font-size: 30px; }
  .status-strip { gap: 14px; overflow-x: auto; }
  .content-grid { border-right: 0; border-left: 0; }
  .tree-viewport { height: clamp(440px, 58vh, 540px); min-height: 0; padding-right: 12px; padding-left: 12px; }
  .selection-bar { align-items: stretch; flex-direction: column; }
  .selection-actions .secondary-button { width: 100%; }
  .achievement-banner { grid-template-columns: 1fr; }
  .achievement-actions { display: grid; grid-template-columns: 1fr; }
  .achievement-actions .primary-button, .achievement-actions .secondary-button, .achievement-actions .danger-outline-button { width: 100%; }
}
@media (max-width: 520px) {
  .page-heading { flex-direction: column; }
  .page-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .breadcrumb { display: none; }
  .panel-heading { align-items: flex-start; }
  .tree-panel .panel-heading { flex-direction: column; }
  .tree-viewport { height: clamp(400px, 56vh, 500px); min-height: 0; }
  .placement-method { grid-template-columns: 1fr; }
  .carryover-row { grid-template-columns: 1fr; }
  .carryover-actions { align-items: stretch; flex-direction: column; }
  .carryover-actions input { width: 100%; margin: 5px 0 0; }
  .status-options { gap: 4px; }
  .today-nested-header { grid-template-columns: 12px auto minmax(0,1fr) auto; }
  .nested-progress { grid-column: 3; grid-row: 2; white-space: normal; }
  .detail-facts { grid-template-columns: 1fr; gap: 8px; }
  .detail-danger { align-items: flex-start; flex-direction: column; }
  .trash-heading, .trash-item { align-items: stretch; grid-template-columns: 1fr; flex-direction: column; }
  .trash-heading-actions { display: grid; grid-template-columns: 1fr; }
  .trash-item-actions { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (pointer: coarse) { .tree-line-hit { stroke-width: 34; } .tree-line-hit.placement-target { stroke-width: 38; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; } }

body.tree-fullscreen-active { overflow: hidden; }
body.tree-fullscreen-active .app-shell.tree-fullscreen { position: fixed; z-index: 80; inset: 0; width: 100vw; height: 100dvh; min-height: 0; display: grid; grid-template-columns: 1fr; background: var(--bg); }
body.tree-fullscreen-active .app-shell.tree-fullscreen .sidebar,
body.tree-fullscreen-active .app-shell.tree-fullscreen .topbar,
body.tree-fullscreen-active .app-shell.tree-fullscreen .today-drawer-button,
body.tree-fullscreen-active .app-shell.tree-fullscreen .page-heading,
body.tree-fullscreen-active .app-shell.tree-fullscreen .status-strip,
body.tree-fullscreen-active .app-shell.tree-fullscreen .achievement-banner,
body.tree-fullscreen-active .app-shell.tree-fullscreen .carryover-panel,
body.tree-fullscreen-active .app-shell.tree-fullscreen .today-drawer-backdrop { display: none !important; }
body.tree-fullscreen-active .app-shell.tree-fullscreen .main-content { min-width: 0; height: 100dvh; overflow: hidden; }
body.tree-fullscreen-active .app-shell.tree-fullscreen .workspace { width: 100%; max-width: none; height: 100%; display: flex; padding: 12px; }
body.tree-fullscreen-active .app-shell.tree-fullscreen .content-grid { min-width: 0; min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) clamp(260px, 32vw, 400px); }
body.tree-fullscreen-active .app-shell.tree-fullscreen .tree-panel,
body.tree-fullscreen-active .app-shell.tree-fullscreen .day-panel { position: relative; inset: auto; width: auto; height: auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; transform: none; transition: none; box-shadow: none; }
body.tree-fullscreen-active .app-shell.tree-fullscreen .tree-panel { border-right: 1px solid var(--line); }
body.tree-fullscreen-active .app-shell.tree-fullscreen .tree-panel .panel-heading { flex: 0 0 auto; align-items: center; flex-direction: row; }
body.tree-fullscreen-active .app-shell.tree-fullscreen .tree-panel .panel-heading p { display: none; }
body.tree-fullscreen-active .app-shell.tree-fullscreen .tree-viewport { height: auto; min-height: 0; flex: 1; }
body.tree-fullscreen-active .app-shell.tree-fullscreen .selection-bar { flex: 0 0 auto; }
body.tree-fullscreen-active .app-shell.tree-fullscreen .day-panel .panel-heading { flex: 0 0 auto; background: var(--surface); }
body.tree-fullscreen-active .app-shell.tree-fullscreen .today-dropzone { min-height: 0; flex: 1; overflow-y: auto; }
body.tree-fullscreen-active .app-shell.tree-fullscreen .today-drawer-close { display: none; }
