/* 墨境 · 姓名、字库与项目工作台。
 * 此文件只对 data-theme="ink" 生效，加载于现有业务样式之后。
 * 常规姓名卡以既有容量变量排版；不改字库字框或统计数字/过场落点几何。
 * 山峦为共享、无滤镜的内联 SVG；没有额外请求或逐卡装饰 DOM。
 */
body[data-theme="ink"] {
  --ink-n-surface: #101b25;
  --ink-n-raised: #15232e;
  --ink-n-deep: #0b141d;
  --ink-n-line: var(--ink-line, rgba(173, 190, 201, .19));
  --ink-n-text: #d6dfe4;
  --ink-n-muted: #a0afb9;
  --ink-n-gold: var(--ink-gold, #d7bb85);
  --ink-n-gold-line: rgba(215, 187, 133, .42);
  --ink-n-gold-soft: rgba(215, 187, 133, .09);
  --ink-n-safe: #92c9b6;
  --ink-n-risk: #e5aa9e;
  --ink-n-landscape: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20480%20200%22%20preserveAspectRatio%3D%22none%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22mist%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%23788d98%22%20stop-opacity%3D%220%22%2F%3E%3Cstop%20offset%3D%22.64%22%20stop-color%3D%22%23788d98%22%20stop-opacity%3D%22.08%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23788d98%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3ClinearGradient%20id%3D%22water%22%20x2%3D%220%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%23607780%22%20stop-opacity%3D%22.12%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%2315232e%22%20stop-opacity%3D%220%22%2F%3E%3C%2FlinearGradient%3E%3C%2Fdefs%3E%3Cpath%20d%3D%22M0%20154C21%20155%2033%20143%2047%20130S64%20108%2076%20116S89%20142%20105%20139S125%20117%20139%20125S156%20149%20175%20149S201%20129%20212%20134S231%20154%20250%20149S275%20110%20291%20119S310%20147%20328%20137S348%2089%20365%20105S383%20145%20400%20138S424%20114%20441%20127S461%20148%20480%20135V200H0Z%22%20fill%3D%22%2350616b%22%20opacity%3D%22.17%22%2F%3E%3Cpath%20d%3D%22M0%20171C21%20166%2035%20148%2051%20150S76%20174%2096%20168S120%20146%20137%20152S161%20172%20183%20171S208%20151%20227%20155S250%20175%20274%20166S297%20138%20314%20148S340%20178%20360%20164S380%20136%20396%20149S418%20175%20439%20168S462%20149%20480%20157V200H0Z%22%20fill%3D%22%23314852%22%20opacity%3D%22.37%22%2F%3E%3Cpath%20d%3D%22M0%20180C72%20166%20106%20177%20158%20178S249%20166%20299%20178S403%20183%20480%20171V200H0Z%22%20fill%3D%22url%28%23water%29%22%2F%3E%3Crect%20y%3D%22138%22%20width%3D%22480%22%20height%3D%2252%22%20fill%3D%22url%28%23mist%29%22%2F%3E%3Cpath%20d%3D%22M0%20194C15%20191%2027%20171%2039%20177S58%20199%2081%20198L121%20200H0ZM351%20200C375%20195%20384%20179%20395%20181S417%20190%20430%20186S459%20182%20480%20178V200Z%22%20fill%3D%22%2309131b%22%20opacity%3D%22.55%22%2F%3E%3Cpath%20d%3D%22M123%20185C157%20182%20174%20187%20208%20184M237%20192C264%20189%20282%20193%20310%20190M325%20184C344%20182%20362%20184%20380%20182%22%20fill%3D%22none%22%20stroke%3D%22%238b9aa2%22%20stroke-width%3D%22.5%22%20opacity%3D%22.13%22%2F%3E%3C%2Fsvg%3E");
}

/* The existing screen/workbench sizing remains the source of truth. */
body[data-theme="ink"] :is(.names-screen, .review-screen, .filter-workbench-screen,
  .saved-page, .library-hub-screen, .project-info-screen, .customer-workbench) {
  min-width: 0;
  color: var(--ink-n-text);
}

body[data-theme="ink"] :is(.names-control-panel, .names-char-sidebar,
  .names-result-panel, .review-tools, .review-preview-panel, .filter-one-screen,
  .saved-workbench-panel, .maintenance-control-panel, .maintenance-results-panel,
  .maintenance-side-panel, .customer-list-panel) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-surface);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .13);
}

/* Names: a quiet library rail, warm selection, and landscape-backed cards. */
body[data-theme="ink"] .names-screen .name-combination-mode {
  min-width: 0;
  max-width: 100%;
  border-color: var(--ink-n-line);
  background: var(--ink-n-deep);
  scrollbar-color: #495563 transparent;
}

body[data-theme="ink"] .names-screen :is(.name-combination-mode, .name-combination-tabs) > button {
  flex-shrink: 0;
  border-color: transparent;
  background: transparent;
  color: var(--ink-n-muted);
  box-shadow: none;
}

body[data-theme="ink"] .names-screen :is(.name-combination-mode, .name-combination-tabs) > button.active {
  border-color: var(--ink-n-gold-line);
  background: var(--ink-n-gold-soft);
  color: var(--ink-n-gold);
  box-shadow: inset 0 -2px 0 var(--ink-n-gold);
}

body[data-theme="ink"] .names-screen .name-combination-mode > span {
  color: var(--ink-n-muted);
}

body[data-theme="ink"] .names-screen :is(.names-control-section,
  .name-char-picker-head, .name-char-foot, .name-char-position-legend,
  .name-partner-pinyin-filter, .names-result-meta) {
  border-color: var(--ink-n-line);
}
body[data-theme="ink"] .names-screen .names-control-panel .names-control-section {
  background: var(--ink-n-deep);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .names-screen .names-control-panel .names-danger-section {
  border-left-color: #976e63;
  background: #241f24;
}
body[data-theme="ink"] .names-screen .names-danger-section summary::after {
  color: var(--ink-n-safe);
}

body[data-theme="ink"] .names-screen .names-char-sidebar .name-char-picker {
  border-color: var(--ink-n-line);
  background: var(--ink-n-deep);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .names-screen .name-char-pinyin-nav button:not(.active) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-muted);
}
body[data-theme="ink"] .names-screen .name-char-pinyin-nav button:disabled {
  background: #131d25;
  color: #71808a;
}
body[data-theme="ink"] .name-pool-identity:is(.regular, .warning, .strict) {
  border-color: var(--ink-n-gold-line);
  border-left-color: var(--ink-n-gold);
  background: #1b252c;
  box-shadow: none;
}
body[data-theme="ink"] .name-pool-identity:is(.regular, .warning, .strict) strong,
body[data-theme="ink"] .name-pool-identity > p b { color: var(--ink-n-gold); }
body[data-theme="ink"] .name-pool-identity :is(small, span) { color: var(--ink-n-muted); }

