@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("./fonts/HarmonyOS_Sans_SC_Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("./fonts/HarmonyOS_Sans_SC_Medium.ttf") format("truetype");
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans SC";
  src: url("./fonts/NotoSansSC.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ui-font: "HarmonyOS Sans SC", "Noto Sans SC", system-ui, "Microsoft YaHei", sans-serif;
  --font-system: 14px;
  --font-body: 13px;
  --font-small: 11px;
  --font-sidebar-menu: 14px;
  --sidebar-menu-gap: 10px;
  --sidebar-menu-letter-spacing: .5px;
  --sidebar-logo-gap: 10px;
  --weight-regular: 400;
  --weight-medium: 500;
  --control-height: 28px;
  --pagination-height: 26px;
  --nav-height: 32px;
  --table-row-height: 34px;
  --status-height: 22px;
  --table-block-padding: 8px;
  --button-inline-padding: 11px;
  --control-radius: 3px;
  --panel-radius: 4px;
  --border-width: 1px;
  --icon-gap: 5px;
  --icon-size: 14px;
  --icon-small: 11px;
  --icon-large: 16px;
}

.jzc-icon-symbols {
  position: absolute;
  inline-size: 0;
  block-size: 0;
  overflow: hidden;
  pointer-events: none;
}

.jzc-icon.jzc-icon {
  display: inline-block;
  width: var(--icon-size);
  height: var(--icon-size);
  flex: none;
  pointer-events: none;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jzc-icon.jzc-icon--small { width: var(--icon-small); height: var(--icon-small); }
.jzc-icon.jzc-icon--large { width: var(--icon-large); height: var(--icon-large); }

@media screen {
  .app .sidebar #nav .nav-item,
  .app .sidebar #nav .nav-item > span:not(.nav-arrow),
  #secondary-menu :is(.secondary-heading, .secondary-link, .secondary-link strong) {
    font-size: var(--font-sidebar-menu) !important;
    letter-spacing: var(--sidebar-menu-letter-spacing);
  }

  .app .sidebar > .jzc-brand {
    margin-block-end: 0;
    transform-origin: center bottom;
  }

  .app .sidebar #nav {
    margin-block-start: var(--sidebar-logo-gap);
    row-gap: var(--sidebar-menu-gap);
    padding-block: 0;
  }

  #secondary-menu .secondary-link {
    display: flex;
    align-items: center;
    min-height: var(--nav-height);
    margin-block: 0;
    padding-block: 0;
    box-sizing: border-box;
  }
  #secondary-menu { box-sizing: border-box; }

  :is(#secondary-menu, #secondary-menu .tertiary-menu)
    > :is(.secondary-link, .secondary-branch) + :is(.secondary-link, .secondary-branch) {
    margin-block-start: var(--sidebar-menu-gap);
  }

  :root[data-ui-theme="deep-space"] {
    --sidebar-bg: #123047;
    --sidebar-fg: rgba(255,255,255,.72);
    --sidebar-marker: #7FA8C0;
    --nav-muted: rgba(255,255,255,.55);
    --page-bg: #F4F7F9;
    --surface: #FFFFFF;
    --head-bg: #E7EFF4;
    --border: #DAE4EB;
    --text: #1F2D38;
    --text-2: #637888;
    --primary: #1D4E6B;
    --accent: #2E86AB;
    --selected-bg: #DFEDF5;
    --zebra: #F9FBFC;
    --hover-bg: #EEF5F9;
    --success: #177A5A;
    --warning: #9A6410;
    --danger: #B93B32;
    --on-primary: #FFFFFF;
    --nav-hover: rgba(255,255,255,.08);
    --nav-selected: rgba(127,168,192,.16);
    --positive-chip-bg: var(--surface);
    --negative-chip-bg: var(--surface);
    --warning-chip-bg: var(--surface);
    --ui-bg: var(--page-bg);
    --ui-surface: var(--surface);
    --ui-text: var(--text);
    --ui-secondary: var(--text-2);
    --ui-muted: var(--text-2);
    --ui-primary: var(--primary);
    --ui-primary-hover: var(--primary);
    --ui-primary-soft: var(--selected-bg);
    --ui-border: var(--border);
    --ui-control: var(--border);
    --ui-blue: var(--accent);
    --ui-radius: var(--panel-radius);
    --ui-shadow: none;
    --green: var(--primary);
    --dark: var(--text);
    --muted: var(--text-2);
    --line: var(--border);
    --bg: var(--page-bg);
    --module-header-height: var(--table-row-height);
    --module-header-font: var(--font-body);
    --module-body-font: var(--font-body);
    --query-font: var(--font-body);
    --query-label: var(--font-body);
    --query-height: var(--control-height);
    --jzc-color-1463ff: var(--primary);
    --jzc-color-0957ed: var(--primary);
    --jzc-color-287bda: var(--accent);
    --jzc-color-263c69: var(--text);
    --jzc-color-294473: var(--text);
    --jzc-color-213b70: var(--text);
    --jzc-color-58739b: var(--text-2);
    --jzc-color-788fb2: var(--text-2);
    --jzc-color-c7d9f3: var(--border);
    --jzc-color-e4edfb: var(--border);
    --jzc-color-e7effb: var(--border);
    --jzc-color-eaf2fd: var(--border);
    --jzc-color-d5e4fa: var(--border);
    --jzc-color-f4f9ff: var(--page-bg);
    --jzc-color-f0f7ff: var(--head-bg);
    --jzc-color-edf5ff: var(--selected-bg);
    --jzc-color-f5faff: var(--hover-bg);
    --jzc-color-f9fcff: var(--zebra);
    --ink: var(--text);
    --ink-muted: var(--text-2);
    --ink-soft: var(--text-2);
    --ink-faint: var(--text-2);
    --blue: var(--primary);
    --blue-hover: var(--primary);
    --blue-soft: var(--selected-bg);
    --lime: var(--success);
    --leaf-text: var(--success);
    --red: var(--danger);
    --red-text: var(--danger);
  }

  [data-ui-theme="deep-space"] body {
    color: var(--text);
    background: var(--page-bg);
    font: var(--weight-regular) var(--font-body)/1.4 var(--ui-font);
    font-synthesis: none;
  }

  /* Module styles currently specify their own control and table sizes. The
     screen theme sets one scale while the original print styles remain intact. */
  [data-ui-theme="deep-space"] :is(.app, dialog, .secondary-menu, .tertiary-menu, .jzc-cloud-theme)
    :where(*):not(svg, svg *, .sr-only, .visually-hidden) {
    font-family: var(--ui-font) !important;
    font-size: var(--font-body) !important;
  }

  [data-ui-theme="deep-space"] :is(.app, dialog, .secondary-menu, .tertiary-menu, .jzc-cloud-theme)
    :is(h1, h2, h3, h4, strong, b, th, [aria-selected="true"]) {
    font-weight: var(--weight-medium);
  }

  [data-ui-theme="deep-space"] :is(.app, .jzc-cloud-theme) :is(.brand, .system-name) {
    font-size: var(--font-system) !important;
  }

  [data-ui-theme="deep-space"] :is(.app, .jzc-cloud-theme)
    :is(.nav-caption, .workspace-label, .service-status, .avatar, .company-avatar, footer, footer *) {
    font-size: var(--font-small) !important;
  }

  [data-ui-theme="deep-space"] .sidebar {
    color: var(--sidebar-fg);
    background: var(--sidebar-bg);
    border-color: var(--sidebar-bg);
  }

  [data-ui-theme="deep-space"] .sidebar .jzc-brand .jzc-wordmark {
    filter: brightness(0) invert(1);
  }

  [data-ui-theme="deep-space"] .sidebar :is(.workspace-label, .nav-caption, .service-status) {
    color: var(--nav-muted);
  }

  [data-ui-theme="deep-space"] .sidebar #nav .nav-item {
    height: var(--nav-height);
    min-height: var(--nav-height);
    padding-block: 0;
    gap: var(--icon-gap);
    color: var(--sidebar-fg);
    border-radius: var(--control-radius);
    letter-spacing: normal;
    font-weight: var(--weight-regular);
    box-shadow: none;
  }

  [data-ui-theme="deep-space"] .sidebar #nav .nav-item :is(span, .jzc-icon, .nav-arrow) { color: inherit; }
  [data-ui-theme="deep-space"] .sidebar #nav .nav-item:hover:not(.active) {
    background: var(--nav-hover);
    color: var(--on-primary);
  }

  [data-ui-theme="deep-space"] .sidebar #nav .nav-item:is(.active, [aria-expanded="true"]) {
    background: var(--nav-selected);
    color: var(--on-primary);
    font-weight: var(--weight-medium);
    box-shadow: none;
  }

  [data-ui-theme="deep-space"] .sidebar .nav-item.active::before {
    display: block;
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    height: auto;
    background: var(--sidebar-marker);
    border-radius: var(--control-radius) 0 0 var(--control-radius);
  }

  [data-ui-theme="deep-space"] .sidebar .nav-item:focus-visible { outline-color: var(--sidebar-marker); }

  [data-ui-theme="deep-space"] :is(.topbar, .workspace-tabs-row, .cloud-header) {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
    box-shadow: none;
  }

  [data-ui-theme="deep-space"] :is(.topbar, .workspace-tabs-row)
    :is(.topbar-left, .topbar-right, .topbar-company, .topbar-period, .profile, .breadcrumb, .workspace-tab:not(.active)) {
    color: var(--text);
  }

  [data-ui-theme="deep-space"] :is(.app, dialog, .jzc-cloud-theme)
    :is(.card, .module-card, .settings-card, .hw-panel, .vm-toolbar, .vm-main, .ledger-result, .module-table-card, .portal-card, .account-panel) {
    border-color: var(--border);
    border-radius: var(--panel-radius);
    box-shadow: none;
  }

  /* The existing modal variants control size and positioning. The outer frame is shared. */
  html[data-ui-theme="deep-space"] :is(#modal, #secondary-menu, dialog, [role="dialog"], [popover],
    .tertiary-menu, .io-menu-list, .book-date-popup, .ledger-filter-popup, .account-search-popup,
    .voucher-subject-popup, .account-aux-options, .account-unit-list, .workspace-book-options, .fd-account-dropdown,
    .vk-help-panel, .notice-centered) {
    color: var(--text);
    background: var(--surface);
    border: var(--border-width) solid var(--border);
    border-radius: var(--panel-radius);
    box-shadow: none;
  }

  html[data-ui-theme="deep-space"] :is(#secondary-menu, .tertiary-menu, .io-menu-list)[data-hover-arrow]::after {
    background-color: var(--surface);
    border-color: var(--border);
  }

  html[data-ui-theme="deep-space"] #secondary-menu .secondary-link {
    border-radius: var(--panel-radius);
  }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme)
    :is(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="range"], [type="file"], [type="color"]), select):not(.voucher-editor *) {
    height: var(--control-height) !important;
    min-height: var(--control-height) !important;
    padding-block: 0 !important;
    border-radius: var(--control-radius) !important;
    border-color: var(--border) !important;
    border-width: var(--border-width);
    background-color: var(--surface);
    color: var(--text);
    line-height: 18px;
    box-sizing: border-box;
  }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme) textarea {
    border-radius: var(--control-radius);
    border-color: var(--border);
    background-color: var(--surface);
    color: var(--text);
  }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme)
    :is(.btn, .button, .zc-outline-button, [data-legacy-upload], .period-select, input[type="submit"])
    :where(.jzc-icon) { color: inherit; }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme)
    :is(.btn, .button, .zc-outline-button, [data-legacy-upload], .period-select, input[type="submit"]) {
    min-height: var(--control-height) !important;
    height: var(--control-height) !important;
    padding: 0 var(--button-inline-padding) !important;
    align-items: center;
    gap: var(--icon-gap);
    color: var(--primary);
    background: var(--surface);
    border-color: var(--border);
    border-width: var(--border-width);
    border-radius: var(--control-radius) !important;
    line-height: 18px;
    box-shadow: none;
  }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme)
    :is(.btn.primary, .button.default, [data-vm-query], [data-ledger-query], .ledger-query-actions button[type="submit"], .vm-query-actions button[type="submit"]) {
    background: var(--primary) !important;
    color: var(--on-primary) !important;
    border-color: var(--primary) !important;
  }

  [data-ui-theme="deep-space"] :is(.app, dialog, .jzc-cloud-theme)
    :is(.pagination, .pager, .vm-pagination, .ledger-pagination, .paginator, .workspace-pagination) :is(button, a, .this-page) {
    min-height: var(--pagination-height) !important;
    height: var(--pagination-height) !important;
    border-radius: var(--control-radius);
    line-height: 18px;
  }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme) table :is(th, td) {
    color: var(--text) !important;
    border-color: var(--border) !important;
    border-width: var(--border-width);
    line-height: 18px;
    vertical-align: middle;
  }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme) table :is(thead, tfoot) tr > :is(th, td),
  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme) table :is(.total, .vm-total, .vm-subtotal, .ledger-balance-total) > td {
    height: auto !important;
    padding-block: var(--table-block-padding) !important;
    background: var(--head-bg) !important;
    font-weight: var(--weight-medium);
  }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme)
    table tbody > tr:not(.total, .vm-total, .vm-subtotal, .ledger-balance-total) > :is(td, th) {
    padding-block: 0;
    background-color: var(--surface);
  }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme)
    table:not(.voucher-sheet) tbody > tr:not(.total, .vm-total, .vm-subtotal, .ledger-balance-total) > :is(td, th) {
    height: var(--table-row-height) !important;
  }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme)
    table tbody > tr:nth-child(even):not(.total, .vm-total, .vm-subtotal, .ledger-balance-total) > :is(td, th) {
    background-color: var(--zebra);
  }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme)
    table:not(.vm-table) tbody > tr:hover:not(.total, .vm-total, .vm-subtotal, .ledger-balance-total) > :is(td, th) {
    background-color: var(--hover-bg) !important;
  }

  [data-ui-theme="deep-space"] :is(#main, dialog, .jzc-cloud-theme)
    table :is(tr.is-selected, tr.selected, tr[aria-selected="true"]) > :is(td, th) {
    background: var(--selected-bg) !important;
  }

  html[data-ui-theme="deep-space"] #main .vm-table .vm-group .vm-subtotal > td {
    background: var(--vm-subtotal-bg) !important;
    border-top: var(--border-width) solid var(--border);
  }

  html[data-ui-theme="deep-space"] #main .vm-table .vm-group .vm-subtotal > .vm-subtotal-gutter {
    border-top: 0;
  }

  html[data-ui-theme="deep-space"] #main .vm-table .vm-group:not(.is-selected) .vm-subtotal > .vm-subtotal-gutter {
    background: var(--surface) !important;
  }

  [data-ui-theme="deep-space"] #main :is(.vm-account, td.summary, td.subject, .voucher-subject-search, .line-summary) {
    color: var(--text) !important;
  }

  [data-ui-theme="deep-space"] :is(.app, dialog, .jzc-cloud-theme)
    :is(.tag, .badge, .status-label, .status-badge, [data-ui-status]) {
    align-items: center;
    display: inline-flex;
    min-height: var(--status-height);
    padding: 0 6px;
    border-radius: var(--control-radius);
    line-height: 18px;
  }

  [data-ui-theme="deep-space"] :is(.tag.warning, .badge.warning, .is-pending, [data-ui-status="warning"]) {
    color: var(--warning) !important;
    background: var(--warning-chip-bg) !important;
  }

  [data-ui-theme="deep-space"] :is(.tag.success, .badge.success, [data-ui-status="success"]) {
    color: var(--success) !important;
    background: var(--positive-chip-bg) !important;
  }

  [data-ui-theme="deep-space"] :is(.tag.danger, .badge.danger, [data-ui-status="danger"]) {
    color: var(--danger) !important;
    background: var(--negative-chip-bg) !important;
  }

  [data-ui-theme="deep-space"] :is(.error, .text-danger) { color: var(--danger); }
  [data-ui-theme="deep-space"] :is(.btn, a, input, select, textarea):focus-visible { outline-color: var(--accent); }
  [data-ui-theme="deep-space"] input:is([type="radio"], [type="checkbox"]) { accent-color: var(--primary); }
  [data-ui-theme="deep-space"] .inline-icon-label { display: inline-flex; align-items: center; gap: var(--icon-gap); }
  [data-ui-theme="deep-space"] .text-button:has(> .jzc-icon) {
    align-items: center;
  }
  [data-ui-theme="deep-space"] .text-button > .jzc-icon:not(:only-child) {
    margin-inline-end: var(--icon-gap);
  }

  [data-ui-theme="deep-space"] .sidebar .help-card {
    border-color: var(--nav-selected);
    background: var(--nav-hover);
    color: var(--sidebar-fg);
    border-radius: var(--panel-radius);
  }

  [data-ui-theme="deep-space"] .sidebar .help-card :is(p, button) { color: inherit; }
  [data-ui-theme="deep-space"] .sidebar .help-icon { display: none; }
  [data-ui-theme="deep-space"] .sidebar .help-card button:hover { color: var(--on-primary); }

  :is(#main, .app) summary:has(> .jzc-disclosure-icon) { list-style: none; }
  :is(#main, .app) summary:has(> .jzc-disclosure-icon)::-webkit-details-marker { display: none; }
  .jzc-disclosure-icon { display: inline-flex; margin-inline-end: var(--icon-gap); }
  details[open] > summary > .jzc-disclosure-icon { transform: rotate(90deg); }

  [data-ui-theme="deep-space"] #main .workspace-home-hero {
    background: var(--surface);
    border: var(--border-width) solid var(--border);
    border-radius: var(--panel-radius);
    box-shadow: none;
  }

  [data-ui-theme="deep-space"] #main .workspace-home-hero-art { visibility: hidden; }
  [data-ui-theme="deep-space"] #main :is(.hw-heading h1, .hw-panel-head h2, .hw-kpi > strong, .hw-task b, .hw-balance-line strong) {
    color: var(--text);
  }

  [data-ui-theme="deep-space"] #main .hw-heading h1 {
    font-size: var(--font-sidebar-menu) !important;
  }

  [data-ui-theme="deep-space"] #main :is(.hw-heading p, .hw-kpi-label, .hw-kpi-change, .hw-task small, .hw-task em, .hw-mini-facts dt, .hw-legend) {
    color: var(--text-2);
  }
  [data-ui-theme="deep-space"] #main :is(.hw-kpi-label, .hw-task-icon, .hw-backup-status) .jzc-icon {
    color: var(--primary);
  }
  [data-ui-theme="deep-space"] #main .hw-close-action {
    height: var(--control-height);
    min-height: var(--control-height);
    padding: 0 var(--button-inline-padding);
    gap: var(--icon-gap);
    border-radius: var(--control-radius);
  }

  [data-ui-theme="deep-space"] #main :is(.hw-kpi, .hw-panel, .hw-shortcuts) {
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--panel-radius);
    box-shadow: none;
  }

  [data-ui-theme="deep-space"] #main .hw-shortcuts a > span {
    color: var(--home-icon-color, var(--primary));
    background: var(--home-icon-bg, var(--hover-bg));
    border-radius: var(--panel-radius);
    box-shadow: none;
  }

  [data-ui-theme="deep-space"] #main :is(.hw-shortcuts a, .hw-kpi):nth-child(4n+1) {
    --home-icon-color: #246686;
    --home-icon-bg: #e2f1f8;
  }
  [data-ui-theme="deep-space"] #main :is(.hw-shortcuts a, .hw-kpi):nth-child(4n+2) {
    --home-icon-color: #177a5a;
    --home-icon-bg: #e3f3ec;
  }
  [data-ui-theme="deep-space"] #main :is(.hw-shortcuts a, .hw-kpi):nth-child(4n+3) {
    --home-icon-color: #8a5d14;
    --home-icon-bg: #f9efda;
  }
  [data-ui-theme="deep-space"] #main :is(.hw-shortcuts a, .hw-kpi):nth-child(4n+4) {
    --home-icon-color: #72528e;
    --home-icon-bg: #f0e9f7;
  }
  [data-ui-theme="deep-space"] #main .hw-kpi-label .jzc-icon { color: var(--home-icon-color, var(--primary)); }

  [data-ui-theme="deep-space"] #main .hw-shortcuts a > span > .jzc-icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    width: var(--icon-size);
    height: var(--icon-size);
  }

  [data-ui-theme="deep-space"] #main :is(.hw-chart-grid, .hw-expense-row > div i) { box-shadow: none; }
  [data-ui-theme="deep-space"] #main :is(.hw-bar, .hw-legend i, .hw-expense-row > div i) { background: var(--accent); }
  [data-ui-theme="deep-space"] #main :is(.hw-bar.cost, .hw-legend > span:nth-child(2) i) { background: #359674; }

  [data-ui-theme="deep-space"] body.jzc-cloud-theme {
    --green: var(--primary);
    --canvas: var(--page-bg);
    --surface-solid: var(--surface);
    --rail-bg: var(--surface);
    --line: var(--border);
    --line-strong: var(--border);
    --font-mono: var(--ui-font);
    --r-xs: var(--control-radius);
    --r-sm: var(--panel-radius);
    --r-md: var(--panel-radius);
    color: var(--text);
    background: var(--page-bg);
  }

  [data-ui-theme="deep-space"][data-theme="dark"] {
    --page-bg: #102637;
    --surface: #19364A;
    --head-bg: #23465D;
    --border: #355569;
    --text: #EDF4F8;
    --text-2: #BACBD6;
    --primary: #86BDDA;
    --on-primary: #123047;
    --selected-bg: #2B4C61;
    --zebra: #1C3A4F;
    --hover-bg: #26475D;
    --success: #83D4B3;
    --warning: #F0C17B;
    --danger: #F2A29B;
  }

  [data-ui-theme="deep-space"] body.jzc-cloud-theme :is(.book-card, .identity-auth, .fd-admin-card, .platform-metrics > a, .platform-hero) {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--panel-radius);
    box-shadow: none;
  }

  [data-ui-theme="deep-space"] body.jzc-cloud-theme :is(.identity-auth, .book-portal, .platform-hero) :is(h1, h2, h3, label) {
    color: var(--text);
  }

  [data-ui-theme="deep-space"] body.jzc-cloud-theme :is(.primary, .fd-book-primary, button[type="submit"], input[type="submit"]):not(.link) {
    min-height: var(--control-height) !important;
    padding-inline: var(--button-inline-padding) !important;
    border-radius: var(--control-radius);
    background: var(--primary);
    border-color: var(--primary);
    color: var(--on-primary);
  }

  [data-ui-theme="deep-space"] .jzc-cloud-theme .platform-rail {
    background: var(--sidebar-bg);
    border-color: var(--sidebar-bg);
  }

  [data-ui-theme="deep-space"] .jzc-cloud-theme .platform-rail .jzc-wordmark { filter: brightness(0) invert(1); }
  [data-ui-theme="deep-space"] .jzc-cloud-theme .platform-rail :is(.platform-rail-label, .platform-nav-group) {
    color: var(--nav-muted);
    font-size: var(--font-small) !important;
    letter-spacing: normal;
  }

  [data-ui-theme="deep-space"] .jzc-cloud-theme .platform-rail .platform-nav-link {
    min-height: var(--nav-height);
    height: var(--nav-height);
    color: var(--sidebar-fg);
    gap: var(--icon-gap);
  }

  [data-ui-theme="deep-space"] .jzc-cloud-theme .platform-rail .platform-nav-link:is(:hover, .active, [aria-current="page"]) {
    background: var(--nav-selected);
    color: var(--sidebar-fg);
  }

  [data-ui-theme="deep-space"] .jzc-cloud-theme .platform-rail .platform-nav-link:is(.active, [aria-current="page"]) {
    box-shadow: inset 3px 0 var(--sidebar-marker);
  }

  [data-ui-theme="deep-space"] .jzc-cloud-theme .platform-icon { color: inherit; }
  [data-ui-theme="deep-space"] .jzc-cloud-theme :is(.platform-admin-avatar, .platform-footer, .platform-footer *) {
    font-size: var(--font-small) !important;
  }

  /* Compact module styles contain more specific size rules than the workspace defaults. */
  html[data-ui-theme="deep-space"] :is(#main, #modal)
    :is(table :is(th, td), .module-primary-action, .st-status, .st-table .text-button,
         .ao-name > span, .journal-generation-options *, .account-search-input, .search, select) {
    font-size: var(--font-body) !important;
  }

  html[data-ui-theme="deep-space"] :is(#main, #modal)
    :is(.cl-surface, .cl-card, .financial-statement, .voucher-editor, .book-card, .module-table-card) {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--panel-radius);
    box-shadow: none;
  }

  html[data-ui-theme="deep-space"] :is(#main, #modal)
    :is(label, .st-search, .cl-form-label, .legacy-file-caption, .book-date-trigger, .cl-preview-meta) {
    color: var(--text-2);
  }

  html[data-ui-theme="deep-space"] :is(#main, #modal)
    :is(.module-header, .section-title, .statement-title, .modal-header, .card-header, .cl-card-heading) :is(h1, h2, h3, strong) {
    color: var(--text);
    font-weight: var(--weight-medium);
  }

  html[data-ui-theme="deep-space"] #main .voucher-editor .voucher-sheet .voucher-amount-cell input:not(:focus) {
    background: transparent;
  }

  html[data-ui-theme="deep-space"] #main .ao-scroll table tbody td {
    padding-block: 0 !important;
  }

  html[data-ui-theme="deep-space"] .zc-book-list {
    --zc-header-height: calc(18px + 2 * var(--table-block-padding) + var(--border-width));
    --zc-row-height: var(--table-row-height);
  }

  html[data-ui-theme="deep-space"] .zc-book-list .st-table th {
    padding-inline: 10px;
  }

  html[data-ui-theme="deep-space"] :is(#main, #modal)
    :is(.page-tabs, .finance-tabs, .module-tabs, .cl-template-tabs, .cl-cost-modes, .cl-tax-modes,
         .legacy-import-tabs, .salary-config-tabs, .report-timeline) :is(button, a) {
    border-radius: var(--control-radius);
    color: var(--primary);
  }

  html[data-ui-theme="deep-space"] :is(#main, #modal)
    :is(.page-tabs, .finance-tabs, .module-tabs, .cl-template-tabs, .cl-cost-modes, .cl-tax-modes,
         .legacy-import-tabs, .salary-config-tabs, .report-timeline) :is(button, a):is(.active, [aria-selected="true"]) {
    color: var(--primary);
    border-color: var(--border);
    background: var(--selected-bg);
    box-shadow: none;
  }

  html[data-ui-theme="deep-space"] :is(#main, #modal)
    :is(.text-button, .account-edit-button, .account-child-button, .voucher-create-account, .voucher-subject-results button) {
    color: var(--primary);
  }

  html[data-ui-theme="deep-space"] :is(#main, #modal)
    :is(.text-button, .account-edit-button, .account-child-button, .voucher-subject-results button):hover {
    background-color: var(--hover-bg);
  }

  html[data-ui-theme="deep-space"] :is(#main, #modal)
    :is(.st-status, .cl-card-status, .am-posted, .demo-badge, .invoice-status, .module-status) {
    display: inline-flex;
    align-items: center;
    min-height: var(--status-height);
    padding-block: 0;
    border-radius: var(--control-radius);
    font-size: var(--font-body) !important;
    line-height: 18px;
    color: var(--text-2);
    background-color: var(--surface);
  }

  html[data-ui-theme="deep-space"] :is(#main, #modal)
    :is(.st-status:not(.muted), .cl-card-status.done, .am-posted) { color: var(--success); }
  html[data-ui-theme="deep-space"] :is(#main, #modal)
    :is(.cl-card-status:not(.done), .ao-aux-mark) { color: var(--warning); background-color: var(--surface); }

  html[data-ui-theme="deep-space"] :is(#main, #modal) :is(.error, .negative, .danger) { color: var(--danger); }
  html[data-ui-theme="deep-space"] :is(#main, #modal) :is(.btn, .zc-outline-button, .period-select):hover:not(.primary, :disabled) {
    background-color: var(--hover-bg);
  }
  html[data-ui-theme="deep-space"] :is(#main, #modal) :is(.btn.primary, [data-ledger-query], [data-vm-query]):disabled {
    color: var(--text-2) !important;
    background-color: var(--head-bg) !important;
    border-color: var(--border) !important;
  }

  html[data-ui-theme="deep-space"] :is(.app, #modal, .jzc-cloud-theme)
    :is(button, a):has(> .jzc-icon):not(.nav-item, .workspace-tab, .hw-shortcuts a) {
    column-gap: var(--icon-gap);
  }

  html[data-ui-theme="deep-space"] .workspace-labeled-action > .jzc-icon {
    margin-inline-end: var(--icon-gap);
  }

  html[data-ui-theme="deep-space"] .workspace-labeled-action:is(.btn, summary) {
    display: inline-flex;
    align-items: center;
    column-gap: 0;
  }

  html[data-ui-theme="deep-space"] :is(.account-edit-button, .account-child-button, .voucher-row-actions button, [data-close-ledger-filter]) > .jzc-icon {
    width: var(--icon-small);
    height: var(--icon-small);
  }

  html[data-ui-theme="deep-space"] :is(.modal-header, .dialog-header, .toast, .workspace-loading-status)
    :is(.jzc-icon, button, span, strong) {
    font-family: var(--ui-font);
    font-size: var(--font-body);
  }

  html[data-ui-theme="deep-space"] :is(.toast, .workspace-loading-status) {
    color: var(--text);
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--panel-radius);
    font: var(--weight-regular) var(--font-body)/1.4 var(--ui-font);
    box-shadow: none;
  }

  html[data-ui-theme="deep-space"] .jzc-cloud-theme :is(.auth-card, .identity-auth, .book-portal, .fd-book-dialog,
    .account-panel, .profile-card, .platform-topbar, .platform-card, .platform-table-wrap, .module, .dashboard-module) {
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--panel-radius);
    box-shadow: none;
    color: var(--text);
  }

  html[data-ui-theme="deep-space"] .jzc-cloud-theme :is(.outline, .fd-book-button, .platform-button, .submit-row a) {
    min-height: var(--control-height);
    padding-inline: var(--button-inline-padding);
    color: var(--primary);
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--control-radius);
  }

  html[data-ui-theme="deep-space"] body.jzc-cloud-theme:has(.login-scene) {
    color: var(--text);
    background: var(--page-bg);
  }

  html[data-ui-theme="deep-space"] .jzc-cloud-theme .login-scene .identity-auth {
    backdrop-filter: none;
  }

  html[data-ui-theme="deep-space"] .jzc-cloud-theme :is(.identity-auth, .auth-card)
    :is(.identity-submit, .get-identity-code, .outline) {
    height: var(--control-height);
    min-height: var(--control-height);
    padding-block: 0;
    padding-inline: var(--button-inline-padding);
    border-radius: var(--control-radius);
    box-shadow: none;
  }

  html[data-ui-theme="deep-space"] .jzc-cloud-theme .identity-tabs :is(a, button).active {
    color: var(--primary);
    border-color: var(--primary);
  }

  html[data-ui-theme="deep-space"] .jzc-cloud-theme .identity-auth a {
    color: var(--primary);
  }

  html[data-ui-theme="deep-space"] :is(.main-wrap > footer, .topbar .profile small) {
    color: var(--text-2);
  }

  html[data-ui-theme="deep-space"] .jzc-cloud-theme .identity-input-wrap:has(.phone-prefix:not([hidden])) {
    background: var(--surface);
    border-color: var(--border);
    border-radius: var(--control-radius);
  }
}

@media screen and (hover: hover) and (pointer: fine) {
  #main :is([data-vm-select], [data-account-select]) {
    opacity: 0;
  }

  #main :is(.vm-check, .account-select-cell):hover input[type="checkbox"],
  #main .vm-group:hover .vm-check input[type="checkbox"],
  #main tr:hover .account-select-cell input[type="checkbox"],
  #main :is(.vm-check, .account-select-cell) input[type="checkbox"]:is(:checked, :indeterminate, :focus) {
    opacity: 1;
  }
}
@font-face {
  font-family: Inter;
  src: url("./fonts/Inter.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

@media screen {
  html[data-ui-theme="deep-space"] {
    --hw-workspace: #f4f6fa;
    --hw-edge: #e7ebf1;
    --hw-rise: #d64550;
    --hw-fall: #17936b;
    --hw-chart-cost: #459b95;
    --hw-chart-expenses: #7169a8;
    --hw-chart-tax: #c39248;
    --hw-chart-profit: var(--hw-rise);
  }

  html[data-ui-theme="deep-space"] .app .sidebar {
    padding: 14px 0 16px;
    background: #112238;
    border-right: 1px solid #223850;
    box-shadow: none;
  }
  html[data-ui-theme="deep-space"] .app .sidebar > .jzc-brand {
    height: 56px;
    margin: 0;
    transform: scale(.9);
  }
  html[data-ui-theme="deep-space"] .app .sidebar #nav {
    display: block;
    margin: 6px 0 0;
    padding: 0;
    border-top: 1px solid #24384c;
  }
  .nav-group + .nav-group { margin-top: 13px; }
  html[data-ui-theme="deep-space"] #nav .nav-group h2 {
    margin: 0;
    padding: 10px 17px 7px;
    font-size: 12px !important;
    font-weight: 500;
    line-height: 17px;
    color: #91a9be;
    letter-spacing: .03em;
  }
  html[data-ui-theme="deep-space"] .app .sidebar #nav .nav-item {
    width: 100%;
    height: 36px;
    min-height: 36px;
    margin: 0;
    padding: 0 15px 0 17px;
    gap: 11px;
    border: 0;
    border-radius: 0;
    color: #c2d2e0;
    font-weight: 400;
  }
  html[data-ui-theme="deep-space"] .app .sidebar #nav .nav-item > svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: #8fa9c0;
  }
  html[data-ui-theme="deep-space"] .app .sidebar #nav .nav-item > .nav-arrow { color: #7f98ae; }
  html[data-ui-theme="deep-space"] .app .sidebar #nav .nav-item:hover:not(.active) { background: #192e45; color: #fff; }
  html[data-ui-theme="deep-space"] .app .sidebar #nav .nav-item.active { background: #1c3656; color: #fff; font-weight: 500; }
  html[data-ui-theme="deep-space"] .app .sidebar #nav .nav-item.active > svg { color: #80beef; }
  html[data-ui-theme="deep-space"] .app .sidebar #nav .nav-item.active::before { width: 2px; border-radius: 0; background: #80beef; }

  html[data-ui-theme="deep-space"] #main:has(.hw-home) { background: var(--hw-workspace); }
  html[data-ui-theme="deep-space"] #main .workspace-home-hero { padding: 16px; }
  html[data-ui-theme="deep-space"] #main .workspace-home-hero .hw-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  @media (max-width: 1190px) {
    html[data-ui-theme="deep-space"] #main .workspace-home-hero .hw-kpis {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }
  @media (max-width: 600px) {
    html[data-ui-theme="deep-space"] #main .workspace-home-hero .hw-kpis {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    html[data-ui-theme="deep-space"] #main .workspace-home-hero .hw-kpi:last-child { grid-column: auto; }
  }
  html[data-ui-theme="deep-space"] #main .hw-home :is(.card,.hw-kpi,.workspace-home-hero) {
    background: #fff;
    border-color: var(--hw-edge);
    box-shadow: none;
  }
  html[data-ui-theme="deep-space"] #main .workspace-home-hero .hw-kpi {
    container-type: inline-size;
  }
  html[data-ui-theme="deep-space"] #main .workspace-home-hero .hw-kpi > strong {
    font-family: Inter, var(--ui-font) !important;
    font-size: clamp(16px, 15cqi, 26px) !important;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  html[data-ui-theme="deep-space"] #main .hw-home :is([data-home-metric="revenue"] > strong,.hw-trend-up) { color: var(--hw-rise); }
  html[data-ui-theme="deep-space"] #main .hw-home .hw-trend-down { color: var(--hw-fall); }
  html[data-ui-theme="deep-space"] #main .hw-home .hw-trend {
    display: inline-flex;
    align-items: baseline;
    vertical-align: baseline;
    gap: 3px;
    font-family: Inter, var(--ui-font) !important;
    font-weight: 500;
  }
  html[data-ui-theme="deep-space"] #main .hw-home .hw-trend .hw-trend-value {
    color: inherit;
    font-family: inherit !important;
    font-weight: inherit;
  }
  .hw-trend svg { align-self: center; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .hw-primary {
    --hw-trend-revenue: #2869a8;
    --hw-trend-profit: #16848c;
  }
  .hw-main-grid:has(.hw-invoice-card) { align-items: stretch; }
  .hw-main-grid > :is(.hw-primary,.hw-invoice-card) { display: grid; min-width: 0; }
  .hw-main-grid > :is(.hw-primary,.hw-invoice-card,.hw-secondary-grid,.hw-aside) > .hw-panel { margin-bottom: 0; }
  .hw-main-grid > .hw-period-overview { display: grid; grid-template-columns: minmax(0, 1fr); }
  .hw-invoice-totals .hw-task { min-width: 0; }
  .hw-invoice-totals .hw-task > span:nth-child(2) { min-width: 0; }
  .hw-invoice-totals .hw-task strong { color: var(--text); overflow-wrap: anywhere; }
  .hw-invoice-totals .hw-task > b { margin-inline-start: auto; white-space: nowrap; }
  .hw-period-overview .hw-mini-facts > div {
    gap: 8px;
  }
  .hw-period-overview dt { flex-shrink: 0; }
  .hw-period-overview dd { min-width: 0; overflow-wrap: anywhere; text-align: end; }
  .hw-trend-revenue { --hw-series: var(--hw-trend-revenue); }
  .hw-trend-profit { --hw-series: var(--hw-trend-profit); }
  html[data-ui-theme="deep-space"] #main .hw-trend-legend :is(.hw-trend-revenue,.hw-trend-profit) i { background: var(--hw-series); }
  #main .hw-trend-scroll { display: block; padding: 0; overflow: hidden; }
  .hw-trend-plot { display: block; width: 100%; height: 100%; }
  #main .hw-trend-plot text { fill: var(--text-2); stroke: none; font-size: var(--font-body); }
  #main .hw-trend-plot polygon { stroke: none; }
  .hw-trend-grid { stroke: var(--hw-edge); }
  .hw-trend-zero { stroke: var(--border); }
  .hw-trend-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
  .hw-trend-point { fill: var(--surface); stroke-width: 1.8; }
  .hw-trend-plot :is(.hw-trend-line,.hw-trend-point) { stroke: var(--hw-series); vector-effect: non-scaling-stroke; }

  .hw-composition-unit, .hw-composition-ring span, .hw-composition-basis { color: var(--text-2); }
  .hw-composition { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; padding: 5px 0 6px; }
  .hw-composition-ring {
    width: 128px;
    height: 128px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: conic-gradient(var(--hw-chart-segments));
  }
  .hw-composition-ring > div {
    width: 96px;
    height: 96px;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 4px;
    text-align: center;
    overflow-wrap: anywhere;
    background: #fff;
    border-radius: 50%;
  }
  html[data-ui-theme="deep-space"] #main .hw-composition-ring strong { font-family: Inter, var(--ui-font) !important; font-weight: 700; }
  .hw-composition ul { flex: 1 1 100px; margin: 0; padding: 0; list-style: none; }
  .hw-composition li { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; min-height: 30px; }
  .hw-composition li i { height: 8px; border-radius: 2px; }
  .hw-composition li + li { border-top: 1px solid var(--hw-edge); }
  .hw-composition li.hw-composition-basis { display: block; min-height: 0; padding-top: 5px; }
}
