/* Agent Notebook — visual language borrowed from Apple's HIG: system type with tight display tracking,
   neutral grays, hairline dividers, soft 12px radii, translucent sidebar, segmented controls, one accent. */
:root {
  --bg: #ffffff; --bg-sub: #f5f5f7; --bg-card: #ffffff; --bg-side: rgba(246, 246, 248, .86);
  --bg-hover: rgba(0, 0, 0, .045); --bg-fill: rgba(120, 120, 128, .12); --bg-fill-2: rgba(120, 120, 128, .2);
  --text: #1d1d1f; --text-2: #6e6e73; --text-3: #86868b;
  --border: rgba(0, 0, 0, .12); --border-2: rgba(0, 0, 0, .07);
  --accent: #0071e3; --accent-bg: rgba(0, 113, 227, .1); --accent-text: #0066cc;
  --danger: #ff3b30; --green: #34c759; --green-bg: rgba(52, 199, 89, .14); --green-text: #248a3d;
  --col-bg: #f5f5f7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 2px 10px rgba(0, 0, 0, .05);
  --shadow-lift: 0 2px 6px rgba(0, 0, 0, .06), 0 8px 24px rgba(0, 0, 0, .08);
  --shadow-pop: 0 12px 48px rgba(0, 0, 0, .16), 0 0 0 1px rgba(0, 0, 0, .04);
  --ring: 0 0 0 3.5px rgba(0, 113, 227, .25);
  --r: 12px; --r-s: 8px; --r-l: 16px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", ui-sans-serif, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e; --bg-sub: #2a2a2d; --bg-card: #2c2c2e; --bg-side: rgba(30, 30, 32, .88);
    --bg-hover: rgba(255, 255, 255, .06); --bg-fill: rgba(120, 120, 128, .24); --bg-fill-2: rgba(120, 120, 128, .34);
    --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #8d8d92;
    --border: rgba(255, 255, 255, .14); --border-2: rgba(255, 255, 255, .08);
    --accent: #0a84ff; --accent-bg: rgba(10, 132, 255, .18); --accent-text: #409cff;
    --danger: #ff453a; --green: #30d158; --green-bg: rgba(48, 209, 88, .16); --green-text: #4cd964;
    --col-bg: #232326;
    --shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lift: 0 0 0 1px rgba(255, 255, 255, .07), 0 8px 24px rgba(0, 0, 0, .45);
    --shadow-pop: 0 16px 56px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .08);
    --ring: 0 0 0 3.5px rgba(10, 132, 255, .32);
  }
}

