    * { box-sizing: border-box; }
    body { margin: 0; background: var(--canvas); color: var(--ink); font: 16px/1.5 system-ui, sans-serif; }
    body:has(.login-screen:not([hidden])) { background: var(--paper); }
    [hidden] { display: none !important; }
    button, select, input { font: inherit; }
    button { cursor: pointer; }
    :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
    h1, h2, p { margin: 0; }
    h1 { font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -.025em; line-height: 1.15; }
    .login-screen { display: grid; align-content: safe center; min-height: 100dvh; padding: 28px 20px; }
    .login { width: min(100%, 340px); margin-inline: auto; }
    .login h1, .login-intro { text-align: center; }
    #login-title:focus-visible { outline: none; }
    .login-intro { color: var(--muted); margin: 6px 0 24px; }
    .wordmark { display: block; width: min(280px, 100%); height: auto; margin: 0 auto 28px; }
    .field { display: grid; gap: 5px; font-size: .94rem; font-weight: 650; }
    .field + .field { margin-top: 12px; }
    select, input {
      width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line);
      border-radius: 18px; background: var(--paper); color: var(--ink); font-weight: 400;
    }
    .theme-choice {
      width: auto; max-width: 100%; min-height: 36px; border-radius: 10px; padding: 5px 8px;
      background: var(--paper); color: var(--ink); font-size: .88rem;
    }
    :root[data-theme="dark"] :is(.wordmark, .top-brand) { filter: brightness(1.7); }
    .sign-in { width: 100%; min-height: 46px; margin-top: 16px; border: 0;
      border-radius: 18px; background: var(--ink); color: var(--paper); font-weight: 650; }
    .login-error { color: var(--error); margin-top: 10px; }
    .login-error:empty { display: none; }
    .demo-button {
      border: 1px solid var(--line); background: var(--paper); color: var(--ink);
    }
    .demo-button:hover { background: var(--selection); }
    .demo-caption { margin-top: 6px; color: var(--muted); text-align: center; font-size: .86rem; }
    .demo-label {
      padding: 3px 8px; border-radius: 8px; background: var(--selection); color: var(--ink);
      font-size: .8rem; white-space: nowrap;
    }
    .sign-in:disabled { opacity: .6; cursor: wait; }
    .top { background: var(--paper); border-bottom: 1px solid var(--line); }
    .top-inner { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
    .top-inner { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 70px; }
    .brand-home { padding: 0; border: 0; background: none; }
    .top-brand { width: 176px; height: auto; display: block; }
    .account { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
    .account { gap: 12px; color: var(--muted); font-size: .9rem; }
    .sign-out, .profile-button {
      border: 0; border-radius: 10px; background: transparent; padding: 8px 12px;
      color: var(--accent); font-weight: 650; white-space: nowrap;
    }
    .profile-button { padding-inline: 8px; color: var(--ink); }
    :is(.sign-out, .profile-button):hover { background: var(--selection); }
    #program { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; }
    .program-body {
      min-height: 0; display: grid; grid-template-columns: minmax(165px, 208px) minmax(0, 1fr);
      gap: clamp(12px, 1.4vw, 22px); padding: clamp(14px, 2vw, 28px);
    }
    .section-menu {
      align-self: start; position: relative; z-index: 1;
      border: 1px solid var(--line); border-radius: 24px; background: var(--paper);
      box-shadow: var(--shadow);
    }
    #module-tabs { display: grid; gap: 2px; padding: 9px; }
    .tab {
      width: 100%; min-height: 44px; padding: 8px 11px; border: 0; border-radius: 14px;
      text-align: left; background: none; color: var(--ink); font-weight: 500;
    }
    .tab:hover, .tab[aria-current="page"] { background: var(--selection); }
    .tab[aria-current="page"] { font-weight: 700; }
    .section-entry { position: relative; min-width: 0; }
    .section-entry:has(.submenu-toggle) { display: flex; }
    .section-entry:has(.submenu-toggle) > .tab { padding-right: 36px; }
    .submenu-toggle {
      position: absolute; inset: 4px 3px 4px auto; width: 30px;
      border: 0; border-radius: 10px; background: transparent; color: var(--muted);
      display: grid; place-items: center;
    }
    .submenu-toggle::before {
      content: ""; width: 6px; height: 6px;
      border: solid currentColor; border-width: 0 1.5px 1.5px 0;
      transform: rotate(-45deg);
    }
    .submenu-toggle:hover, .submenu-toggle[aria-expanded="true"] { background: var(--selection); }
    .section-submenu {
      position: absolute; top: var(--submenu-offset, 0px); left: 100%;
      width: max-content; min-width: 180px; padding-left: 8px;
    }
    .section-submenu-items {
      display: grid; gap: 2px; padding: 6px; overflow: auto;
      max-height: var(--submenu-height, 60dvh);
      border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
      box-shadow: var(--shadow);
    }
    .section-submenu .tab { min-height: 36px; }
    .program-content, .frames { min-width: 0; min-height: 0; }
    .program-content { overflow: auto; }
    .program-content:has(.section-header:not([hidden])) {
      display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 0;
    }
    .section-title { margin: 0 0 12px; }
    .section-tabs {
      display: flex; flex-wrap: wrap; gap: 4px; padding: 5px;
      border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
    }
    .section-tabs .tab { width: auto; min-height: 36px; }
    :is(#finance-header, #module-header) { padding-bottom: 14px; }
    #settings-notice { margin-top: 12px; color: var(--muted); }
    .frames { height: 100%; }
    .module-frame { width: 100%; height: 100%; border: 0; display: block; background: transparent; }
    .workspace { padding: clamp(14px, 4vw, 44px); }
    .chooser { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
    .module-link {
      min-height: 112px; display: grid; align-content: center; gap: 4px; background: var(--paper);
      border: 1px solid var(--line); border-radius: 12px; text-align: left; padding: 20px; color: var(--accent);
    }
    .module-link strong { font-size: 1.13rem; }
    .module-link span { color: var(--muted); font-size: .9rem; }
    .module-link:hover { border-color: var(--accent); }
    @media (max-width: 760px) {
      .top-inner { width: calc(100% - 32px); }
      .chooser { grid-template-columns: 1fr; }
      .module-link { min-height: 76px; }
    }
    @media (max-width: 600px) {
      .program-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); padding: 12px; }
      .section-menu { border-radius: 14px; }
      #module-tabs { display: flex; flex-wrap: wrap; padding: 6px; }
      .tab { width: auto; min-height: 36px; padding: 6px 9px; font-size: .88rem; }
      .section-entry { position: static; }
      .submenu-toggle { position: static; flex: none; margin: 3px 3px 3px -33px; z-index: 1; }
      .section-submenu { inset: 100% 0 auto; padding: 4px 0 0; width: auto; }
      .section-submenu .tab { width: 100%; }
    }
    @media (max-width: 480px) {
      .top-brand { width: 145px; }
      .sign-out { padding-inline: 8px; }
      .top-inner { gap: 8px; flex-wrap: wrap; padding-block: 8px; }
      .account { gap: 6px; }
    }
    .access-note { text-align: center; margin-top: 12px; }
    .access-note a { color: var(--accent); }
