/* Dawn palette for the existing workbench. Load after styles.css, before home.css. */
.is-workspace,
dialog,
.toast {
  --bg: #fbf8f1;
  --surface: #fffdf8;
  --surface-2: #f4eddf;
  --text: #26251f;
  --muted: #706858;
  --line: #dfc99e;
  --cyan: #124d52;
  --gold: #92713b;
  color-scheme: light;
  color: var(--text);
}
.is-workspace { background: var(--bg); font-size: 15px; line-height: 1.75; }
.is-workspace .workspace-shell { background: radial-gradient(ellipse at 78% 0, #f5e9cd70, transparent 55%), var(--bg); }
.is-workspace ::selection, dialog ::selection { background: #dce9df; color: #143f42; }
.is-workspace :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible,
dialog :is(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid #124d52; outline-offset: 3px;
}
.is-workspace :is(.side-nav, .chat-scroll, .chart-scroll, .table-wrap, pre), dialog {
  scrollbar-color: #b5a17c #f6f0e4; scrollbar-width: thin;
}
.is-workspace .skip-link { background: #124d52; color: #fffdf8; }

/* Persistent navigation and page frame. */
.is-workspace .sidebar {
  width: 252px; padding: 28px 18px 20px; border-color: #dfc99e;
  background: linear-gradient(180deg, #f8f2e6, #f5eddf);
}
.is-workspace .sidebar .brand { margin: 0 7px 25px; color: #333023; gap: 10px; }
.is-workspace .sidebar .brand-mark { width: 35px; height: 35px; color: #92713b; filter: none; }
.is-workspace .sidebar .brand > span { font-size: 21px; font-weight: 700; letter-spacing: 0; }
.is-workspace .sidebar .brand b { font-size: 16px; color: #886930; }
.is-workspace .sidebar .brand small { font-size: 12px; letter-spacing: 1px; color: #706858; }
.is-workspace .new-chat {
  height: auto; min-height: 47px; padding: 9px; flex-shrink: 0;
  background: #124d52; border-color: #124d52; color: #fffdf8; font-size: 14px;
  box-shadow: 0 3px 12px #124d5212;
}
.is-workspace .new-chat:hover { background: #0c3e43; border-color: #0c3e43; }
.is-workspace .side-intro { font-size: 13px; color: #524d40; padding: 19px 7px 8px; }
.is-workspace .side-intro small { color: #706858; font-size: 12px; line-height: 1.6; }
.is-workspace .orb-dot { background: #92713b; box-shadow: 0 0 0 3px #92713b12; }
.is-workspace .side-nav { min-height: 0; }
.is-workspace .nav-group { margin-bottom: 13px; }
.is-workspace .nav-heading { font-size: 12px; color: #82704e; letter-spacing: 1.5px; padding-top: 10px; }
.is-workspace .nav-item { min-height: 45px; height: auto; padding: 10px 13px; font-size: 14px; font-weight: 500; color: #5b5648; }
.is-workspace .nav-item .icon { color: #89734e; width: 18px; height: 18px; }
.is-workspace .nav-item:hover { background: #eee4cf; color: #353023; }
.is-workspace .nav-item.selected { background: #e9e1cf; border-color: #d6c198; color: #124d52; }
.is-workspace .nav-item.selected .icon { color: #124d52; }
.is-workspace .nav-item.selected i { background: #92713b; box-shadow: none; }
.is-workspace .side-profile { border-color: #dfc99e; color: #403c31; font-size: 13px; padding-top: 17px; flex-shrink: 0; }
.is-workspace .side-profile small { color: #706858; font-size: 12px; line-height: 1.5; }
.is-workspace .side-profile > .icon { color: #92713b; }
.is-workspace .profile-avatar { background: #eee1c9; border-color: #d5be92; color: #775a2b; }
.is-workspace .workspace-main { margin-left: 252px; }
.is-workspace .mobile-bottom-nav { display: none; }
.is-workspace .work-header { background: #fbf8f1ed; border-color: #e6d6b8; height: 74px; padding: 0 34px; }
.is-workspace .breadcrumb { color: #706858; font-size: 13px; gap: 12px; }
.is-workspace .breadcrumb i { color: #a49270; }
.is-workspace .breadcrumb b { color: #353023; }
.is-workspace .service-state { color: #706858; font-size: 12px; white-space: nowrap; }
.is-workspace .service-state i { background: #9c7b35; width: 6px; height: 6px; }
.is-workspace .service-state.ready i, .is-workspace .status-dot { background: #397b61; }
.is-workspace .work-content { padding: 36px 38px 40px; }
.is-workspace .workspace-footer { color: #706858; font-size: 12px; letter-spacing: .5px; padding: 12px 20px 24px; }
.is-workspace #calculation-result { scroll-margin-top: 92px; }
.is-workspace .page-heading { gap: 20px; margin-bottom: 28px; }
.is-workspace .page-heading h1 { color: #302c22; font-size: 30px; font-weight: 600; letter-spacing: 0; }
.is-workspace .page-heading p { color: #706858; font-size: 14px; line-height: 1.9; }
.is-workspace .eyebrow, dialog .eyebrow { color: #886930; font-size: 12px; letter-spacing: 1.4px; }
.is-workspace .panel { background: #fffdf8; border-color: #e0cda9; box-shadow: 0 7px 24px #76592708; }
.is-workspace .panel-heading h2 { color: #322e24; font-size: 18px; }

/* Shared controls and non-success states. */
.is-workspace .button, dialog .button { font-size: 14px; min-height: 44px; padding: 10px 18px; }
.is-workspace .button.primary, dialog .button.primary {
  background: #124d52; color: #fffdf8; border-color: #124d52; box-shadow: 0 3px 12px #124d5212;
}
.is-workspace .button.primary:hover, dialog .button.primary:hover { background: #0c3e43; border-color: #0c3e43; box-shadow: 0 4px 15px #124d5222; }
.is-workspace .button.secondary, .is-workspace .button.subtle, dialog .button.secondary {
  background: #faf5e9; color: #5f4c2d; border-color: #d7bf92;
}
.is-workspace .button.secondary:hover, .is-workspace .button.subtle:hover, dialog .button.secondary:hover {
  background: #f0e5cf; border-color: #ae8c50;
}
.is-workspace .icon-button, dialog .icon-button { color: #706046; min-width: 42px; min-height: 42px; }
.is-workspace .icon-button:hover, dialog .icon-button:hover { background: #efe5d2; color: #124d52; }
.is-workspace .quiet-button { color: #706046; font-size: 13px; min-height: 40px; }
.is-workspace .quiet-button:hover { background: #f0e5d2; color: #42351d; }
.is-workspace .text-link { color: #124d52; font-size: 14px; min-height: 40px; }
.is-workspace .text-link:hover { color: #7b5d2a; text-decoration: underline; text-underline-offset: 4px; }
.is-workspace .pill { color: #6d552d; border-color: #dac59f; background: #f8efd9; font-size: 12px; }
.is-workspace .pill.success { color: #27634c; border-color: #aac5ad; background: #edf4e9; }
.is-workspace .hint, dialog .hint { color: #706858; font-size: 13px; line-height: 1.8; }
.is-workspace .notice, dialog .notice {
  background: #faf0d9; border-color: #dfc99e; color: #66502b; font-size: 14px; line-height: 1.9;
}
.is-workspace .notice a, dialog .notice a { color: #124d52; }
.is-workspace .error-message, dialog .error-message {
  color: #9b3531; background: #fff1eb; border: 1px solid #e7b7a8;
  border-radius: 8px; padding: 10px 13px; font-size: 14px;
}
.is-workspace .spinner, dialog .spinner { border-color: #bdb18d; border-top-color: currentColor; }
.is-workspace pre, dialog pre { background: #f5f0e5; border-color: #ddcba9; color: #494639; font-size: 13px; }
.is-workspace summary, dialog summary { color: #5a603e; font-size: 14px; min-height: 40px; padding: 9px 0; }
.is-workspace summary:hover, dialog summary:hover { color: #124d52; }
.is-workspace .engine-symbol { color: #92713b; }

/* Tool parameters, saved profiles and their modal share the same native fields. */
.is-workspace .tool-card { min-height: 238px; padding: 25px; }
.is-workspace .tool-card:hover { background: #fcf6e9; border-color: #b99c68; box-shadow: 0 10px 22px #7659270d; }
.is-workspace .tool-card-top > span { color: #8b7855; font-size: 12px; }
.is-workspace .tool-card h2 { color: #342f23; font-size: 23px; }
.is-workspace .tool-card p { color: #706858; font-size: 14px; }
.is-workspace .tool-card > div:last-child { color: #124d52; font-size: 14px; }
.is-workspace .tool-guide { background: linear-gradient(150deg, #f9f1df, #fffdf8); }
.is-workspace .tool-guide h3 { color: #57452a; }
.is-workspace .guide-line > b { color: #886930; font-size: 13px; }
.is-workspace .guide-line p { color: #4b473a; font-size: 14px; }
.is-workspace .guide-line small { color: #706858; font-size: 12px; }
.is-workspace .tool-guide > .text-link { border-color: #dfc99e; font-size: 13px; }
.is-workspace .field, dialog .field { color: #524b3b; font-size: 14px; gap: 8px; }
.is-workspace .field :is(input, select, textarea),
.is-workspace form input:not([type=checkbox]):not([type=hidden]):not([type=radio]),
.is-workspace form select, .is-workspace form textarea,
dialog .field :is(input, select, textarea),
dialog form input:not([type=checkbox]):not([type=hidden]):not([type=radio]),
dialog form select, dialog form textarea {
  background: #fffefa; color: #302e26; border: 1px solid #cbbb9a;
  min-height: 45px; border-radius: 7px; padding: 10px 12px; font-size: 15px; line-height: 1.6;
}
.is-workspace :is(input, textarea)::placeholder, dialog :is(input, textarea)::placeholder { color: #827866; opacity: 1; }
.is-workspace .field :is(input, select, textarea):disabled, dialog .field :is(input, select, textarea):disabled {
  background: #efebe2; color: #81796b; opacity: 1; cursor: not-allowed;
}
.is-workspace .field :is(.hint, small), dialog .field :is(.hint, small) { color: #706858; font-size: 12px; }
.is-workspace .check-field, dialog .check-field { color: #5e5544; font-size: 14px; min-height: 36px; }
.is-workspace input[type=checkbox], dialog input[type=checkbox] {
  accent-color: #124d52; width: 18px; height: 18px; min-height: 18px; padding: 0; flex-shrink: 0;
}
.is-workspace .section-label { font-size: 14px; color: #806235; letter-spacing: 1px; }
.is-workspace .form-panel fieldset { border-color: #dfc99e; }
.is-workspace .form-panel legend { color: #71592e; font-size: 14px; }
.is-workspace .form-panel .notice { font-size: 13px; }
.is-workspace .advanced-fields, .is-workspace form details, dialog form details { border-color: #e0cfaf; }
.is-workspace form button:not(.button):not(.round-send):not(.icon-button),
dialog form button:not(.button):not(.round-send):not(.icon-button) {
  background: #f5ecd9; color: #68512c; border-color: #cfb98f; font-size: 14px; min-height: 40px;
}
.is-workspace .form-submit { border-color: #e0cfaf; }
.is-workspace .form-submit .hint { font-size: 12px; }

/* All nine engines use these shared result structures. */
.is-workspace .result-toolbar h2 { color: #342e23; }
.is-workspace .result-toolbar p, .is-workspace .input-summary summary { color: #706858; font-size: 13px; }
.is-workspace .result-section { background: #fffdf8; border-color: #decca8; }
.is-workspace .result-heading, .is-workspace .result-section :is(h2, h3) { color: #4e4129; }
.is-workspace .result-section :is(h2, h3) { font-size: 19px; line-height: 1.7; }
.is-workspace .result-section p, .is-workspace .result-section ul { color: #575244; font-size: 14px; }
.is-workspace .result-section dl { font-size: 14px; }
.is-workspace .result-section dt { color: #706858; }
.is-workspace .result-section dd { color: #343126; }
.is-workspace .result-section a { color: #124d52; text-decoration: underline; text-underline-offset: 3px; }
.is-workspace .metric { background: #f5eddd; border-color: #dfc99e; padding: 16px; }
.is-workspace .metric :is(span, label, small) { font-size: 13px; color: #70604a; }
.is-workspace .metric :is(strong, b) { color: #124d52; font-size: 21px; overflow-wrap: anywhere; }
.is-workspace .palace { background: #fcf8ee; border-color: #d9c59f; }
.is-workspace .bazi-pillars .palace { background: linear-gradient(145deg, #f8efd9, #fffdf8); }
.is-workspace .pillar-stem, .is-workspace .pillar-branch { color: #124d52; font-size: 34px; }
.is-workspace .pillar-god { color: #896a33; font-size: 13px; }
.is-workspace .palace :is(h3, h4) { color: #5b4c32; font-size: 14px; }
.is-workspace .palace p, .is-workspace .palace small { color: #70604a; font-size: 12px; overflow-wrap: anywhere; }
.is-workspace .palace-main { color: #124d52; font-size: 18px; }
.is-workspace .palace-stems { color: #88632d; }
.is-workspace .ziwei-grid { min-width: 680px; }
.is-workspace .ziwei-grid .palace { font-size: 13px; min-height: 158px; padding: 13px; }
.is-workspace .ziwei-grid .palace > header { color: #5d4a2c; }
.is-workspace .ziwei-grid .palace > header span, .is-workspace .ziwei-grid .palace > footer { color: #706858; font-size: 12px; }
.is-workspace .major-stars, .is-workspace .ziwei-star { color: #856229; font-size: 14px; }
.is-workspace .ziwei-star small { margin-left: 3px; }
.is-workspace .palace.is-life-palace { background: #f2e7cf; border-color: #a98a50; box-shadow: inset 0 0 0 1px #a98a5030; }
.is-workspace .palace.is-void { border-style: dashed; }
.is-workspace .chart-center { background: radial-gradient(ellipse, #eee2c9, #faf7ee); color: #5d4a2c; }
.is-workspace .chart-center strong { color: #124d52; }
.is-workspace .chart-center p { color: #70604a; font-size: 13px; }
.is-workspace .qimen-grid .palace > header { color: #514027; font-size: 14px; }
.is-workspace .qimen-grid .palace > header > span, .is-workspace .qimen-grid .palace > footer { color: #70604a; font-size: 12px; }
.is-workspace .qimen-grid .palace-stems { font-size: 16px; }
.is-workspace .hexagram h4 { color: #7f602f; font-size: 16px; }
.is-workspace .hexagram > p { color: #575244; font-size: 14px; }
.is-workspace .yao-row span { color: #705733; font-size: 12px; }
.is-workspace .yao-line i { background: #92713b; }
.is-workspace .element-bars label { color: #575244; font-size: 14px; }
.is-workspace .element-bars meter { accent-color: #92713b; height: 16px; }
.is-workspace .element-bars meter::-webkit-meter-bar { background: #eee6d5; border-color: #dfc99e; }
.is-workspace .element-bars meter::-webkit-meter-optimum-value { background: #a2834d; }
.is-workspace .element-bars meter::-moz-meter-bar { background: #a2834d; }
.is-workspace .comparison-charts h4 { color: #6d552e; font-size: 16px; }
.is-workspace .data-table { color: #413b2e; font-size: 14px; min-width: 420px; }
.is-workspace .data-table th { background: #eee3cc; color: #624d2a; font-weight: 500; padding: 12px 14px; }
.is-workspace .data-table td { color: #484335; border-color: #e6d9c2; padding: 13px 14px; }
.is-workspace .data-table tbody tr:nth-child(even) { background: #faf6ed; }
.is-workspace .data-table tr:hover td { background: #f0eadb; }

/* Reports, profiles and settings. */
.is-workspace .search-box { background: #fffdf8; border-color: #d8c7a6; color: #8b7046; }
.is-workspace .search-box input { color: #343126; font-size: 14px; min-height: 44px; }
.is-workspace .report-link h2 { color: #343126; font-size: 18px; overflow-wrap: anywhere; }
.is-workspace .report-link p { color: #706858; font-size: 12px; }
.is-workspace .report-link .eyebrow { font-size: 12px; }
.is-workspace .report-arrow { color: #92713b; }
.is-workspace .empty-state > .icon { color: #92713b; }
.is-workspace .empty-state p { color: #706858; font-size: 14px; }
.is-workspace .profile-card-head { border-color: #e2d2b2; }
.is-workspace .profile-card-head h2 { color: #343126; font-size: 18px; }
.is-workspace .profile-card-head p { color: #706858; font-size: 12px; }
.is-workspace .profile-card dl { font-size: 14px; }
.is-workspace .profile-card dt { color: #706858; flex-shrink: 0; }
.is-workspace .profile-card dd { color: #403a2e; }
.is-workspace .profile-actions { border-color: #e2d2b2; }
.is-workspace .profile-actions .text-link { font-size: 14px; }
.is-workspace .settings-panel > p, .is-workspace .settings-panel details p { color: #5e5748; font-size: 14px; }
.is-workspace .status-list { font-size: 14px; }
.is-workspace .status-list > div { border-color: #e3d5bc; }
.is-workspace .status-list dt { color: #706858; }
.is-workspace .status-list dd { color: #124d52; }
.is-workspace .data-counts b { color: #92713b; }
.is-workspace .data-counts span, .is-workspace .settings-panel .hint { color: #706858; font-size: 13px; }
.is-workspace .setting-toggle { color: #494235; font-size: 14px; }
.is-workspace .setting-toggle small { color: #706858; font-size: 12px; }

/* Chat remains a scrollable conversation with a visible, natural-height composer. */
.is-workspace .chat-main { min-height: 590px; height:calc(100vh - 162px);height: calc(100dvh - 162px); }
.is-workspace .chat-scroll { min-height: 160px; }
.is-workspace .chat-welcome { max-width: 620px; }
.is-workspace .welcome-orb { background: radial-gradient(ellipse, #f4e5bc, #fcf9ef); color: #92713b; border-color: #c4a56a; box-shadow: inset 0 0 22px #e4c98545, 0 0 45px #d8bd7c20; }
.is-workspace .welcome-orb::before, .is-workspace .welcome-orb::after { border-color: #c0a37170; }
.is-workspace .chat-welcome .eyebrow { font-size: 12px; }
.is-workspace .chat-welcome h1 { color: #353024; font-size: 34px; font-weight: 600; letter-spacing: 0; }
.is-workspace .chat-welcome p { color: #706858; font-size: 15px; line-height: 1.9; }
.is-workspace .chat-suggestions button { background: #fbf6e9; color: #6b5632; border-color: #ddc79d; font-size: 13px; min-height: 48px; }
.is-workspace .chat-suggestions button:hover { background: #f0e5cc; border-color: #b39256; }
.is-workspace .chat-model-note { color: #706858; font-size: 12px; flex-wrap: wrap; }
.is-workspace .chat-model-note a { color: #124d52; }
.is-workspace .chat-composer-zone { background: #fbf8f1; flex-shrink: 0; }
.is-workspace .chat-composer { background: #fffefa; border-color: #ceb889; box-shadow: 0 5px 22px #8061300b; }
.is-workspace .chat-composer:focus-within { border-color: #124d52; box-shadow: 0 0 0 2px #124d521e; }
.is-workspace .chat-composer textarea { background: transparent; border: 0; color: #302e26; min-height: 65px; font-size: 15px; line-height: 1.8; padding: 0 3px; }
.is-workspace .composer-bottom > label { color: #7e6841; flex: 1; }
.is-workspace .composer-bottom select { background: #fffefa; border: 0; color: #70604a; font-size: 13px; max-width: 100%; min-height: 40px; padding: 5px 8px; }
.is-workspace .composer-bottom .round-send { width: 44px; height: 44px; flex-basis: 44px; background: #124d52; color: #fffdf8; box-shadow: none; }
.is-workspace .composer-bottom .round-send:hover { background: #0c3e43; }
.is-workspace .chat-footnote { color: #706858; font-size: 12px; line-height: 1.7; }
.is-workspace .chat-context .eyebrow { font-size: 12px; }
.is-workspace .chat-context h2 { color: #4c402a; }
.is-workspace .context-blank { color: #92713b; }
.is-workspace .context-blank p { color: #70604a; font-size: 14px; }
.is-workspace .context-blank small { color: #706858; font-size: 12px; }
.is-workspace .context-bottom { border-color: #e2d2b2; }
.is-workspace .context-bottom > .icon { color: #92713b; }
.is-workspace .context-bottom p, .is-workspace .context-selected p { color: #706858; font-size: 13px; }
.is-workspace .context-bottom .text-link, .is-workspace .context-selected .button { font-size: 13px; }
.is-workspace .context-selected h3 { color: #51432b; font-size: 16px; }
.is-workspace .conversation-title { color: #706858; font-size: 14px; }
.is-workspace .message-avatar { background: #eee1c4; color: #775b2c; }
.is-workspace .message-label { color: #706858; font-size: 12px; }
.is-workspace .message-bubble { background: #fffdf8; color: #343126; border-color: #e1cfaa; font-family: var(--font-serif); font-weight: 500; font-size: var(--reading-size, 16px); }
.is-workspace .from-user .message-bubble { background: #eaf0e7; border-color: #bccfbd; color: #254b3e; }
.is-workspace .from-user .message-avatar { background: #dce8de; color: #124d52; }

/* The native dialog is rendered in the top layer; toast may appear on either page. */
dialog { background: #fffdf8; border-color: #cfb98e; box-shadow: 0 24px 90px #43351e30; font-size: 15px; max-height:calc(100vh - 32px);max-height: calc(100dvh - 32px); }
dialog::backdrop { background: #302b2057; backdrop-filter: blur(4px); }
dialog .dialog-heading h2 { color: #3f3524; }
dialog .dialog-heading .eyebrow { font-size: 12px; }
.toast { background: #124d52; color: #fffdf8; border-color: #356b6d; box-shadow: 0 7px 28px #203d3025; font-size: 14px; line-height: 1.7; }

@media (max-width: 1200px) {
  .is-workspace .work-content { padding: 30px 28px 36px; }
  .is-workspace .chat-main { min-height: 560px; height:calc(100vh - 156px);height: calc(100dvh - 156px); }
}
@media (max-width: 1100px) {
  .is-workspace .tools-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .is-workspace .settings-grid, .is-workspace .profile-grid, .is-workspace .report-list { grid-template-columns: 1fr; }
  .is-workspace .hexagram-grid { grid-template-columns: 1fr; }
  .is-workspace .comparison-charts { grid-template-columns: 1fr; }
  .is-workspace .page-heading { align-items: flex-start; }
  .is-workspace .page-heading > .button { white-space: normal; flex-shrink: 0; }
}
@media (max-width: 860px) {
  .is-workspace .sidebar {
    width: 270px; max-width: calc(100vw - 48px); z-index: 30;
    transform: translateX(-100%); visibility: hidden; transition: transform .2s, visibility .2s;
  }
  .is-workspace.sidebar-open .sidebar { transform: translateX(0); visibility: visible; }
  .is-workspace.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 25; background: #342d224d; backdrop-filter: blur(3px); }
  .is-workspace .workspace-main { margin-left: 0; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
  .is-workspace .mobile-menu { display: inline-grid; }
  .is-workspace .work-header { padding: 0 22px; }
  .is-workspace .chat-main { min-height: 520px; height:calc(100vh - 238px - env(safe-area-inset-bottom, 0px));height: calc(100dvh - 238px - env(safe-area-inset-bottom, 0px)); }
  .is-workspace .chat-scroll { max-height: none; }
  .is-workspace .chat-composer-zone { position: static; padding-bottom: 8px; scroll-margin-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
  .is-workspace .mobile-bottom-nav {
    position: fixed; inset: auto 0 0; z-index: 20; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    height: calc(68px + env(safe-area-inset-bottom, 0px)); gap: 8px;
    padding: 7px 18px calc(7px + env(safe-area-inset-bottom, 0px));
    background: #fffdf8f5; border-top: 1px solid #dfc99e; box-shadow: 0 -3px 16px #76592708;
    backdrop-filter: blur(12px);
  }
  .is-workspace .mobile-bottom-nav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 44px; border-radius: 10px; color: #70604a; font-size: 12px; line-height: 1.5;
  }
  .is-workspace .mobile-bottom-nav .icon { width: 20px; height: 20px; }
  .is-workspace .mobile-bottom-nav a:hover { background: #f5eddd; color: #124d52; }
  .is-workspace .mobile-bottom-nav a.active { background: #eee5d1; color: #124d52; font-weight: 500; }
}
@media (max-width: 600px) {
  .is-workspace .work-header { height: 64px; padding: 0 12px; }
  .is-workspace .work-header > div { gap: 6px; }
  .is-workspace .header-right { gap: 3px !important; }
  .is-workspace .breadcrumb { gap: 6px; font-size: 12px; }
  .is-workspace .service-state { font-size: 12px; gap: 4px; }
  .is-workspace .work-content { padding: 25px 16px 30px; }
  .is-workspace .page-heading { flex-wrap: wrap; gap: 12px; }
  .is-workspace .page-heading h1 { font-size: 28px; }
  .is-workspace .page-heading > .button { margin-top: 0; font-size: 14px; min-height: 44px; }
  .is-workspace .tools-overview { gap: 12px; }
  .is-workspace .tool-card { padding: 19px 14px; min-height: 236px; }
  .is-workspace .tool-card h2 { font-size: 20px; }
  .is-workspace .tool-card p { font-size: 13px; }
  .is-workspace .tool-card > div:last-child { font-size: 13px; gap: 6px; }
  .is-workspace .form-panel { padding: 23px 17px; }
  .is-workspace .form-grid, dialog .form-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .is-workspace .event-row { padding: 14px; border: 1px solid #e0cfaf; border-radius: 9px; }
  .is-workspace .field :is(input, select, textarea),
  .is-workspace form input:not([type=checkbox]):not([type=hidden]):not([type=radio]),
  .is-workspace form select, .is-workspace form textarea,
  dialog .field :is(input, select, textarea), dialog form select, dialog form textarea,
  dialog form input:not([type=checkbox]):not([type=hidden]):not([type=radio]) { font-size: 16px; }
  .is-workspace .result-section { padding: 20px 13px; }
  .is-workspace .result-toolbar { flex-wrap: wrap; }
  .is-workspace .toolbar-actions { flex-wrap: wrap; gap: 8px; }
  .is-workspace .toolbar-actions .button { font-size: 14px; }
  .is-workspace .metric { min-width: 115px; padding: 13px; }
  .is-workspace .bazi-pillars { gap: 6px; }
  .is-workspace .bazi-pillars .palace { padding: 12px 5px; }
  .is-workspace .bazi-pillars .section-label { font-size: 13px; letter-spacing: 0; }
  .is-workspace .pillar-stem, .is-workspace .pillar-branch { font-size: 29px; letter-spacing: 0; }
  .is-workspace .qimen-grid { gap: 6px; }
  .is-workspace .qimen-grid .palace { padding: 10px 7px; }
  .is-workspace .qimen-grid .palace > header { font-size: 13px; }
  .is-workspace .qimen-grid .palace-main { font-size: 14px; }
  .is-workspace .qimen-grid .palace-stems { font-size: 13px; }
  .is-workspace .qimen-grid .palace > header > span, .is-workspace .qimen-grid .palace > footer { font-size: 12px; }
  .is-workspace .qimen-grid .chart-center { padding: 12px 7px; }
  .is-workspace .data-table { font-size: 13px; }
  .is-workspace .data-table :is(th, td) { padding: 11px; }
  .is-workspace .report-filter { flex-wrap: wrap; gap: 10px; }
  .is-workspace .search-box { width: 100%; flex-basis: 100%; }
  .is-workspace .profile-card, .is-workspace .settings-panel { padding: 23px 19px; }
  .is-workspace .profile-card dl > div { gap: 12px; }
  .is-workspace .status-list > div { gap: 14px; }
  .is-workspace .settings-panel > p { font-size: 14px; }
  .is-workspace .chat-main { min-height: 520px; height:calc(100vh - 217px - env(safe-area-inset-bottom, 0px));height: calc(100dvh - 217px - env(safe-area-inset-bottom, 0px)); }
  .is-workspace .chat-scroll { padding: 5px 0 20px; }
  .is-workspace .chat-welcome { margin-top: 24px; }
  .is-workspace .chat-welcome h1 { font-size: 27px; letter-spacing: 0; }
  .is-workspace .chat-welcome p { font-size: 14px; }
  .is-workspace .chat-suggestions { max-width: 350px; }
  .is-workspace .chat-suggestions button { font-size: 14px; }
  .is-workspace .chat-composer-zone { position: static; }
  .is-workspace .chat-composer { padding: 13px; }
  .is-workspace .chat-composer textarea { font-size: 16px; min-height: 65px; }
  .is-workspace .composer-bottom select { font-size: 13px; }
  .is-workspace .message-bubble { font-size: var(--reading-size, 16px); padding: 12px 14px; }
  .is-workspace .message-avatar { width: 29px; height: 29px; }
  .is-workspace .chat-footnote { font-size: 12px; }
  dialog { padding: 24px 18px; }
  dialog .dialog-heading h2 { font-size: 26px; }
  .toast { font-size: 14px; bottom: 18px; }
}
@media (max-width: 380px) {
  .is-workspace .service-state { display: none; }
  .is-workspace .tools-overview { grid-template-columns: 1fr; }
  .is-workspace .tool-card { min-height: 210px; }
}
@media (prefers-reduced-motion: reduce) {
  .is-workspace .sidebar { transition: none; }
}
/* One viewport frame: only the conversation scrolls, not a second outer page. */
.is-workspace.is-chat .workspace-main { height:100vh;height: 100dvh; display: flex; flex-direction: column; min-height: 0; }
.is-workspace.is-chat .work-header { flex-shrink: 0; }
.is-workspace.is-chat .work-content { flex: 1; min-height: 0; width: 100%; margin: 0 auto; }
.is-workspace .chat-layout { height: 100%; min-height: 0; }
.is-workspace .chat-main { height: 100%; min-height: 0; }
.is-workspace.is-chat .workspace-footer { display: none; }
@media (max-width:600px) {
  .is-workspace .chat-welcome { margin: 12px auto; }
  .is-workspace .welcome-orb { width: 64px; height: 64px; margin-bottom: 20px; }
  .is-workspace .chat-welcome h1 { font-size: 25px; margin: 14px 0; }
  .is-workspace .chat-suggestions { grid-template-columns: repeat(3,minmax(0,1fr)); margin-top: 20px; }
  .is-workspace .chat-suggestions button { min-height: 58px; font-size: 12px; padding: 10px; }
  .is-workspace .chat-suggestions .icon { display: none; }
  .is-workspace .toast { bottom: calc(82px + env(safe-area-inset-bottom,0px)); }
}
@media print {
  .is-workspace.is-chat .workspace-main { height: auto; display: block; }
  .is-workspace, .is-workspace .workspace-shell, .is-workspace .workspace-main { background: #fff; color: #26251f; }
  .is-workspace .workspace-main { margin: 0; padding-bottom: 0; }
  .is-workspace .work-content { max-width: none; padding: 0; }
  .is-workspace .report-view, .is-workspace .result-section, .is-workspace .panel, .is-workspace .palace,
  .is-workspace .bazi-pillars .palace, .is-workspace .chart-center, .is-workspace .metric {
    background: #fff; border-color: #c7baa1; box-shadow: none; color: #26251f;
  }
  .is-workspace .result-section { break-inside: auto; }
  .is-workspace .palace, .is-workspace .metric, .is-workspace .data-table tr { break-inside: avoid; }
  .is-workspace .table-wrap, .is-workspace .chart-scroll { overflow: visible; }
  .is-workspace .ziwei-grid, .is-workspace .data-table { min-width: 0; }
  .is-workspace .data-table { font-size: 11pt; }
  .is-workspace .data-table th { background: #f1eadc; color: #3c3426; white-space: normal; }
  .is-workspace .data-table td { color: #363126; overflow-wrap: anywhere; }
  .is-workspace .result-section p, .is-workspace .palace p, .is-workspace .hint { color: #514936; }
  .is-workspace .sidebar-scrim, .is-workspace .mobile-bottom-nav, .is-workspace .chat-composer-zone, .toast, dialog { display: none !important; }
}

.is-report-center .work-content { padding: 0 !important; }
.is-report-center .workspace-shell { background: #f6f5f1; }
.is-report-center .work-header { height: 52px; background: #f9f9f7; border-color: #e5e3de; }
.is-report-center .sidebar { width: 280px; background: #f6f6f4; border-color: #e5e3de; padding: 24px 20px 16px; }
.is-report-center .workspace-main { margin-left: 280px; }
.is-report-center .nav-item.selected { background: #eeede8; color: #71684f; border-color: transparent; }
.is-report-center .new-chat { background: #8a806a; border-color: #8a806a; box-shadow: none; }
.is-report-center .workspace-footer { background: #f6f5f1; }
.rp-loading { padding: 60px; text-align: center; color: #81796b; }
.rp-share-dialog,.rp-profile-dialog,.rp-confirm-dialog { width: min(720px,calc(100vw - 28px)); padding: 26px; background: #fffdf8; border: 1px solid #dfd7c7; border-radius: 16px; }
.rp-share-dialog textarea { width: 100%; }
.rp-share-dialog::backdrop,.rp-profile-dialog::backdrop,.rp-confirm-dialog::backdrop { background: #0008; }
@media(max-width:860px){.is-report-center .workspace-main{margin-left:0}.is-report-center .sidebar{width:280px}.is-report-center .work-header{padding:0 18px}}