/* ---- base ----------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(0, 113, 227, .22); }
input, select, textarea { accent-color: var(--accent); }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=search], input[type=date], select, textarea {
  border: none; background: var(--bg-fill); border-radius: var(--r-s); padding: 6px 10px; outline: none; transition: box-shadow .15s, background .15s;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: var(--ring); background: var(--bg-card); }
select { -webkit-appearance: none; appearance: none; padding-right: 26px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.ok { color: var(--green-text); } .err { color: var(--danger); }
.spacer { flex: 1; }

/* ---- shell ---------------------------------------------------------------------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 244px; flex: none; background: var(--bg-side); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); display: flex; flex-direction: column; border-right: 1px solid var(--border-2); transition: margin-left .25s cubic-bezier(.2, .8, .2, 1); }
.sidebar.collapsed { margin-left: -244px; }
.expand { position: fixed; left: 10px; top: 10px; display: none; z-index: 5; }
.sidebar.collapsed ~ .expand { display: block; }
.ws { display: flex; align-items: center; gap: 8px; padding: 16px 12px 8px 16px; font-weight: 600; font-size: 14px; letter-spacing: -.01em; }
.ws-icon { font-size: 18px; }
.ws-name { flex: 1; }
.side-search { padding: 4px 12px 10px; }
.side-search input { width: 100%; background: var(--bg-fill); border-radius: var(--r-s); padding: 6px 10px; font-size: 13px; }
.side-search input::placeholder { color: var(--text-3); }
.side-section { padding: 6px 10px; }
.side-section.grow { flex: 1; overflow-y: auto; }
.side-label { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 4px; font-size: 11px; font-weight: 600; color: var(--text-3); letter-spacing: .04em; text-transform: uppercase; }
.side-item { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; font-size: 13.5px; color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .12s; }
.side-item:hover { background: var(--bg-hover); }
.side-item.active { background: rgba(0, 0, 0, .085); font-weight: 600; }
@media (prefers-color-scheme: dark) { .side-item.active { background: rgba(255, 255, 255, .11); } }
.side-item .emoji { width: 20px; text-align: center; flex: none; font-size: 14px; }
.side-item .count { margin-left: auto; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.side-item .badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 600; padding: 0 6px; line-height: 17px; min-width: 17px; text-align: center; }
.tree-children { margin-left: 14px; padding-left: 2px; }
.tree-folder > .side-item .caret { display: inline-block; width: 14px; font-size: 9px; color: var(--text-3); transition: transform .15s; }
.tree-folder.open > .side-item .caret { transform: rotate(90deg); }
.tree-folder:not(.open) > .tree-children { display: none; }
.side-footer { padding: 8px 10px 10px; border-top: 1px solid var(--border-2); }
.side-footer .side-item { color: var(--text-2); }

.main { flex: 1; overflow-y: auto; min-width: 0; }
.main > .page { animation: fade-up .22s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.topbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); font-size: 13px; color: var(--text-2); border-bottom: 1px solid transparent; }
.topbar .crumb { display: inline-flex; gap: 6px; align-items: center; }
.topbar .crumb a { padding: 2px 6px; margin: 0 -6px; border-radius: 6px; }
.topbar .crumb a:hover { color: var(--text); background: var(--bg-hover); }
.page { max-width: 880px; margin: 0 auto; padding: 28px 56px 120px; }
.page.wide { max-width: none; padding-left: 40px; padding-right: 40px; }
.page-icon { font-size: 60px; line-height: 1; margin-bottom: 10px; }
.page-title { font-family: var(--serif); font-size: 36px; font-weight: 700; line-height: 1.15; letter-spacing: -.004em; margin: 0 0 10px; outline: none; border: none; width: 100%; background: transparent; padding: 0; text-wrap: balance; }
.page-title:empty::before { content: '无标题'; color: var(--text-3); }
.page-desc { color: var(--text-2); margin: 0 0 18px; font-size: 15px; }
.nb-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.nb-head .page-icon { font-size: 34px; line-height: 1; margin: 0; }
.nb-head .page-title { margin: 0; }
.nb-meta { color: var(--text-3); font-size: 12.5px; letter-spacing: .02em; margin-top: 2px; }
.standfirst { font-family: var(--serif); font-size: 16px; line-height: 1.6; color: var(--text-2); margin: 10px 0 14px; max-width: 60ch; }

/* ---- buttons & controls ---------------------------------------------------------- */
.icon-btn, .mini-btn { border: none; background: transparent; color: var(--text-3); border-radius: 6px; padding: 2px 6px; font-size: 14px; line-height: 1.3; transition: background .12s, color .12s; }
.icon-btn:hover, .mini-btn:hover { background: var(--bg-hover); color: var(--text); }
.btn { border: none; background: var(--bg-fill); color: var(--text); border-radius: var(--r-s); padding: 0 13px; height: 32px; font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: background .12s, transform .08s, box-shadow .12s; }
.btn:hover { background: var(--bg-fill-2); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { box-shadow: var(--ring); outline: none; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.danger { color: var(--danger); background: transparent; }
.btn.danger:hover { background: rgba(255, 59, 48, .1); }
.btn.small { height: 27px; padding: 0 10px; font-size: 13px; border-radius: 7px; }
.btn.active { background: var(--accent-bg); color: var(--accent-text); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
select.btn { padding-right: 26px; }
/* iOS-style segmented control */
.seg, .segmented { display: inline-flex; align-items: center; background: var(--bg-fill); border-radius: 9px; padding: 2px; gap: 2px; }
.seg button, .segmented .btn { border: none; background: transparent; height: 24px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--text-2); box-shadow: none; }
.segmented .btn.small { height: 24px; }
.seg button:hover, .segmented .btn:hover { color: var(--text); background: transparent; }
.seg button.active, .segmented .btn.active { background: var(--bg-card); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .04); }
.segmented .btn:active { transform: none; }

.chip { display: inline-flex; align-items: center; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--bg-fill); color: var(--text-2); white-space: nowrap; line-height: 19px; letter-spacing: .01em; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.chip.status { background: var(--accent-bg); color: var(--accent-text); }
.chip.source { background: var(--green-bg); color: var(--green-text); }
.chip.btn-chip { cursor: pointer; background: var(--bg-card); box-shadow: 0 0 0 1px var(--border); transition: all .12s; }
.chip.btn-chip:hover { background: var(--accent-bg); color: var(--accent-text); box-shadow: 0 0 0 1px var(--accent); }

.toolbar { display: flex; align-items: center; gap: 8px; padding: 6px 0 12px; margin-bottom: 18px; flex-wrap: wrap; border-bottom: 1px solid var(--border-2); }
.toolbar input[type=date] { padding: 3px 8px; font-size: 13px; height: 27px; border-radius: 7px; }
.date-nav { display: inline-flex; align-items: center; gap: 4px; }
.divider { border: none; border-top: 1px solid var(--border-2); margin: 0 0 18px; }

/* ---- note page ------------------------------------------------------------------ */
.props { display: grid; grid-template-columns: 150px 1fr; gap: 2px 10px; margin: 6px 0 18px; font-size: 14px; }
.props .k { color: var(--text-3); display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.props .v { padding: 2px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 30px; }
.props .v input, .props .v select { background: transparent; border-radius: 6px; padding: 3px 7px; min-width: 120px; transition: background .12s; }
.props .v input:hover, .props .v select:hover { background: var(--bg-fill); }
.props .v input:focus, .props .v select:focus { background: var(--bg-card); box-shadow: var(--ring); }
.add-prop { color: var(--text-3); font-size: 13px; padding: 4px 0; cursor: pointer; grid-column: 1 / -1; }
.add-prop:hover { color: var(--accent-text); }
.body-view { min-height: 200px; cursor: text; border-radius: var(--r-s); transition: background .15s; }
.body-view:hover { background: var(--bg-sub); box-shadow: 0 0 0 10px var(--bg-sub); }
.body-view:empty::before { content: '点击开始输入 Markdown…'; color: var(--text-3); }
.body-edit { width: 100%; min-height: 60vh; border: none; outline: none; resize: vertical; background: var(--bg-sub); border-radius: var(--r); font-family: var(--mono); font-size: 13.5px; line-height: 1.65; padding: 14px 16px; }
.body-edit:focus { box-shadow: var(--ring); background: var(--bg-card); }
.editbar { display: flex; gap: 8px; align-items: center; justify-content: flex-end; color: var(--text-3); font-size: 12px; margin-bottom: 10px; }
.md { line-height: 1.65; font-size: 15.5px; }
.md h1 { font-size: 26px; letter-spacing: -.02em; margin: 30px 0 10px; } .md h2 { font-size: 21px; letter-spacing: -.015em; margin: 26px 0 8px; } .md h3 { font-size: 17px; margin: 20px 0 6px; }
.md p { margin: 4px 0 10px; } .md ul, .md ol { padding-left: 24px; margin: 4px 0 10px; } .md li { margin: 3px 0; }
.md code { font-family: var(--mono); font-size: 85%; background: var(--bg-fill); padding: 1px 6px; border-radius: 5px; }
.md pre { background: var(--bg-sub); border-radius: var(--r); padding: 14px 18px; overflow-x: auto; } .md pre code { background: none; padding: 0; }
.md blockquote { border-left: 3px solid var(--border); margin: 10px 0; padding: 2px 16px; color: var(--text-2); }
.md table { border-collapse: collapse; margin: 10px 0; font-size: 14px; } .md th, .md td { border-bottom: 1px solid var(--border-2); padding: 6px 12px; text-align: left; } .md th { color: var(--text-3); font-weight: 500; font-size: 12.5px; }
.md a { color: var(--accent-text); } .md a:hover { text-decoration: underline; } .md img { max-width: 100%; border-radius: var(--r); }
.md hr { border: none; border-top: 1px solid var(--border-2); margin: 20px 0; }
.md input[type=checkbox] { margin-right: 6px; }
.wikilink { color: var(--accent-text); text-decoration: none !important; }
.wikilink:hover { text-decoration: underline !important; }
.wikilink.missing { color: var(--text-3); border-bottom: 1px dashed var(--text-3); }
.links-box { margin-top: 32px; border-top: 1px solid var(--border-2); padding-top: 14px; font-size: 13px; }
.links-box h4 { margin: 8px 0 6px; font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.links-box a { display: inline-block; margin: 0 10px 6px 0; color: var(--accent-text); }
.links-box a:hover { text-decoration: underline; }
.field { display: inline-flex; align-items: center; gap: 5px; padding: 0 8px 0 0; border-radius: 6px; font-size: 12px; background: var(--bg-fill); color: var(--text-2); margin: 0 4px 2px 0; line-height: 20px; vertical-align: middle; font-family: var(--mono); overflow: hidden; }
.field .fk { background: var(--accent-bg); color: var(--accent-text); padding: 0 7px; font-family: var(--font); font-weight: 500; }

/* ---- cards & surfaces ---------------------------------------------------------- */
.card-box { border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; background: var(--bg-card); box-shadow: var(--shadow); }
a.card-box { transition: transform .15s cubic-bezier(.2, .8, .2, 1), box-shadow .15s; }
a.card-box:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.banner { display: flex; align-items: center; gap: 12px; margin: 0 0 22px; padding: 12px 14px 12px 16px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 14px; }
.kv .k { color: var(--text-3); }
.code { font-family: var(--mono); font-size: 12.5px; background: var(--bg-sub); border-radius: var(--r-s); padding: 12px 14px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; margin: 8px 0; }
.token-box { background: var(--accent-bg); border-radius: var(--r); padding: 16px; margin-top: 14px; }
.empty { color: var(--text-3); font-size: 13px; padding: 8px 6px; }
.empty.well { text-align: center; padding: 18px 8px; border: 1px dashed var(--border); border-radius: 10px; font-size: 12px; }

/* ---- capture, inbox, feed ------------------------------------------------------- */
.capture { display: flex; flex-direction: column; gap: 8px; border-radius: var(--r); padding: 12px 14px 10px; margin: 0 0 26px; background: var(--bg-card); box-shadow: var(--shadow); transition: box-shadow .15s, padding .15s; }
.capture.compact { flex-direction: row; align-items: center; padding: 6px 8px 6px 14px; gap: 10px; background: var(--bg-fill); box-shadow: none; margin-bottom: 20px; }
.capture.compact textarea { flex: 1; min-height: 24px; height: 24px; font-size: 14px; resize: none; overflow: hidden; }
.capture.compact .row { gap: 6px; }
.capture.compact .row > select, .capture.compact .row > span { display: none; }
.capture.compact.open { flex-direction: column; align-items: stretch; background: var(--bg-card); box-shadow: var(--shadow-lift), var(--ring); padding: 12px 14px 10px; }
.capture.compact.open textarea { min-height: 72px; height: auto; font-size: 15px; resize: vertical; overflow: auto; }
.capture.compact.open .row > select, .capture.compact.open .row > span { display: inline-flex; }
.capture:focus-within { box-shadow: var(--shadow-lift), var(--ring); }
.capture textarea { border: none; outline: none; resize: vertical; min-height: 46px; background: transparent; font: inherit; font-size: 15px; padding: 2px 0; box-shadow: none !important; }
.capture textarea::placeholder { color: var(--text-3); }
.capture .row { display: flex; align-items: center; gap: 8px; }
.capture select { padding: 3px 26px 3px 9px; font-size: 13px; height: 27px; border-radius: 7px; }
.feed-group { margin: 0 0 30px; }
.feed-head { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); margin: 0 0 4px; padding: 0 0 8px; border-bottom: 1.5px solid var(--text); }
.feed-head .n { letter-spacing: 0; text-transform: none; }
.feed-head .btn, .feed-head .btn.small { letter-spacing: 0; text-transform: none; font-weight: 500; }
.feed-head a:hover { color: var(--accent-text); }
.feed-head .n { color: var(--text-3); font-weight: 400; font-size: 13px; }
.feed-item { display: flex; gap: 12px; padding: 13px 4px; cursor: pointer; align-items: flex-start; border-bottom: 1px solid var(--border-2); transition: background .12s; }
.feed-item:hover { background: var(--bg-hover); box-shadow: 0 0 0 6px var(--bg-hover); border-radius: 4px; }
.feed-item .dot { display: none; }
.feed-item .t { font-family: var(--serif); font-weight: 700; font-size: 16px; line-height: 1.35; }
.feed-item .ex { color: var(--text-2); font-size: 13.5px; line-height: 1.55; margin-top: 2px; }
.feed-item .meta { margin-left: auto; display: flex; gap: 4px; align-items: center; flex: none; font-size: 11.5px; color: var(--text-3); }
.journal-day { padding: 4px 4px 8px; margin: 0; border-bottom: 1px solid var(--border-2); cursor: pointer; transition: background .12s; }
.journal-day:hover { background: var(--bg-hover); box-shadow: 0 0 0 6px var(--bg-hover); border-radius: 4px; }
.journal-day .entry { border-top: none; }
.journal-day .entry + .entry { border-top: 1px solid var(--border-2); }
.journal-day .md { font-size: 14.5px; }
.journal-day .md h2 { font-size: 13px; color: var(--text-2); margin: 16px 0 4px; font-weight: 600; letter-spacing: 0; }
.journal-day .md h2 small { font-weight: 400; color: var(--text-3); font-size: 11px; margin-left: 6px; }
.journal-day .md h2:first-child { margin-top: 0; }
.inbox-item { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; padding: 13px 4px; border-bottom: 1px solid var(--border-2); }
.inbox-item .t { font-family: var(--serif); font-weight: 700; font-size: 16px; line-height: 1.35; cursor: pointer; flex: 1; min-width: 60%; }
.inbox-item .t:hover { color: var(--accent-text); }
.inbox-item .ex { color: var(--text-2); font-size: 13.5px; line-height: 1.55; width: 100%; }
.inbox-item .assign { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; width: 100%; }
.inbox-item .assign select { padding: 2px 26px 2px 8px; font-size: 12.5px; height: 24px; border-radius: 999px; }
.timeline-date { font-size: 12px; font-weight: 600; color: var(--text-2); margin: 26px 0 4px; position: sticky; top: 44px; background: var(--bg); padding: 6px 0 8px; letter-spacing: .1em; text-transform: uppercase; border-bottom: 1.5px solid var(--text); z-index: 1; }
.timeline-date:first-child { margin-top: 0; }
.toc { border-top: 1px solid var(--border-2); }
.toc-item { display: grid; grid-template-columns: 28px auto 1fr auto; align-items: baseline; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--border-2); transition: background .12s; }
.toc-item:hover { background: var(--bg-hover); box-shadow: 0 0 0 6px var(--bg-hover); border-radius: 4px; }
.toc-item .emoji { font-size: 16px; text-align: center; }
.toc-item .t { font-family: var(--serif); font-weight: 700; font-size: 16px; }
.toc-item .d { color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toc-item .n { color: var(--text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---- kanban --------------------------------------------------------------------- */
.board { display: flex; gap: 14px; align-items: flex-start; overflow-x: auto; padding-bottom: 24px; min-height: 60vh; }
.col { flex: none; width: 276px; background: var(--col-bg); border-radius: 14px; padding: 10px; transition: background .15s, box-shadow .15s; }
.col.drag-over { background: var(--accent-bg); box-shadow: inset 0 0 0 1.5px var(--accent); }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.col-head .count { color: var(--text-3); font-weight: 400; font-variant-numeric: tabular-nums; }
.col-head .add { margin-left: auto; }
.card { background: var(--bg-card); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; margin-bottom: 8px; cursor: pointer; font-size: 14px; transition: transform .15s cubic-bezier(.2, .8, .2, 1), box-shadow .15s; }
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lift); }
.card.dragging { opacity: .5; transform: scale(.98); }
.card .t { font-family: var(--serif); font-weight: 700; font-size: 15px; margin-bottom: 5px; line-height: 1.35; }
.card .ex { color: var(--text-2); font-size: 12.5px; line-height: 1.5; max-height: 3.75em; overflow: hidden; margin-bottom: 10px; }
.card .meta { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; font-size: 11px; color: var(--text-3); }
.card .meta .chip { font-size: 11px; line-height: 18px; }
.card .meta .date { margin-left: auto; }

/* ---- tables --------------------------------------------------------------------- */
.list { background: var(--bg-card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.list table { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th { text-align: left; color: var(--text-3); font-weight: 500; font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border-2); background: var(--bg-sub); white-space: nowrap; }
.list th.sortable { cursor: pointer; } .list th.sortable:hover { color: var(--text); }
.list td { padding: 10px 14px; border-bottom: 1px solid var(--border-2); cursor: pointer; vertical-align: top; }
.list tr:last-child td { border-bottom: none; }
.list tr:hover td { background: var(--bg-hover); }
.settings table th { text-align: left; color: var(--text-3); font-weight: 500; font-size: 12px; padding: 4px 6px 8px; border-bottom: 1px solid var(--border-2); }
.settings table td { border-bottom: 1px solid var(--border-2); }
.settings table tr:last-child td { border-bottom: none; }

/* ---- side peek, modal, toast ----------------------------------------------------- */
.peek { width: min(580px, 60vw); flex: none; border-left: 1px solid var(--border-2); background: var(--bg); overflow-y: auto; box-shadow: -12px 0 40px rgba(0, 0, 0, .08); }
.peek.hidden { display: none; }
.peek:not(.hidden) { animation: slide-in .22s cubic-bezier(.2, .8, .2, 1); }
@keyframes slide-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.peek .page { padding: 18px 36px 80px; }
.peek .page-title { font-size: 26px; }
.peek-bar { display: flex; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; background: color-mix(in srgb, var(--bg) 85%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); z-index: 2; }
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .28); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; z-index: 50; }
.modal.hidden { display: none; }
.modal .box { background: var(--bg-card); border-radius: 14px; box-shadow: var(--shadow-pop); width: 560px; max-width: 94vw; max-height: 76vh; overflow: auto; animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.modal .box h3 { margin: 0; padding: 16px 20px; font-size: 16px; font-weight: 600; letter-spacing: -.01em; border-bottom: 1px solid var(--border-2); }
.modal .box .content { padding: 18px 20px; }
.modal .box .footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border-2); }
.search-hit { padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.search-hit:hover { background: var(--bg-hover); }
.search-hit .t { font-weight: 500; } .search-hit .s { font-size: 12.5px; color: var(--text-2); }
.search-hit .p { font-size: 11.5px; color: var(--text-3); }
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: rgba(29, 29, 31, .92); color: #fff; padding: 9px 18px; border-radius: 999px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lift); z-index: 60; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
@media (prefers-color-scheme: dark) { .toast { background: rgba(245, 245, 247, .94); color: #1d1d1f; } }
.toast.hidden { display: none; }

/* ---- settings & forms ----------------------------------------------------------- */
.settings h2 { font-family: var(--serif); font-size: 23px; font-weight: 700; letter-spacing: 0; margin: 38px 0 6px; }
.settings p { color: var(--text-2); margin: 4px 0 14px; font-size: 14px; }
.form { display: grid; grid-template-columns: 140px 1fr; gap: 12px 14px; align-items: center; font-size: 14px; }
.form label { color: var(--text-2); }
.form input[type=text], .form input[type=url], .form input[type=number], .form select { width: 100%; }
.form .row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.form .actions { grid-column: 2; display: flex; gap: 8px; }

/* ---- activity log --------------------------------------------------------------- */
.audit { font-size: 13px; overflow-x: auto; background: var(--bg-card); border-radius: var(--r); box-shadow: var(--shadow); }
.audit .row { display: grid; min-width: 640px; grid-template-columns: 140px 170px 170px minmax(160px, 1fr); gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--border-2); align-items: baseline; }
.audit .row .chip { max-width: 100%; }
.audit .row:last-child { border-bottom: none; }
.audit .ts { color: var(--text-3); font-family: var(--mono); font-size: 12px; }
.audit .act { font-family: var(--mono); font-size: 12px; }
.audit .act.denied { color: var(--danger); }
.audit .tgt { color: var(--text-2); word-break: break-all; }

/* ---- charts --------------------------------------------------------------------- */
.charts { display: flex; flex-direction: column; gap: 16px; padding-bottom: 24px; }
.metric-card { border-radius: var(--r-l); background: var(--bg-card); box-shadow: var(--shadow); padding: 16px 18px 12px; }
.metric-head { display: flex; align-items: center; gap: 10px; }
.metric-title { display: flex; align-items: baseline; gap: 6px; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.metric-title .mk { font-family: var(--mono); font-size: 14px; }
.metric-stats { display: flex; gap: 26px; margin: 12px 0 6px; flex-wrap: wrap; }
.metric-stats .sv { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.metric-stats .sl { font-size: 11.5px; color: var(--text-3); }
.chart-wrap { position: relative; min-height: 220px; }
.chart { display: block; overflow: visible; max-width: 100%; }
.chart .grid { stroke: var(--border-2); stroke-width: 1; }
.chart .tick { fill: var(--text-3); font-size: 11px; font-family: var(--font); }
.chart .label { fill: var(--text); font-size: 12px; font-weight: 600; font-family: var(--font); }
.chart .bar { fill: var(--accent); opacity: .9; }
.chart .bar.on { opacity: 1; filter: brightness(1.12); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart .area { fill: var(--accent); opacity: .08; }
.chart .dot { fill: var(--bg-card); stroke: var(--accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart .dot.on { fill: var(--accent); }
.chart .cursor { stroke: var(--text-3); stroke-dasharray: 3 3; stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .hit { fill: transparent; cursor: pointer; }
.chart-tip { position: absolute; top: 8px; min-width: 160px; max-width: 320px; background: color-mix(in srgb, var(--bg-card) 92%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-radius: 10px; box-shadow: var(--shadow-pop); padding: 9px 12px; font-size: 12px; pointer-events: none; z-index: 3; }
.chart-tip .td { color: var(--text-3); font-size: 11px; }
.chart-tip .tv { font-size: 16px; font-weight: 600; margin: 2px 0 4px; letter-spacing: -.01em; }
.chart-tip .ti { display: flex; gap: 4px; padding: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- relation graph ------------------------------------------------------------- */
.graph-wrap { position: relative; height: calc(100vh - 170px); min-height: 360px; border-radius: var(--r-l); background: var(--bg-sub); overflow: hidden; }
.graph { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.graph:active { cursor: grabbing; }
.graph .gl line { stroke: var(--text-3); stroke-opacity: .4; stroke-width: 1.2; transition: stroke-opacity .15s; }
.graph .gl line.dim { stroke-opacity: .06 !important; }
.graph .gl line.related { stroke: var(--accent); stroke-dasharray: 4 3; stroke-linecap: round; }
.chart-tip .tr { margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--border-2); }
.chart-tip .tn { font-size: 12px; color: var(--text); line-height: 1.35; }
.chart-tip .tr .td { white-space: normal; line-height: 1.4; margin-top: 1px; }
.graph .gn { cursor: pointer; transition: opacity .15s; }
.graph .gn circle { stroke: var(--bg-sub); stroke-width: 1.5; }
.graph .gn .hitarea { fill: transparent; stroke: none; }
.graph .gn:hover circle:not(.hitarea) { stroke: var(--text); stroke-width: 2; }
.graph .gn text { font-size: 11px; fill: var(--text-2); pointer-events: none; paint-order: stroke; stroke: var(--bg-sub); stroke-width: 3px; stroke-linejoin: round; }
.graph .gn.dim { opacity: .12; }
.graph .gn.hit circle:not(.hitarea) { stroke: var(--text); stroke-width: 2.5; }
.graph .gn.focus circle:not(.hitarea) { stroke: var(--text); stroke-width: 3; }
.graph .gn.focus text { fill: var(--text); font-weight: 600; }
.graph-hint { position: absolute; left: 14px; bottom: 10px; font-size: 11px; pointer-events: none; }
.legend { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; border: none; background: var(--bg-fill); border-radius: 999px; padding: 3px 10px 3px 7px; font-size: 12.5px; font-weight: 500; color: var(--text-2); transition: background .12s, opacity .12s; }
.legend-chip:hover { background: var(--bg-fill-2); color: var(--text); }
.legend-chip .sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend-chip.off { opacity: .4; text-decoration: line-through; }

/* ---- login (phone / remote) ----------------------------------------------------- */
.login { position: fixed; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 360px; text-align: center; padding: 24px 24px 28px; border-radius: 20px; background: var(--bg-card); box-shadow: var(--shadow-lift); }
.login-box .err { color: var(--danger); font-size: 13px; }

/* ---- phone layout ---------------------------------------------------------------- */
.menu-btn { display: none; font-size: 18px; padding: 2px 8px; margin-left: -6px; }
@media (max-width: 760px) {
  .app { height: 100dvh; }
  .menu-btn { display: inline-block; }
  .expand, #collapse { display: none !important; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 40; width: min(300px, 84vw); margin: 0 !important; transform: translateX(-104%); transition: transform .28s cubic-bezier(.2, .8, .2, 1); box-shadow: none; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  body.drawer-open .sidebar { transform: none; box-shadow: 12px 0 48px rgba(0, 0, 0, .18); }
  body.drawer-open::after { content: ''; position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .25); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
  .topbar { padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .topbar .crumb { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; min-width: 0; }
  .topbar select.btn { max-width: 110px; }
  .page, .page.wide { padding: 14px 16px 100px; }
  .page-title { font-size: 28px; }
  .nb-head { gap: 10px; } .nb-head .page-icon { font-size: 26px; }
  .toc-item { grid-template-columns: 24px 1fr auto; } .toc-item .d { display: none; }
  .feed-item .t, .inbox-item .t, .toc-item .t { font-size: 15.5px; }
  .feed-head { font-size: 11px; }
  .page-icon { font-size: 44px; }
  .props { grid-template-columns: 96px 1fr; font-size: 13.5px; }
  .toolbar { gap: 6px; }
  .toolbar .btn.small, .segmented .btn { height: 30px; }
  .segmented .btn, .seg button { height: 28px; }
  .btn.small { height: 30px; font-size: 13.5px; }
  .capture textarea { font-size: 16px; } /* 16px keeps iOS Safari from zooming the page on focus */
  input, select, textarea { font-size: 16px !important; }
  .board { gap: 10px; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 24px; }
  .col { width: 84vw; scroll-snap-align: start; }
  .list { overflow-x: auto; }
  .list table { min-width: 560px; }
  .peek { position: fixed; inset: 0; width: 100%; z-index: 45; border-left: none; box-shadow: none; }
  .peek .page { padding: 14px 16px 80px; }
  .peek-bar { padding-top: calc(10px + env(safe-area-inset-top)); }
  .modal { padding: 0; align-items: flex-end; }
  .modal .box { width: 100%; max-width: none; max-height: 92dvh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .form { grid-template-columns: 1fr; gap: 6px; }
  .form label { font-size: 12.5px; }
  .form .actions { grid-column: 1; }
  .kv { grid-template-columns: 1fr !important; }
  .metric-stats { gap: 16px; }
  .metric-stats .sv { font-size: 17px; }
  .graph-wrap { height: 70dvh; }
  .timeline-date { top: 38px; }
  .feed-item .meta { display: none; }
  .toast { bottom: calc(20px + env(safe-area-inset-bottom)); max-width: 90vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .login-box { box-shadow: none; background: transparent; }
}
@media (hover: none) { .card:hover, a.card-box:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { .main > .page, .peek:not(.hidden), .modal .box, .toast { animation: none; } }

/* ---- journal entries & structured properties ----------------------------------- */
.entry { padding: 14px 0 6px; border-top: 1px solid var(--border-2); }
.entry:first-child { border-top: none; padding-top: 0; }
.entry-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 6px; flex-wrap: wrap; }
.entry-head .time { font-family: var(--mono); font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.entry-head .etitle { font-weight: 600; font-size: 15.5px; line-height: 1.35; flex: 1; min-width: 0; }
.entry-head .etitle:empty { display: none; }
.entry p { margin: 2px 0 8px; }
.journal-day .entry { padding: 10px 0 2px; }
.journal-day .entry-head .etitle { font-size: 14px; }
.journal-body { font-size: 15px; }
.prop-chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
.prop-chips .chip { font-family: var(--mono); font-weight: 400; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.prop-chips .chip b { font-family: var(--font); font-weight: 500; margin-right: 2px; }
@media (max-width: 760px) {
  .props { grid-template-columns: 1fr; gap: 0; }
  .props .k { padding: 10px 0 0; font-size: 12px; }
  .props .v { padding: 0 0 4px; min-height: 26px; }
  .props .v input { width: 100%; min-width: 0; }
  .props .v input[type=date] { width: auto; }
  .entry-head .etitle { font-size: 16px; }
}

/* collapsed journal entries in lists */
.ebody.clamp { max-height: 4.9em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.more-btn { border: none; background: transparent; color: var(--accent-text); font-size: 12.5px; padding: 2px 0 6px; font-weight: 500; }
.more-btn:hover { text-decoration: underline; }

/* ---- reading typography: traditional magazine --------------------------------------
   Reading bodies (.md) set in a serif with a measured column: indented paragraphs instead of
   gaps, a lede and drop cap on articles, ruled section heads, pull quotes, ruled tables,
   underlined links, old-style figures in prose and lining figures in tables. The app chrome
   (sidebar, buttons, forms) keeps the system sans. */
:root { --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti SC", "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", STSong, "Times New Roman", serif; }
.md { font-family: var(--serif); font-size: 17px; line-height: 1.85; letter-spacing: .005em; text-align: justify; hanging-punctuation: first allow-end last; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; font-kerning: normal; font-variant-numeric: oldstyle-nums proportional-nums; }
.md p { margin: 0; text-indent: 0; }
.md p + p { text-indent: 2em; margin-top: .25em; }
.md p:has(> .field:first-child) { text-indent: 0; margin-top: .7em; font-family: var(--font); text-align: left; line-height: 1.6; }
.md p:has(> .field:first-child) + p { text-indent: 0; margin-top: .7em; }
.md strong { font-weight: 700; } .md em { font-style: italic; }
.md h1, .md h2, .md h3 { font-family: var(--serif); text-align: left; text-indent: 0; hyphens: manual; font-weight: 700; letter-spacing: 0; text-wrap: balance; }
.md h1 { font-size: 30px; line-height: 1.2; margin: 1.5em 0 .5em; }
.md h2 { font-size: 23px; line-height: 1.25; margin: 2em 0 .6em; }
.md h2::before { content: ''; display: block; width: 2.4em; border-top: 2px solid var(--text); margin-bottom: .65em; }
.md h3 { font-size: 18.5px; line-height: 1.3; margin: 1.6em 0 .4em; }
.md h4, .md h5, .md h6 { font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); margin: 1.6em 0 .4em; text-align: left; }
.md h1 + p, .md h2 + p, .md h3 + p, .md h4 + p, .md hr + p, .md blockquote p, .md li p { text-indent: 0; }
.md ul, .md ol { padding-left: 1.7em; margin: .7em 0 1em; text-align: left; }
.md li { margin: .3em 0; padding-left: .2em; } .md li::marker { color: var(--text-3); } .md ol li::marker { font-variant-numeric: lining-nums; }
.md li > ul, .md li > ol { margin: .2em 0 .3em; }
.md blockquote { border: none; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 1.5em 0; padding: .9em 0 .9em 2.3em; position: relative; font-size: 18.5px; line-height: 1.7; color: var(--text-2); text-align: left; }
.md blockquote::before { content: '“'; position: absolute; left: 0; top: .32em; font-size: 3.2em; line-height: 1; color: var(--text-3); font-family: Georgia, "Times New Roman", serif; }
.md blockquote p + p { text-indent: 0; margin-top: .5em; }
.md a { color: inherit; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: .2em; } .md a:hover { color: var(--accent-text); }
.md a.url { font-family: var(--font); font-size: .82em; font-weight: 500; color: var(--accent-text); text-decoration: none; background: var(--accent-bg); border-radius: 6px; padding: 1px 7px 1px 6px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: baseline; display: inline-block; line-height: 1.6; }
.md a.url::after { content: ' ↗'; font-size: .85em; opacity: .7; }
.md a.url:hover { background: var(--accent); color: #fff; }
.md .wikilink { color: inherit; text-decoration: underline !important; text-decoration-style: dotted !important; text-decoration-color: var(--text-3) !important; }
.md .wikilink:hover { color: var(--accent-text); } .md .wikilink.missing { border-bottom: none; color: var(--text-2); }
.md code { font-size: 80%; letter-spacing: 0; padding: .1em .45em; border-radius: 4px; font-variant-numeric: lining-nums; }
.md pre { font-size: 13px; line-height: 1.6; text-align: left; margin: 1.2em 0; border-radius: var(--r-s); border-left: 2px solid var(--border); padding: 12px 16px; }
.md table { width: 100%; margin: 1.5em 0; font-family: var(--font); font-size: 14px; text-align: left; border-top: 1.5px solid var(--text); border-bottom: 1px solid var(--text); font-variant-numeric: lining-nums tabular-nums; hyphens: manual; }
.md th { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); font-weight: 600; padding: 10px 10px 7px; border-bottom: 1px solid var(--border); }
.md td { padding: 8px 10px; border-bottom: 1px solid var(--border-2); vertical-align: top; } .md tr:last-child td { border-bottom: none; }
.md hr { border: none; border-top: 1px solid var(--text-2); width: 3em; margin: 2.4em auto; }
.md img { border-radius: 2px; display: block; margin: 1.4em auto; }
.md img + em { display: block; text-align: center; font-family: var(--font); font-style: normal; font-size: 12.5px; color: var(--text-3); margin-top: -.9em; margin-bottom: 1.4em; }
.md input[type=checkbox] { margin-right: .5em; vertical-align: -.05em; }

/* the article page: headline, one dateline between two rules, the measured column, a small colophon */
.article-page { max-width: 760px; }
.article-page .page-title { font-family: var(--serif); font-size: 40px; font-weight: 700; line-height: 1.12; letter-spacing: -.004em; margin: 8px 0 14px; text-wrap: balance; }
.dateline { display: flex; align-items: center; gap: 10px; font-family: var(--font); font-size: 13px; color: var(--text-2); letter-spacing: .01em; border-top: 1.5px solid var(--text); border-bottom: 1px solid var(--border); padding: 9px 0; margin: 0 0 34px; }
.dateline .dl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; flex: 1; min-width: 0; line-height: 20px; }
.dateline .dl a:hover { color: var(--text); } .dateline .dot { color: var(--text-3); } .dateline .tags { color: var(--text-3); }
.dateline .chip { font-size: 11.5px; }
.dateline .mini-btn { font-size: 12px; white-space: nowrap; }
.article-page .props { grid-template-columns: 90px 1fr; gap: 0 12px; font-family: var(--font); font-size: 13.5px; background: var(--bg-sub); border-radius: var(--r); padding: 10px 16px; margin: -22px 0 34px; }
.article-page .props.collapsed { display: none; }
.article-page .props .k { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); font-weight: 600; padding: 7px 0; }
.article-page .props .k > span:first-child { display: none; }
.article-page .props .v { min-height: 28px; }
.article-page .props .v input, .article-page .props .v select { border-color: transparent; }
.article-page .body-view { padding: 2px 0; }
.article-page .md > :first-child { margin-top: 0; }
.colophon { font-family: var(--font); font-size: 12px; color: var(--text-3); margin-top: 40px; padding-top: 10px; border-top: 1px solid var(--border-2); letter-spacing: .01em; word-break: break-all; }
.article-page .body-view > p:first-child { font-size: 19.5px; line-height: 1.7; margin-bottom: .7em; }
.article-page .body-view.dropcap > p:first-child::first-letter { float: left; font-family: var(--serif); font-size: 3.35em; line-height: .82; font-weight: 700; padding: .1em .12em 0 0; color: var(--text); }
.article-page .links-box { font-family: var(--font); border-top: none; margin-top: 10px; padding-top: 0; }
.peek .md { font-size: 16px; line-height: 1.8; }
.peek .article-page .page-title { font-size: 30px; }
.peek .article-page .body-view > p:first-child { font-size: 17.5px; }
.peek .article-page .body-view.dropcap > p:first-child::first-letter { font-size: 3em; }

/* journal pages as a diary: the hour in the margin, a bold serif headline, then the entry */
.entry { position: relative; padding: 20px 0 12px 4.8em; border-top: 1px solid var(--border-2); }
.entry:first-child { border-top: none; padding-top: 4px; }
.entry-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 .4em; flex-wrap: wrap; text-align: left; hyphens: manual; }
.entry-head .time { position: absolute; left: 0; top: calc(20px + .22em); font-family: var(--serif); font-size: 15px; line-height: 1.3; color: var(--text-2); font-variant-numeric: lining-nums tabular-nums; letter-spacing: .02em; }
.entry:first-child .entry-head .time { top: calc(4px + .22em); }
.entry-head .etitle { font-family: var(--serif); font-weight: 700; font-size: 19px; line-height: 1.3; letter-spacing: 0; text-wrap: balance; }
.entry-head .chip.source { font-family: var(--font); align-self: center; }
.entry p { margin: 0; } .ebody > p:first-child { text-indent: 0; } .ebody p + p { text-indent: 2em; margin-top: .25em; }
.journal-body { font-size: 17px; }
.journal-day .md { font-size: 15.5px; line-height: 1.75; }
.journal-day .entry { padding: 14px 0 6px 4.3em; }
.journal-day .entry:first-child { padding-top: 2px; }
.journal-day .entry-head .time { font-size: 13px; top: calc(14px + .25em); }
.journal-day .entry:first-child .entry-head .time { top: calc(2px + .25em); }
.journal-day .entry-head .etitle { font-size: 16.5px; }
.ebody.clamp { max-height: 5.2em; }
@media (max-width: 760px) {
  .md { font-size: 16.5px; line-height: 1.8; text-align: left; hyphens: manual; }
  .article-page .page-title { font-size: 30px; }
  .article-page .body-view > p:first-child { font-size: 18px; }
  .article-page .props { grid-template-columns: 1fr; margin-top: -18px; }
  .dateline { margin-bottom: 26px; }
  .entry, .journal-day .entry { padding-left: 0; }
  .entry-head .time, .journal-day .entry-head .time { position: static; font-size: 13px; }
  .entry-head .etitle { font-size: 18px; flex-basis: 100%; order: 2; } .entry-head .chip.source { order: 1; margin-left: auto; }
  .journal-day .entry-head .etitle { font-size: 16px; }
  .md blockquote { padding-left: 1.8em; font-size: 17px; }
}