body[data-theme="ink"] .names-screen :is(.names-control-title strong,
  .name-char-picker-title strong, .name-char-picker h3,
  .high-quality-name-summary h3, .strict-name-workbench-filter-label) {
  color: var(--ink-n-text);
}

body[data-theme="ink"] .names-screen :is(.names-control-title span,
  .name-char-picker-title span, .name-char-foot, .name-char-pinyin,
  .name-char-position-legend, .name-search-meta, .template-name-reason) {
  color: var(--ink-n-muted);
}

body[data-theme="ink"] .names-screen :is(.name-char-tile,
  .high-quality-name-summary > button, .name-pinyin-match-panel,
  .template-mode-note, .name-search-info, .name-stats > div) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
  box-shadow: none;
}

body[data-theme="ink"] .names-screen :is(.name-char-tile:hover,
  .high-quality-name-summary > button:hover) {
  border-color: var(--ink-n-gold-line);
  background: #1d2d36;
}

body[data-theme="ink"] .names-screen :is(.name-char-grid button.name-char-tile.active,
  .high-quality-name-summary > button.active) {
  border-color: var(--ink-n-gold);
  background: #2b2c28;
  color: #f0dab1;
  box-shadow: inset 0 0 0 1px var(--ink-n-gold-line);
  animation: none;
}

