:root {
  --paper: #f6f3ee;
  --card: #fffbf8;
  --pink: #c1767d;
  --ink: #464240;
  --muted: #8b817b;
  --line: #e2deda;
  --wash: var(--paper);
  --rose: rgba(193, 118, 125, .1);
  --focus: var(--pink);
  --error: #a03c4c;
  --shadow: 0 3px 12px rgba(70, 66, 64, .025);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* Thin up/down chevrons use the text color and need no image requests. */
  --caret-up: linear-gradient(135deg, transparent 39%, var(--ink) 41%, var(--ink) 59%, transparent 61%);
  --caret-down: linear-gradient(45deg, transparent 39%, var(--ink) 41%, var(--ink) 59%, transparent 61%);
  font: 13px/1.8 "Noto Sans CJK SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; padding: var(--safe-top) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 27px; font-weight: 400; letter-spacing: 1.5px; line-height: 1.55; }
h2 { font-size: 16px; font-weight: 500; }
h3 { font-size: 14px; font-weight: 600; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, input, textarea, select { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: 1px solid var(--line); border-radius: 8px; background: var(--card); min-height: 40px; padding: 8px 13px; line-height: 1.5; }
button.primary { background: var(--pink); border-color: var(--pink); color: var(--card); font-weight: 400; }
button.quiet { background: transparent; border-color: transparent; padding-inline: 10px; }
button.danger { color: var(--error); background: transparent; border-color: transparent; }
button:disabled { opacity: .45; cursor: default; }
@media (hover: hover) {
  a:hover { color: var(--focus); }
  button:not(:disabled):hover { border-color: var(--pink); background-color: var(--rose); color: var(--focus); }
  button.primary:not(:disabled):hover { background: var(--pink); filter: brightness(.95); color: var(--card); }
}
:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
input, textarea, select { max-width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 7px; background-color: transparent; padding: 9px 11px; }
input:not([type="checkbox"]), textarea { width: 100%; }
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { line-height: 1.8; min-height: 80px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; min-height: 44px; padding: 7px 32px 7px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background-color: transparent; background-image: var(--caret-up), var(--caret-down), var(--caret-down), var(--caret-up); background-size: 5px 5px; background-repeat: no-repeat; background-position: right 16px top calc(50% - 4px), right 11px top calc(50% - 4px), right 16px top calc(50% + 2px), right 11px top calc(50% + 2px); }
input[type="checkbox"] { accent-color: var(--pink); width: 18px; height: 18px; flex-shrink: 0; margin: 0; }
label { display: block; font-size: 12px; color: var(--muted); }
label > input, label > textarea, label > select { display: block; margin-top: 6px; font-size: 14px; color: var(--ink); }
label.check { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-size: 14px; }
.icon { width: 20px; height: 20px; flex-shrink: 0; vertical-align: middle; }
.muted, .meta { font-size: 12px; color: var(--muted); }
.break { overflow-wrap: anywhere; }
.inline, .pending { display: flex; align-items: center; gap: 12px; }
.shell { max-width: 1120px; margin: auto; padding: 0 32px; }
.topbar { min-height: 78px; display: flex; align-items: center; gap: 28px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; white-space: nowrap; font-weight: 500; font-size: 25px; letter-spacing: 1px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 36px; }
.topbar nav { display: flex; gap: 5px; margin: auto; }
.topbar nav a { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 13px; min-height: 44px; border-radius: 8px; font-size: 13px; color: var(--muted); position: relative; }
.topbar nav a.active { color: var(--focus); font-weight: 500; }
.badge { display: block; flex-shrink: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--pink); }
#logout { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--muted); }
#main { padding: 0 0 28px; }
footer { color: var(--muted); font-size: 10px; padding: 20px 0 calc(24px + var(--safe-bottom)); text-align: center; }
.card, .draft-card, .settings-section, .recentrow { background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.empty, .loading { padding: 42px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty button { display: block; margin: 16px auto 0; }
.error { color: var(--error); font-size: 13px; white-space: pre-wrap; }
.success { color: var(--ink); }
.error:empty, #draft-result:empty { display: none; }
.hint { padding: 12px 14px; background: var(--rose); border-radius: 8px; font-size: 13px; white-space: pre-wrap; }
.configuration-warning { padding: 16px; border: 1px solid var(--pink); border-left: 4px solid var(--pink); border-radius: 8px; background: var(--rose); color: var(--ink); margin-bottom: 16px; }
.configuration-warning h3 { font-size: 15px; }
.configuration-warning ul { padding-left: 20px; margin: 8px 0; }
.configuration-warning p { font-size: 13px; }
/* Overview: a quiet welcome, then compact numbers and useful entry points. */
.hero { padding: 22px 24px; margin-bottom: 0; }
.headline { font-size: 14px; font-weight: 400; line-height: 1.5; margin: 6px 0 11px; color: var(--muted); }
.headline strong { font-size: 38px; font-weight: 400; color: var(--pink); margin-right: 7px; }
.hero .muted { margin-top: 0; font-size: 11px; max-width: 620px; }
.hero a { color: var(--focus); text-decoration: underline; text-underline-offset: 3px; }
.callout { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 16px; text-align: left; font-size: 13px; }
.callout strong { font-size: inherit; font-weight: 400; }
.callout.calm { color: var(--muted); font-size: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.stat { display: grid; text-align: center; gap: 8px; padding: 18px 8px; }
.stat strong { font-size: 30px; font-weight: 400; line-height: 1.4; font-variant-numeric: tabular-nums; color: var(--pink); }
.stat span { color: var(--muted); font-size: 12px; }
.panel { margin-top: 24px; }
.panelhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 3px 10px; }
.panelhead h2 { font-size: 16px; font-weight: 500; }
.panelhead .meta { font-size: 11px; }
.panelhead button { color: var(--focus); font-size: 12px; padding: 4px 6px; }
.bars, .recent { list-style: none; padding: 0; margin: 0; }
.bars-card { padding: 12px 20px; }
.barrow { width: 100%; display: grid; grid-template-columns: 6.5em minmax(0, 1fr) 2em; align-items: center; gap: 14px; padding: 10px 0; border: 0; background: transparent; font-size: 13px; text-align: left; }
.barname { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.bartrack { height: 6px; border-radius: 5px; background: var(--line); overflow: hidden; }
.barfill { opacity: .65; display: block; height: 100%; width: 4%; background: var(--pink); border-radius: 5px; }
.barcount { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.idle { font-size: 11px; padding: 6px 0; }
.recent { display: grid; gap: 10px; }
.recentrow { width: 100%; display: grid; gap: 6px; padding: 18px 20px; text-align: left; }
.recentrow .rowtitle { font-weight: 600; }
/* Review: one reading column, with restrained editing affordances. */
.reader { min-width: 0; }
.reader > .empty { background: var(--wash); border-radius: 10px; padding: 32px 20px; }
.draft-card { --reader-pad: 24px; position: relative; padding: 0 var(--reader-pad); border-color: var(--line); }
.draft-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 calc(-1 * var(--reader-pad)) 14px; padding: 12px var(--reader-pad); border-bottom: 1px solid var(--line); }
.reader form { display: grid; gap: 14px; }
.draft-card > .hint { margin-bottom: 16px; }
.fieldcaption { display: flex; justify-content: space-between; align-items: center; font-size: 10px; color: var(--muted); }
.readfield textarea { min-height: 0; overflow: hidden; resize: none; padding: 3px 0; border: 1px solid transparent; background: transparent; border-radius: 5px; font-size: 13px; line-height: 1.8; margin-top: 4px; display: block; }
.readfield textarea:focus { outline: none; background: transparent; border-bottom-color: var(--pink); }
.readfield.title textarea { font-size: 19px; font-weight: 400; line-height: 1.6; letter-spacing: .2px; }
.readfield.summary { background: transparent; border-radius: 0; border-left: 2px solid var(--pink); padding: 0 0 0 12px; }
.readfield.summary textarea { font-size: 12px; line-height: 1.8; color: var(--ink); }
.wordcount { font-size: 10px; }
.draft-props { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; padding: 0; }
.prop-label { font-size: 11px; color: var(--muted); }
.prop > select { width: 100%; }
.topic-picks { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.topic-pick { display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.topic-select { min-width: 8.5em; max-width: 100%; font-size: 12px; background-color: transparent; border-color: var(--line); min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
.remove-topic { padding: 4px 8px; min-width: 36px; color: var(--muted); }
.add-topic { font-size: 11px; color: var(--focus); }
label.milestone { font-size: 11px; gap: 6px; line-height: 1.6; }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 16px 0; }
.actions .primary { margin-left: auto; }
.approval-area { display: grid; justify-items: end; gap: 5px; margin-left: auto; }
.approval-note { color: var(--focus); font-size: 12px; }
.approval-buttons { display: flex; gap: 8px; }
/* Each card owns its actions; the whole page scrolls as one document. */
.reader .actions { position: static; background: transparent; margin: 0 calc(-1 * var(--reader-pad)); padding: 12px 18px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }
.reload-draft { font-size: 13px; color: var(--focus); text-decoration: underline; }
.rejected-link { margin: 8px auto 0; font-size: 12px; color: var(--muted); }
.subhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; }
.subhead h2 { font-size: 15px; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 12px; }
.pagination button { font-size: 12px; padding: 8px 10px; }
/* Memory: compact rows share the page surface; only an open row has a pink rail. */
.topic-strip { display: flex; gap: 22px; overflow-x: auto; padding: 0; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.topic-strip::-webkit-scrollbar { display: none; }
#card-filters .topic-pill { flex-shrink: 0; display: flex; align-items: center; gap: 4px; font-size: 12px; min-height: 38px; border: 0; border-bottom: 2px solid transparent; background: transparent; border-radius: 0; padding: 7px 0; }
.topic-pill span { font-size: 10px; opacity: .7; }
#card-filters .topic-pill.active { color: var(--focus); border-bottom-color: var(--pink); font-weight: 500; }
.card-search { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 0; border-bottom: 1px solid var(--line); }
.search-input { position: relative; min-width: 0; }
.search-input > .icon { position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.search-input input { padding: 8px 8px 8px 27px; min-height: 44px; border: 0; border-radius: 0; background: transparent; }
#toggle-filters { display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 10px; border: 0; border-radius: 0; background: transparent; color: var(--muted); }
#toggle-filters .icon { width: 17px; height: 17px; }
#toggle-filters[aria-expanded="true"] { color: var(--focus); }
.filter-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 16px 0 4px; }
.filter-panel > label { min-width: 0; }
.filter-panel select { width: 100%; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0; }
.filter-chips:empty { display: none; }
.filter-chip { display: flex; align-items: center; gap: 8px; padding: 6px 10px; min-height: 36px; font-size: 12px; background: var(--rose); color: var(--focus); border: 0; }
#cards-result { display: grid; gap: 0; }
.cardrow { position: relative; min-width: 0; padding: 0; border-bottom: 1px solid var(--line); scroll-margin-top: 16px; }
.cardrow[open] { padding-left: 14px; }
.cardrow[open]::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px; background: var(--pink); }
.cardrow > summary { display: grid; grid-template-columns: minmax(0, 1fr) 16px; column-gap: 6px; row-gap: 3px; padding: 14px 0 12px; list-style: none; cursor: pointer; }
.cardrow > summary::-webkit-details-marker { display: none; }
.carddate { flex-shrink: 0; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cardrow > summary > p { grid-column: 1 / -1; min-width: 0; }
.cardrow > summary::after { content: ''; grid-column: 2; grid-row: 1; justify-self: center; align-self: center; width: 5px; height: 5px; border: solid var(--muted); border-width: 0 1px 1px 0; transform: rotate(45deg); }
.cardrow[open] > summary::after { transform: rotate(225deg); }
.cardrow h2 { flex: 1; min-width: 0; font-size: 14px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.cardrow p.muted { font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.cardrow[open] > summary { padding-bottom: 12px; }
.cardbody { padding: 0 0 14px; overflow-wrap: anywhere; }
.cardbody > p { white-space: pre-wrap; line-height: 1.85; font-size: 13px; }
.cardbody > p.meta { font-size: 11px; color: var(--focus); margin-top: 14px; }
.tag { display: inline-block; margin-left: 6px; padding: 2px 7px; vertical-align: middle; background: var(--rose); color: var(--focus); font-size: 10px; line-height: 1.5; border-radius: 6px; font-weight: 500; }
/* Dates retain native pickers while exposing an empty-value hint on iOS. */
.date-control { display: block; position: relative; margin-top: 6px; width: 100%; min-width: 0; }
.date-control input { appearance: none; -webkit-appearance: none; box-sizing: border-box; display: block; width: 100%; inline-size: 100%; min-width: 0; min-inline-size: 0; min-height: 46px; }
.date-control input::-webkit-date-and-time-value { min-height: 1.5em; text-align: left; }
.date-control:not(.has-value) input { color: transparent; }
.date-control:not(.has-value) input:focus { color: var(--ink); }
.date-placeholder { position: absolute; top: 12px; left: 12px; font-size: 13px; color: var(--muted); pointer-events: none; }
.date-control.has-value .date-placeholder, .date-control:focus-within .date-placeholder { display: none; }
/* Settings sections keep compact controls without nested cards. */
.settings-index { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; }
.settings-index button { flex-shrink: 0; white-space: nowrap; background: transparent; border-color: transparent; font-size: 13px; color: var(--focus); padding: 8px; }
.settings-section { padding: 24px; margin-bottom: 16px; scroll-margin-top: 16px; }
.settings-section > h2 { font-size: 16px; font-weight: 500; }
.settings-section > .muted { margin: 5px 0 20px; max-width: 620px; line-height: 1.75; }
.settings-section form { display: grid; gap: 16px; }
.settings-section .actions { padding: 0; }
.together-row { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.together-row > label { flex: 1 1 150px; max-width: 300px; }
.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.person { display: grid; gap: 12px; }
.person h2, .person h3 { font-size: 14px; }
dialog { max-width: 460px; width: calc(100% - 32px); border: 1px solid var(--line); border-radius: 16px; padding: 24px; color: var(--ink); background: var(--card); box-shadow: 0 16px 80px rgba(70, 66, 64, .12); }
dialog::backdrop { background: rgba(70, 66, 64, .33); backdrop-filter: blur(3px); }
dialog p { margin-top: 12px; }
.dialog-actions { display: flex; justify-content: end; gap: 10px; margin-top: 22px; }
#relogin form { display: grid; gap: 16px; }
.login { width: calc(100% - 32px); max-width: 400px; margin: 12vh auto 40px; padding: 32px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.login .brand { color: var(--ink); margin-bottom: 28px; font-size: 25px; }
.login h1 { font-size: 23px; margin-bottom: 8px; }
.login > p { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.login form { display: grid; gap: 18px; }
.login form > .muted { font-size: 11px; text-align: center; }
#notice { position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); z-index: 20; background: var(--ink); color: var(--card); padding: 12px 18px; border-radius: 14px; box-shadow: 0 4px 22px rgba(70, 66, 64, .12); font-size: 13px; pointer-events: none; }
#notice:empty { display: none; }
.settings-session { display: flex; justify-content: end; padding: 10px 0; }
.space-settings select { width: 100%; max-width: 320px; }
.review-stack { max-width: 760px; }
.draft-position { color: var(--focus); font-size: 11px; white-space: nowrap; }
.review-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.review-navigation button { font-size: 12px; }
.cardheading { grid-column: 1; display: flex; align-items: baseline; gap: 10px; min-width: 0; }
/* The backdrop and paper surfaces are sampled from the approved reference. */
.brand-mark svg { width: 34px; height: 36px; }
.shell[data-current-page="overview"] .brand { font-weight: 600; }
.tagline { font-size: 11px; color: var(--muted); letter-spacing: .5px; white-space: nowrap; }
.pagehead { padding: 22px 0 19px; }
.eyebrow { color: var(--muted); font-size: 9px; letter-spacing: 2.3px; margin-bottom: 7px; line-height: 1.5; }
.heading-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page-description { color: var(--muted); font-size: 12px; margin-top: 6px; }
.shell[data-current-page="overview"] h1 { font-weight: 600; letter-spacing: 1px; }
.hero-intro { font-size: 14px; color: var(--ink); }
.headline span { font-size: 13px; }
.callout .primary { flex-shrink: 0; font-size: 11px; min-height: 32px; padding: 5px 10px; }
.draft-head::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); height: calc(100% - 16px); max-height: 38px; width: 4px; border-radius: 0 2px 2px 0; background: var(--pink); }
.draft-props > .prop:first-child { grid-column: 1 / -1; }
.draft-props select { font-size: 12px; }
.review-footnote { flex-basis: 100%; font-size: 10px; color: var(--muted); }
.readfield.summary .fieldcaption { color: var(--pink); }
@media (max-width: 960px) and (min-width: 701px) {
  .shell { padding: 0 24px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding: 16px 0 0; }
  .topbar nav { order: 3; width: 100%; justify-content: center; }
}
@media (max-width: 700px) {
  :root { --nav-height: 64px; }
  html { scroll-padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 18px); }
  input, select, textarea, label > input, label > textarea, label > select, .date-control input { font-size: 16px; }
  .shell { padding: 0 16px calc(var(--nav-height) + var(--safe-bottom)); }
  .topbar { min-height: 56px; gap: 8px; }
  .topbar nav { position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; margin: 0; height: calc(var(--nav-height) + var(--safe-bottom)); padding: 6px max(12px, env(safe-area-inset-right, 0px)) calc(6px + var(--safe-bottom)) max(12px, env(safe-area-inset-left, 0px)); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; background: var(--paper); border-top: 1px solid var(--line); }
  .topbar nav a { display: flex; flex-direction: column; gap: 3px; padding: 5px 0; border-radius: 8px; font-size: 10px; line-height: 1.25; }
  .topbar nav a .icon { width: 20px; height: 20px; }
  .topbar nav .badge { position: absolute; top: 3px; left: calc(50% + 5px); border: 1.5px solid var(--paper); width: 8px; height: 8px; }
  footer { padding: 18px 8px 24px; font-size: 10px; line-height: 1.8; }
  .panelhead .meta { font-size: 10px; }
  .bars-card { padding: 10px 16px; }
  .barrow { grid-template-columns: 6em minmax(0, 1fr) 2em; gap: 10px; }
  .draft-head .meta { font-size: 11px; }
  .approval-buttons { gap: 6px; }
  .approval-note { font-size: 11px; }
  #notice { bottom: calc(var(--nav-height) + var(--safe-bottom) + 16px); }
  .settings-section { padding: 20px 18px; }
  .people { grid-template-columns: 1fr; gap: 24px; }
  .together-row > label { max-width: none; }
  .login { margin-top: 7vh; padding: 28px 24px; }
  .brand { font-size: 25px; gap: 7px; }
  .tagline { font-size: 9px; letter-spacing: .3px; margin-left: auto; }
  .pagehead { padding: 16px 0 15px; }
  .eyebrow { font-size: 8px; }
  .page-description { font-size: 11px; }
  .hero { padding: 14px 16px; }
  .hero-intro { font-size: 13px; }
  .headline { margin: 3px 0 6px; }
  .headline strong { font-size: 34px; }
  .stats { gap: 10px; margin: 12px 0; }
  .stat { padding: 11px 4px; gap: 5px; }
  .stat strong { font-size: 27px; }
  .stat span { font-size: 11px; }
  .callout { font-size: 12px; padding: 6px 12px; }
  .panel { margin-top: 20px; }
  .draft-card { --reader-pad: 18px; }
  .readfield.body textarea { font-size: 13px; }
  .readfield.summary textarea { font-size: 12px; }
  .draft-props > .prop select { font-size: 12px; }
  .draft-props > .prop { font-size: 10px; }
  .draft-props { gap: 10px; }
  .topic-select { min-width: 8em; }
  .reader .actions button { font-size: 12px; padding-inline: 12px; }
  .review-footnote { font-size: 9px; }
  /* Reading stays compact; focused controls use 16px to avoid iPhone zoom. */
  .readfield.body textarea:focus, .readfield.summary textarea:focus,
  .draft-props > .prop select:focus { font-size: 16px; }

}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
/* Credentials stay within the existing compact settings sections. */
.key-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
#space-key { width: 100%; min-width: 0; font-family: monospace; font-size: 13px; }
.persona-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
#persona-text { min-height: 230px; }
.conversation-note { font-size: 11px; margin-bottom: 16px; }
.conversation-turn { border-bottom: 1px solid var(--line); padding: 8px 0 14px; }
.conversation-message { padding: 10px 0; }
.conversation-message.assistant { padding-left: 12px; border-left: 2px solid var(--line); }
.conversation-heading { display: flex; align-items: baseline; gap: 12px; margin-bottom: 6px; font-size: 11px; color: var(--muted); }
.conversation-heading > span:first-child { color: var(--ink); font-weight: 500; }
.conversation-body, .recalled-card > p { white-space: pre-wrap; overflow-wrap: anywhere; }
.conversation-state { color: var(--error); font-size: 11px; }
.conversation-recall { margin-top: 8px; font-size: 11px; }
.conversation-recall > summary { color: #985860; cursor: pointer; width: fit-content; }
.recall-detail { padding: 10px 0; }
.recalled-card { border-top: 1px solid var(--line); padding: 10px 0; margin-top: 8px; }
.recalled-card h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 12px; font-weight: 500; }
.recalled-card > p { margin-top: 6px; font-size: 12px; }
.receipt-label { color: var(--muted); font-size: 10px; font-weight: 400; white-space: nowrap; }
.recall-overview { font-size: 11px; margin-top: 20px; }

#summary-library { margin: 14px 0; border-block: 1px solid var(--line); padding: 10px 0; }
#summary-library > summary, .round-summaries > summary, .saved-summary > summary { cursor: pointer; color: #985860; font-size: 12px; }
.saved-summary { border-bottom: 1px solid var(--line); padding: 9px 0; }
.summary-detail { padding: 8px 0; }
.summary-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-bottom: 8px; }
.summary-coverage { list-style: none; padding: 0; margin: 8px 0; font-size: 11px; }
.summary-coverage li { display: flex; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); }
.summary-coverage time { flex-shrink: 0; color: var(--muted); }
.summary-coverage span { overflow-wrap: anywhere; }
.round-summaries { margin-block: 8px; }
.history-omitted { margin-bottom: 8px; }

.collection-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.collection-tabs button { border: 0; border-radius: 0; padding: 8px 0; background: transparent; font-size: 13px; color: var(--muted); }
.collection-tabs button[aria-selected="true"] { color: #98565e; border-bottom: 2px solid var(--pink); }
.diary-note { margin-bottom: 14px; font-size: 12px; }
.diary-row { border-bottom: 1px solid var(--line); }
.diary-summary { display: flex; justify-content: space-between; gap: 12px; width: 100%; border: 0; border-radius: 0; padding: 13px 0; background: transparent; text-align: left; font-size: 13px; }
.diary-row.open .diary-reader { border-left: 2px solid var(--pink); padding: 0 0 12px 12px; }
.diary-reader h3 { font-size: 14px; margin: 0 0 8px; }
.diary-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.diary-edited { font-size: 10px; color: var(--muted); }
.diary-actions { display: flex; justify-content: flex-end; gap: 14px; margin-top: 10px; }
.diary-actions button { color: #98565e; font-size: 12px; }
.diary-form textarea { min-height: 180px; }

.card-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 12px; }
.card-actions button { flex: none; width: auto; font-size: 12px; }
.card-editor { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.card-editor .readfield.title textarea { font-size: 14px; }
.card-editor .readfield.title textarea:focus { font-size: 16px; }
.card-editor .card-edit-note { margin: 12px 0; font-size: 11px; }
.card-error:empty { display: none; }

.conversation-entry { display: flex; align-items: center; min-height: 44px; gap: 8px; padding: 10px 0; margin: 12px 0 16px; border-bottom: 1px solid var(--line); color: var(--focus); font-size: 12px; text-decoration: none; }
.conversation-entry .icon { width: 17px; height: 17px; flex: none; }
.conversation-entry .entry-arrow { margin-left: auto; }

.approval-schedule { font-size: 12px; margin: 8px 0 12px; line-height: 1.7; }
#auto-approval-form .check { font-size: 13px; line-height: 1.7; }

.archive-guard { margin: 8px 0 12px; font-size: 12px; line-height: 1.7; }

.summary-sources { margin: 1rem 0; padding: .8rem 0; border-top: 1px solid var(--line); }
.summary-sources summary { cursor: pointer; line-height: 1.7; }
.summary-sources article { padding: .8rem 0; }
.summary-sources h3 { font-size: 1rem; }
.summary-draft h2 { line-height: 1.6; overflow-wrap: anywhere; }

/* Memos keep a readable notebook rhythm; row controls stay close to the text. */
.memos-page { max-width: 900px; }
.memo-core, .memo-recent, .memo-pending, .memo-tidy { margin-bottom: 32px; }
.memo-core .panelhead, .memo-recent > .panelhead, .memo-pending > .panelhead { margin: 0 0 6px; }
.memo-core > .muted, .memo-recent > .muted, .memo-pending > .muted { margin-bottom: 12px; }
.memo-core textarea { background: var(--card); min-height: 152px; }
.memo-save { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.memo-save .muted, .memo-toolbar .muted { font-size: 12px; }
.memo-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.memo-limit, #adoption-notice { color: #99565e; background: var(--rose); padding: 10px 14px; border-radius: 6px; margin-bottom: 12px; }
#adoption-notice { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.memo-section { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 15px; }
.memo-section > .panelhead { margin: 0 0 4px; }
.memo-section h3 { font-size: 14px; font-weight: 500; letter-spacing: .5px; }
.memo-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 16px; border-bottom: 1px solid var(--line); padding: 12px 0; }
.memo-text, .pending-bookmark p, .tidy-compare p, .tidy-unchanged p { white-space: pre-wrap; overflow-wrap: anywhere; }
.memo-text { padding: 5px 0; }
.memo-row-actions { display: flex; gap: 0; align-items: center; justify-content: flex-end; }
.memo-row-actions button { font-size: 12px; min-height: 36px; padding: 6px 8px; }
.star-note { color: var(--muted); opacity: .65; }
.star-note[aria-pressed="true"] { color: #99565e; opacity: 1; }
.memo-changed { background: var(--rose); padding-inline: 10px; border-radius: 5px; }
.memo-row .tidy-question { grid-column: 1 / -1; }
.memo-empty { padding: 14px 0; }
.memo-line-editor { padding: 12px 0; }
.memo-line-editor textarea { background: var(--card); }
.pending-bookmark { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.pending-bookmark > div { min-width: 0; }
.pending-bookmark > button { flex-shrink: 0; font-size: 12px; }
.memo-tidy { border-top: 1px solid var(--line); padding-top: 24px; scroll-margin-top: 20px; }
.tidy-total { margin: 16px 0; font-size: 18px; }
.tidy-total strong { color: #99565e; font-weight: 500; }
.tidy-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); margin: 16px 0; }
.tidy-tabs button { background: transparent; border: 0; border-bottom: 2px solid transparent; border-radius: 0; padding: 8px 4px; min-width: 0; }
.tidy-tabs button[aria-selected="true"] { border-bottom-color: var(--pink); color: #99565e; }
.tidy-tabs small { display: block; font-size: 10px; color: var(--muted); white-space: normal; }
.tidy-change { padding: 14px 0; border-bottom: 1px solid var(--line); }
.tidy-change .check { align-items: start; font-size: 13px; }
.tidy-change small { color: var(--muted); font-size: 11px; }
.tidy-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding: 12px 0; }
.tidy-compare > div { min-width: 0; }
.tidy-compare > div:last-child { border-left: 2px solid var(--pink); padding-left: 14px; }
.tidy-compare p + p { margin-top: 8px; }
.tidy-question { font-size: 12px; color: #99565e; margin-top: 8px; }
.tidy-question strong { font-weight: 500; }
.tidy-unchanged { margin: 16px 0; }
.tidy-unchanged summary { cursor: pointer; color: var(--muted); }
.tidy-unchanged article { margin: 12px 0; }
.tidy-selection { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin: 16px 0; }
.tidy-selection > .primary { margin-left: auto; }
.tidy-selection > span { margin-right: 8px; color: var(--muted); font-size: 12px; }
.tidy-note { margin-top: 12px; }
.mcp-field { display: flex; align-items: end; gap: 8px; margin: 12px 0; }
.mcp-field > label { flex: 1; min-width: 0; }
.mcp-field input { font-family: ui-monospace, monospace; font-size: 13px; }
.mcp-field > button { flex-shrink: 0; }
.mcp-instructions { margin-top: 20px; }
.mcp-instructions h3 { font-weight: 500; margin-bottom: 6px; }
.mcp-instructions p + p { margin-top: 6px; }
@media (max-width: 700px) {
  .memo-row { grid-template-columns: 1fr; gap: 0; padding: 10px 0 4px; }
  .memo-row-actions { justify-content: flex-end; }
  .memo-row-actions button { min-height: 40px; padding-inline: 12px; }
  .memo-save > .primary { margin-left: auto; }
  .tidy-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 8px; }
  .tidy-tabs small { font-size: 11px; }
  .tidy-compare { grid-template-columns: 1fr; gap: 12px; }
  .tidy-selection > .primary { width: 100%; margin-top: 8px; }
  .mcp-field input { font-size: 16px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
