:root,
[data-theme="classic"] {
  --theme-accent: #3b82f6;
  --theme-accent-bright: #60a5fa;
  --theme-on-accent: #fff;
  --theme-bg: #f9fafb;
  --theme-chat-bg: #f8fafc;
  --theme-panel: #fff;
  --theme-card: #fff;
  --theme-hover: #eff6ff;
  --theme-border: #e5e7eb;
  --theme-text: #1f2937;
  --theme-text-secondary: #6b7280;
  --theme-nav-active: rgba(59, 130, 246, 0.08);
  --theme-nav-hover: rgba(59, 130, 246, 0.06);
  --theme-logo-end: #10b981;
  --theme-shadow: 0 12px 40px rgba(15, 23, 42, 0.12), 0 0 1px rgba(15, 23, 42, 0.08);
}

[data-theme="midnight"] {
  --theme-accent: #c9a96e;
  --theme-accent-bright: #e8c988;
  --theme-on-accent: #080a0e;
  --theme-bg: #080a0e;
  --theme-chat-bg: #080a0e;
  --theme-panel: #0d1117;
  --theme-card: #111620;
  --theme-hover: #161d2e;
  --theme-border: rgba(201, 169, 110, 0.3);
  --theme-text: #e8eaf0;
  --theme-text-secondary: #8892a4;
  --theme-nav-active: rgba(201, 169, 110, 0.16);
  --theme-nav-hover: rgba(201, 169, 110, 0.1);
  --theme-logo-end: #e8c988;
  --theme-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

[data-theme="ocean"] {
  --theme-accent: #5b9df0;
  --theme-accent-bright: #8dbdf5;
  --theme-on-accent: #080a0e;
  --theme-bg: #070b12;
  --theme-chat-bg: #070b12;
  --theme-panel: #0c1322;
  --theme-card: #101a2e;
  --theme-hover: #16233c;
  --theme-border: rgba(91, 157, 240, 0.3);
  --theme-text: #e5ecf7;
  --theme-text-secondary: #8ea3c0;
  --theme-nav-active: rgba(91, 157, 240, 0.16);
  --theme-nav-hover: rgba(91, 157, 240, 0.1);
  --theme-logo-end: #8dbdf5;
  --theme-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

[data-theme="jade"] {
  --theme-accent: #46c997;
  --theme-accent-bright: #72ddb0;
  --theme-on-accent: #07100c;
  --theme-bg: #07100c;
  --theme-chat-bg: #07100c;
  --theme-panel: #0b1812;
  --theme-card: #0f2018;
  --theme-hover: #152b20;
  --theme-border: rgba(70, 201, 151, 0.3);
  --theme-text: #e1f2ea;
  --theme-text-secondary: #8fb8a8;
  --theme-nav-active: rgba(70, 201, 151, 0.16);
  --theme-nav-hover: rgba(70, 201, 151, 0.1);
  --theme-logo-end: #72ddb0;
  --theme-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
}

[data-theme="ivory"] {
  --theme-accent: #9a6b3f;
  --theme-accent-bright: #c08a4d;
  --theme-on-accent: #fff;
  --theme-bg: #f3eee6;
  --theme-chat-bg: #f3eee6;
  --theme-panel: #faf6ef;
  --theme-card: #fffdf8;
  --theme-hover: #efe6d6;
  --theme-border: rgba(154, 107, 63, 0.3);
  --theme-text: #2a241c;
  --theme-text-secondary: #5f5648;
  --theme-nav-active: rgba(154, 107, 63, 0.12);
  --theme-nav-hover: rgba(154, 107, 63, 0.08);
  --theme-logo-end: #c08a4d;
  --theme-shadow: 0 12px 40px rgba(80, 60, 30, 0.18);
}

[data-theme="mist"] {
  --theme-accent: #3d6fb3;
  --theme-accent-bright: #5a8cc9;
  --theme-on-accent: #fff;
  --theme-bg: #eef1f5;
  --theme-chat-bg: #eef1f5;
  --theme-panel: #f6f8fb;
  --theme-card: #fff;
  --theme-hover: #e4eaf2;
  --theme-border: rgba(61, 111, 179, 0.3);
  --theme-text: #1f2733;
  --theme-text-secondary: #4d5c6e;
  --theme-nav-active: rgba(61, 111, 179, 0.12);
  --theme-nav-hover: rgba(61, 111, 179, 0.08);
  --theme-logo-end: #5a8cc9;
  --theme-shadow: 0 12px 40px rgba(30, 50, 80, 0.18);
}

.entagent-theme {
  background: var(--theme-bg);
  color: var(--theme-text);
}

/* Rich-text editors keep a white document canvas in every app theme. */
.entagent-theme .ai-document-editor-shell,
.entagent-theme .doc-editor-shell {
  color: #1f2937;
}

.entagent-theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--theme-border);
  border-radius: 8px;
  padding: 6px 10px;
  background: var(--theme-panel);
  color: var(--theme-text);
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.entagent-theme-switcher:hover,
.entagent-theme-switcher:focus-visible {
  border-color: var(--theme-accent);
  background: var(--theme-hover);
}

.entagent-theme-switcher:focus-visible {
  outline: 2px solid var(--theme-accent);
  outline-offset: 2px;
}

.entagent-theme-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 92px;
}