body[data-theme="ink"] .names-screen :is(.name-char-tile.active .name-char-pinyin,
  .name-char-tile.active .name-char-position) { color: #e3ccaa; }

body[data-theme="ink"] .names-screen :is(.name-char-sort, .name-char-pinyin-nav,
  .template-recommendation-tabs, .action-image-mode-switch) button.active {
  border-color: var(--ink-n-gold-line);
  background: var(--ink-n-gold-soft);
  color: var(--ink-n-gold);
}

/* Only paint: do not alter these numbers' font metrics or transforms. */
body[data-theme="ink"] .names-screen :is(.name-stats strong,
  .strict-name-workbench-count strong b) { color: var(--ink-n-gold); }
body[data-theme="ink"] .names-screen .name-stats span { color: var(--ink-n-muted); }

body[data-theme="ink"] .names-screen .quick-name-item {
  border-color: var(--ink-n-line);
  background-color: var(--ink-n-raised);
  background-image: linear-gradient(180deg, rgba(16, 27, 37, .08), rgba(16, 27, 37, .2)), var(--ink-n-landscape);
  background-repeat: no-repeat;
  background-position: center, center bottom;
  background-size: cover, 100% 100%;
  box-shadow: inset 0 1px 0 rgba(222, 232, 238, .025);
}

body[data-theme="ink"] .names-screen .quick-name-item:hover {
  border-color: var(--ink-n-gold-line);
  box-shadow: inset 0 0 0 1px rgba(215, 187, 133, .1);
}

body[data-theme="ink"] .names-screen .quick-name-item.favorite {
  border-color: #a48b5d;
  background-color: #282921;
}

body[data-theme="ink"] .names-screen .quick-name-item.candidate {
  border-color: #4a8275;
  background-color: #132c2b;
}

body[data-theme="ink"] .names-screen .quick-name-item.risk {
  border-color: #976e63;
  background-color: #302324;
}

body[data-theme="ink"] .names-screen .name-text {
  color: #e7e8e2;
  text-shadow: 0 1px 7px rgba(0, 0, 0, .3);
}

body[data-theme="ink"] .names-screen .name-text.favorite { color: #ead3a5; }
body[data-theme="ink"] .names-screen .name-text.candidate { color: #addac7; }
body[data-theme="ink"] .names-screen .name-text.meaning-enabled:hover {
  color: #f1dbaf;
  text-decoration-color: var(--ink-n-gold-line);
}

body[data-theme="ink"] .names-screen .quick-name-actions {
  border-color: var(--ink-n-gold-line);
  background: #15232e;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .42);
}

body[data-theme="ink"] .names-screen :is(.strict-name-workbench-topline,
  .strict-name-workbench-toolbar, .strict-name-card-actions,
  .strict-name-workbench-filter-popover, .strict-name-workbench-more-popover,
  .strict-name-workbench-letter-popover, .strict-name-workbench-letter-float > summary) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-surface);
  color: var(--ink-n-text);
}

body[data-theme="ink"] .names-screen :is(.strict-name-workbench-route,
  .strict-name-workbench-active-filters b, .strict-name-proof-tags span,
  .strict-name-workbench-type) {
  border-color: var(--ink-n-gold-line);
  background: var(--ink-n-gold-soft);
  color: var(--ink-n-gold);
}

body[data-theme="ink"] .names-screen .strict-name-proof-summary small {
  color: var(--ink-n-muted);
}
body[data-theme="ink"] .names-screen .strict-name-proof-summary small b {
  color: var(--ink-n-text);
}

/* Current measured workbenches: scope matches the candidate's v2 renderers. */
body[data-theme="ink"] .names-screen .names-result-panel.regular-name-display {
  --regular-name-min-width: 170px;
  --regular-name-row-height: 96px;
  --regular-name-column-gap: 9px;
  --regular-name-row-gap: 9px;
}
body[data-theme="ink"] .names-screen .names-result-panel.regular-name-display .screen-list-area {
  overflow: auto;
  overscroll-behavior: contain;
}
body[data-theme="ink"] .names-screen .regular-name-display .quick-name-main {
  align-items: flex-start;
  padding: 18px 6px 6px;
}
body[data-theme="ink"] .names-screen .regular-name-display .name-text {
  font-family: var(--ink-font-display, "Songti SC", "STSong", "SimSun", serif);
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: .05em;
}
body[data-theme="ink"] .names-screen .regular-name-display .quick-name-item.normal:not(.risk),
body[data-theme="ink"] .names-screen .regular-name-display .quick-name-item.normal:not(.risk):hover,
body[data-theme="ink"] .names-screen .regular-name-display .quick-name-item.normal:not(.risk):focus-within,
body[data-theme="ink"] .names-screen:is(.pronunciation-workbench-v2, .high-quality-workbench-v2, .action-image-workbench-v2)
  .names-result-panel :is(.pronunciation-name-card, .high-quality-name-card, .action-image-name-card),
body[data-theme="ink"] .guided-names-screen .guided-name-card {
  border-color: var(--ink-n-line);
  background: var(--ink-n-landscape) center bottom / 100% 100% no-repeat, linear-gradient(180deg, #172631, #101b25);
  box-shadow: inset 0 1px 0 rgba(222, 232, 238, .025);
}
body[data-theme="ink"] .names-screen .regular-name-display .name-text.normal,
body[data-theme="ink"] .names-screen:is(.pronunciation-workbench-v2, .high-quality-workbench-v2, .action-image-workbench-v2)
  :is(.pronunciation-name-card, .high-quality-name-card, .action-image-name-card) .name-text,
body[data-theme="ink"] .guided-names-screen .guided-names-results .guided-name-card .guided-name-card-name {
  color: #e7e8e2;
}
body[data-theme="ink"] .names-screen .regular-name-display .quick-name-item:nth-child(3n + 2) {
  background-size: 142% 100%, cover;
  background-position: left bottom, center;
}
body[data-theme="ink"] .names-screen .regular-name-display .quick-name-item:nth-child(3n) {
  background-size: 135% 100%, cover;
  background-position: right bottom, center;
}
body[data-theme="ink"] .names-screen:is(.pronunciation-workbench-v2, .high-quality-workbench-v2, .action-image-workbench-v2)
  .names-result-panel :is(.pronunciation-name-card, .high-quality-name-card, .action-image-name-card).favorite {
  border-color: #a48b5d;
  background-color: #282921;
}
body[data-theme="ink"] .names-screen:is(.pronunciation-workbench-v2, .high-quality-workbench-v2, .action-image-workbench-v2)
  .names-result-panel :is(.pronunciation-name-card, .high-quality-name-card, .action-image-name-card).candidate {
  border-color: #4a8275;
  background-color: #132c2b;
}
body[data-theme="ink"] .names-screen:is(.pronunciation-workbench-v2, .high-quality-workbench-v2, .action-image-workbench-v2)
  .names-result-panel :is(.pronunciation-name-card, .high-quality-name-card, .action-image-name-card).risk {
  border-color: #976e63;
}
body[data-theme="ink"] .names-screen:is(.pronunciation-workbench-v2, .high-quality-workbench-v2, .action-image-workbench-v2)
  :is(.pronunciation-card-actions, .high-quality-card-actions, .action-image-card-actions) button,
body[data-theme="ink"] .guided-names-screen .guided-name-card-actions button {
  border-color: var(--ink-n-line);
  background: rgba(11, 20, 29, .66);
  color: var(--ink-n-gold);
}
body[data-theme="ink"] .names-screen:is(.pronunciation-workbench-v2, .high-quality-workbench-v2, .action-image-workbench-v2)
  :is(.pronunciation-card-actions, .high-quality-card-actions, .action-image-card-actions) button:is(.status-favorite, .status-candidate),
body[data-theme="ink"] .guided-names-screen .guided-name-card-actions button:is(.status-favorite, .status-candidate) {
  border-color: var(--ink-n-gold-line);
  background: #2b2d28;
  color: #f0dab1;
}
body[data-theme="ink"] .names-screen:is(.pronunciation-workbench-v2, .high-quality-workbench-v2, .action-image-workbench-v2)
  :is(.high-quality-stats > div, .action-image-stats > div, .action-image-left-summary,
    .action-image-verb-tile, .high-quality-group) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .names-screen:is(.pronunciation-workbench-v2, .high-quality-workbench-v2, .action-image-workbench-v2)
  :is(.high-quality-stats strong, .action-image-stats strong, .action-image-left-summary strong) { color: var(--ink-n-gold); }
body[data-theme="ink"] .names-screen:is(.pronunciation-workbench-v2, .high-quality-workbench-v2, .action-image-workbench-v2)
  :is(.high-quality-stats span, .action-image-stats span, .action-image-verb-note,
    .action-image-verb-pinyin, .action-image-left-foot, .action-image-grade,
    .pronunciation-reading) { color: var(--ink-n-muted); }
body[data-theme="ink"] .names-screen.action-image-workbench-v2 .action-image-verb-tile[aria-pressed="true"],
body[data-theme="ink"] .names-screen.high-quality-workbench-v2 .high-quality-group.active {
  border-color: var(--ink-n-gold);
  background: #2b2d28;
  color: var(--ink-n-gold);
  animation: none;
}
body[data-theme="ink"] .names-screen.action-image-workbench-v2 .action-image-verb-tile[aria-pressed="true"] .action-image-verb-glyph { color: var(--ink-n-gold); }

body[data-theme="ink"] .guided-names-screen {
  --guided-ink: #d6dfe4;
  --guided-muted: #a0afb9;
  --guided-accent: #d7bb85;
  --guided-border: rgba(173, 190, 201, .19);
  --guided-panel: #101b25;
  --guided-surface: #15232e;
  --guided-soft: #2b2d28;
  --guided-card: #101b25;
}
body[data-theme="ink"] .guided-names-screen :is(.field label,
  .guided-names-more-filters > summary, .guided-surname-basis > summary,
  .guided-template-categories > *, .guided-surname-basis p) { color: var(--ink-n-muted); }
body[data-theme="ink"] .guided-names-screen .guided-surname-phrase-list .surname-homophone-phrase {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .guided-names-screen .guided-surname-phrase-list .surname-homophone-phrase.active {
  border-color: var(--ink-n-gold-line);
  background: #2b2d28;
  box-shadow: inset 2px 0 var(--ink-n-gold);
}
body[data-theme="ink"] .guided-names-screen .guided-names-results .guided-name-card .guided-name-card-name.favorite { color: #ead3a5; }
body[data-theme="ink"] .guided-names-screen .guided-names-results .guided-name-card .guided-name-card-name.candidate { color: #addac7; }
body[data-theme="ink"] .guided-names-screen :is(.guided-name-card.template-caution, .guided-name-card.risk) {
  border-color: #976e63;
  background-color: #302324;
}
body[data-theme="ink"] .guided-names-screen :is(.guided-name-proof-tag,
  .guided-name-card-elements, .guided-name-card-tags .guided-name-more-trigger) { color: var(--ink-n-muted); }
body[data-theme="ink"] :is(.shared-name-filter-editor-modal,
  .shared-name-filter-ai-notice, .shared-name-filter-summary) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-surface);
  color: var(--ink-n-text);
}
body[data-theme="ink"] :is(.shared-name-filter-editor-body,
  .shared-name-filter-editor-actions) { border-color: var(--ink-n-line); }
body[data-theme="ink"] :is(.shared-name-filter-editor-header p,
  .shared-name-filter-editor-footnote) { color: var(--ink-n-muted); }

/* Rich modes retain the original card/content hierarchy and all actions. */
body[data-theme="ink"] :is(.classical-name-card, .classical-compact-card,
  .saved-candidate-card, .saved-candidate-card.delivery-mode) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-landscape) center bottom / 100% 160px no-repeat, var(--ink-n-surface);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

body[data-theme="ink"] :is(.classical-compact-card:hover,
  .classical-compact-card:focus-visible, .saved-candidate-card.delivery-mode:hover) {
  border-color: var(--ink-n-gold-line);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .24);
  transform: none;
}

body[data-theme="ink"] :is(.classical-name-card > header,
  .classical-name-card footer, .classical-browse-toolbar,
  .classical-name-start, .classical-name-toolbar, .classical-evaluation-progress,
  .classical-evaluation-numbers span, .classical-name-empty,
  .names-ai-combo-status, .names-ai-combo-results,
  .saved-manual-single, .saved-homophone-status, .saved-candidate-count-notice) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
}

