/* 墨境 · shared foundation. Loaded after existing themes; never changes classic/tech.
 * Page adapters consume --ui-* tokens. Output artwork, canvases and frozen documents
 * deliberately have no theme selectors here. */

html[data-theme="ink"] { color-scheme: dark; background: #060c12; }

body[data-theme="ink"] {
  color-scheme: dark;
  --ui-canvas: #060c12;
  --ui-canvas-deep: #04080d;
  --ui-surface-1: #101b25;
  --ui-surface-2: #15232e;
  --ui-surface-3: #1b2c38;
  --ui-surface-4: #243744;
  --ui-surface-hover: #223540;
  --ui-surface-selected: #302d26;
  --ui-surface-disabled: #111c25;
  --ui-paper: #f8f5ed;
  --ui-text-strong: #f1eee6;
  --ui-text: #d6dfe4;
  --ui-text-muted: #a0afb9;
  --ui-text-faint: #889aa7;
  --ui-text-on-accent: #171913;
  --ui-line: rgba(164, 185, 200, .23);
  --ui-line-subtle: rgba(164, 185, 200, .13);
  --ui-line-strong: rgba(215, 187, 133, .61);
  --ui-focus-ring: rgba(233, 205, 153, .25);
  --ui-accent: #d7bb85;
  --ui-accent-strong: #c9a96c;
  --ui-intelligence: #b9aed8;
  --ui-success: #9ecbb5;
  --ui-warning: #edc18a;
  --ui-danger: #efa7a6;
  --ui-info: #a5c9e1;
  --ui-accent-soft: rgba(215, 187, 133, .12);
  --ui-intelligence-soft: rgba(185, 174, 216, .12);
  --ui-success-soft: rgba(158, 203, 181, .12);
  --ui-warning-soft: rgba(237, 193, 138, .12);
  --ui-danger-soft: rgba(239, 167, 166, .12);
  --ui-info-soft: rgba(165, 201, 225, .12);
  --ui-radius-xs: 5px;
  --ui-radius-sm: 8px;
  --ui-radius-md: 12px;
  --ui-radius-lg: 16px;
  --ui-radius-xl: 20px;
  --ui-space-1: 4px;
  --ui-space-2: 8px;
  --ui-space-3: 12px;
  --ui-space-4: 16px;
  --ui-space-5: 20px;
  --ui-space-6: 24px;
  --ui-control-sm: 30px;
  --ui-control-md: 38px;
  --ui-control-lg: 44px;
  --ui-shadow-panel: inset 0 1px 0 rgba(240, 239, 226, .035), 0 18px 48px rgba(0, 0, 0, .2);
  --ui-shadow-focus: 0 0 0 3px var(--ui-focus-ring);
  --ui-shadow-glow: 0 0 22px rgba(215, 187, 133, .09);
  --ui-transition: 150ms ease;
  --ink-gold: var(--ui-accent);
  --ink-line: var(--ui-line);
  --ink-glass: linear-gradient(145deg, rgba(25, 40, 51, .96), rgba(11, 21, 30, .98));
  --ink-font-display: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "AiNameHuiwen", serif;
  --ink-sidebar-width: 248px;
  --ink-topbar-height: 76px;
  --bg: var(--ui-canvas);
  --panel: var(--ui-surface-1);
  --ink: var(--ui-text-strong);
  --text: var(--ui-text);
  --muted: var(--ui-text-muted);
  --line: var(--ui-line);
  --border: var(--ui-line);
  --accent: var(--ui-accent);
  --primary: var(--ui-accent);
  --green: var(--ui-success);
  --accent-2: var(--ui-accent-strong);
  --danger: var(--ui-danger);
  --soft: var(--ui-surface-2);
  --shadow: var(--ui-shadow-panel);
  background: radial-gradient(ellipse at 76% 0, rgba(43, 74, 94, .22), transparent 54rem), var(--ui-canvas);
  color: var(--ui-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body[data-theme="ink"] ::selection { background: #685a40; color: #fff8e9; }
body[data-theme="ink"] :where(.main, .nav, .panel, .ui-workbench, .modal-backdrop, .workbench-drawer, .saved-candidate-drawer) {
  scrollbar-color: #647580 #0b141d;
  scrollbar-width: thin;
}
body[data-theme="ink"] :focus-visible { outline: 2px solid #f3d69e; outline-offset: 3px; }
body[data-theme="ink"] :where(.muted, .eyebrow, .field > small):not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *) { color: var(--ui-text-muted); }
body[data-theme="ink"] a:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *) { color: #e5c992; text-underline-offset: .18em; }

/* Shared controls: preserve business-specific dimensions and layout. */
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *) {
  border-color: #c9a96c;
  border-radius: var(--ui-radius-sm);
  background: linear-gradient(135deg, #dfc797, #c9ac76);
  color: var(--ui-text-on-accent);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 250, 229, .24);
  transition: background-color var(--ui-transition), border-color var(--ui-transition), color var(--ui-transition), box-shadow var(--ui-transition);
}
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):hover:not(:disabled) {
  border-color: #ecd7ab;
  background: #e5cd9e;
  filter: none;
  box-shadow: 0 3px 14px rgba(215, 187, 133, .14);
  transform: none;
}
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):active:not(:disabled),
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *).button-clicked:not(:disabled) { transform: none; box-shadow: inset 0 0 0 1px rgba(6, 12, 18, .35); }
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):is(.secondary, .ghost, .ui-action, .ui-tile, .ui-list-item) {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025);
}
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):is(.secondary, .ghost, .ui-action, .ui-tile, .ui-list-item):hover:not(:disabled) {
  border-color: var(--ui-line-strong);
  background: var(--ui-surface-hover);
  color: var(--ui-text-strong);
}
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *).ui-action--primary {
  border-color: #c9a96c;
  background: linear-gradient(135deg, #dfc797, #c9ac76);
  color: var(--ui-text-on-accent);
}
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *).ui-action--primary:hover:not(:disabled) { background: #e5cd9e; color: var(--ui-text-on-accent); }
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):is(.warning, .danger, .danger-outline, .ui-action--danger) {
  border-color: rgba(239, 167, 166, .48);
  background: #34232b;
  color: #ffc3be;
  box-shadow: none;
}
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):is(.warning, .danger, .danger-outline, .ui-action--danger):hover:not(:disabled) {
  border-color: #efa7a6;
  background: #472d34;
  color: #ffdbd7;
}
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *).ui-action--ghost { border-color: transparent; background: transparent; color: var(--ui-text-muted); box-shadow: none; }
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):disabled {
  border-color: var(--ui-line-subtle);
  background: var(--ui-surface-disabled);
  color: var(--ui-text-faint);
  box-shadow: none;
  opacity: .72;
  cursor: not-allowed;
}
body[data-theme="ink"] button:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):is(.ui-tile, .ui-list-item):is(.active, .selected, .is-active) {
  border-color: var(--ui-accent);
  background: var(--ui-surface-selected);
  color: #f4dfb8;
  box-shadow: inset 0 0 0 1px rgba(215, 187, 133, .15);
}
body[data-theme="ink"] :where(input, select, textarea):not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *) {
  border-color: #526571;
  border-radius: var(--ui-radius-sm);
  background: #0a141d;
  color: var(--ui-text-strong);
  caret-color: #f0d39b;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .18);
}
body[data-theme="ink"] :where(input, textarea):not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *)::placeholder { color: #98a7b1; opacity: 1; }
body[data-theme="ink"] :where(input, select, textarea):not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):focus {
  border-color: #e7cc94;
  box-shadow: var(--ui-shadow-focus);
}
body[data-theme="ink"] :where(input, select, textarea):not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):focus-visible { outline: 2px solid #f3d69e; outline-offset: 2px; }
body[data-theme="ink"] :where(input, select, textarea):not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):disabled { background: var(--ui-surface-disabled); color: var(--ui-text-faint); opacity: .75; }
body[data-theme="ink"] :where(input[type="checkbox"], input[type="radio"], input[type="range"]):not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *) { accent-color: #d7bb85; box-shadow: none; }
body[data-theme="ink"] input[type="color"]:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *) { background: var(--ui-surface-2); padding: 3px; }
body[data-theme="ink"] select option:not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *) { background: #101b25; color: #f1eee6; }
body[data-theme="ink"] :where(input, textarea):not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *):-webkit-autofill {
  -webkit-text-fill-color: #f1eee6;
  -webkit-box-shadow: 0 0 0 1000px #14212c inset;
  caret-color: #f0d39b;
}
body[data-theme="ink"] :where(.check, .filter-checks label) { border-color: var(--ui-line); background: var(--ui-surface-2); color: var(--ui-text); }
body[data-theme="ink"] :where(.check, .filter-checks label):has(input:checked) { border-color: var(--ui-line-strong); background: var(--ui-surface-selected); }

