:root {
  color-scheme: light;
  --paper: #f7f8fc;
  --white: #fff;
  --ink: #1d2334;
  --muted: #616b7d;
  --subtle: #737d90;
  --edge: #e3e7ef;
  --quiet: #f2f4f9;
  --accent: #5544af;
  --accent-dark: #453597;
  --accent-soft: #eeebfa;
  --green: #277651;
  --danger: #a43746;
  --serif: "STSong", "Songti SC", "SimSun", Georgia, serif;
  --sans: "Geist", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  font: 16px/1.55 var(--sans);
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: var(--accent-dark); }
button:disabled { cursor: default; opacity: .5; }
:focus-visible { outline: 2px solid #7560df; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 1rem; font-weight: 700; }
h3 { font-size: 1rem; font-weight: 650; }
small { font-size: .8125rem; }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; z-index: 5; display: flex; flex-direction: column; padding: 24px 16px 16px; background: #fdfdff; border-right: 1px solid var(--edge); overflow: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; margin-bottom: 28px; }
.brand-logo { width: 39px; height: 39px; position: relative; flex: none; border-radius: 11px; background: #25233c; color: #f2eefa; display: grid; place-items: center; font: bold 24px/1 var(--serif); }
.brand-name { font-size: 1.125rem; font-weight: 760; letter-spacing: .13em; line-height: 1.3; }
.brand-detail { margin-top: 2px; font-size: .75rem; color: var(--muted); }
.project-button { width: 100%; display: flex; align-items: center; gap: 9px; text-align: left; padding: 8px 10px; border: 1px solid var(--edge); background: var(--white); border-radius: 9px; margin-bottom: 24px; }
.project-button:hover { border-color: #c5bbf2; }
.project-icon { display: grid; place-items: center; width: 29px; height: 31px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-dark); font-family: var(--serif); font-weight: 700; flex: none; }
.project-label { flex: 1; min-width: 0; font-size: .875rem; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-label { margin: 0 9px 6px; font-size: .75rem; letter-spacing: .1em; color: var(--subtle); }
.nav { display: grid; gap: 3px; }
.nav-button { display: flex; align-items: center; gap: 12px; min-height: 43px; width: 100%; border: 0; border-radius: 7px; padding: 7px 11px; background: transparent; text-align: left; color: #515c71; font-size: .875rem; }
.nav-button:hover { background: var(--quiet); color: var(--ink); }
.nav-button[aria-current="page"] { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; }
.nav-count { margin-left: auto; font-size: .75rem; color: var(--muted); }
.sidebar-bottom { margin-top: auto; border-top: 1px solid var(--edge); padding-top: 10px; }
.topbar { position: sticky; top: 0; z-index: 4; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 67px; padding: 12px clamp(20px, 3.2vw, 48px); border-bottom: 1px solid var(--edge); background: rgba(253,253,255,.97); }
.breadcrumb, .top-actions, .button-row, .inline { display: flex; align-items: center; gap: 10px; }
.breadcrumb { font-size: .875rem; white-space: nowrap; color: var(--muted); }
.breadcrumb strong { color: var(--ink); font-weight: 650; }
.crumb-divider { color: #a0a8b9; }
.top-actions { gap: 12px; }
.save-state { color: var(--muted); white-space: nowrap; font-size: .75rem; display: flex; gap: 6px; align-items: center; }
.save-state::before { content: ""; width: 6px; height: 6px; flex: none; border-radius: 50%; background: #438968; }
.save-state[data-error="1"] { color: var(--danger); }
.save-state[data-error="1"]::before { background: var(--danger); }
.btn, .search-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 7px 12px; min-height: 38px; border: 1px solid var(--edge); background: var(--white); color: var(--ink); border-radius: 8px; font-size: .875rem; font-weight: 600; white-space: nowrap; text-decoration: none; }
.btn:hover, .search-button:hover { background: var(--quiet); }
.primary { background: var(--accent); color: var(--white); border-color: var(--accent); }
.primary:hover { background: var(--accent-dark); }
.quiet { background: transparent; border-color: transparent; color: var(--accent-dark); }
.danger { color: var(--danger); }
.search-button { justify-content: flex-start; min-width: 170px; color: var(--muted); font-weight: 500; }
kbd { margin-left: auto; border: 1px solid var(--edge); border-radius: 4px; font: .75rem var(--sans); padding: 1px 4px; color: var(--muted); background: var(--quiet); }
.icon { display: inline-block; flex: none; position: relative; width: 17px; height: 17px; color: currentColor; }
.icon::before, .icon::after { content: ""; position: absolute; }
.icon-home::before { inset: 1px; border: 1.5px solid; border-radius: 3px; background: linear-gradient(currentColor,currentColor) 50% 0/1px 100%,linear-gradient(currentColor,currentColor) 0 50%/100% 1px; background-repeat: no-repeat; }
.icon-note::before, .icon-book::before { inset: 1px 2px; border: 1.5px solid; border-radius: 2px; }
.icon-note::after { inset: 5px 5px 5px; border-top: 1px solid; border-bottom: 1px solid; }
.icon-book::after { left: 6px; top: 1px; bottom: 1px; border-right: 1px solid; }
.icon-person::before { width: 6px; height: 6px; left: 5.5px; top: 1px; border: 1.4px solid; border-radius: 50%; }
.icon-person::after { width: 13px; height: 6px; left: 2px; top: 9px; border: 1.4px solid; border-radius: 8px 8px 3px 3px; }
.icon-graph::before { inset: 2px; background: radial-gradient(circle at 20% 78%,currentColor 2px,transparent 2.6px),radial-gradient(circle at 83% 78%,currentColor 2px,transparent 2.6px),radial-gradient(circle at 50% 19%,currentColor 2px,transparent 2.6px); }
.icon-graph::after { inset: 5px 5px 5px; border-left: 1px solid; border-top: 1px solid; transform: rotate(45deg); }
.icon-track::before { inset: 2px 4px 2px 1px; background: repeating-linear-gradient(to bottom,currentColor 0 1px,transparent 1px 5px); }
.icon-track::after { inset: 1px 2px 1px 8px; border-left: 1px solid; transform: skewX(-23deg); }
.icon-clue::before { inset: 2px 4px 1px; border: 1.5px solid; border-radius: 2px 2px 4px 4px; }
.icon-clue::after { left: 6px; right: 6px; bottom: 5px; height: 1px; background: currentColor; }
.icon-folder::before { inset: 4px 1px 2px; border: 1.5px solid; border-radius: 2px; }
.icon-folder::after { inset: 2px 9px 8px 3px; border-top: 1.5px solid; border-left: 1.5px solid; }
.icon-gear::before { inset: 1px; border: 1.4px solid; border-radius: 6px; transform: rotate(45deg); }
.icon-gear::after { inset: 6px; border: 1.4px solid; border-radius: 50%; }
.icon-search::before { width: 9px; height: 9px; border: 1.5px solid; border-radius: 50%; top: 1px; left: 1px; }
.icon-search::after { width: 6px; height: 1.5px; bottom: 3px; right: 1px; transform: rotate(45deg); background: currentColor; }
.icon-plus::before, .icon-plus::after { background: currentColor; border-radius: 1px; }
.icon-plus::before { left: 3px; right: 3px; top: 8px; height: 1.5px; }
.icon-plus::after { top: 3px; bottom: 3px; left: 8px; width: 1.5px; }
.icon-edit::before { width: 12px; height: 4px; border: 1.3px solid; border-radius: 1px; left: 2px; top: 6px; transform: rotate(-43deg); }
.icon-chevron::before { width: 6px; height: 6px; left: 5px; top: 4px; transform: rotate(45deg); border-bottom: 1.4px solid; border-right: 1.4px solid; }
.mobile-menu { display: none; }
.main { max-width: 1500px; padding: 32px clamp(20px, 3.2vw, 48px) 44px; margin: 0 auto; outline: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 26px; }
.page-head h1 { font-family: var(--serif); font-size: clamp(2rem,3.6vw,3.1rem); letter-spacing: .04em; font-weight: 750; line-height: 1.16; overflow-wrap: anywhere; }
.page-head p { color: var(--muted); margin-top: 9px; font-size: .9375rem; }
.heading-tag { margin-bottom: 10px; display: inline-flex; color: var(--accent-dark); background: var(--accent-soft); border-radius: 5px; padding: 2px 7px; font-size: .75rem; font-weight: 650; letter-spacing: .04em; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1.61fr) minmax(300px, 1fr); gap: 16px; align-items: stretch; }
.panel { min-width: 0; background: var(--white); border: 1px solid var(--edge); border-radius: 13px; box-shadow: 0 1px 2px rgba(36,43,66,.035); overflow: hidden; }
.panel-head { min-height: 61px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 17px; }
.panel-head h2 { display: flex; gap: 8px; align-items: center; }
.panel-head .btn { min-height: 32px; padding: 4px 8px; }
.panel-foot { display: flex; justify-content: space-between; align-items: center; min-height: 43px; gap: 8px; padding: 7px 17px; color: var(--muted); font-size: .8125rem; }
.panel-foot button { font-size: .8125rem; padding: 4px 6px; min-height: 28px; }
.canvas-panel .panel-head { border-bottom: 1px solid var(--edge); }
.canvas-panel .panel-foot { border-top: 1px solid var(--edge); }
.graph-controls { display: flex; gap: 7px; align-items: center; }
.graph-controls select { font-size: .8125rem; padding: 5px 28px 5px 8px; min-height: 32px; }
.graph-view { height: 302px; position: relative; overflow: hidden; background: radial-gradient(#d9deeb 0.75px,transparent .85px) 0 0/16px 16px, #fafbfe; }
.graph-view.expanded { height: clamp(390px, 58dvh, 660px); }
.graph-plane { position: absolute; inset: 0; transform-origin: center; }
.graph-lines, .graph-nodes { position: absolute; inset: 0; width: 100%; height: 100%; }
.graph-lines { pointer-events: none; }
.node, .edge-label { position: absolute; transform: translate(-50%,-50%); }
.node { display: grid; gap: 3px; justify-items: center; width: max-content; max-width: 94px; border: 0; padding: 0 2px 2px; background: none; touch-action: none; color: var(--ink); user-select: none; }
.node:hover .avatar { box-shadow: 0 0 0 3px white,0 0 0 5px #b5a7ee; }
.node .avatar { width: 41px; height: 41px; border: 2px solid #fff; box-shadow: 0 0 0 1px #d3d8e7; font-size: 1rem; }
.node .avatar.central { width: 49px; height: 49px; border-color: #f8f5ff; box-shadow: 0 0 0 2px #9b88e3; }
.node-name { background: #fafbfee8; padding: 0 4px; text-align: center; border-radius: 4px; font-size: .75rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 94px; }
.edge-label { border: 1px solid #e4e7f1; background: #fdfdff; border-radius: 4px; padding: 1px 4px; color: #616b80; white-space: nowrap; font-size: .75rem; line-height: 1.35; z-index: 1; max-width: 115px; overflow: hidden; text-overflow: ellipsis; }
.edge-label:hover { border-color: #b6a8ea; color: var(--accent-dark); }
.zoom-box { position: absolute; z-index: 2; bottom: 12px; left: 12px; display: flex; border: 1px solid var(--edge); border-radius: 7px; background: var(--white); }
.zoom-box button { min-width: 35px; min-height: 33px; background: transparent; border: 0; font-size: .875rem; color: var(--muted); }
.zoom-box button + button { border-left: 1px solid var(--edge); }
.zoom-box button:hover { color: var(--accent-dark); background: var(--quiet); }
.chapter-card { display: flex; flex-direction: column; }
.chapter-card .panel-head { padding-bottom: 8px; }
.chapter-preview { display: flex; flex-direction: column; height: 100%; gap: 13px; padding: 11px 19px 17px; }
.chapter-kicker { color: var(--muted); font-size: .8125rem; }
.chapter-preview h3 { margin-top: 4px; font: 700 1.5rem/1.24 var(--serif); letter-spacing: .035em; }
.excerpt { margin: 0; border-left: 2px solid #c3b5ee; border-radius: 0 7px 7px 0; padding: 12px 13px; background: #f8f7fc; font-family: var(--serif); font-size: .9375rem; line-height: 1.95; color: #3f4558; white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; max-height: 195px; overflow-wrap: anywhere; }
.preview-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 3px; }
.pill { padding: 2px 7px; border-radius: 5px; flex: none; display: inline-block; font-size: .75rem; white-space: nowrap; font-weight: 650; background: var(--quiet); color: #535e73; }
.pill.lilac, .avatar.lilac { background: #ede8fa; color: #5544a2; }
.pill.mint, .avatar.mint { background: #e0f1eb; color: #286c5c; }
.pill.blue, .avatar.blue { background: #e7edfa; color: #405e9c; }
.pill.peach, .avatar.peach { background: #fae9df; color: #9a4f38; }
.pill.rose, .avatar.rose { background: #f6e7ef; color: #964e73; }
.pill.sand, .avatar.sand { background: #f5ecda; color: #775c2e; }
.avatar { display: inline-grid; width: 38px; height: 38px; place-items: center; flex: none; border-radius: 50%; font: 700 1rem var(--serif); }
.dashboard-list { padding: 0 17px 8px; }
.summary-row { display: flex; width: 100%; align-items: center; text-align: left; gap: 10px; background: transparent; border: 0; border-top: 1px solid #edf0f5; padding: 10px 0; min-height: 46px; }
.summary-row:hover .summary-title { color: var(--accent-dark); }
.summary-title { font-size: .875rem; font-weight: 650; overflow-wrap: anywhere; flex: 1; }
.summary-meta { font-size: .75rem; color: var(--muted); text-align: right; }
.muted { color: var(--muted); }
.empty { padding: 29px 19px; color: var(--muted); font-size: .9375rem; text-align: center; }
.graph-view > .empty { position: absolute; inset: 16% 8% auto; }
.list-stack { display: grid; gap: 10px; }
.item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 17px; min-height: 76px; }
.item-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.item h3, .item p { overflow-wrap: anywhere; }
.item p { color: var(--muted); font-size: .875rem; white-space: pre-wrap; margin-top: 3px; }
.item-info { min-width: 0; }
.item-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.person-cards { display: grid; gap: 13px; grid-template-columns: repeat(auto-fit, minmax(min(250px,100%),1fr)); }
.person-card { padding: 16px; display: grid; gap: 11px; align-content: start; }
.person-card p { overflow-wrap: anywhere; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.tabs { background: var(--quiet); padding: 3px; display: inline-flex; flex-wrap: wrap; border: 1px solid var(--edge); border-radius: 8px; gap: 3px; }
.tabs button { padding: 5px 10px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--muted); font-size: .875rem; min-height: 34px; }
.tabs button[aria-pressed="true"] { background: var(--white); border-color: var(--edge); color: var(--accent-dark); font-weight: 650; }
.section-gap { margin-top: 19px; }






.field, .stack-fields { display: grid; gap: 5px; min-width: 0; }
.stack-fields { gap: 13px; }
.field > span { font-size: .875rem; font-weight: 650; }
.field small { color: var(--muted); font-weight: 400; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid #dce1eb; border-radius: 7px; padding: 8px 10px; background-color: var(--white); }
textarea { resize: vertical; min-height: 82px; }
select:not([multiple]) { appearance: none; padding-right: 27px; background: linear-gradient(45deg,transparent 47%,#637087 51%) right 12px center/5px 5px no-repeat,linear-gradient(135deg,#637087 49%,transparent 53%) right 7px center/5px 5px no-repeat,white; }
.columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.check-grid { display: flex; flex-wrap: wrap; gap: 7px 12px; }
.check-grid label { display: flex; gap: 5px; align-items: center; font-size: .875rem; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
.settings-panel { max-width: 800px; padding: 18px; }
.notice { margin-bottom: 14px; padding: 8px 11px; color: var(--danger); border: 1px solid #eecbd2; border-radius: 7px; background: #fdf3f4; font-size: .875rem; }
dialog { border: 1px solid var(--edge); border-radius: 15px; padding: 0; width: min(565px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow: auto; box-shadow: 0 25px 95px #14213b24; color: var(--ink); }
dialog::backdrop { background: #252b4255; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--edge); }
.dialog-head h2 { font-size: 1.125rem; }
.dialog-head button { min-width: 35px; font-size: 1.25rem; padding: 0; }
.dialog-body { padding: 16px 18px 19px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.dialog-body p + p { margin-top: 8px; }
.error-text { color: var(--danger); font-size: .875rem; white-space: pre-wrap; }
.result-list { display: grid; gap: 7px; margin-top: 12px; }
.result-button { display: block; width: 100%; border: 1px solid var(--edge); border-radius: 6px; background: white; text-align: left; padding: 9px; overflow-wrap: anywhere; }
.result-button:hover { background: var(--quiet); }
.result-button small { display: block; color: var(--muted); }
.result-text { white-space: pre-wrap; overflow-wrap: anywhere; padding: 10px; background: var(--quiet); border-radius: 7px; }
.toast { position: fixed; z-index: 10; right: 25px; bottom: 22px; background: #2f2a49; color: white; border-radius: 9px; box-shadow: 0 8px 25px #2f2a492c; display: flex; align-items: center; gap: 12px; padding: 10px 13px; font-size: .875rem; max-width: calc(100% - 50px); }
.toast button { border: 1px solid #8e82bd; color: white; padding: 3px 8px; background: transparent; border-radius: 5px; }
@media (max-width: 1120px) {

  .sidebar { padding-inline: 12px; }
  .topbar, .main { padding-inline: 24px; }
  .dashboard { grid-template-columns: minmax(0,1.38fr) minmax(260px,1fr); }
  .search-button { min-width: 130px; }
  .search-button kbd { display: none; }
}
@media (max-width: 880px) {

  .dashboard { grid-template-columns: minmax(0,1fr); }
  .graph-view { height: 320px; }
  .save-state { display: none; }

}
@media (max-width: 690px) {
  .shell { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 216px; transform: translateX(-100%); transition: transform .15s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax #252b423d; }
  .mobile-menu { display: inline-flex; }
  .topbar, .main { padding-inline: 14px; }
  .topbar { min-height: 57px; padding-block: 8px; }
  .search-button { min-width: 38px; }
  .search-caption, .crumb-divider, .crumb-root { display: none; }
  .page-head { align-items: flex-start; flex-direction: column; }



  .item { flex-wrap: wrap; }
}
@media (pointer: coarse) {
  .nav-button, .btn, .zoom-box button, .tabs button { min-height: 43px; }
  .zoom-box button { min-width: 42px; }
}
.wrap { flex-wrap: wrap; }
.checks { min-width: 0; border: 1px solid var(--edge); border-radius: 8px; padding: 7px 10px 10px; margin: 0; }
.checks legend { font-size: .875rem; font-weight: 650; padding: 0 4px; }
@media (min-width: 691px) and (max-width: 880px) {
  .project-button { gap: 6px; padding-inline: 6px; }
  .project-icon { width: 25px; }
}
/* Writing desk */
#writing-chapter { width: min(255px, 100%); min-width: 0; flex: 0 1 auto; }
.writing-chapter-bar .button-row { flex-wrap: wrap; gap: 5px; }
.writing-manuscript { display: flex; flex-direction: column; min-width: 0; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.writing-chapter-bar, .writing-footer { flex: none; }
.writing-chapter-bar, .writing-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.writing-chapter-bar { border-bottom: 1px solid var(--edge); flex-wrap: wrap; }
.writing-chapter-bar select { font-size: .875rem; min-height: 38px; }
.writing-sheet { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--sheet); }
.writing-title { padding: 30px clamp(18px, 3vw, 42px) 5px; }
.writing-title h1 { font: 700 clamp(1.5rem, 2.4vw, 2.25rem)/1.28 var(--serif); letter-spacing: .04em; overflow-wrap: anywhere; }
.writing-surface { position: relative; flex: 1; min-height: 0; }
.writing-title, .writing-surface { width: 100%; max-width: 830px; margin-inline: auto; }
.writing-type {
  width: 100%; margin: 0; border: 0; padding: 16px clamp(16px, 3vw, 42px) 32px;
  font: 500 1.125rem/1.95 var(--serif); letter-spacing: .018em; tab-size: 4;
  white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; font-variant-ligatures: none;
}
.writing-input {
  display: block; position: relative; height: 100%; min-height: 0;
  resize: none; border-radius: 0; background: transparent; appearance: none;
}
.writing-input:focus-visible { outline: 2px solid #9d90dc; outline-offset: -2px; }
.writing-input::placeholder { color: var(--subtle); }
.writing-mirror { position: absolute; top: 0; left: 0; overflow: hidden; pointer-events: none; color: transparent; }
.writing-mirror mark { background: #e8ddfb; color: transparent; border-radius: 2px; }
.writing-mirror mark.current-mention { background: #d5c4f5; box-shadow: 0 1px #725ab2; }
.writing-footer { border-top: 1px solid var(--edge); flex-wrap: wrap; }
.writing-footer .btn, .writing-rel-bar .btn { padding: 4px 8px; min-height: 31px; }
.mention-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 3px; }
.mention-tools small { color: var(--accent-dark); padding: 0 5px; }
.writing-context .panel-head { min-height: 56px; padding-bottom: 8px; }
.writing-picker { display: grid; gap: 6px; padding: 0 16px 13px; }
.writing-picker .field > span { color: var(--muted); }
.writing-graph { border: 0; border-top: 1px solid var(--edge); border-radius: 0; box-shadow: none; }
.writing-graph .graph-view { height: clamp(225px, 29dvh, 280px); }
.writing-graph .panel-foot { min-height: 36px; padding-inline: 12px; border-bottom: 1px solid var(--edge); }
.writing-graph .node[aria-pressed="true"] .avatar { box-shadow: 0 0 0 2px #765bc3; background: #e8ddfb; color: #4e3691; }
.writing-graph .node[aria-pressed="true"] .node-name { background: #e8ddfb; color: #4e3691; }
.writing-graph .edge-label.muted-edge { color: #686f7e; border-color: #e7e9f0; background: #fafbfe; }
.writing-rel-bar { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 11px 13px 5px; }
.writing-rel-bar h3 { min-width: 0; overflow-wrap: anywhere; }
.writing-rel-list { margin: 0; padding: 0 13px 9px; list-style: none; max-height: 255px; overflow: auto; }
.writing-rel-list li + li { border-top: 1px solid #edf0f5; }
.writing-rel { display: flex; width: 100%; text-align: left; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 5px; border: 0; background: transparent; min-height: 39px; }
.writing-rel:hover { background: var(--quiet); }
.writing-rel strong { font-size: .875rem; overflow-wrap: anywhere; }
.writing-rel small { margin-left: 6px; color: var(--muted); }
.writing-rel .pill { max-width: 42%; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1120px) {
  .writing-chapter-bar, .writing-footer { padding-inline: 11px; }

}
@media (pointer: coarse) {
  .writing-footer .btn, .writing-rel-bar .btn, .writing-rel, .writing-context .panel-head .btn { min-height: 43px; }
}

.profile-card { display: flex; align-items: flex-start; padding: 22px; gap: 17px; max-width: 690px; }
.account-panel { margin-top: 14px; padding: 22px; max-width: 690px; }
.account-panel h2 { margin: 0 0 12px; font-size: 1rem; }
.account-panel p { margin: 0 0 14px; }
.account-panel .row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-avatar { display: grid; place-items: center; flex: none; width: 48px; height: 48px;
  border-radius: 50%; background: var(--quiet); color: var(--accent-dark); font-weight: 700; }
.profile-info { min-width: 0; overflow-wrap: anywhere; }
.profile-info p { margin: 5px 0; white-space: pre-wrap; }
.profile-info small { display: block; margin-top: 5px; }