body[data-theme="ink"] :is(.classical-name-card h3, .classical-compact-card > strong,
  .saved-candidate-name strong, .classical-detail-head h2) {
  color: #e7e8e2;
  font-family: var(--ink-font-display, "Songti SC", "STSong", serif);
  font-weight: 500;
}

body[data-theme="ink"] :is(.classical-poem p, .classical-deep-meaning p,
  .classical-meanings p, .saved-candidate-drawer dd) { color: var(--ink-n-text); }
body[data-theme="ink"] :is(.classical-compact-card > small,
  .classical-compact-card.pending > span, .classical-browse-toolbar > span,
  .classical-evaluation-progress > div:first-child span,
  .saved-candidate-card > p, .saved-candidate-card > header > span) { color: var(--ink-n-muted); }

body[data-theme="ink"] :is(.classical-name-card section > strong,
  .classical-name-card header span, .classical-compact-card header span,
  .classical-evaluation-numbers b, .classical-evaluation-progress > div:first-child strong,
  .saved-candidate-toolbar h2, .saved-homophone-status strong,
  .saved-candidate-wuxing) { color: var(--ink-n-gold); }

body[data-theme="ink"] :is(.classical-name-card header em,
  .classical-compact-card > header em, .classical-meanings p b,
  .saved-candidate-toolbar h2 span, .saved-candidate-name em,
  .saved-manual-single-badge) {
  border-color: var(--ink-n-gold-line);
  background: #2b2d28;
  color: var(--ink-n-gold);
}

body[data-theme="ink"] :is(.classical-compact-card > footer,
  .saved-candidate-card > footer) { border-color: var(--ink-n-line); }
body[data-theme="ink"] .classical-compact-card.candidate { border-color: #4a8275; background-color: #132c2b; }
body[data-theme="ink"] .classical-compact-card.favorite { border-color: #a48b5d; background-color: #282921; }

body[data-theme="ink"] :is(.saved-candidate-card.delivery-selected,
  .saved-candidate-card.delivery-mode.delivery-selected) {
  border-color: #9dcab5;
  background-color: #193c36;
  box-shadow: inset 6px 0 #92c9b6, 0 6px 16px rgba(0, 0, 0, .2);
}
body[data-theme="ink"] .saved-candidate-card.delivery-selected .saved-candidate-name strong { color: #d1ebdf; }
body[data-theme="ink"] .saved-candidate-card.delivery-mode.has-current-primary:not(.delivery-selected) {
  border-color: var(--ink-n-gold);
  background-color: #373024;
  box-shadow: inset 6px 0 var(--ink-n-gold);
}

body[data-theme="ink"] :is(.saved-action-menu-popover, .saved-candidate-drawer,
  .classical-detail-drawer, .saved-candidate-drawer dl > div,
  .saved-candidate-drawer > section, .classical-detail-drawer section,
  .classical-detail-drawer > footer) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-surface);
  color: var(--ink-n-text);
}
body[data-theme="ink"] :is(.saved-candidate-drawer h2,
  .saved-candidate-drawer > section > strong, .classical-detail-drawer section > strong) { color: var(--ink-n-gold); }
body[data-theme="ink"] .saved-page :is(.saved-round-toolbar,
  .saved-action-menu > summary, .saved-action-menu-popover button,
  .saved-manual-single-surname input) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .saved-page :is(.saved-manual-single > summary,
  .saved-action-menu[open] > summary) { color: var(--ink-n-gold); }
body[data-theme="ink"] .saved-page .saved-manual-single-body { border-color: var(--ink-n-line); }
body[data-theme="ink"] .saved-page .saved-round-badges { color: var(--ink-n-muted); }

body[data-theme="ink"] .deleted-char-recovery-screen :is(.recovery-stat,
  .recovery-helper, .recovery-char-card, .recovery-empty) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .deleted-char-recovery-screen .recovery-tabs button.active {
  border-color: var(--ink-n-gold);
  background: var(--ink-n-gold);
  color: #17212a;
}
body[data-theme="ink"] .deleted-char-recovery-screen .recovery-char-card.selected {
  border-color: var(--ink-n-gold);
  background: #52432c;
  color: #fff0d0;
  box-shadow: inset 0 0 0 1px var(--ink-n-gold);
}
body[data-theme="ink"] .deleted-char-recovery-screen .recovery-char-card.restored {
  border-color: #598573;
  background: #1e3630;
  color: #b7dcc8;
}

/* Review: keep character geometry and preserve every history category. */
body[data-theme="ink"] .review-screen :is(.review-workbench-header,
  .review-status-pills > span, .review-library-home, .review-delete-tool,
  .review-history-panel, .review-memory-panel, .review-ai-assistant,
  .review-ai-statebar, .review-ai-hard-rules > div,
  .review-manual-preview, .review-finish, .review-header-menu > div) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-surface);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .review-screen :is(.review-tool-tabs button,
  .review-library-level-switch button, .review-ai-tabs button,
  .review-pinyin-result-char, .review-ai-char, .char-item) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
  box-shadow: none;
}
body[data-theme="ink"] .review-screen :is(.review-tool-tabs button.active,
  .review-library-level-switch button.active, .review-ai-tabs button.active) {
  border-color: var(--ink-n-gold-line);
  background: var(--ink-n-gold-soft);
  color: var(--ink-n-gold);
  box-shadow: inset 0 -2px var(--ink-n-gold);
}
body[data-theme="ink"] .review-screen :is(.review-tool-tabs button span,
  .review-title-block > span, .review-library-bar > div > span,
  .review-library-home > span, .review-status-pills small,
  .review-history-head span, .review-memory-head span, .review-delete-tool-head span,
  .review-ai-statebar span, .review-ai-head span, .review-ai-group-head,
  .review-ai-char > span, .review-pinyin-result-char span) { color: var(--ink-n-muted); }