/* Permanent shell: a quiet dark frame around the active workspace. */
body[data-theme="ink"] .app-shell { grid-template-columns: var(--ink-sidebar-width) minmax(0, 1fr); background: var(--ui-canvas); }
body[data-theme="ink"] .sidebar {
  position: relative;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 0;
  border-right: 1px solid var(--ui-line-subtle);
  background: linear-gradient(165deg, rgba(23, 37, 47, .76), transparent 35%), #080f16;
  padding: 26px 16px 16px;
  color: var(--ui-text);
}
body[data-theme="ink"] .sidebar .brand { margin-bottom: 24px; }
body[data-theme="ink"] :where(.tech-brand, .tech-login-brand) { display: flex; align-items: center; gap: 12px; }
body[data-theme="ink"] :where(.tech-brand, .tech-login-brand) > span:last-child { display: grid; gap: 6px; min-width: 0; }
body[data-theme="ink"] :where(.tech-brand, .tech-login-brand) strong { color: var(--ui-text-strong); font-family: var(--ink-font-display); font-size: 20px; font-weight: 500; letter-spacing: .04em; }
body[data-theme="ink"] :where(.tech-brand, .tech-login-brand) small { color: var(--ui-text-muted); font-size: 10px; font-weight: 400; letter-spacing: .12em; }
body[data-theme="ink"] .tech-brand-mark {
  position: relative;
  display: block;
  flex: none;
  width: 36px;
  height: 42px;
  border: 1px solid rgba(215, 187, 133, .55);
  border-radius: 3px 3px 13px 3px;
  background: linear-gradient(155deg, rgba(215, 187, 133, .18), rgba(215, 187, 133, .025));
  box-shadow: inset 0 0 0 4px #101b22;
}
body[data-theme="ink"] .tech-brand-mark::after { content: ""; position: absolute; inset: 10px 9px; border-block: 1px solid #d7bb85; border-left: 1px solid #d7bb85; transform: skewY(-12deg); }
body[data-theme="ink"] .user-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 15px;
  border: 1px solid var(--ui-line-subtle);
  border-radius: 8px;
  background: rgba(24, 38, 48, .55);
  padding: 10px;
  color: var(--ui-text-muted);
  font-size: 11px;
}
body[data-theme="ink"] .user-line b { border-radius: 4px; background: var(--ui-accent-soft); padding: 3px 7px; color: #e3c995; font-size: 10px; }
body[data-theme="ink"] .nav { flex: 1; min-height: 0; align-content: start; gap: 4px; overflow-y: auto; padding: 2px 3px 2px 0; }
body[data-theme="ink"] .tech-nav-label { display: block; padding: 10px 12px 7px; color: var(--ui-text-faint); font-size: 9px; font-weight: 500; letter-spacing: .19em; }
body[data-theme="ink"] .nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  border-color: transparent;
  background: transparent;
  padding: 8px 12px;
  color: #adbac3;
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}
body[data-theme="ink"] .nav button:hover:not(:disabled) { border-color: var(--ui-line-subtle); background: rgba(33, 50, 62, .64); color: #f1eee6; box-shadow: none; }
body[data-theme="ink"] .nav button.active {
  border-color: rgba(215, 187, 133, .23);
  background: linear-gradient(90deg, rgba(215, 187, 133, .14), rgba(215, 187, 133, .035));
  color: #edd5a8;
  box-shadow: inset 2px 0 #d7bb85;
}
body[data-theme="ink"] .client-nav-lock { margin-left: auto; }
body[data-theme="ink"] .client-nav-locked { opacity: .66; }
body[data-theme="ink"] .tech-sidebar-meta { display: grid; gap: 7px; margin-top: 13px; border-top: 1px solid var(--ui-line-subtle); padding: 13px 8px 0; }
body[data-theme="ink"] .tech-sidebar-meta > span { display: flex; align-items: center; gap: 7px; color: var(--ui-text-muted); font-size: 10px; }
body[data-theme="ink"] .tech-sidebar-meta small { color: var(--ui-text-faint); font-size: 9px; }
body[data-theme="ink"] :where(.tech-live-status, .tech-sidebar-meta) i { display: inline-block; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--ui-success); box-shadow: 0 0 0 3px rgba(158, 203, 181, .08); }
body[data-theme="ink"] .main,
body[data-theme="ink"] .main.screen-main {
  position: relative;
  height: 100vh;
  padding: calc(var(--ink-topbar-height) + 20px) 24px 20px;
  background: radial-gradient(ellipse at 84% -8%, rgba(44, 76, 96, .22), transparent 46rem), var(--ui-canvas);
}
body[data-theme="ink"] .main.screen-main { padding: calc(var(--ink-topbar-height) + 12px) 20px 14px; }
body[data-theme="ink"] .tech-topbar {
  position: fixed;
  z-index: 90;
  inset: 0 0 auto var(--ink-sidebar-width);
  height: var(--ink-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--ui-line-subtle);
  background: rgba(9, 17, 24, .95);
  padding: 0 26px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
body[data-theme="ink"] .tech-topbar > div:first-child { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 5px 18px; }
body[data-theme="ink"] .tech-kicker { color: #bba981; font-size: 9px; font-weight: 500; letter-spacing: .2em; line-height: 1.3; }
body[data-theme="ink"] .tech-topbar .tech-kicker { grid-column: 1 / -1; }
body[data-theme="ink"] .tech-topbar strong { color: var(--ui-text-strong); font-family: var(--ink-font-display); font-size: 23px; font-weight: 500; letter-spacing: .06em; line-height: 1.2; }
body[data-theme="ink"] .tech-topbar small { overflow: hidden; color: var(--ui-text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
body[data-theme="ink"] .tech-topbar-status { display: flex; align-items: center; gap: 16px; flex: none; }
body[data-theme="ink"] .tech-live-status { display: inline-flex; align-items: center; gap: 8px; color: var(--ui-text-muted); font-size: 10px; white-space: nowrap; }
body[data-theme="ink"] .tech-role-badge { border: 1px solid var(--ui-line); border-radius: 5px; background: rgba(215, 187, 133, .065); padding: 6px 10px; color: #decba8; font-size: 10px; }

/* Login and the three-option switcher share the same tokens as the workspace. */
body[data-theme="ink"] .ui-theme-switcher { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 180px; border-color: var(--ui-line); border-radius: 8px; background: #0b151e; }
body[data-theme="ink"] .ui-theme-switcher button { min-height: 30px; border: 1px solid transparent; background: transparent; padding: 4px 8px; color: var(--ui-text-muted); font-size: 11px; font-weight: 500; box-shadow: none; }
body[data-theme="ink"] .ui-theme-switcher button:hover:not(:disabled) { border-color: var(--ui-line-subtle); background: var(--ui-surface-hover); color: var(--ui-text-strong); box-shadow: none; }
body[data-theme="ink"] .ui-theme-switcher button.active { border-color: rgba(215, 187, 133, .45); background: #302d26; color: #f1d7a8; box-shadow: inset 0 -1px var(--ui-accent); }
body[data-theme="ink"] .ui-theme-switcher--sidebar { width: 100%; margin-top: 14px; }
body[data-theme="ink"] .tech-login { min-height: 100vh; height: 100dvh; grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr); gap: 36px; overflow-y: auto; padding: 48px clamp(30px, 6vw, 96px); background: radial-gradient(ellipse at 20% 65%, rgba(45, 78, 97, .32), transparent 48%), linear-gradient(130deg, #0d1720, #060c12 75%); }
body[data-theme="ink"] .tech-login-visual { position: relative; align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; width: 100%; min-height: 540px; padding: 10px 0 64px; }
body[data-theme="ink"] .tech-login-visual::before { content: ""; position: absolute; inset: 20% 6% 6% -20%; pointer-events: none; border: 1px solid rgba(215, 187, 133, .08); border-radius: 50%; background: radial-gradient(ellipse at 60% 60%, transparent 50%, rgba(130, 161, 180, .05) 50.1%, transparent 50.6%, transparent 62%, rgba(215, 187, 133, .06) 62.1%, transparent 62.5%); transform: rotate(-20deg); }
body[data-theme="ink"] :where(.tech-login-brand, .tech-login-copy) { position: relative; z-index: 1; }
body[data-theme="ink"] .tech-login-brand strong { font-size: 24px; }
body[data-theme="ink"] .tech-login-copy { max-width: 630px; margin-top: 84px; }
body[data-theme="ink"] .tech-login-copy h1 { margin: 20px 0; color: var(--ui-text-strong); font-family: var(--ink-font-display); font-size: clamp(32px, 3.4vw, 52px); font-weight: 400; line-height: 1.55; letter-spacing: .05em; }
body[data-theme="ink"] .tech-login-copy p { max-width: 460px; color: var(--ui-text-muted); font-size: 14px; line-height: 1.9; }
body[data-theme="ink"] .tech-signal-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
body[data-theme="ink"] .tech-signal-row span { display: inline-flex; align-items: center; gap: 7px; border-top: 1px solid rgba(215, 187, 133, .25); padding: 12px 12px 0 0; color: #c3b69d; font-size: 11px; }
body[data-theme="ink"] .tech-signal-row i { width: 3px; height: 3px; border-radius: 50%; background: #d7bb85; }
body[data-theme="ink"] .tech-login .login-panel { position: relative; z-index: 1; justify-self: center; width: min(470px, 100%); border-color: rgba(178, 193, 203, .25); border-radius: 18px; background: var(--ink-glass); padding: 32px; box-shadow: 0 30px 80px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(237, 223, 193, .05); }
body[data-theme="ink"] .tech-login-panel-head { display: grid; gap: 20px; }
body[data-theme="ink"] .tech-login-panel-head h1 { margin: 9px 0 0; color: var(--ui-text-strong); font-family: var(--ink-font-display); font-size: 28px; font-weight: 500; }
body[data-theme="ink"] .tech-login-panel-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
body[data-theme="ink"] .login-panel > p { font-size: 12px; line-height: 1.8; }
body[data-theme="ink"] .tech-login .grid { gap: 19px; margin-top: 26px; }
body[data-theme="ink"] .tech-login .field label { color: var(--ui-text); font-size: 12px; font-weight: 500; }
body[data-theme="ink"] .tech-login input { min-height: 46px; padding: 12px 14px; }
body[data-theme="ink"] .tech-login .grid > p { margin: 0; font-size: 11px; line-height: 1.7; }
body[data-theme="ink"] .tech-login-submit { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 10px 16px; }
body[data-theme="ink"] .tech-login-submit span { font-size: 20px; }
body[data-theme="ink"] .tech-login-security { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 24px; color: var(--ui-text-faint); font-size: 10px; }
body[data-theme="ink"] .login-version { border-color: var(--ui-line-subtle); color: var(--ui-text-faint); font-size: 10px; }

/* Semantic surfaces only; no suffix-wide card/panel or document tag overrides. */
body[data-theme="ink"] :where(.panel, .ui-surface, .ui-workbench-frame, .ui-context-card, .ui-route-card) { border-color: var(--ui-line); border-radius: var(--ui-radius-md); background: var(--ink-glass); color: var(--ui-text); box-shadow: var(--ui-shadow-panel); }
body[data-theme="ink"] .ui-surface--muted { background: var(--ui-surface-2); box-shadow: none; }
body[data-theme="ink"] .ui-surface--inset { background: #0a141d; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2); }
body[data-theme="ink"] :where(.ui-workbench, .ui-workbench-stage, .ui-page) { color: var(--ui-text); }
body[data-theme="ink"] .ui-workbench-rail { border-color: var(--ui-line-subtle); background: #0d1821; }
body[data-theme="ink"] :where(.page-head, .ui-page-head, .toolbar, .fixed-bottom-actions) { border-color: var(--ui-line); }
body[data-theme="ink"] :where(.page-head, .ui-page-head) > :where(h1, h2),
body[data-theme="ink"] :where(.page-head, .ui-page-head) > div > :where(h1, h2) { color: var(--ui-text-strong); font-family: var(--ink-font-display); font-weight: 500; letter-spacing: .035em; }
body[data-theme="ink"] :where(.page-head, .ui-page-head) p { color: var(--ui-text-muted); }
body[data-theme="ink"] .ui-metric-card { border-color: var(--ui-line); background: var(--ui-surface-2); color: var(--ui-text); box-shadow: none; }
body[data-theme="ink"] .ui-metric-card :where(b, strong) { color: #edd5a8; font-variant-numeric: tabular-nums; }
body[data-theme="ink"] .ui-metric-card small { color: var(--ui-text-muted); }
body[data-theme="ink"] .ui-route-card.is-recommended { border-color: var(--ui-line-strong); background: linear-gradient(145deg, #2b2c29, #111e27); }
body[data-theme="ink"] .ui-route-card.is-disabled { background: var(--ui-surface-disabled); opacity: .72; }
body[data-theme="ink"] .ui-route-card :where(h2, h3) { color: var(--ui-text-strong); }
body[data-theme="ink"] .ui-route-card :where(p, li) { color: var(--ui-text-muted); }
body[data-theme="ink"] .ui-empty-state { border: 1px dashed #576672; border-radius: var(--ui-radius-md); background: linear-gradient(145deg, #12212c, #0b141d); color: var(--ui-text-muted); }
body[data-theme="ink"] .ui-empty-state :where(h2, h3, strong) { color: var(--ui-text-strong); }

/* Tables and tabs keep their existing column widths and density. */
body[data-theme="ink"] :where(.table, .ui-table) { color: var(--ui-text); }
body[data-theme="ink"] :where(.table, .ui-table) :where(th, td) { border-color: var(--ui-line-subtle); }
body[data-theme="ink"] :where(.table, .ui-table) th { background: #0c1720; color: #bbc8cf; font-weight: 500; }
body[data-theme="ink"] :where(.table, .ui-table) tbody tr:hover { background: rgba(167, 190, 205, .05); }
body[data-theme="ink"] :where(.tabs, .ui-tabs) { border-color: var(--ui-line); background: #0b151e; color: var(--ui-text); }
body[data-theme="ink"] :where(.tabs, .ui-tabs) button,
body[data-theme="ink"] button.ui-tab { border-color: transparent; background: transparent; color: var(--ui-text-muted); box-shadow: none; }
body[data-theme="ink"] :where(.tabs, .ui-tabs) button:hover:not(:disabled),
body[data-theme="ink"] button.ui-tab:hover:not(:disabled) { border-color: var(--ui-line); background: var(--ui-surface-hover); color: var(--ui-text-strong); }
body[data-theme="ink"] :where(.tabs, .ui-tabs) button:is(.active, .is-active, [aria-selected="true"]),
body[data-theme="ink"] button.ui-tab:is(.active, .is-active, [aria-selected="true"]) { border-color: rgba(215, 187, 133, .4); background: var(--ui-surface-selected); color: #efd8ad; box-shadow: inset 0 -2px #d7bb85; }

/* Notices retain semantic differences; warning/danger are not brand gold. */
body[data-theme="ink"] :where(.notice, .ui-notice) { border-color: rgba(165, 201, 225, .35); background: #152a37; color: #c9deeb; }
body[data-theme="ink"] :where(.notice.warning, .ui-notice--warning) { border-color: rgba(237, 193, 138, .45); background: #322b23; color: #f0d0a6; }
body[data-theme="ink"] :where(.form-error, .ui-notice--danger, .notice.error) { border-color: rgba(239, 167, 166, .45); background: #34232b; color: #f3b8b4; }
body[data-theme="ink"] :where(.ui-notice--success, .notice.success) { border-color: rgba(158, 203, 181, .4); background: #1c302b; color: #b8dcc8; }
body[data-theme="ink"] .floating-message { border: 1px solid #7e7157; border-left: 3px solid #d7bb85; background: #222b2f; color: #f0dfbe; box-shadow: 0 12px 30px rgba(0, 0, 0, .3); }
body[data-theme="ink"] .floating-message-close { border: 0; background: transparent; color: #dfcca7; box-shadow: none; }
body[data-theme="ink"] .floating-message-close:hover:not(:disabled) { background: #3c403b; color: #fff0d3; box-shadow: none; }

/* Explicit overlay containers, so artwork/preview panes inside retain their colors. */
body[data-theme="ink"] :where(.modal-backdrop, .workbench-drawer-backdrop, .saved-candidate-drawer-backdrop, .classical-detail-backdrop, .profile-drawer-backdrop, .client-history-backdrop, .client-settings-backdrop, .client-copy-backdrop, .ai-selection-backdrop, .material-ocr-backdrop, .pronunciation-evidence-backdrop) { background: rgba(2, 6, 10, .78); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
body[data-theme="ink"] :where(.center-modal, .analysis-modal, .name-detail-modal, .unique-detail-modal, .assignment-modal, .dashboard-backup-modal, .ai-selection-dialog, .client-copy-dialog, .client-settings-dialog, .client-credentials-dialog, .filter-info-dialog, .filter-picker-dialog, .exclusion-preview-dialog, .delivery-external-custom-dialog, .poetry-archive-preview-dialog, .poetry-material-editor-dialog, .material-ocr-modal, .pronunciation-evidence-modal, .sidebar-color-settings-modal) { border-color: rgba(182, 198, 208, .32); border-radius: 14px; background: linear-gradient(145deg, #182630, #0d1720); color: var(--ui-text); box-shadow: 0 30px 80px rgba(0, 0, 0, .46); }
body[data-theme="ink"] :where(.workbench-drawer, .saved-candidate-drawer, .classical-detail-drawer, .project-profile-drawer, .new-client-drawer, .client-history-drawer, .similar-name-drawer) { border-color: rgba(182, 198, 208, .32); background: linear-gradient(155deg, #172630, #0d1720); color: var(--ui-text); box-shadow: -22px 0 64px rgba(0, 0, 0, .4); }
body[data-theme="ink"] :where(.center-modal, .workbench-drawer, .saved-candidate-drawer, .classical-detail-drawer, .project-profile-drawer, .similar-name-drawer) > :where(h2, header) { border-color: var(--ui-line); color: var(--ui-text-strong); }
body[data-theme="ink"] :where(.center-modal, .workbench-drawer, .saved-candidate-drawer, .classical-detail-drawer, .project-profile-drawer, .similar-name-drawer) > header h2 { color: var(--ui-text-strong); }
body[data-theme="ink"] .modal-icon { background: var(--ui-accent-soft); color: #e8ce9c; }
body[data-theme="ink"] .modal-detail { border-color: var(--ui-line); background: #101c25; color: #d6dfe4; }
body[data-theme="ink"] :where(.drawer-form > section, .drawer-form > footer, .similar-name-drawer-footer, .saved-candidate-drawer > section, .saved-candidate-drawer dl > div) { border-color: var(--ui-line); background: #101c25; color: var(--ui-text); }
body[data-theme="ink"] .saved-candidate-drawer :where(dd, section > strong) { color: var(--ui-text); }
body[data-theme="ink"] :where(.saved-action-menu-popover, .first-round-more-menu[open] > div, .smart-funnel-history-menu > div) { border-color: var(--ui-line); background: #15232e; color: var(--ui-text); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
body[data-theme="ink"] :where(.saved-action-menu, .first-round-more-menu, .smart-funnel-history-menu) > summary { border-color: var(--ui-line); background: #15232e; color: var(--ui-text); }
body[data-theme="ink"] .saved-action-menu-popover button { border-color: var(--ui-line-subtle); background: #15232e; color: var(--ui-text); }

/* Management entry, record intake and published-report chrome.
 * These predate ui-surface and have literal light backgrounds in styles.css. */
body[data-theme="ink"] .management-hub {
  border: 1px solid var(--ui-line-subtle);
  border-radius: 14px;
  background: radial-gradient(ellipse at 30% 28%, rgba(75, 107, 127, .12), transparent 55%), #0a141d;
}
body[data-theme="ink"] .management-heading span { color: var(--ui-text-muted); font-weight: 500; }
body[data-theme="ink"] .management-heading h1 { color: var(--ui-text-strong); font-family: var(--ink-font-display); font-weight: 500; letter-spacing: .18em; }
body[data-theme="ink"] .management-choices { gap: 20px; }
body[data-theme="ink"] button.management-choice {
  --ink-tile-tone: #b3c4ce;
  border: 1px solid var(--ui-line);
  border-top-color: var(--ink-tile-tone);
  border-radius: 12px;
  background: linear-gradient(145deg, #20323e, #101c25);
  color: var(--ui-text-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 10px 28px rgba(0, 0, 0, .17);
}
body[data-theme="ink"] button.management-choice--library { --ink-tile-tone: #9ecbb5; }
body[data-theme="ink"] button.management-choice--rules { --ink-tile-tone: #a5c9e1; }
body[data-theme="ink"] button.management-choice--dynamics { --ink-tile-tone: #b9aed8; }
body[data-theme="ink"] button.management-choice--tasks { --ink-tile-tone: #d7bb85; }
body[data-theme="ink"] button.management-choice--aesthetic { --ink-tile-tone: #d5adc2; }
body[data-theme="ink"] button.management-choice--risk { --ink-tile-tone: #efa7a6; }
body[data-theme="ink"] button.management-choice strong { color: var(--ui-text-strong); font-family: var(--ink-font-display); font-weight: 500; font-size: 22px; text-wrap: balance; }
body[data-theme="ink"] button.management-choice:hover:not(:disabled),
body[data-theme="ink"] button.management-choice:focus-visible { border-color: var(--ink-gold); background: linear-gradient(145deg, #2b382f, #182630); color: var(--ui-text-strong); transform: none; box-shadow: var(--ui-shadow-glow); }

body[data-theme="ink"] .record-create-panel :is(.project-create-upload, .bazi-edit-empty, .project-create-text-fallback, .project-create-admin, .admin-note-field, .create-bazi-core span, .birth-calendar-preview, .lunar-leap-check) {
  border-color: var(--ui-line);
  background: var(--ui-surface-2);
  color: var(--ui-text);
}
body[data-theme="ink"] .record-create-panel .project-create-upload { border-color: #778b96; background: linear-gradient(145deg, #1d303c, #111e27); }
body[data-theme="ink"] .record-create-panel .project-create-upload:focus-within { outline: 2px solid #f3d69e; outline-offset: 3px; }
body[data-theme="ink"] .record-create-panel .intake-upload-card > :is(strong, span) { color: #ecd4a6; }
body[data-theme="ink"] .record-create-panel .intake-upload-card em { background: var(--ui-accent-soft); color: #dec79c; }
body[data-theme="ink"] .record-create-panel :is(.project-create-help, .intake-upload-card small, .project-create-next p, .birth-calendar-preview p, .project-create-text-fallback small) { color: var(--ui-text-muted); }
body[data-theme="ink"] .record-create-panel :is(.project-create-text-fallback, .project-create-admin) > summary { color: #c5d3db; }
body[data-theme="ink"] .record-create-panel :is(.create-bazi-core b, .birth-calendar-preview strong, .admin-note-field label) { color: var(--ui-text-strong); }
body[data-theme="ink"] .record-create-panel .drawer-form > section > h3 { color: var(--ui-text-strong); }
/* Match the existing !important rule on this one legacy help panel. */
body[data-theme="ink"] .record-create-panel .project-create-next { border-color: var(--ui-line) !important; background: #14262b !important; }
body[data-theme="ink"] .record-create-panel .client-create-lock-message { background: rgba(8, 16, 23, .94); color: var(--ui-text); }

body[data-theme="ink"] :is(.lucky-list-head, .lucky-list-versions, .lucky-list-document, .lucky-list-empty) { border-color: var(--ui-line); background: var(--ink-glass); color: var(--ui-text); }
body[data-theme="ink"] .lucky-list-head h1 { color: var(--ui-text-strong); font-family: var(--ink-font-display); font-weight: 500; }
body[data-theme="ink"] .lucky-list-head > div > span { color: #d7bb85; font-weight: 500; }
body[data-theme="ink"] :is(.lucky-list-head p, .lucky-list-project-picker > span, .lucky-list-empty span, .lucky-list-pdf-loading span, .lucky-list-version-title span, .lucky-list-version > small, .lucky-list-toolbar span) { color: var(--ui-text-muted); }
body[data-theme="ink"] .lucky-list-project-picker select { border-color: #526571; background: #0a141d; color: var(--ui-text-strong); }
body[data-theme="ink"] :is(.lucky-list-version-title, .lucky-list-toolbar) { border-color: var(--ui-line); background: transparent; }
body[data-theme="ink"] :is(.lucky-list-version-title strong, .lucky-list-toolbar strong, .lucky-list-empty strong, .lucky-list-pdf-loading strong) { color: var(--ui-text-strong); }
body[data-theme="ink"] button.lucky-list-version { border-color: var(--ui-line); background: #15232e; color: var(--ui-text); box-shadow: none; }
body[data-theme="ink"] button.lucky-list-version > span { color: #d7bb85; }
body[data-theme="ink"] button.lucky-list-version.active,
body[data-theme="ink"] button.lucky-list-version:hover:not(:disabled) { border-color: var(--ui-line-strong); background: #302d26; color: #f2dfbd; }
body[data-theme="ink"] .lucky-list-toolbar { background: #111e27; }
body[data-theme="ink"] .lucky-list-pdf-stage { background: #070e15; }
body[data-theme="ink"] :is(.lucky-list-pdf-loading.error, .lucky-list-empty.error) strong { color: var(--ui-danger); }

/* Legacy workspace tabs omitted semantic ui-tab classes. */
body[data-theme="ink"] :is(.global-search-mode-tabs, .global-name-compare-tabs, .zodiac-admin-workspace-tabs, .zodiac-mobile-pane-tabs, .rule-category-switch) { border-color: var(--ui-line); background: transparent; }
body[data-theme="ink"] :is(.global-search-mode-tabs, .global-name-compare-tabs, .zodiac-admin-workspace-tabs, .zodiac-mobile-pane-tabs, .rule-category-switch) button { border-color: var(--ui-line); background: #15232e; color: var(--ui-text-muted); box-shadow: none; }
body[data-theme="ink"] :is(.global-search-mode-tabs, .global-name-compare-tabs, .zodiac-admin-workspace-tabs, .zodiac-mobile-pane-tabs, .rule-category-switch) button.active { border-color: var(--ui-line-strong); background: #302d26; color: #efd8ad; box-shadow: inset 0 -2px #d7bb85; }
body[data-theme="ink"] :is(.global-search-mode-tabs, .global-name-compare-tabs, .zodiac-admin-workspace-tabs, .zodiac-mobile-pane-tabs, .rule-category-switch) button:hover:not(:disabled) { border-color: var(--ui-line-strong); background: #223540; color: var(--ui-text-strong); }
body[data-theme="ink"] :is(.toolbar, .managed-rule-toolbar, .maintenance-toolbar) { border-color: var(--ui-line); background: transparent; color: var(--ui-text); }

/* Existing reorder mode stays functional without an endless decorative wiggle. */
body[data-theme="ink"] .sidebar.sidebar-reorder-mode .sidebar-menu-item { animation: none; border-style: dashed; border-color: var(--ui-line); }
body[data-theme="ink"] .sidebar.sidebar-reorder-mode .sidebar-reorder-tools { border-color: var(--ui-line); background: #182731; }
body[data-theme="ink"] .app-shell .sidebar .sidebar-reorder-tools button:last-child { background: #d7bb85; color: #171913; }

/* The dual reply page has a legacy global light shell. Keep it inside this theme. */
body[data-theme="ink"]:has(.xhs-reply--dual) { color-scheme: dark; }
body[data-theme="ink"]:has(.xhs-reply--dual) .app-shell { grid-template-columns: var(--ink-sidebar-width) minmax(0, 1fr); background: var(--ui-canvas); }
body[data-theme="ink"]:has(.xhs-reply--dual) .main.screen-main { padding: calc(var(--ink-topbar-height) + 12px) 20px 14px; background: var(--ui-canvas); color: var(--ui-text); }
body[data-theme="ink"]:has(.xhs-reply--dual) .tech-topbar { display: flex; }
body[data-theme="ink"]:has(.xhs-reply--dual) .sidebar { padding: 26px 16px 16px; border-color: var(--ui-line-subtle); background: #080f16; color: var(--ui-text); }
body[data-theme="ink"]:has(.xhs-reply--dual) .sidebar .brand { margin: 0 0 24px; }
body[data-theme="ink"]:has(.xhs-reply--dual) .tech-brand strong { color: var(--ui-text-strong); font-size: 20px; letter-spacing: .04em; }
body[data-theme="ink"]:has(.xhs-reply--dual) .tech-brand small,
body[data-theme="ink"]:has(.xhs-reply--dual) .tech-brand-mark { display: block; }
body[data-theme="ink"]:has(.xhs-reply--dual) .tech-sidebar-meta { display: grid; }
body[data-theme="ink"]:has(.xhs-reply--dual) .user-line { margin: 0 0 15px; border: 1px solid var(--ui-line-subtle); background: rgba(24, 38, 48, .55); padding: 10px; color: var(--ui-text-muted); font-size: 11px; }
body[data-theme="ink"]:has(.xhs-reply--dual) .user-line b { padding: 3px 7px; background: var(--ui-accent-soft); color: #e3c995; font-size: 10px; }
body[data-theme="ink"]:has(.xhs-reply--dual) .tech-nav-label { padding: 10px 12px 7px; color: var(--ui-text-faint); font-size: 9px; letter-spacing: .19em; }
body[data-theme="ink"]:has(.xhs-reply--dual) .nav button { min-height: 39px; border: 1px solid transparent; border-radius: 8px; color: #adbac3; font-size: 12px; }
body[data-theme="ink"]:has(.xhs-reply--dual) .nav button:hover:not(:disabled) { border-color: var(--ui-line-subtle); background: rgba(33, 50, 62, .64); color: var(--ui-text-strong); }
body[data-theme="ink"]:has(.xhs-reply--dual) .nav button.active { border-color: rgba(215, 187, 133, .23); background: linear-gradient(90deg, rgba(215, 187, 133, .14), rgba(215, 187, 133, .035)); color: #edd5a8; box-shadow: inset 2px 0 #d7bb85; }
body[data-theme="ink"]:has(.xhs-reply--dual) .ui-theme-switcher--sidebar { width: 100%; margin: 14px 0 0; border-color: var(--ui-line); background: #0b151e; }
body[data-theme="ink"]:has(.xhs-reply--dual) .ui-theme-switcher button { min-height: 30px; border: 1px solid transparent; color: var(--ui-text-muted); }
body[data-theme="ink"]:has(.xhs-reply--dual) .ui-theme-switcher button.active { border-color: rgba(215, 187, 133, .45); background: #302d26; color: #f1d7a8; box-shadow: inset 0 -1px var(--ui-accent); }

@media (max-width: 1180px) {
  body[data-theme="ink"] { --ink-sidebar-width: 224px; }
  body[data-theme="ink"] .sidebar { padding-inline: 12px; }
  body[data-theme="ink"] .tech-brand strong { font-size: 18px; }
  body[data-theme="ink"] .tech-topbar-status .tech-live-status { display: none; }
  body[data-theme="ink"] .tech-login { gap: 28px; padding-inline: 30px; }
  body[data-theme="ink"] .tech-login .login-panel { padding: 26px; }
}

/* Names already reserves its own compact page head in the full-height layout.
 * A second fixed header would cover its mode tabs when the legacy 6px inset wins. */
@media (min-width: 901px) {
  body[data-theme="ink"] .main.screen-main.with-project-context:has(.names-screen) > .tech-topbar { display: none; }
}

@media (max-width: 900px) {
  body[data-theme="ink"] { --ink-sidebar-width: 0px; --ink-topbar-height: 68px; }
  body[data-theme="ink"] .app-shell { display: block; }
  body[data-theme="ink"] .sidebar { position: fixed; z-index: 1003; inset: 0 auto 0 0; width: min(290px, 86vw); height: 100dvh; padding: 22px 16px; transform: translateX(-102%); transition: transform 180ms ease; }
  body[data-theme="ink"] .mobile-nav-open .sidebar { transform: translateX(0); }
  body[data-theme="ink"] .mobile-nav-toggle { top: 16px; left: 12px; min-height: 36px; border-color: var(--ui-line); background: #172630; color: #e5d6bb; box-shadow: none; }
  body[data-theme="ink"] .mobile-nav-open .mobile-nav-backdrop { background: rgba(2, 6, 10, .76); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
  body[data-theme="ink"] .tech-topbar { padding: 0 14px 0 128px; }
  body[data-theme="ink"] .tech-topbar > div:first-child { display: block; }
  body[data-theme="ink"] .tech-topbar strong { font-size: 19px; letter-spacing: .02em; }
  body[data-theme="ink"] .tech-topbar :where(.tech-kicker, small) { display: none; }
  body[data-theme="ink"] .main,
  body[data-theme="ink"] .main.screen-main { padding: calc(var(--ink-topbar-height) + 14px) 12px 14px; }
  body[data-theme="ink"] .main.screen-main.with-project-context:has(.names-screen) { padding-top: calc(var(--ink-topbar-height) + 14px); }
  body[data-theme="ink"] .main > .grid.two { grid-template-columns: minmax(0, 1fr); }
  body[data-theme="ink"] .main > .grid.two > .panel { min-width: 0; overflow-x: auto; }
  body[data-theme="ink"] .tech-login { display: block; height: 100dvh; overflow-y: auto; padding: 28px 20px; }
  body[data-theme="ink"] .tech-login-visual { min-height: 0; max-width: 600px; margin: 0 auto; padding: 0; }
  body[data-theme="ink"] .tech-login-visual::before { display: none; }
  body[data-theme="ink"] .tech-login-copy { margin-top: 32px; }
  body[data-theme="ink"] .tech-login-copy h1 { font-size: 32px; line-height: 1.45; }
  body[data-theme="ink"] .tech-login-copy p { font-size: 12px; }
  body[data-theme="ink"] .tech-signal-row { display: none; }
  body[data-theme="ink"] .tech-login .login-panel { width: min(600px, 100%); margin: 28px auto 0; }
  body[data-theme="ink"]:has(.xhs-reply--dual) .app-shell .main.screen-main { padding: calc(var(--ink-topbar-height) + 14px) 12px 14px; }
  body[data-theme="ink"]:has(.xhs-reply--dual) .mobile-nav-toggle { border-color: var(--ui-line); background: #172630; color: #e5d6bb; }
}

@media (max-width: 560px) {
  body[data-theme="ink"] .tech-topbar { gap: 8px; }
  body[data-theme="ink"] .tech-topbar-status { display: none; }
  body[data-theme="ink"] .tech-topbar strong { font-size: 17px; }
  body[data-theme="ink"] .tech-login { padding: 22px 14px; }
  body[data-theme="ink"] .tech-login-brand strong { font-size: 21px; }
  body[data-theme="ink"] .tech-login-copy { margin-top: 24px; }
  body[data-theme="ink"] .tech-login-copy h1 { font-size: 27px; }
  body[data-theme="ink"] .tech-login-copy p { display: none; }
  body[data-theme="ink"] .tech-login .login-panel { margin-top: 22px; padding: 22px 18px; }
  body[data-theme="ink"] .tech-login-panel-head h1 { font-size: 25px; }
  body[data-theme="ink"] .tech-login-panel-actions { flex-wrap: wrap; }
  body[data-theme="ink"] .ui-theme-switcher--login { margin-left: 0; }
  body[data-theme="ink"] .modal-backdrop { padding: 12px; }
  body[data-theme="ink"] .center-modal { max-height: calc(100dvh - 24px); overflow-y: auto; padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme="ink"] *,
  body[data-theme="ink"] *::before,
  body[data-theme="ink"] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  body[data-theme="ink"] { --ui-text: CanvasText; --ui-text-strong: CanvasText; --ui-text-muted: CanvasText; --ui-text-faint: GrayText; --ui-accent: Highlight; --ui-line: ButtonBorder; --ui-line-strong: Highlight; --ui-surface-1: Canvas; --ui-surface-2: Canvas; --ui-surface-3: Canvas; --ui-surface-selected: Canvas; --ink-glass: none; background: Canvas; color: CanvasText; }
  body[data-theme="ink"] :where(.app-shell, .main, .sidebar, .tech-topbar, .tech-login, .login-panel, .panel, .ui-surface, .ui-theme-switcher, .center-modal) { border-color: ButtonBorder; background: Canvas; color: CanvasText; box-shadow: none; }
  body[data-theme="ink"] :where(button, input, select, textarea):not(:where(.memo-paper, .delivery-book-page, .delivery-pdf-preview, .xhs-canvas-stage, .xhs-note-canvas-stage, .xhs-canvas-frame, .xhs-reference-frame) *) { border-color: ButtonBorder; background: ButtonFace; color: ButtonText; box-shadow: none; }
  body[data-theme="ink"] :where(button.active, button.selected, button.is-active, button[aria-selected="true"]) { outline: 2px solid Highlight; outline-offset: -3px; }
  body[data-theme="ink"] :focus-visible { outline: 3px solid Highlight; outline-offset: 3px; }
  body[data-theme="ink"] :where(.tech-brand-mark, .tech-login-visual)::before,
  body[data-theme="ink"] .tech-brand-mark::after { display: none; }
}
