@font-face {
  font-family: Archivo;
  src: url('/fonts/archivo-latin-ext.woff2') format('woff2');
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Archivo;
  src: url('/fonts/archivo-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: Montserrat;
  src: url('/fonts/montserrat-latin-ext.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: Montserrat;
  src: url('/fonts/montserrat-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light;
  --paper: #ffffff;
  --soft: #f7f6f4;
  --ink: #171717;
  --muted: #64615f;
  --rule: #e8e5e2;
  --field-edge: #d5cfc9;
  --gold: #f7a918;
  --radius: 6px;
  --headings: Archivo, ui-sans-serif, system-ui, sans-serif;
  font-family: Montserrat, ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); min-width: 320px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button[disabled] { opacity: .53; cursor: default; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible,
.graph-node:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
button, a { -webkit-tap-highlight-color: transparent; }
svg { width: 19px; height: 19px; flex: 0 0 auto; vertical-align: middle; }
h1,h2,h3,p { margin: 0; }
h1,h2,h3 { font-family: var(--headings); }
strong { font-weight: 600; }
small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.boot { display: flex; min-height: 100dvh; justify-content: center; align-items: center; gap: 12px; font-weight: 600; }
.brand { font: 700 19px/1.08 var(--headings); letter-spacing: -.025em; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font: 500 11px/1.25 Montserrat, system-ui, sans-serif; letter-spacing: 0; }
.workspace { min-height: 100dvh; display: grid; grid-template-columns: 224px minmax(0,1fr); }
.sidebar { min-height: 100dvh; background: var(--paper); border-right: 1px solid var(--rule); position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column; padding: 28px 12px 16px; overflow-y: auto; }
.brand-link { display: block; margin: 0 12px 28px; }
.nav-group + .nav-group { border-top: 1px solid var(--rule); margin-top: 12px; padding-top: 12px; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 44px; position: relative; padding: 8px 12px;
  border-radius: var(--radius); color: var(--muted); font-weight: 500; }
.nav-link:hover, .profile:hover { background: var(--soft); }
.nav-link.active { background: var(--soft); color: var(--ink); font-weight: 600; }
.nav-link.active::before { content: ''; position: absolute; left: 0; top: calc(50% - 8px); width: 3px; height: 16px; border-radius: 2px; background: var(--gold); }
.profile { width: 100%; border: 0; margin-top: auto; text-align: left; display: flex; background: transparent; align-items: center; gap: 12px; padding: 12px 8px; border-radius: var(--radius); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--ink); font-weight: 600; flex: 0 0 32px; font-size: .8rem; }
.profile-text { flex: 1 1 auto; min-width: 0; }
.profile-text strong, .profile-text small { display: block; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.profile-text small { color: var(--muted); margin-top: 3px; }
.profile > svg { color: var(--muted); width: 16px; }
.surface { min-width: 0; }
.mobile-header { display: none; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.screen { max-width: 1400px; margin: 0 auto; padding: 32px 32px 48px; }
.loading { color: var(--muted); padding: 48px 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-weight: 650; font-size: 28px; line-height: 1.16; letter-spacing: -.02em; }
.page-head p { margin-top: 4px; color: var(--muted); line-height: 1.55; }
.button, .icon-button {
  border: 1px solid var(--field-edge); background: var(--paper); border-radius: var(--radius); padding: 8px 12px; font-weight: 600;
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.25; text-align: center;
}
.button svg { width: 17px; height: 17px; }
.button:hover, .icon-button:hover { background: var(--soft); }
.primary { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.primary:hover { background: #393939; border-color: #393939; }
.quiet { background: transparent; border-color: transparent; }
.icon-button { width: 40px; height: 40px; min-height: 40px; padding: 0; }
.stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); background: var(--soft); margin-bottom: 20px; border-radius: var(--radius); }
.stat { border-left: 1px solid var(--rule); padding: 12px 16px; }
.stat:first-child { border-left: 0; }
.stat:hover > span { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.stat > span { display: block; color: var(--muted); font-size: .86rem; }
.stat strong { display: block; margin-top: 8px; font: 650 22px/1 var(--headings); font-variant-numeric: tabular-nums; }
.dashboard-notice { margin: 0 0 16px; font-size: .9rem; }
.dashboard-notice a { text-decoration: underline; text-underline-offset: 3px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0,1.35fr) minmax(0,1fr); gap: 20px; }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); min-width: 0; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.section-head h2 { font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.section-head a { flex: 0 0 auto; color: var(--muted); font-size: .86rem; font-weight: 600; }
.section-head a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.dashboard-grid > .card, .settings-card { padding: 20px; }
.card-actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.task-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--rule); }
.task-row:first-child { border-top: 0; }
.task-actions { display: grid; justify-items: end; gap: 5px; }
.task-actions .button { min-height: 32px; padding: 4px 8px; font-size: .78rem; }
.task-check { height: 24px; width: 24px; display: grid; place-items: center; color: var(--paper); flex: 0 0 24px; border: 1px solid var(--field-edge); border-radius: var(--radius); background: transparent; padding: 0; }
.task-check:hover { border-color: var(--ink); }
.task-check svg { width: 15px; height: 15px; }
.task-row.done .task-check { background: #557a57; border-color: #557a57; }
.task-row.done .task-label > strong { text-decoration: line-through; color: var(--muted); }
.task-label { min-width: 0; flex: 1; }
.task-label strong { display: block; line-height: 1.4; overflow-wrap: anywhere; }
.task-label small { color: var(--muted); display: block; margin: 4px 0; line-height: 1.35; }
.task-label small svg { width: 13px; height: 13px; }
.task-detail { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.badge { padding: 4px 8px; font-size: .76rem; font-weight: 600; color: var(--muted); background: var(--soft);
  border-radius: var(--radius); align-items: center; gap: 4px; display: inline-flex; white-space: nowrap; line-height: 1.3; }
.badge svg { width: 13px; height: 13px; }
.badge.plain { border: 1px solid var(--rule); background: transparent; }
.priority-high { background: #f9e5e7; color: #a33143; }
.priority-normal { background: var(--soft); color: var(--muted); }
.priority-low { background: #e6efe4; color: #4b6147; }
.graph-card {
  border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper);
  min-width: 0; padding: 16px 20px; display: flex; flex-direction: column;
}
.graph-header { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.graph-header h2 { font-size: 18px; font-weight: 650; overflow-wrap: anywhere; }
.graph-link { display: grid; place-items: center; color: var(--muted); width: 30px; height: 30px; }
.graph-link:hover { color: var(--ink); background: var(--soft); border-radius: var(--radius); }
.graph-link svg { height: 17px; width: 17px; }
.graph-wrap { position: relative; min-height: 0; margin: 8px 0; }
.graph { width: 100%; height: auto; display: block; max-height: 280px; overflow: hidden; }
.graph-lines { stroke: #c6c0bc; stroke-width: 1.4; }
.graph-node { cursor: pointer; }
.graph-node .node-dot { fill: #817b76; }
.graph-node.root-node .node-dot, .graph-node:hover .node-dot { fill: var(--ink); }
.graph-node text { fill: var(--ink); font-size: 15px; font-weight: 500; paint-order: stroke fill; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.graph-node.root-node text { font-weight: 600; }
.graph-wide .graph { max-height: 460px; touch-action: none; cursor: grab; }
.graph-wide .graph:active { cursor: grabbing; }
.graph-controls { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.graph-controls button { border: 1px solid var(--field-edge); border-radius: var(--radius); background: var(--paper); padding: 8px 12px; min-height: 36px; }
.graph-controls button:hover { background: var(--soft); }
.graph-count, .graph-limit { font-size: .8rem; color: var(--muted); }
.graph-count span { margin-left: 8px; }
.graph-limit { display: block; padding: 4px 0; }
.graph-empty { padding: 16px 0; }
.map-links { margin-bottom: 12px; }
.empty { padding: 16px 0; color: var(--muted); }
.empty strong { line-height: 1.4; }
.empty p { margin-top: 4px; max-width: 52ch; line-height: 1.5; font-size: .9rem; }
.mail-row { display: flex; gap: 16px; align-items: flex-start; width: 100%; text-align: left; padding: 12px 8px;
  border: 0; border-top: 1px solid var(--rule); background: transparent; }
.mail-row:first-child { border-top: 0; }
.mail-row:hover { background: var(--soft); }
.mail-contents { flex: 1 1 auto; min-width: 0; }
.mail-subject { display: block; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.mail-row.unread .mail-subject { font-weight: 600; }
.mail-contents small { display: block; margin-top: 4px; color: var(--muted); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.mail-meta { display: flex; align-items: flex-end; flex-direction: column; gap: 4px; font-size: .82rem; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.list-card { padding: 4px 20px; }
.slack-suggestion { display: flex; justify-content: space-between; align-items: start; gap: 16px; padding: 18px 0; overflow-wrap: anywhere; }
.slack-suggestion + .slack-suggestion { border-top: 1px solid var(--rule); }
.slack-suggestion h2 { margin: 3px 0 6px; font-size: 16px; }
.slack-suggestion .actions { flex-shrink: 0; }
.slack-source { display: grid; gap: 4px; color: var(--muted); font-size: 13px; }
.slack-source blockquote { border-left: 2px solid var(--rule); margin: 0; padding: 3px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.slack-source a, .slack-settings-link a { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 640px) {
  .slack-suggestion { flex-direction: column; gap: 10px; }
}
.event-row { display: flex; align-items: center; gap: 12px; min-height: 64px; border-top: 1px solid var(--rule); padding: 8px 0; }
.event-row:first-child { border-top: 0; }
.event-row > strong { flex: 1; overflow-wrap: anywhere; }
.event-date { min-width: 68px; color: var(--ink); background: var(--soft); border-radius: var(--radius); text-align: center; padding: 8px; font-weight: 600; }
.event-date small { display: block; color: var(--muted); font-size: .76rem; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--soft); width: max-content; max-width: 100%; flex-wrap: wrap; border-radius: var(--radius); margin-bottom: 16px; }
.tabs .button { background: transparent; border-color: transparent; min-height: 36px; padding: 8px 12px; color: var(--muted); font-size: .9rem; }
.tabs .selected { background: var(--paper); border-color: var(--rule); color: var(--ink); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .tabs { margin: 0; }
.search { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 0 12px; background: var(--paper); border: 1px solid var(--field-edge); border-radius: var(--radius); color: var(--muted); }
.search > input[type=search] { border: 0; background: transparent; padding: 8px 0; min-width: 0; margin: 0; }
.search:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.search input:focus-visible { outline: 0; }
.memory-layout { display: grid; grid-template-columns: minmax(204px,28%) minmax(0,1fr); background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); min-height: 430px; }
.memory-list { min-width: 0; align-self: start; position: sticky; top: 24px; }
.memory-search { padding: 12px; }
.memory-rows { max-height: 65dvh; overflow-y: auto; padding: 0 12px 12px; }
.note-row { display: block; padding: 10px 8px; border-top: 1px solid var(--rule); line-height: 1.35; overflow-wrap: anywhere; }
.note-row:hover, .note-row[aria-current] { background: var(--soft); }
.note-row[aria-current] { color: var(--ink); }
.note-row small { display: block; margin-top: 4px; color: var(--muted); font-size: .79rem; }
.note-row small span, .note-scope span { margin-left: 6px; padding-left: 8px; border-left: 1px solid var(--rule); }
.note-list-empty { padding: 8px; color: var(--muted); font-size: .86rem; line-height: 1.5; }
.note-reader { min-width: 0; border-left: 1px solid var(--rule); padding: 24px; scroll-margin: 24px; }
.note-reader:focus { outline: none; }
.note-reader-empty { color: var(--muted); margin-top: 4px; }
.note-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.note-heading h2 { font-size: clamp(1.4rem,2.6vw,2rem); font-weight: 650; letter-spacing: -.03em; overflow-wrap: anywhere; }
.note-scope, .note-byline { color: var(--muted); font-size: .85rem; line-height: 1.5; }
.note-scope { margin-bottom: 6px; }
.note-byline { margin-top: 8px; }
.note-body { margin: 24px 0; overflow-wrap: anywhere; line-height: 1.65; max-width: 78ch; }
.note-body > * + * { margin-top: 12px; }
.note-body h1, .note-body h2 { font-size: 1.28rem; line-height: 1.35; }
.note-body h3, .note-body h4 { font-size: 1.07rem; }
.note-body :is(ul,ol) { padding-inline-start: 22px; }
.note-body a, .note-references a:not(.button) { text-decoration: underline; text-underline-offset: .2em; }
.note-body code { background: var(--soft); padding: 2px 4px; }
.note-body pre { overflow-x: auto; background: var(--soft); padding: 12px; }
.note-body pre code { padding: 0; }
.note-body blockquote { margin-inline: 0; padding: 8px 12px; border-left: 2px solid var(--rule); color: var(--muted); }
.note-body table { display: block; overflow-x: auto; border-collapse: collapse; }
.note-body :is(th,td) { text-align: left; border-bottom: 1px solid var(--rule); padding: 6px 10px; }
.note-references, .note-foot { border-top: 1px solid var(--rule); padding-top: 12px; }
.note-section-head, .note-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.note-references ul { list-style: none; padding: 0; margin: 8px 0; }
.note-references li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 0; overflow-wrap: anywhere; }
.note-references small, .note-foot small { color: var(--muted); }
.note-references p { margin: 8px 0; }
.note-foot { margin-top: 16px; }
.note-foot .button { margin-left: auto; }
.note-back.button { display: none; }
.note-link-picker { margin-bottom: 12px; }
.note-link-picker label { margin-top: 8px; }
.note-link-options { max-height: 160px; overflow-y: auto; padding: 0 4px 4px; }
.note-link-option[hidden] { display: none; }
.note-link-option span { flex: 1; overflow-wrap: anywhere; }
.note-link-option small { color: var(--muted); }
.settings-grid { display: grid; grid-template-columns: minmax(0,1.2fr) minmax(0,1fr); gap: 16px; align-items: start; }
.connection-card h2 { margin: 0 0 14px; }
.connection-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 14px 0; border-top: 1px solid var(--rule); }
.connection-row:last-child { padding-bottom: 0; }
.connection-label { flex: 1 0 10rem; min-width: 0; overflow-wrap: anywhere; }
.connection-label strong, .connection-label small { display: block; }
.connection-label small { margin-top: 4px; color: var(--muted); line-height: 1.4; }
.connection-row .button, .settings-section-head .button { font-size: .81rem; }
.settings-details summary { cursor: pointer; font-weight: 600; }
.settings-details[open] > summary { margin-bottom: 12px; }
.settings-subheading { font-size: .88rem; margin: 16px 0 4px; }
.settings-section-head { flex-wrap: wrap; gap: 6px; }
.setup-section { display: grid; gap: 10px; }
.setup-section + .setup-section { border-top: 1px solid var(--rule); padding-top: 14px; }
.setup-section h3,.setup-section p { margin: 0; }
.setup-section h3 { font-size: 1rem; }
.setup-section p { line-height: 1.5; color: var(--muted); }
.setup-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.setup-fields[hidden] { display: none; }
.copy-field { display: flex; gap: 8px; align-items: stretch; }
.copy-field input { flex: 1; min-width: 0; }
.copy-field .button { flex-shrink: 0; }
.service-actions { padding-top: 10px; border-top: 1px solid var(--rule); }
@media (max-width: 540px) {
  .setup-fields { grid-template-columns: minmax(0,1fr); }
  .connection-row { gap: 9px; }
}
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.setting-row { padding: 12px 0; border-top: 1px solid var(--rule); display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.setting-row > div { min-width: 0; overflow-wrap: anywhere; }
.setting-row small { display: block; margin-top: 4px; color: var(--muted); line-height: 1.35; }
.setting-row .button { flex-shrink: 0; font-size: .81rem; }
.invitation-row { flex-wrap: wrap; }
.status-ok { background: #e9f0e4; color: #41613a; }
.status-ok i { background: #578456; }
.integration-row { flex-wrap: wrap; }
.integration-row > div:first-child { flex: 1; }
.setting-row code, .system-details code { font-size: .8rem; }
.system-details { color: var(--muted); border-top: 1px solid var(--rule); padding-top: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: .82rem; }
.member { display: flex; align-items: center; gap: 9px; }
.inline-form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.inline-form > label:first-child { flex: 1; }
.inline-form input { min-width: 120px; }
.toggle { display: block; flex: 0 0 42px; position: relative; }
.toggle input { position: absolute; opacity: 0; inset: 0; width: 100%; cursor: pointer; margin: 0; }
.toggle span { height: 24px; border-radius: 12px; background: #d4c9c1; display: block; cursor: pointer; }
.toggle span::after { content: ""; display: block; width: 18px; height: 18px; transform: translate(3px,3px); background: white; border-radius: 50%; transition: transform .15s ease; }
.toggle input:checked + span { background: var(--ink); }
.toggle input:checked + span::after { transform: translate(21px,3px); }
.toggle input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.subtle,.muted,.hint { color: var(--muted); }
.subtle,.hint { font-size: .9rem; line-height: 1.55; margin: 10px 0; }
.hint { background: var(--soft); border-radius: var(--radius); padding: 12px; }
.small { font-size: .83rem; line-height: 1.4; }
.auth-body { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: min(100%,420px); padding: 32px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--rule); }
.auth-card .brand { margin-bottom: 24px; }
.auth-card h1 { font-weight: 650; letter-spacing: -.02em; font-size: 28px; line-height: 1.16; margin: 8px 0; }
.auth-card > p, .auth-card form { margin-top: 13px; }
.auth-card > p { color: var(--muted); line-height: 1.55; }
.auth-card form > .button { width: 100%; }
.auth-card form > label, dialog form > label { margin-bottom: 12px; }
label { display: block; font-weight: 600; }
input:not([type=checkbox]), select, textarea {
  width: 100%; border: 1px solid var(--field-edge); border-radius: var(--radius); min-height: 40px; padding: 8px 12px; display: block;
  background: var(--paper); font-weight: 400;
}
label input:not([type=checkbox]), label select, label textarea { margin-top: 8px; }
:is(input,select,textarea):user-invalid { border-color: #963844; }
select { max-width: 100%; }
.setting-row select { max-width: 140px; }
.memory-transfer > summary { font: 650 18px/1.4 var(--headings); }
.memory-transfer > .actions, .obsidian-install { margin-top: 12px; }
.obsidian-install { color: var(--muted); font-size: .88rem; }
summary { cursor: pointer; }
.obsidian-install ol { padding-inline-start: 20px; line-height: 1.55; }
.obsidian-install code { overflow-wrap: anywhere; }
textarea { resize: vertical; min-height: 72px; }
.form-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 10px; margin-bottom: 12px; }
.checkbox { display: flex; align-items: center; gap: 8px; }
input[type=checkbox] { accent-color: var(--ink); }
.form-error { color: #963844; margin: 8px 0; font-size: .9rem; }
.form-error:empty { display: none; }
dialog { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--paper); color: var(--ink); width: min(680px,calc(100vw - 32px));
  max-height: min(calc(100dvh - 32px),760px); padding: 0; }
dialog::backdrop { background: rgb(23 23 23 / 26%); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--rule); }
.dialog-heading h2 { font-size: 22px; font-weight: 650; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dialog-content { padding: 20px 24px 24px; }
.dialog-content h3 { font-size: 1rem; margin: 12px 0 8px; }
.dialog-content p + .actions, .dialog-content .prose-text + .actions { margin-top: 14px; }
.task-matches:not(:empty) { background: var(--soft); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px; margin-top: 12px; }
.task-match { padding: 8px 0; border-top: 1px solid var(--rule); overflow-wrap: anywhere; }
.task-match small { display: block; margin-top: 3px; color: var(--muted); }
.task-match .actions { margin-top: 6px; }
.prose-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; margin: 12px 0; }
.input-examples { color: var(--muted); margin: 12px 0; }
.input-examples ul { padding-inline-start: 20px; line-height: 1.55; }
.connection-steps { margin: 0 0 16px; padding-inline-start: 20px; line-height: 1.55; }
.connection-steps li + li { margin-top: 8px; }
.mail-header { display: grid; gap: 8px; color: var(--muted); font-size: .9rem; line-height: 1.45; margin: 0 0 16px; }
.mail-header > div { display: grid; grid-template-columns: 56px minmax(0,1fr); gap: 8px; }
.mail-header dd { color: var(--ink); margin: 0; overflow-wrap: anywhere; }
.mail-dialog .prose-text { margin: 20px 0; font-size: 15px; }
.mail-attachments { margin: 0 0 16px; padding: 0; list-style: none; }
.mail-attachments li { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 44px; padding: 8px 0; border-top: 1px solid var(--rule); }
.mail-attachments li:last-child { border-bottom: 1px solid var(--rule); }
.mail-attachments span { overflow-wrap: anywhere; }
.mail-attachments a { flex-shrink: 0; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.analysis { margin: 12px 0; padding: 12px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--soft); }
.analysis p, .analysis details { margin-top: 7px; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 50; background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--radius); max-width: min(420px,calc(100vw - 32px)); }
.toast[data-style=error] { background: #8d2a3e; border-color: #7a2335; }
@media (max-width: 1120px) {
  .workspace { grid-template-columns: 200px minmax(0,1fr); }
  .screen { padding: 24px 24px 40px; }
  .settings-grid { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 870px) {
  .dashboard-grid { grid-template-columns: minmax(0,1fr); }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat:nth-child(odd) { border-left: 0; }
  .stat:nth-child(n+3) { border-top: 1px solid var(--rule); }
  .memory-layout { display: block; min-height: 0; }
  .memory-layout:not(.has-note) .note-reader, .memory-layout.has-note .memory-list { display: none; }
  .memory-list { position: static; }
  .memory-rows { max-height: none; }
  .note-reader { border-left: 0; padding: 16px; }
  .note-back.button { display: inline-flex; margin-bottom: 16px; }
}
@media (max-width: 760px) {
  .workspace { display: block; }
  .sidebar { display: none; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; gap: 12px; min-height: 60px;
    position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--rule); }
  .mobile-header .brand { font-size: 17px; }
  .screen { padding: 16px 16px max(32px,env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 20px; }
  .page-head h1 { font-size: 26px; }
  .page-head p { font-size: .9rem; }
  .page-head .button, .mobile-header .icon-button { min-height: 44px; }
  .mobile-header .icon-button { width: 44px; }
  .note-open .page-head .actions, .note-open .toolbar { display: none; }
  .note-reader { scroll-margin: 72px; }
  .stats { margin-bottom: 16px; }
  .stat { padding: 12px; }
  .stat > span { font-size: .85rem; }
  .stat strong { font-size: 20px; }
  .graph-card { padding: 16px; }
  .graph-wide .graph { min-height: 200px; }
  .graph-node text { font-size: 20px; }
  .dashboard-grid, .settings-grid { gap: 12px; }
  .dashboard-grid > .card,.settings-card,.list-card { padding-inline: 16px; }
  .dashboard-grid > .card,.settings-card { padding-block: 16px; }
  .dialog-heading, .dialog-content { padding-inline: 16px; }
  .mail-dialog { margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; border: 0; border-radius: 0; }
  .mail-dialog .dialog-heading { position: sticky; top: 0; background: var(--paper); z-index: 1; }
  .mail-dialog .dialog-content { padding-bottom: max(24px,env(safe-area-inset-bottom)); }
  .search { flex: 1; }
  .toast { bottom: max(16px,env(safe-area-inset-bottom)); right: 16px; }
  input,textarea,select { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