body[data-theme="ink"] .review-screen :is(.review-status-pills strong,
  .review-library-bar h2 strong, .review-library-home > strong,
  .review-ai-statebar strong, .review-ai-char > strong) { color: var(--ink-n-gold); }
body[data-theme="ink"] .review-screen :is(.review-header-menu > summary,
  .review-library-bar, .review-tool-pane, .review-ai-confirm) { border-color: var(--ink-n-line); }
body[data-theme="ink"] .review-screen .review-header-menu > summary {
  border-color: var(--ink-n-gold-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-gold);
}
body[data-theme="ink"] .review-screen .review-header-menu[open] > summary {
  background: #2b2d28;
  color: #f0dab1;
}

body[data-theme="ink"] .review-screen :is(.history-delete-3, .history-delete-2) {
  background: #51312f;
  border-color: #a76c64;
  color: #ffd4c9;
}
body[data-theme="ink"] .review-screen .history-delete-1 {
  background: #35282a;
  border-color: #79564f;
  color: #e4bcb2;
}
body[data-theme="ink"] .review-screen .history-balanced {
  background: #343125;
  border-color: #8a7955;
  color: #e7d5a6;
}
body[data-theme="ink"] .review-screen .history-keep-1 {
  background: #1c302d;
  border-color: #3f6b5d;
  color: #b2d4c4;
}
body[data-theme="ink"] .review-screen :is(.history-keep-3, .history-keep-2) {
  background: #24443b;
  border-color: #6a9b84;
  color: #d1e9d9;
}
body[data-theme="ink"] .review-screen .history-none {
  background: var(--ink-n-raised);
  border-color: var(--ink-n-line);
  color: var(--ink-n-muted);
}
body[data-theme="ink"] .review-screen :is(.char-item.selected,
  .review-pinyin-result-char.selected, .review-ai-char.selected,
  .review-manual-preview button.selected) {
  border-color: #e1b365;
  background: #52432c;
  color: #fff0d0;
  box-shadow: inset 0 0 0 1px #e1b365;
}
body[data-theme="ink"] .review-screen :is(.review-ai-char.selected > strong,
  .review-pinyin-result-char.selected span) { color: #fff0d0; }

/* Filtering: warm rail and crisp cards, preserving checked/keep/exclude states. */
body[data-theme="ink"] :is(.filter-workbench-topline, .filter-console-stage,
  .filter-console-nav, .filter-console-summary, .filter-action-bar,
  .filter-basic-grid > section, .filter-result-metrics > div,
  .filter-manual-basis, .filter-gender-buttons label > span,
  .filter-current-record, .filter-summary-list, .filter-picker-dialog,
  .filter-info-dialog, .filter-project-grid > button) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-surface);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .filter-console-nav { background: var(--ink-n-deep); }
body[data-theme="ink"] .filter-workbench-screen .filter-console-nav .ui-nav-item {
  border-color: var(--ink-n-line);
  background: var(--ink-n-surface);
  color: var(--ink-n-text);
  box-shadow: none;
}
body[data-theme="ink"] .filter-workbench-screen .filter-console-nav .ui-nav-item.active {
  border-color: var(--ink-n-gold-line);
  background: #2b2d28;
  color: var(--ink-n-gold);
  box-shadow: inset 3px 0 var(--ink-n-gold);
}
body[data-theme="ink"] .filter-workbench-screen .filter-console-nav .ui-nav-item strong {
  color: inherit;
}
body[data-theme="ink"] .filter-workbench-screen .filter-action-bar:not(.filter-result-actions) > div > strong {
  color: var(--ink-n-text);
}
body[data-theme="ink"] :is(.filter-console-nav button,
  .filter-stage-title h2, .filter-summary-head > span,
  .filter-basic-grid h3, .filter-gender-buttons strong,
  .filter-summary-list strong, .filter-current-record strong) { color: var(--ink-n-text); }
body[data-theme="ink"] :is(.filter-console-nav button i,
  .filter-gender-buttons b, .filter-inline-hint, .filter-elements-unrestricted,
  .filter-auto-note, .filter-summary-tip, .filter-empty-result) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-muted);
}
body[data-theme="ink"] :is(.filter-console-nav button.active,
  .filter-project-grid > button.active, .filter-gender-buttons input:checked + span) {
  border-color: var(--ink-n-gold-line);
  background: var(--ink-n-gold-soft);
  color: var(--ink-n-gold);
  box-shadow: inset 3px 0 var(--ink-n-gold);
}
body[data-theme="ink"] :is(.filter-console-nav button.active i,
  .filter-gender-buttons input:checked + span b) {
  background: #d7bb85;
  color: #17212a;
}
body[data-theme="ink"] :is(.filter-console-nav button small,
  .filter-summary-list span, .filter-current-record small,
  .filter-elements-unrestricted strong) { color: var(--ink-n-muted); }