.entagent-theme-option .anticon {
  margin-left: auto;
  color: var(--theme-accent);
}

.entagent-theme-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: 0 0 0 1px var(--theme-border);
}

@media (max-width: 1260px) {
  .entagent-theme-switcher {
    padding: 7px;
  }
  .entagent-theme-switcher > span:last-child {
    display: none;
  }
}
.ip-page {
  --ip-ink: #142b3b;
  --ip-accent: #087f8c;
  --ip-paper: #f7f9f9;
  --ip-line: #d7e1e3;
  color: var(--ip-ink);
  width: 100%;
  box-sizing: border-box;
  padding: 24px;
}

.ip-page--patent { --ip-accent: #8c5f1e; }

.ip-page__heading, .ip-section__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.ip-page__heading { margin-bottom: 24px; }
.ip-page__heading h1 { margin: 8px 0; font-size: 24px; font-weight: 600; line-height: 1.35; }
.ip-page__heading p { margin: 0; color: #647682; font-size: 14px; }
.ip-eyebrow { color: var(--ip-accent); font: 700 11px/1.4 Consolas, monospace; letter-spacing: .15em; }
.ip-page__actions { display: flex; gap: 10px; flex-shrink: 0; }
.ip-page .ant-btn-primary { background: var(--ip-accent); border-color: var(--ip-accent); }
.ip-page .ant-btn-primary:hover { background: #075f69 !important; border-color: #075f69 !important; }
.ip-page--patent .ant-btn-primary:hover { background: #714b17 !important; border-color: #714b17 !important; }
.ip-ledger-heading { border-top: 2px solid var(--ip-ink); border-bottom: 1px solid var(--ip-line); display: flex; justify-content: space-between; padding: 14px 2px; font-size: 12px; font-weight: 600; letter-spacing: .05em; }
.ip-ledger-heading span:last-child { font-weight: 400; color: #71838e; }
.ip-project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 14px; padding-top: 20px; }
.ip-project-card { appearance: none; border: 1px solid var(--ip-line); background: white; border-radius: 8px; text-align: left; color: inherit; min-height: 172px; padding: 20px 22px; display: flex; flex-direction: column; cursor: pointer; transition: border-color .18s, transform .18s, box-shadow .18s; }
.ip-project-card:hover { border-color: var(--ip-accent); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(20,43,59,.08); }
.ip-project-card:focus-visible { outline: 3px solid var(--ip-accent); outline-offset: 2px; }
.ip-project-card__overline { color: var(--ip-accent); font: 600 11px Consolas, monospace; margin-bottom: 17px; }
.ip-project-card strong { font-size: 17px; line-height: 1.45; }
.ip-project-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; color: var(--ip-accent); }
.ip-empty { padding: 72px 0; background: white; }
.ip-pagination { display: flex; justify-content: flex-end; margin-top: 24px; }
.ip-workbench { display: grid; grid-template-columns: 176px minmax(0, 1fr) 244px; gap: 22px; align-items: start; }
.ip-workbench__nav, .ip-workbench__aside, .ip-section { border: 1px solid var(--ip-line); background: #fff; border-radius: 8px; }
.ip-workbench__nav { position: sticky; top: 88px; padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.ip-workbench__nav button { appearance: none; border: 0; background: transparent; color: #536875; cursor: pointer; text-align: left; border-radius: 5px; padding: 10px 12px; font-size: 13px; }
.ip-workbench__nav button[aria-current='step'] { background: #eaf4f4; color: var(--ip-accent); font-weight: 700; }
.ip-workbench__nav button:hover { background: #f1f5f5; }
.ip-workbench__main { min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.ip-workbench__aside { position: sticky; top: 88px; padding: 22px; }
.ip-workbench__aside h3 { font: 600 18px 'Noto Serif SC', 'Songti SC', serif; margin: 8px 0 16px; }
.ip-workbench__aside p, .ip-muted { color: #72828b; font-size: 12px; line-height: 1.55; }
.ip-section { padding: 25px; }
.ip-section h2 { margin: 6px 0 0; font-size: 20px; }
.ip-section__heading { margin-bottom: 24px; }
.ip-section .ant-form-item:last-child { margin-bottom: 0; }
.ip-outline-assistant-action { display: flex; justify-content: flex-end; margin: -6px 0 30px; }
.ip-outline-assistant-action .ant-btn { color: var(--ip-accent); border-color: var(--ip-line); }
.ip-task-status { margin-top: 16px; display: grid; gap: 10px; }
.ip-issue-list { margin-top: 18px; }
.ip-evidence { border-left: 3px solid var(--ip-accent); background: var(--ip-paper); padding: 12px 16px; margin: 12px 0; font-size: 13px; }
@media (max-width: 1100px) { .ip-workbench { grid-template-columns: 160px minmax(0, 1fr); } .ip-workbench__aside { grid-column: 2; position: static; } }
@media (max-width: 720px) { .ip-page__heading { align-items: flex-start; flex-direction: column; } .ip-workbench { display: block; } .ip-workbench__nav { position: static; display: flex; flex-direction: row; overflow-x: auto; margin-bottom: 14px; } .ip-workbench__nav button { white-space: nowrap; } .ip-workbench__aside { margin-top: 16px; } .ip-section { padding: 18px; } }
@media (prefers-reduced-motion: reduce) { .ip-project-card { transition: none; } }

html[data-theme]:not([data-theme="classic"]) .ip-page {
  --ip-ink: var(--theme-text);
  --ip-accent: var(--theme-accent);
  --ip-paper: var(--theme-bg);
  --ip-line: var(--theme-border);
}
html[data-theme]:not([data-theme="classic"]) .ip-page__heading p,
html[data-theme]:not([data-theme="classic"]) .ip-ledger-heading span:last-child,
html[data-theme]:not([data-theme="classic"]) .ip-muted,
html[data-theme]:not([data-theme="classic"]) .ip-workbench__aside p,
html[data-theme]:not([data-theme="classic"]) .ip-workbench__nav button {
  color: var(--theme-text-secondary);
}
html[data-theme]:not([data-theme="classic"]) .ip-project-card,
html[data-theme]:not([data-theme="classic"]) .ip-empty,
html[data-theme]:not([data-theme="classic"]) .ip-workbench__nav,
html[data-theme]:not([data-theme="classic"]) .ip-workbench__aside,
html[data-theme]:not([data-theme="classic"]) .ip-section {
  background: var(--theme-card);
}
html[data-theme]:not([data-theme="classic"]) .ip-workbench__nav button:hover,
html[data-theme]:not([data-theme="classic"]) .ip-workbench__nav button[aria-current='step'] {
  background: var(--theme-hover);
  color: var(--theme-accent);
}
html[data-theme]:not([data-theme="classic"]) .ip-page .ant-btn-primary:hover {
  background: var(--theme-accent-bright) !important;
  border-color: var(--theme-accent-bright) !important;
}
