:root {
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  color-scheme: light;
  --canvas: #fafcf9;
  --surface: #fff;
  --soft: #f3f6f1;
  --ink: #26342e;
  --muted: #6b7b6e;
  --line: #dfe6df;
  --glass: #ffffffbf;
  --dot: #d7e0d6;
  --field: #fcfdfb;
  --highlight: #e0e9db;
  --green: #e5f3eb;
  --green-ink: #25634a;
  --purple: #eeebf9;
  --purple-ink: #63538c;
  --orange: #fcf0df;
  --orange-ink: #8c5d2c;
  --neutral: #e9eeea;
  --neutral-ink: #3b5144;
}
:root[data-theme=dark] {
  color-scheme: dark;
  --canvas: #151b19;
  --surface: #202823;
  --soft: #26312a;
  --ink: #e5ebe6;
  --muted: #a6b5aa;
  --line: #3d4b40;
  --glass: #202823c7;
  --dot: #344038;
  --field: #1b241e;
  --highlight: #334a3a;
  --green: #253f31;
  --green-ink: #b2dec5;
  --purple: #353049;
  --purple-ink: #d1c5ed;
  --orange: #453b28;
  --orange-ink: #e9ceaa;
  --neutral: #2b372f;
  --neutral-ink: #d1ddce;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, select { font: inherit; }
button {
  cursor: pointer;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
}
button:hover { background: var(--soft); }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #91b59d; outline-offset: 2px; }
.primary { background: #315940; color: #fff; border-color: #315940; }
.primary:hover { background: #234a32; }
.board-shell { position: relative; height: 100vh; height: 100dvh; overflow: hidden; }
#viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--canvas) radial-gradient(var(--dot) 1px, transparent 1px) 0 0 / 24px 24px;
  touch-action: none;
  cursor: grab;
}
#viewport:focus-visible { outline-offset: -3px; }
#viewport.dragging, #viewport.dragging .node-main { cursor: grabbing; }
#world { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
#connections { position: absolute; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.wire { fill: none; stroke-width: 1.5; opacity: .65; transition: opacity 240ms ease, d 240ms ease; }
.wire.green { stroke: #85b49b; }
.wire.purple { stroke: #b0a0d3; }
.wire.orange { stroke: #d5a76f; }
.wire.neutral { stroke: #a7b9aa; }
.wire.muted { opacity: .28; }
.node {
  position: absolute;
  width: 236px;
  user-select: none;
  transform: scale(var(--node-size, 1));
  transform-origin: 118px 50px;
  transition: transform 240ms ease, opacity 240ms ease;
}
.node.muted { opacity: .65; }
.node.ancestor { opacity: .78; }
.node.selected { z-index: 1; }
.node.muted:hover, .node.ancestor:hover, .node:focus-within { opacity: 1; }
.node-main {
  position: relative;
  width: 100%;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border: 1px solid #d0ddd2;
  border-radius: 13px;
  background: var(--neutral);
  color: var(--neutral-ink);
  box-shadow: 0 2px 3px #253f2910;
  cursor: pointer;
}
.node.green .node-main { background: var(--green); color: var(--green-ink); border-color: #c4ddce; }
.node.purple .node-main { background: var(--purple); color: var(--purple-ink); border-color: #d9d0ec; }
.node.orange .node-main { background: var(--orange); color: var(--orange-ink); border-color: #e9d8be; }
.node.selected .node-main { box-shadow: 0 0 0 3px var(--canvas), 0 0 0 5px #75937b; }
.node-title { font-size: calc(15px / var(--label-scale, 1)); font-weight: 600; line-height: 1.35; text-align: center; overflow-wrap: anywhere; }
.node-path { font-size: calc(10px / var(--label-scale, 1)); line-height: 1.35; text-align: center; color: var(--muted); margin: 12px -15px 0; overflow-wrap: anywhere; max-height: 100px; overflow: auto; }
.node-root .node-main { background: #315940; color: #fff; border-color: #315940; }
.node-root .node-title { font-size: calc(18px / var(--label-scale, 1)); }
.node-title.department-tone-0 { color: #275c85; }
.node-title.department-tone-1 { color: #775084; }
.node-title.department-tone-2 { color: #885c25; }
.node-title.department-tone-3 { color: #246b5b; }
.fold { position: absolute; top: 88px; left: calc(50% - 12px); height: 24px; min-height: 24px; width: 24px; padding: 0; border-color: #d7e0d5; border-radius: 50%; font-size: 14px; color: #5b775d; display: grid; place-items: center; }
.toolbar, .zoom, .board-bottom, #board-results, .menu-panel {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--glass);
  box-shadow: 0 4px 16px #304d3613;
  backdrop-filter: blur(12px);
}
.toolbar { z-index: 3; top: 12px; left: 12px; display: flex; gap: 6px; align-items: center; padding: 5px; max-width: calc(100% - 24px); }
.brand { padding: 0 7px; color: #315940; font-size: 14px; white-space: nowrap; }
.board-search { flex: 0 1 196px; min-width: 0; }
.board-search input[type=search] { margin: 0; min-height: 38px; padding: 7px 10px; font-size: 16px; }
#board-results { top: calc(100% + 6px); left: 0; width: min(370px, 100%); padding: 8px; }
#board-results p { margin: 3px 3px 6px; color: #61745f; font-size: 12px; }
#board-result-list { list-style: none; margin: 0; padding: 0; max-height: min(320px, 45dvh); overflow: auto; }
#board-result-list button { display: block; width: 100%; text-align: left; margin-top: 4px; overflow-wrap: anywhere; }
#board-result-list small { display: block; color: #647963; margin-top: 3px; }
.file-actions { display: flex; gap: 6px; margin-top: 8px; }
.zoom { left: 12px; bottom: 12px; display: flex; align-items: center; gap: 3px; padding: 4px; }
.zoom button { min-height: 33px; padding: 4px 9px; }
.zoom output { min-width: 38px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.board-bottom { left: 220px; bottom: 12px; max-width: min(360px, calc(100% - 24px)); display: flex; align-items: center; gap: 7px; padding: 6px 9px; color: #516750; font-size: 11px; }
.board-bottom button { min-height: 27px; padding: 3px 6px; }
dialog { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 15px 70px #1c2e2333; padding: 25px; max-width: 440px; width: calc(100% - 32px); color: var(--ink); }
dialog::backdrop { background: #1c302c40; backdrop-filter: blur(3px); }
h2 { font-size: 19px; margin: 0 0 22px; font-weight: 600; }
.dialog-top { display: flex; justify-content: space-between; }
.dialog-top button { border: none; margin-top: -8px; font-size: 24px; background: transparent; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
input:not([type=file]), select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 11px 12px; background: var(--field); margin-bottom: 19px; color: var(--ink); min-height: 44px; font-size: 16px; }
select:disabled { color: #697666; background: #f1f4ef; }
.dialog-path { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; line-height: 1.6; margin-top: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 23px; }
#notice { position: fixed; bottom: 68px; left: 50%; transform: translateX(-50%); max-width: calc(100% - 32px); border-radius: 12px; background: #304c36; color: #fff; padding: 13px 20px; z-index: 10; font-size: 13px; box-shadow: 0 5px 25px #263f2830; }
#confirm-import p, #confirm-delete p { font-size: 14px; line-height: 1.6; color: #657663; }
#delete-title { overflow-wrap: anywhere; }
.danger { color: #9a2727; border-color: #e5c4c4; }
.danger:hover { background: #fff1f1; }
.fold { left: auto; right: 10px; top: 86px; z-index: 2; }
.link-preview { stroke: #315940; stroke-width: 2; stroke-dasharray: 6 4; fill: none; }
.node-task-count { position: absolute; bottom: 6px; right: 9px; color: #526d58; font-size: 10px; }
.empty-note { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 10px 0; }
.todo-list { list-style: none; padding: 0; margin: 0; }
.todo-row {
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) 34px;
  gap: 6px;
  align-items: start;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
}
.todo-row input[type=checkbox] { width: 18px; height: 18px; margin: 9px 0; accent-color: #315940; cursor: pointer; }
.todo-row .todo-text { font-size: 14px; min-height: 36px; padding: 6px 5px; margin: 0; border-color: transparent; background: transparent; }
.todo-row .todo-text:hover, .todo-row .todo-text:focus { border-color: #ccd8c8; }
.todo-label { display: block; padding: 7px 0; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.todo-context { display: block; border: 0; min-height: 24px; padding: 0; color: var(--muted); font-size: 11px; text-align: left; background: transparent; }
.todo-star { min-height: 34px; padding: 4px; border-color: transparent; font-size: 22px; color: #8b7743; }
.todo-star[aria-pressed=true] { color: #ac771b; }
.todo-row.done .todo-text, .todo-row.done .todo-label { text-decoration: line-through; color: #879087; }
.todo-entry { display: flex; align-items: start; gap: 6px; }
.todo-entry input:not([type=file]) { min-width: 0; margin: 0; font-size: 14px; }
.todo-entry button { min-height: 44px; }
.completed-todos { margin: 14px 0 6px; }
.completed-todos summary { font-size: 13px; color: var(--muted); cursor: pointer; padding: 6px 0; }
.completed-todos[hidden], #block-todos[hidden] { display: none; }
#editor { max-width: 510px; max-height: calc(100dvh - 28px); overflow: auto; }
#editor h3 { font-size: 15px; margin: 12px 0; }
#block-settings { margin: 0 0 14px; }
#block-settings > summary { font-size: 13px; color: #5d735c; cursor: pointer; margin-bottom: 12px; }
#block-settings input, #block-settings select { font-size: 14px; }
#delete-block { margin-top: 12px; }
@media (max-width: 760px) {
  .tool-caption, .toolbar .brand { display: none; }
  .toolbar { gap: 4px; }
  .toolbar > button { padding: 7px 9px; flex-shrink: 0; }
  .board-search { min-width: 38px; }
  .board-search input[type=search] { font-size: 13px; padding: 7px 5px; }
}
@media (max-width: 540px) {
  .tool-caption { display: none; }
  .board-bottom { left: 12px; bottom: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  .node, .wire { transition: none; }
}
.board-area { position: absolute; inset: 0; }
.sidebar { position: absolute; z-index: 5; top: 12px; left: 12px; width: 166px; display: flex; flex-direction: column; padding: 12px 7px 8px; border: 1px solid var(--line); border-radius: 16px; background: var(--glass); backdrop-filter: blur(12px); box-shadow: 0 4px 20px #15301c0a; }
.sidebar-brand { display: flex; align-items: center; gap: 8px; padding: 0 8px; color: var(--ink); }
.sidebar-brand > span { display: grid; place-items: center; width: 30px; height: 32px; border-radius: 9px; background: #315940; color: #fff; font-family: Georgia, serif; font-size: 20px; }
.sidebar-brand strong { font-size: 15px; }
.main-menu { display: grid; gap: 2px; margin-top: 13px; }
.main-menu button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; border: 0; background: transparent; text-align: left; padding: 7px 8px; font-size: 12px; }
.main-menu button > span:first-child { display: inline-grid; place-items: center; width: 18px; flex-shrink: 0; font-size: 17px; }
.main-menu button:hover { background: var(--soft); }
.main-menu button[aria-current], .main-menu button[aria-expanded=true] { background: var(--highlight); font-weight: 600; }
.toolbar { left: 190px; max-width: calc(100% - 202px); }
.board-menu { flex-shrink: 0; }
.board-menu > summary { display: grid; place-items: center; list-style: none; width: 34px; height: 38px; border-radius: 8px; cursor: pointer; font-size: 22px; }
.board-menu > summary::-webkit-details-marker { display: none; }
.board-menu > summary:hover { background: var(--soft); }
.menu-panel { right: 0; top: calc(100% + 6px); width: min(255px, calc(100vw - 24px)); padding: 7px; background: var(--surface); }
.menu-panel > button { display: block; width: 100%; border: 0; text-align: left; }
.menu-panel p { padding: 7px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.compact-panel { position: absolute; z-index: 6; top: 20%; left: 30%; width: min(500px, calc(100% - 24px)); height: min(480px, calc(100dvh - 100px)); border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: 0 16px 65px #15291c26; display: flex; flex-direction: column; overflow: hidden; }
.compact-panel.is-expanded { width: min(760px, calc(100% - 24px)); height: min(660px, calc(100dvh - 40px)); }
.compact-panel.is-collapsed { height: auto; width: min(300px, calc(100% - 24px)); }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: move; touch-action: none; user-select: none; }
.panel-header h2 { margin: 0; font-size: 16px; }
.panel-actions { display: flex; gap: 4px; }
.panel-actions button { min-height: 30px; width: 30px; padding: 0; font-size: 17px; }
.panel-content { padding: 15px; overflow: auto; min-height: 0; }
.panel-content h3 { font-size: 15px; margin: 5px 0 12px; }
.panel-eyebrow { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
.panel-section-title { display: flex; align-items: center; justify-content: space-between; }
.panel-section-title > span { font-size: 12px; color: #6d7e67; }
#structure-tree { position: absolute; inset: 76px 0 60px 190px; overflow: auto; padding: 14px 24px 30px 0; touch-action: pan-y; cursor: auto; }
#structure-tree h1 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
#structure-tree ul { list-style: none; margin: 9px 0; padding-left: 28px; }
#structure-tree > ul { padding-left: 0; }
#structure-tree li { position: relative; border-left: 1px solid var(--line); padding: 5px 0 5px 16px; }
#structure-tree li::before { content: ''; position: absolute; top: 28px; left: 0; width: 16px; border-top: 1px solid var(--line); }
.structure-node { position: relative; width: min(280px, 100%); min-height: 46px; text-align: left; overflow-wrap: anywhere; font-size: 14px; border-radius: 12px; padding: 12px 16px; box-shadow: 0 2px 5px #182b1d07; }
.structure-node:hover { filter: brightness(.98); }
.structure-node.green { background: var(--green); color: var(--green-ink); }
.structure-node.purple { background: var(--purple); color: var(--purple-ink); }
.structure-node.orange { background: var(--orange); color: var(--orange-ink); }
.structure-node[aria-current] { outline: 2px solid #75937b; outline-offset: 1px; }
.block-tabs { display: flex; gap: 4px; padding: 4px; margin: 18px 0 22px; background: var(--soft); border-radius: 12px; }
.block-tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); min-width: 0; padding: 8px 5px; }
.block-tabs [aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 5px #13221a10; }
.compact-panel[hidden], #panel-content[hidden], [data-panel-content][hidden], #world[hidden], #structure-tree[hidden], .zoom[hidden], [data-block-content][hidden], #block-tabs[hidden] { display: none; }
:root[data-theme=dark] .node-title.department-tone-0 { color: #a1cdec; }
:root[data-theme=dark] .node-title.department-tone-1 { color: #d5ade4; }
:root[data-theme=dark] .node-title.department-tone-2 { color: #edc38d; }
:root[data-theme=dark] .node-title.department-tone-3 { color: #9ad8be; }
:root[data-theme=dark] .node-main, :root[data-theme=dark] .node.green .node-main, :root[data-theme=dark] .node.purple .node-main, :root[data-theme=dark] .node.orange .node-main { border-color: var(--line); }
:root[data-theme=dark] .danger { color: #edacac; border-color: #7b4c4c; }
:root[data-theme=dark] .danger:hover { background: #4a2f2f; }
:root[data-theme=dark] select:disabled { background: var(--soft); color: var(--muted); }
:root[data-theme=dark] .board-bottom, :root[data-theme=dark] #board-results p, :root[data-theme=dark] #board-result-list small, :root[data-theme=dark] #block-settings > summary { color: var(--muted); }
@media (max-width: 650px) {
 .sidebar { top: 8px; left: 8px; width: 48px; padding: 10px 4px 6px; border-radius: 13px; }
 .sidebar-brand { padding: 0 4px; }
 .sidebar-brand strong, .sidebar .menu-label { display: none; }
 .main-menu { margin-top: 12px; }
 .main-menu button { justify-content: center; padding: 8px 0; }
 .toolbar { left: 68px; max-width: calc(100% - 76px); top: 8px; gap: 2px; }
 .toolbar > button { padding: 7px 8px; }
 .board-menu > summary { width: 26px; }
 #structure-tree { left: 68px; padding: 12px 12px 24px 0; }
 #structure-tree ul { padding-left: 14px; }
 #structure-tree > ul { padding-left: 0; }
 .structure-node { padding: 10px 12px; }
 .panel-header { padding: 10px; gap: 6px; }
 .panel-header h2 { font-size: 14px; }
 .panel-actions button { width: 27px; }
 .panel-content { padding: 12px; }
}

.document-actions, .document-format { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 14px; }
.document-actions button, .document-format button { min-height: 32px; font-size: 12px; padding: 6px 9px; }
.document-row { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.document-open { display: block; width: 100%; text-align: left; text-decoration: none; color: var(--ink); background: transparent; border: 0; padding: 4px 0; font-size: 14px; min-height: 28px; }
.document-open:hover { color: var(--green-ink); }
.document-row > small { display: block; color: var(--muted); font-size: 11px; margin: 4px 0; }
#document-editor { max-width: 760px; max-height: calc(100dvh - 32px); overflow: auto; }
#document-body { min-height: 240px; max-height: 45dvh; overflow: auto; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--field); color: var(--ink); line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
#document-body:focus { outline: 2px solid #75937b; }
#document-body h2 { margin: 12px 0; }
#document-body table { border-collapse: collapse; width: 100%; margin: 10px 0; }
#document-body td, #document-body th { border: 1px solid var(--line); padding: 7px; }
#document-body input[type=checkbox] { width: 16px; min-height: 16px; margin: 0 6px 0 0; accent-color: #527e5c; }
#document-body a { color: var(--green-ink); }
#document-upload-status { color: var(--muted); font-size: 12px; }
.task-plan-trigger { display: block; border: 0; padding: 2px 0; background: transparent; font-size: 11px; color: var(--muted); min-height: 24px; }
.task-plan-trigger.overdue { color: #bc5a45; }
:root[data-theme=dark] .task-plan-trigger.overdue { color: #f0a38e; }
.task-schedule { border: 0; padding: 0; margin: 22px 0; }
.task-schedule legend { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.task-schedule label { display: flex; gap: 10px; align-items: center; color: var(--ink); padding: 5px 0; font-size: 14px; }
.task-schedule input[type=radio] { width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: #527e5c; }
#task-filters { margin-top: 4px; margin-bottom: 14px; }
#task-filters button { font-size: 12px; }
#task-filters [aria-pressed=true] { background: var(--surface); color: var(--ink); }

textarea { width:100%; border:1px solid var(--line); border-radius:9px; padding:10px; background:var(--field); color:var(--ink); font:inherit; font-size:14px; resize:vertical; margin-bottom:16px; line-height:1.5; }
.task-open { border:0; background:transparent; padding:5px 0; text-align:left; min-height:30px; width:100%; color:var(--ink); }
.task-meta { display:inline-block; color:var(--muted); font-size:10px; margin-right:9px; }
#task-planner { max-width:610px; max-height:calc(100dvh - 30px); overflow:auto; }
.task-properties { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.task-properties select { display:block; margin-top:7px; }
.task-breakdown summary,.calendar-new summary { cursor:pointer; padding:12px 0; font-size:13px; color:var(--muted); }
.task-breakdown textarea { margin-top:10px; }
.subtask-link { display:block; width:100%; text-align:left; margin-top:5px; font-size:13px; }
.form-error { color:#b94e40; font-size:13px; min-height:18px; line-height:1.5; }
:root[data-theme=dark] .form-error { color:#f0ab9c; }
#task-filters { flex-wrap:wrap; }
#task-filters button { min-width:50px; }
.calendar-tabs { margin:0 0 14px; }
.calendar-navigation { display:flex; align-items:center; gap:5px; margin-bottom:10px; }
.calendar-navigation > button { width:28px; padding:2px; min-height:30px; }
#calendar-range { flex:1; text-align:center; font-size:12px; color:var(--muted); }
#calendar-date { width:34px; height:32px; padding:3px; min-height:32px; margin:0; color:transparent; }
#calendar-date::-webkit-datetime-edit { display:none; }
.calendar-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:4px; }
.calendar-grid.today { display:flex; justify-content:center; }
.calendar-day { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:5px; border:0; padding:8px 0 4px; min-width:0; background:transparent; border-radius:12px; }
.calendar-day > small { font-size:10px; color:var(--muted); }
.calendar-day > span { font-size:17px; }
.calendar-day[aria-pressed=true] { background:var(--highlight); }
.calendar-day.is-today > span { text-decoration:underline; text-underline-offset:5px; }
.calendar-day.other-month { opacity:.45; }
.calendar-grid.month .calendar-day { min-height:54px; gap:2px; }
.calendar-grid.month .calendar-day > small:first-child { display:none; }
.calendar-grid.month .calendar-day:nth-child(-n+7) > small:first-child { display:block; }
.calendar-day .calendar-dot { height:9px; font-size:12px; }
.calendar-day-heading { display:flex; justify-content:space-between; align-items:center; gap:8px; margin:18px 0 8px; }
.calendar-day-heading h3 { margin:0; font-size:14px; font-weight:500; }
#calendar-add { border-radius:20px; padding:5px 12px; min-height:31px; }
#calendar-picker { max-width:580px; max-height:calc(100dvh - 32px); overflow:auto; }
#calendar-picker-list { max-height:260px; overflow:auto; }
.calendar-pick-task { width:100%; text-align:left; display:block; border:0; border-bottom:1px solid var(--line); background:transparent; padding:10px 4px; }
.calendar-pick-task small { display:block; color:var(--muted); font-size:11px; padding-top:5px; }
.calendar-new form { padding-top:10px; }
#calendar-weekly { border-top:1px solid var(--line); margin-top:16px; padding-top:12px; }
#calendar-weekly h3 { color:var(--muted); font-weight:400; font-size:12px; }
#calendar-weekly[hidden] { display:none; }
@media(max-width:540px){ .task-properties { grid-template-columns:1fr; gap:0; } .calendar-navigation { gap:2px; } #calendar-range { font-size:11px; } .calendar-day > span { font-size:15px; } }

.auth-page { min-height:100dvh; display:grid; place-items:center; background:var(--canvas); padding:20px; }
.auth-card { width:min(400px,100%); padding:28px; border:1px solid var(--line); border-radius:20px; background:var(--surface); box-shadow:0 14px 50px #14271b14; }
.auth-card h1 { font-size:23px; margin:25px 0 8px; font-weight:600; }
.auth-card > .empty-note { margin-bottom:25px; }
.auth-card form > button { margin-top:5px; }
.auth-card label input { margin-top:7px; }
#access-dialog { max-width:540px; max-height:calc(100dvh - 32px); overflow:auto; }
#access-content { font-size:13px; line-height:1.6; }
#access-content > label,#access-content form { margin-top:20px; }
#access-content input,#access-content select { margin-top:7px; }
.member-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 0; border-bottom:1px solid var(--line); }
.member-row > span { overflow-wrap:anywhere; }
.member-row button { flex-shrink:0; font-size:11px; min-height:30px; padding:5px 8px; }
.test-banner { position:fixed; bottom:12px; right:12px; z-index:8; font-size:10px; padding:6px 9px; border-radius:8px; color:var(--muted); background:var(--glass); border:1px solid var(--line); pointer-events:none; }
@media(max-width:540px){ .test-banner { bottom:105px; left:12px; right:auto; font-size:9px; } .auth-card { padding:22px; } }

/* Select the connection itself; endpoints appear only for that connection. */
.wire-hit { fill:none; stroke:transparent; stroke-width:24px; vector-effect:non-scaling-stroke; pointer-events:stroke; cursor:pointer; }
.wire.link-selected { opacity:1; stroke-width:2.5px; }
.wire-hit:focus-visible { stroke:#75937b55; outline:none; }
#link-handles { position:absolute; inset:0; z-index:4; pointer-events:none; }
.link-handle { position:absolute; width:44px; height:44px; min-height:44px; padding:0; border:0; background:transparent; border-radius:50%; pointer-events:auto; touch-action:none; cursor:grab; transform-origin:center; }
.link-handle::after { content:''; position:absolute; inset:14px; border:2px solid var(--surface); border-radius:50%; background:#6c9d80; box-shadow:0 0 0 1px #406b51; }
.link-handle:hover { background:#75937b18; }
.link-handle:active { cursor:grabbing; }
.node.link-target { opacity:1; }
.node.link-target .node-main { box-shadow:0 0 0 3px var(--surface),0 0 0 6px #6ba686,0 0 22px 5px #6ba68666; border-color:#6ba686; }
#viewport.linking .wire.link-selected { opacity:.14; }
.link-preview { stroke:#6ba686; stroke-width:2px; vector-effect:non-scaling-stroke; pointer-events:none; }
.panel-section-title { justify-content:flex-end; }
#star-count { color:var(--muted); font-size:11px; }
dialog { max-height:calc(100dvh - 24px); overflow:auto; }
.panel-content { overscroll-behavior:contain; touch-action:pan-y; }
@media(max-width:650px){
 .main-menu button { min-height:44px; }
 .toolbar > button,.board-menu > summary { min-height:44px; min-width:36px; }
 .board-search input[type=search] { min-height:44px; font-size:16px; }
 .compact-panel,.compact-panel.is-expanded { width:calc(100% - 76px); height:calc(100dvh - 204px); max-height:640px; }
 .compact-panel.is-collapsed { width:calc(100% - 76px); height:auto; }
 .panel-header { padding:8px; }
 .panel-actions { gap:0; }
 .panel-actions button { width:40px; min-height:44px; }
 .panel-header h2 { font-size:14px; }
 .panel-content { padding:10px; }
 .block-tabs { overflow-x:auto; scrollbar-width:thin; }
 .block-tabs button { min-height:44px; }
 #task-filters button { flex:0 0 auto; padding:8px 10px; }
 .calendar-navigation > button { width:40px; min-height:44px; flex-shrink:0; }
 #calendar-date { width:36px; height:44px; min-height:44px; }
 .calendar-day { min-height:48px; }
 #calendar-add { min-height:44px; }
 .todo-row { grid-template-columns:30px minmax(0,1fr) 40px; }
 .todo-star { width:40px; min-height:44px; }
 input[type=checkbox] { min-width:24px; min-height:24px; }
 .document-actions button,.document-format button { min-height:44px; }
 dialog { padding:16px; width:calc(100% - 16px); max-height:calc(100dvh - 16px); }
 input,select,textarea,[contenteditable] { font-size:16px; }
 .dialog-actions { flex-wrap:wrap; }
 .test-banner { max-width:calc(100% - 80px); pointer-events:none; }
}

#calendar-range[hidden] + #calendar-next { margin-left:auto; }
@media(max-width:650px){ #task-filters { flex-wrap:nowrap; } button,summary { -webkit-tap-highlight-color:transparent; } }