body[data-theme="ink"] .filter-summary-list li {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
}
body[data-theme="ink"] .filter-summary-list li.filter-summary-stroke.unset {
  border-color: var(--ink-n-gold-line);
  background: #312a21;
}
body[data-theme="ink"] .filter-summary-list li.filter-summary-stroke.unset strong { color: var(--ink-n-gold); }
body[data-theme="ink"] .filter-summary-list li.filter-summary-stroke.configured {
  border-color: #598573;
  background: #1e3630;
}
body[data-theme="ink"] .filter-result-metrics strong { color: var(--ink-n-gold); }
body[data-theme="ink"] .filter-workbench-screen :is(.filter-result-notice.is-safe strong,
  .filter-action-bar.filter-result-actions strong) { color: #b7dcc8; }
body[data-theme="ink"] .filter-gender-buttons input:focus-visible + span {
  outline: 2px solid var(--ink-n-gold);
  outline-offset: 2px;
}

body[data-theme="ink"] .filter-workbench-screen :is(.component-filter-card,
  .component-filter-card.common:not(.keep):not(.exclude), .exclusion-option,
  .element-check, .filter-preview-char-grid > span) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .filter-workbench-screen :is(.component-filter-card.keep,
  .component-mode-switch button.keep.active, .element-check:has(input:checked),
  .filter-result-notice.is-safe, .filter-auto-badge.ready) {
  border-color: #598573;
  background: #1e3630;
  color: #b7dcc8;
}
body[data-theme="ink"] .filter-workbench-screen :is(.component-filter-card.exclude,
  .component-mode-switch button.exclude.active) {
  border-color: #986c61;
  background: #3a2929;
  color: #efbfb0;
}
body[data-theme="ink"] .filter-workbench-screen .component-mode-switch button {
  border-color: var(--ink-n-line);
  background: var(--ink-n-deep);
  color: var(--ink-n-muted);
}
body[data-theme="ink"] .filter-workbench-screen .component-mode-switch button.active:not(.keep):not(.exclude) {
  border-color: #788896;
  background: #30404b;
  color: #e3e9ed;
}
body[data-theme="ink"] .filter-workbench-screen .filter-stroke-setting.unset {
  border-color: #a98b56 !important;
  background: #312a21 !important;
  box-shadow: 0 0 0 3px rgba(215, 187, 133, .07);
}
body[data-theme="ink"] .filter-workbench-screen .filter-stroke-setting.configured {
  border-color: #598573 !important;
  background: #1e3630 !important;
  box-shadow: 0 0 0 3px rgba(146, 201, 182, .07);
}
body[data-theme="ink"] .filter-workbench-screen :is(.filter-stroke-setting h3,
  .filter-stroke-copy > strong, .filter-stroke-setting.configured .filter-stroke-copy > strong) {
  color: var(--ink-n-gold);
}
body[data-theme="ink"] .filter-workbench-screen .filter-stroke-setting p { color: var(--ink-n-muted); }
body[data-theme="ink"] .filter-workbench-screen :is(.filter-auto-badge.missing,
  .filter-workbench-topline span.pending) { background: #352c23; color: #e7c791; }
body[data-theme="ink"] .filter-workbench-screen :is(.filter-auto-badge.manual,
  .filter-workbench-topline span) { background: #23323f; color: #b5c9d8; }
body[data-theme="ink"] .filter-workbench-screen .filter-workbench-topline span.ready {
  background: #1e3630;
  color: #b7dcc8;
}

/* Historical matches use the same project context and naming state semantics. */
body[data-theme="ink"] .history-match-screen :is(.history-match-profile,
  .history-name-card, .history-name-card.other-length, .history-review-metric) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .history-match-screen :is(.history-match-profile strong,
  .history-name-card-head strong, .history-empty-state strong) { color: var(--ink-n-gold); }
body[data-theme="ink"] .history-match-screen :is(.history-match-profile span,
  .history-match-profile small, .history-name-card span, .history-name-card p,
  .history-match-hero p, .history-pagination) { color: var(--ink-n-muted); }
body[data-theme="ink"] .history-match-screen .history-match-tabs button {
  border-color: var(--ink-n-line);
  background: var(--ink-n-surface);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .history-match-screen .history-match-tabs button.active {
  border-color: var(--ink-n-gold-line);
  background: #2b2d28;
  color: var(--ink-n-gold);
}

/* Library hub and measured character workspaces. */
body[data-theme="ink"] .library-hub-screen :is(.admin-hub-head,
  .admin-hub-tabs, .maintenance-results-head, .maintenance-tool-section,
  .maintenance-batch-details, .maintenance-toolbar, .library-upload-workbench,
  .template-word-panel, .action-image-panel) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-surface);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .library-hub-screen .admin-hub-head > div > span {
  color: var(--ink-n-gold);
  letter-spacing: .12em;
}
body[data-theme="ink"] .library-hub-screen .admin-hub-health {
  border-color: #426a5d;
  background: #182d28;
  color: var(--ink-n-safe);
}
body[data-theme="ink"] .library-hub-screen :is(.maintenance-char-tile,
  .maintenance-char-main, .library-card, .library-upload-card) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
  box-shadow: none;
}
body[data-theme="ink"] .library-hub-screen .maintenance-char-main small { color: var(--ink-n-muted); }
body[data-theme="ink"] .library-hub-screen .maintenance-char-tile.selected {
  border-color: var(--ink-n-gold);
  background: #2b2c28;
  box-shadow: inset 0 0 0 1px var(--ink-n-gold-line);
}
body[data-theme="ink"] .library-hub-screen .maintenance-char-tile.selected .maintenance-char-main {
  background: transparent;
  color: #f0dab1;
}
body[data-theme="ink"] .library-hub-screen .maintenance-char-tile.deleted {
  border-color: #805f58;
  background: #302528;
}
body[data-theme="ink"] .library-hub-screen .maintenance-char-tile.deleted .maintenance-char-main {
  background: transparent;
  color: var(--ink-n-risk);
}
body[data-theme="ink"] .ac-workspace {
  --ac-bg: #101b25;
  --ac-muted-bg: #15232e;
  --ac-line: rgba(173, 190, 201, .19);
  --ac-text: #d6dfe4;
  --ac-muted: #a0afb9;
  --ac-accent: #d7bb85;
  --ac-selected: #2b2c28;
}
body[data-theme="ink"] .ac-workspace button.active {
  border-color: var(--ink-n-gold-line);
  background: #2b2c28;
  color: var(--ink-n-gold);
}
body[data-theme="ink"] .ac-workspace button.ac-primary { color: #15212a; }

body[data-theme="ink"] .global-library-workspace {
  --gl-panel: #101b25;
  --gl-card: #15232e;
  --gl-ink: #d6dfe4;
  --gl-muted: #a0afb9;
  --gl-line: rgba(173, 190, 201, .19);
  --gl-accent: #d7bb85;
  --gl-active: #2b2d28;
}
body[data-theme="ink"] :is(.global-name-compare-form, .global-name-compare-results,
  .global-name-compare-stat, .global-name-compare-summary span,
  .global-name-compare-card, .global-name-compare-pair > div) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .global-name-compare-card.category-matched,
body[data-theme="ink"] .global-name-compare-pair > div.is-hit {
  border-color: #598573;
  background: #1e3630;
}
body[data-theme="ink"] .global-name-compare-card.category-none {
  border-color: #986c61;
  background: #3a2929;
}
body[data-theme="ink"] .global-name-compare-card:is(.category-partial, .category-unknown) {
  border-color: var(--ink-n-gold-line);
  background: #312a21;
}
body[data-theme="ink"] :is(.global-name-compare-card-head > strong,
  .global-name-compare-pair b) { color: var(--ink-n-text); }
body[data-theme="ink"] :is(.global-name-compare-pair span,
  .global-name-compare-card-foot small) { color: var(--ink-n-muted); }
body[data-theme="ink"] .global-name-compare-pair .is-hit em { color: #b7dcc8; }
body[data-theme="ink"] .global-name-compare-pair .is-miss em { color: #efbfb0; }

/* Project information and customer/project table workbench. */
body[data-theme="ink"] :is(.project-profile-tabs, .profile-summary-card,
  .profile-basic-edit, .profile-intake-edit, .profile-intake-requirements,
  .profile-requirements-primary, .profile-naming-methods, .profile-notes-edit,
  .profile-method-setting, .profile-authority-readonly,
  .customer-stat-strip > *, .workbench-drawer, .drawer-form > section,
  .customer-list-toolbar, .customer-list-footer) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-surface);
  color: var(--ink-n-text);
  box-shadow: none;
}
body[data-theme="ink"] :is(.profile-kv-grid > div, .profile-authority-values > div,
  .project-requirement-readonly, .intake-empty, .profile-method-check,
  .customer-stat-strip i, .client-ceiling-panel) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
}
body[data-theme="ink"] :is(.profile-card-title, .profile-section-heading,
  .project-info-head, .project-requirement-manager-heading,
  .project-requirement-row, .project-requirement-manager-note,
  .customer-table-wrap, .workbench-drawer > header) { border-color: var(--ink-n-line); }
body[data-theme="ink"] :is(.profile-card-title h3, .profile-kv-grid b,
  .profile-authority-title strong, .profile-authority-values b,
  .project-requirement-manager-heading h3, .customer-stat-strip strong,
  .customer-table strong, .customer-tabs b) { color: var(--ink-n-text); }
body[data-theme="ink"] :is(.profile-kv-grid span, .profile-authority-values span,
  .profile-authority-title span, .profile-authority-readonly p,
  .project-requirement-row > label, .customer-stat-strip small,
  .customer-table small, .customer-workbench-head p) { color: var(--ink-n-muted); }
body[data-theme="ink"] :is(.profile-source-badge, .profile-source-badge.manual_filter,
  .project-profile-edit-badge, .stage-pill, .customer-tabs button.active) {
  border-color: var(--ink-n-gold-line);
  background: #2b2d28;
  color: var(--ink-n-gold);
}
body[data-theme="ink"] .project-info-screen.is-editing:not(.client-access-active) :is(.project-profile-tabs,
  .project-info-scroll, .project-profile-form .profile-basic-edit.compact) {
  border-color: var(--ink-n-gold-line);
  background: #141e26;
}
body[data-theme="ink"] .project-info-screen.is-editing:not(.client-access-active) .project-info-scroll {
  box-shadow: inset 3px 0 var(--ink-n-gold);
}
body[data-theme="ink"] .customer-workbench :is(.delivery-status-button.is-delivered,
  .after-sales-status-button.is-resolved, .delivery-countdown.is-safe,
  .delivery-countdown.is-complete) {
  border-color: #466d5c;
  background: #1b302a;
  color: #a7d1b9;
}
body[data-theme="ink"] .customer-workbench :is(.delivery-countdown.is-urgent,
  .delivery-countdown.is-warning, .after-sales-status-button.is-active,
  .review-flag) {
  border-color: #806947;
  background: #352c23;
  color: #e7c791;
}
body[data-theme="ink"] .customer-workbench .delivery-countdown.is-overdue {
  border-color: #875c54;
  background: #3b2829;
  color: #f0b0a3;
}
body[data-theme="ink"] .customer-workbench :is(.delivery-status-button.is-pending,
  .after-sales-status-button.is-none, .delivery-countdown.is-unset) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-muted);
}
body[data-theme="ink"] .customer-workbench .project-workbench-table tr.review-needed {
  background: rgba(215, 187, 133, .055);
}

body[data-theme="ink"] .project-info-screen :is(.requirement-list > div,
  .profile-summary-card.notes > div, .bazi-authority-grid > div,
  .bazi-core-grid > div, .bazi-detail-body section, .bazi-detail-kv span,
  .five-grid-item, .sancai-result, .intake-upload-card,
  .bazi-strengths span, .bazi-stat-tags span, .bazi-hexagram-lines span) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-raised);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .project-info-screen :is(.bazi-authority-preview,
  .bazi-five-overview, .bazi-five-donut > div) {
  border-color: var(--ink-n-gold-line);
  background: var(--ink-n-surface);
}
body[data-theme="ink"] .project-info-screen :is(.profile-summary-card span,
  .bazi-detail-body p, .bazi-flow-rows span, .bazi-authority-grid span,
  .bazi-authority-preview > p, .intake-upload-card small,
  .five-grid-item > span, .five-grid-item > small, .five-grid-item > p,
  .sancai-result > p) { color: var(--ink-n-muted); }
body[data-theme="ink"] .project-info-screen :is(.profile-kv-grid strong,
  .requirement-list strong, .bazi-authority-grid b, .bazi-authority-head strong,
  .bazi-core-grid .bazi-four-pillars strong, .bazi-detail-body h4,
  .bazi-five-donut strong, .bazi-five-bars h4, .bazi-strengths span b,
  .bazi-stat-tags span b, .intake-upload-card > strong,
  .five-grid-item > strong, .five-grid-item > b, .sancai-result-head > strong,
  .sancai-result-head > b) { color: var(--ink-n-text); }
body[data-theme="ink"] .project-info-screen :is(.bazi-core-grid .favorable,
  .bazi-status-ok, .profile-review-ok, .five-grid-item.auspicious,
  .five-grid-item.great_auspicious, .sancai-result.auspicious) {
  border-color: #598573;
  background: #1e3630;
  color: #b7dcc8;
}
body[data-theme="ink"] .project-info-screen :is(.bazi-core-grid .unfavorable,
  .five-grid-item.inauspicious, .five-grid-item.great_inauspicious,
  .sancai-result.inauspicious) {
  border-color: #986c61;
  background: #3a2929;
  color: #efbfb0;
}
body[data-theme="ink"] .project-info-screen :is(.profile-review-warning,
  .bazi-season-note, .bazi-warning-list div, .bazi-updated-badge,
  .bazi-empty-badge, .bazi-edit-head > span, .intake-upload-card em,
  .five-grid-item.half_auspicious, .sancai-result.half_auspicious) {
  border-color: var(--ink-n-gold-line);
  background: #312a21;
  color: #e7c791;
}
body[data-theme="ink"] .project-info-screen :is(.bazi-warning-list strong,
  .bazi-warning-list span, .intake-upload-card > span) { color: #e7c791; }
body[data-theme="ink"] .project-info-screen :is(.project-profile-tabs button,
  .bazi-table-wrap th, .bazi-table-wrap td) {
  border-color: var(--ink-n-line);
  background: var(--ink-n-surface);
  color: var(--ink-n-text);
}
body[data-theme="ink"] .project-info-screen .project-profile-tabs button.is-active {
  border-color: var(--ink-n-gold-line);
  background: #2b2d28;
  color: var(--ink-n-gold);
  box-shadow: inset 0 -2px var(--ink-n-gold);
}
body[data-theme="ink"] .project-info-screen .project-profile-tabs button small { color: var(--ink-n-muted); }

/* Final contrast corrections from the rendered-page audit. */
body[data-theme="ink"] .filter-workbench-screen .filter-action-bar > div > span,
body[data-theme="ink"] .project-info-screen .project-profile-tabs > em,
body[data-theme="ink"] .history-match-screen .history-empty-state span {
  color: var(--ink-n-muted);
}
body[data-theme="ink"] :is(.review-screen, .deleted-char-recovery-screen)
  .pinyin-initial-filter button.active {
  background: var(--ink-n-gold);
  color: #17212a;
}
body[data-theme="ink"] .names-screen .shared-name-filter-trigger > span {
  background: #152d29;
  color: #e1efe8;
}
body[data-theme="ink"] .project-style-screen:not(.seasonal-screen) .role-tabs button.active {
  border-color: var(--ink-n-gold-line);
  background: #2b2d28;
  color: var(--ink-n-gold);
}
body[data-theme="ink"] .project-style-screen:not(.seasonal-screen) .role-tabs button.active > span {
  color: var(--ink-n-text);
  opacity: 1;
}
body[data-theme="ink"] .saved-page .saved-candidate-empty > strong {
  color: var(--ink-n-gold);
}
body[data-theme="ink"] .rule-hub-screen .admin-hub-head > div > span,
body[data-theme="ink"] .history-match-screen .history-match-hero > div > span {
  color: var(--ink-n-gold);
}

/* Mobile: allow toolbars to reflow, keep result scrolling within the workspace. */
@media (max-width: 1100px) {
  body[data-theme="ink"] .names-screen .name-combination-mode { flex-wrap: wrap; }
  body[data-theme="ink"] .names-screen .name-combination-mode > span { flex-basis: 100%; }
  body[data-theme="ink"] :is(.strict-name-workbench-toolbar,
    .classical-browse-toolbar, .saved-page-nav, .customer-list-toolbar) { flex-wrap: wrap; }
}

@media (max-width: 720px) {
  /* A phone scrolls the expanded tools and results as separate, natural-height
   * sections. The list retains a usable viewport when switching an existing
   * large page into this theme; CSS never rebuilds inputs or result nodes. */
  body[data-theme="ink"] .main.screen-main.with-project-context:has(.names-screen .regular-name-display) {
    overflow-y: auto;
  }
  body[data-theme="ink"] .main.screen-main.with-project-context
    .project-context-content:has(.names-screen .regular-name-display) {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  body[data-theme="ink"] .names-screen:has(.regular-name-display) {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    overflow: visible;
  }
  body[data-theme="ink"] .names-screen .names-workbench:has(> .regular-name-display),
  body[data-theme="ink"] .names-screen .names-workbench:has(> .regular-name-display) .names-left-tools {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
  }
  body[data-theme="ink"] .names-screen .names-workbench:has(> .regular-name-display) .names-char-sidebar {
    flex: 0 0 auto;
    height: 220px;
    max-height: none;
  }
  body[data-theme="ink"] .names-screen .names-workbench:has(> .regular-name-display) .names-project-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body[data-theme="ink"] .names-screen .names-workbench:has(> .regular-name-display) .names-project-row .names-control-actions {
    grid-column: 1 / -1;
  }
  body[data-theme="ink"] .names-screen .names-result-panel.regular-name-display {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
  }
  body[data-theme="ink"] .names-screen .regular-name-display > * { flex: 0 0 auto; }
  body[data-theme="ink"] .names-screen .regular-name-display .screen-list-area {
    height: 50vh;
    min-height: 320px;
    max-height: 520px;
    overflow: auto;
  }
  body[data-theme="ink"] .names-screen .names-result-panel.regular-name-display {
    --regular-name-min-width: 128px;
    --regular-name-row-height: 90px;
    --regular-name-column-gap: 6px;
    --regular-name-row-gap: 7px;
  }
  body[data-theme="ink"] .names-screen .regular-name-display .name-text { font-size: 25px; }
  body[data-theme="ink"] .names-screen .name-combination-mode { gap: 4px; }
  body[data-theme="ink"] .names-screen :is(.name-combination-mode, .name-combination-tabs) > button {
    min-height: 34px;
    padding: 6px 9px;
  }
  body[data-theme="ink"] :is(.saved-page-head, .customer-workbench-head,
    .project-info-head, .review-library-bar) { flex-wrap: wrap; }
  body[data-theme="ink"] :is(.saved-page-nav, .customer-head-actions,
    .customer-filters, .review-library-controls) { min-width: 0; max-width: 100%; flex-wrap: wrap; }
  body[data-theme="ink"] .customer-filters :is(input, select) { min-width: 0; max-width: 100%; }
  body[data-theme="ink"] .customer-table-wrap { max-width: 100%; overflow-x: auto; }
  body[data-theme="ink"] .project-info-screen .project-profile-tabs {
    display: flex;
    overflow-x: auto;
    max-width: 100%;
  }
  body[data-theme="ink"] .project-info-screen .project-profile-tabs > button { flex: 0 0 auto; }
  body[data-theme="ink"] .classical-detail-drawer { width: min(650px, 100vw); }
  body[data-theme="ink"] .classical-name-list.compact-view { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body[data-theme="ink"] .saved-candidate-toolbar { grid-template-columns: minmax(0, 1fr); }
  body[data-theme="ink"] .saved-candidate-primary-actions { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme="ink"] :is(.names-screen .quick-name-item,
    .classical-compact-card, .saved-candidate-card) { transition: none; }
}
