    :root {
      --equica-blue: #0b3d91;
      --equica-mid-blue: #1760c4;
      --equica-red: #d6242e;
      --equica-light-blue: #f2f5fb;
      --equica-card: #fff;
      --equica-border: #d7deec;
      --equica-text: #14254b;
      --equica-muted: #5d6c85;
      --equica-hover: rgba(11, 61, 145, 0.08);
    }
    
    html, body {
      height: 100%;
      margin: 0;
      font-family: "Poppins","Inter","Segoe UI",sans-serif;
      background: var(--equica-light-blue);
      color: var(--equica-text);
    }
    
    /* Layout */
    #app {
      --sidebar-width: 330px;
      display: flex;
      height: 100vh;
      overflow: hidden;
      position: relative;
    }
    
    /* Sidebar */
    #sidebar {
      width: var(--sidebar-width);
      flex: 0 0 var(--sidebar-width);
      background: var(--equica-card);
      color: var(--equica-text);
      display: flex;
      flex-direction: column;
      padding: 1.25rem 1.5rem;
      border-right: 1px solid var(--equica-border);
      box-shadow: 6px 0 22px rgba(13,48,96,.06);
      transition: transform .3s ease, opacity .3s ease;
      position: relative;
      height: 100vh; /* 👈 key part */
      overflow: hidden; /* ensure internal overflow areas handle their own scrolling */
    }

    #sidebar.is-resize-ready,
    #sidebar.is-active {
      cursor: col-resize;
    }

    .layout-resizer {
      flex: 0 0 10px;
      position: relative;
      cursor: col-resize;
      user-select: none;
      touch-action: none;
      z-index: 20;
    }

    .layout-resizer::before {
      content: "";
      position: absolute;
      top: 0;
      bottom: 0;
      left: 50%;
      width: 1.11px;
      transform: translateX(-50%);
      background: rgba(11,61,145,.14);
      transition: background .15s ease;
    }

    .layout-resizer:hover::before,
    .layout-resizer.is-active::before {
      background: rgba(11,61,145,.42);
    }

    .layout-resizer--assistant::before {
      background: rgba(200, 200, 200, 0.55);
    }

    .layout-resizer--assistant:hover::before,
    .layout-resizer--assistant.is-active::before {
      background: rgba(200, 200, 200, 0.85);
    }
    
    #sidebar h2 {
      color: var(--equica-blue);
      font-size: 1.1rem;
      margin-bottom: 0;
      font-weight: 600;
      letter-spacing: .6px;
      text-transform: uppercase;
    }

    .sidebar-brand {
      min-width: 0;
    }

    .sidebar-organization-name {
      margin-top: .2rem;
      color: var(--equica-muted);
      font-size: .78rem;
      font-weight: 500;
      line-height: 1.25;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    
    .sidebar-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: .75rem;
      margin-bottom: 1rem;
    }
    
    .sidebar-toggle,
    .sidebar-toggle-floating {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      border: 1px solid transparent;
      background: transparent;
      color: var(--equica-blue);
      cursor: pointer;
      padding: 0;
    }
    
    .sidebar-toggle {
      width: 32px; height: 32px; font-size: .85rem;
      transition: background .2s ease, color .2s ease, border-color .2s ease;
    }
    .sidebar-toggle i { pointer-events: none; }
    
    .sidebar-toggle:hover,
    .sidebar-toggle:focus-visible {
      background: var(--equica-hover);
      border-color: rgba(11,61,145,.16);
    }
    
    .sidebar-toggle-floating {
      position: absolute; top: 1.5rem; left: 1.5rem;
      width: 40px; height: 40px; font-size: 1rem;
      background: var(--equica-card);
      border-color: rgba(11,61,145,.18);
      box-shadow: 0 6px 16px rgba(13,48,96,.12);
      display: none; z-index: 100;
    }
    .sidebar-toggle-floating:hover,
    .sidebar-toggle-floating:focus-visible { border-color: rgba(11,61,145,.3); }
    
    #app.sidebar-hidden #sidebar {
      transform: translateX(-100%);
      opacity: 0;
      pointer-events: none;
      position: absolute; inset: 0 auto 0 0;
    }
    #app.sidebar-hidden .sidebar-toggle-floating { display: inline-flex; }
    
    .sidebar-nav { 
      display: flex;
      flex-direction: column;
      flex: 1;
      min-height: 0; /* 👈 important for flex children with overflow */ 
    }
    
    .sidebar-action {
      display: flex; align-items: center; gap: 10px;
      padding: .65rem .9rem; border-radius: 10px;
      color: var(--equica-text); background: transparent; border: 0; width: 100%;
      text-align: left; font: inherit; font-weight: 500; letter-spacing: .01em;
      transition: background .2s ease, color .2s ease, box-shadow .2s ease;
      cursor: pointer;
    }
    .sidebar-action:hover,
    .sidebar-action:focus-visible {
      background: var(--equica-hover);
      color: var(--equica-blue);
      box-shadow: inset 0 0 0 1px rgba(11,61,145,.1);
    }
    .sidebar-action.is-active {
      background: rgba(11,61,145,.12);
      color: var(--equica-blue);
      box-shadow: inset 0 0 0 1px rgba(11,61,145,.25);
    }
    .sidebar-action i { width: 20px; text-align: center; color: var(--equica-blue); }

    .sidebar-history {
      flex: 1; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; min-width: 0;
    }
    
    .sidebar-history-item {
      background: var(--equica-light-blue);
      color: var(--equica-text);
      display: flex; align-items: stretch; gap: .35rem;
      padding: .35rem; border-radius: 10px; margin-bottom: .45rem;
      font-size: .9rem; border: 1px solid transparent;
      transition: background .2s ease, color .2s ease, border-color .2s ease;
    }

    .sidebar-history-item:hover {
      background: var(--equica-hover);
      border-color: rgba(11,61,145,.18);
      color: var(--equica-blue);
    }

    .sidebar-history-item.is-active {
      background: var(--equica-blue);
      color: #fff;
      border-color: rgba(11,61,145,.6);
    }

    .sidebar-history-item__main {
      flex: 1;
      min-width: 0;
      border: 0;
      background: transparent;
      color: inherit;
      text-align: left;
      font: inherit;
      cursor: pointer;
      padding: .2rem .35rem;
    }

    .sidebar-history-item__title {
      display: block;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .sidebar-history-item__action {
      flex: 0 0 auto;
      width: 34px;
      border: 0;
      border-radius: 8px;
      background: transparent;
      color: inherit;
      cursor: pointer;
      transition: background .2s ease, transform .2s ease;
    }

    .sidebar-history-item__action:hover,
    .sidebar-history-item__action:focus-visible {
      background: rgba(11,61,145,.18);
      transform: translateY(-1px);
    }

    .sidebar-history-item.is-active .sidebar-history-item__action {
      background: transparent;
      color: #fff;
    }

    .sidebar-history-item small { display: block; font-size: .75rem; margin-top: .2rem; }
    
    .sidebar-footer { color: var(--equica-muted); }
    
    .sidebar-history-loader { text-align: center; padding: .5rem 0; font-size: .8rem; }
    .sidebar-footer { font-size: .75rem; text-align: center; padding-top: 1rem; border-top: 1px solid var(--equica-border); }
    
    .sidebar-profile-files { margin-top: .5rem; max-height: 140px; overflow-y: auto; }
    .sidebar-profile-files .profile-file {
      display: flex; align-items: center; justify-content: space-between;
      background: rgba(11,61,145,.06);
      border: 1px solid rgba(11,61,145,.12);
      border-radius: 8px; padding: .35rem .45rem; margin-bottom: .35rem;
      font-size: .8rem; color: var(--equica-text);
    }
    .sidebar-profile-files .profile-file .buttons { margin-left: .5rem; }

    .organization-suspension-banner {
      position: relative;
      z-index: 10;
      box-sizing: border-box;
      width: 100%;
      flex: 0 0 auto;
      padding: .75rem 1rem;
      background: #b42318;
      color: #fff;
      text-align: center;
      font-weight: 700;
    }
    
    /* Main content */
    #main-content {
      flex: 1;
      background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(242,245,251,.92));
      overflow-y: auto; padding: 1.5rem 1.25rem 1rem;
      display: flex;
      flex-direction: column;
    }
    #app.sidebar-hidden #main-content {
      padding-top: 3.75rem;
      padding-left: 3.75rem;
    }
    #main.section {
      padding: 0;
      margin-bottom: .75rem;
    }
    #main > .container {
      max-width: none !important;
      width: 100%;
      padding: 0;
    }
    div#disclaimer {
      margin-top: auto;
      text-align: center;
      color: gray;
      font-size: 0.72rem;
    }
    
    input, textarea, select { background: transparent !important; }
    
    a { color: var(--equica-blue); font-weight: 500; }
    a:hover { color: var(--equica-mid-blue); }
    
    .input, .textarea, .select select {
      border-color: var(--equica-border);
      background: #fff !important;
      box-shadow: none; color: var(--equica-text);
      transition: border-color .15s ease, box-shadow .15s ease;
    }
    .input:focus, .textarea:focus, .select select:focus {
      border-color: var(--equica-blue);
      box-shadow: 0 0 0 .12em rgba(11,61,145,.15);
    }
    
    .label,
    h1.title,
    h2.subtitle { color: var(--equica-blue); font-weight: 600; letter-spacing: .01em; }
    
    h1.title { margin-bottom: 1.25rem; font-weight: 700; }
    h2.subtitle { font-weight: 700; }
    
    /* Buttons */
    .button { font-weight: 500; letter-spacing: .01em; transition: transform .15s ease; }
    .button:hover { transform: translateY(-1px); }
    
    .button.is-primary, .button.is-primary:disabled {
      background: var(--equica-red); border-color: var(--equica-red);
      color: #fff; font-weight: 600; text-transform: uppercase; padding: .65em 1.6em;
    }
    .button.is-primary:hover { background: #bb1f28; border-color: #bb1f28; }
    
    .button.is-link, .button.is-info {
      background: var(--equica-blue); border-color: var(--equica-blue); color: #fff;
    }
    .button.is-link:hover, .button.is-info:hover {
      background: var(--equica-mid-blue); border-color: var(--equica-mid-blue);
    }
    .button.is-light {
      color: var(--equica-blue);
      border-color: rgba(11,61,145,.16);
      background: rgba(11,61,145,.05);
    }
    .button.is-light:hover { background: rgba(11,61,145,.12); }
    
    /* Tags / chips */
    .nipez-line { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .5rem; }
    .tag.tag-nipez { background: #e6ffed; color: #1f7a1f; border-radius: 12px; }
    .tag.tag-zakazka { background: #e6f3ff; color: var(--equica-blue); border-radius: 12px; cursor: pointer; }
    .nipez-add-row { position: relative; flex-wrap: nowrap; }
    .nipez-suggestions { position: relative; margin-top: .35rem; }
    .nipez-suggestions.is-hidden { display: none; }
    .nipez-suggestion-list {
      position: absolute; inset: 0 auto auto 0; min-width: 100%;
      background: #fff; border: 1px solid var(--equica-border); border-radius: 10px;
      box-shadow: 0 14px 28px rgba(13,48,96,.18); max-height: 240px; overflow-y: auto;
      z-index: 60; padding: .25rem 0;
    }
    .nipez-suggestion-item {
      width: 100%; padding: .55rem .9rem; text-align: left; border: 0; background: transparent;
      font: inherit; color: var(--equica-text); cursor: pointer;
    }
    .nipez-suggestion-item:hover,
    .nipez-suggestion-item:focus {
      background: var(--equica-hover);
      outline: none;
    }
    
    #pdfDropZone {
      width: 10%; height: 20px;
      border: 2px dashed rgba(11,61,145,.4); border-radius: 10px;
      display: flex; justify-content: center; align-items: center;
      font-size: 16px; color: var(--equica-muted);
      background: rgba(11,61,145,.04); cursor: pointer; backdrop-filter: blur(4px);
    }
    #pdfDropZone.dragover { background: rgba(11,61,145,.12); border-color: rgba(11,61,145,.45); }
    
    .tags { display: flex; flex-wrap: wrap; gap: .5rem; }
    
    .legend-color.orange { background: rgba(255,165,0,.2); }
    .legend-color.red { background: rgba(255,0,0,.2); }
    
    .refine-controls.is-locked,
    #viewRodnyListBtn.is-locked,
    #viewRodnyListBtn.is-locked:disabled { opacity: .5; pointer-events: none; }
    
    /* Scrollbar */
    ::-webkit-scrollbar { width: 6px; }
    ::-webkit-scrollbar-thumb { background: rgba(11,61,145,.35); border-radius: 4px; }
    
    /* Markdown */
    .markdown-rendered {
      line-height: 1.6;
    }
    .markdown-rendered table {
      border-collapse: collapse; width: 100%; margin: 1em 0; font-size: .95em;
      border: 1px solid rgba(11,61,145,.12); border-radius: 12px; overflow: hidden;
    }
    .markdown-rendered th,
    .markdown-rendered td { border: 1px solid rgba(11,61,145,.12); padding: 8px 12px; text-align: left; }
    .markdown-rendered th { background: rgba(11,61,145,.1); font-weight: 600; color: var(--equica-blue); }
    .markdown-rendered tr:nth-child(even) { background: rgba(11,61,145,.04); }
    .markdown-rendered tr:hover { background: rgba(11,61,145,.1); }
    
    .markdown-rendered h1,
    .markdown-rendered h2,
    .markdown-rendered h3,
    .markdown-rendered h4,
    .markdown-rendered h5,
    .markdown-rendered h6 {
      font-weight: 600; line-height: 1.3; margin: 1.4em 0 .6em;
      color: var(--equica-blue);
    }
    .markdown-rendered h1 { font-size: 2rem; border-bottom: 2px solid rgba(11,61,145,.16); padding-bottom: .3em; }
    .markdown-rendered h2 { font-size: 1.6rem; color: var(--equica-text); border-left: 4px solid var(--equica-red); padding-left: .5em; }
    .markdown-rendered h3 { font-size: 1.3rem; }
    .markdown-rendered h4,
    .markdown-rendered h5,
    .markdown-rendered h6 { font-weight: 500; color: var(--equica-muted); }
    .markdown-rendered h4 { font-size: 1.1rem; }
    .markdown-rendered h5 { font-size: 1rem; }
    .markdown-rendered h6 { font-size: .95rem; }

    #zakazka-rezim-div {
      transition: all 0.2s ease;
      opacity: 0;
      max-height: 0;
      overflow: hidden;
    }
    #zakazka-rezim-div:not(.is-hidden) {
      opacity: 1;
      max-height: 100px;
    }

    .equica-modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(20,37,75,.45); z-index: 1200; padding: 1.5rem; }
    .equica-modal.is-active { display: flex; }
    .equica-modal__card { background: var(--equica-card); border-radius: 14px; box-shadow: 0 18px 40px rgba(13,48,96,.22); padding: 1.6rem; width: min(420px, 100%); border: 1px solid rgba(11,61,145,.12); }
    .equica-modal__message { color: var(--equica-text); white-space: pre-wrap; line-height: 1.5; margin-bottom: 1.4rem; }
    .equica-modal__actions { display: flex; justify-content: flex-end; gap: .75rem; }

    .editor-workspace {
      --assistant-width: 620px;
      display: flex;
      align-items: stretch;
      gap: .35rem;
      position: relative;
      width: 100%;
    }

    .editor-canvas {
      flex: 1 1 auto;
      min-width: 0;
    }

    .rl-editor-info {
      margin-bottom: 1.5rem;
    }

    .rl-org-type-field {
      display: flex;
      align-items: center;
      flex-wrap: wrap;
      column-gap: .75rem;
      row-gap: .35rem;
      width: 100%;
    }

    .rl-org-type-field .label {
      margin-bottom: 0;
      white-space: nowrap;
    }

    .rl-org-type-field .control {
      min-width: min(100%, 22rem);
    }

    .rl-org-type-field .select,
    .rl-org-type-field select {
      width: 100%;
    }

    .rl-show-revisions-control {
      display: inline-flex;
      align-items: center;
      gap: .55rem;
      margin-left: auto;
    }

    .rl-show-revisions-control.is-hidden {
      display: none;
    }

    .rl-show-revisions-label {
      color: var(--equica-muted);
      font-size: .9rem;
      font-weight: 600;
      white-space: nowrap;
    }

    .revision-toggle {
      display: inline-flex;
      align-items: center;
      cursor: pointer;
    }

    .revision-toggle input {
      position: absolute;
      opacity: 0;
      pointer-events: none;
    }

    .revision-toggle__track {
      position: relative;
      display: grid;
      grid-template-columns: 1fr 1fr;
      align-items: center;
      width: 4.9rem;
      height: 2rem;
      padding: .18rem;
      border-radius: 999px;
      background: rgba(11,61,145,.08);
      color: var(--equica-muted);
      font-size: .72rem;
      font-weight: 700;
      line-height: 1;
      transition: background .18s ease, border-color .18s ease;
    }

    .revision-toggle__text {
      position: relative;
      z-index: 1;
      text-align: center;
      transition: color .18s ease;
    }

    .revision-toggle__thumb {
      position: absolute;
      top: .18rem;
      bottom: .18rem;
      left: .18rem;
      width: calc(50% - .18rem);
      border-radius: 999px;
      background: #fff;
      box-shadow: 0 2px 6px rgba(13,48,96,.16);
      transition: transform .18s ease;
    }

    .revision-toggle input:checked + .revision-toggle__track .revision-toggle__thumb {
      transform: translateX(100%);
    }

    .revision-toggle input:checked + .revision-toggle__track .revision-toggle__text--yes,
    .revision-toggle input:not(:checked) + .revision-toggle__track .revision-toggle__text--no {
      color: var(--equica-text);
    }

    .revision-toggle input:focus-visible + .revision-toggle__track {
      outline: 2px solid rgba(11,61,145,.35);
      outline-offset: 2px;
    }

    .editor-workspace.assistant-hidden .editor-canvas {
      flex-basis: 100%;
    }

    .assistant-panel {
      width: var(--assistant-width);
      flex: 0 0 var(--assistant-width);
      min-width: 360px;
      max-width: 760px;
      display: flex;
      flex-direction: column;
      position: sticky;
      align-self: flex-start;
      top: 0;
      height: calc(100vh - 3rem);
      max-height: var(--assistant-panel-max-height, calc(100vh - 1rem));
      background: linear-gradient(180deg, rgba(248,250,253,.98), rgba(243,246,251,.96));
      border: 1px solid rgba(11,61,145,.12);
      border-radius: 18px;
      box-shadow: 0 14px 30px rgba(13,48,96,.06);
      overflow: hidden;
    }

    .editor-workspace.assistant-hidden .assistant-panel,
    .editor-workspace.assistant-unavailable .assistant-panel {
      display: none;
    }

    .editor-workspace.assistant-hidden .layout-resizer--assistant,
    .editor-workspace.assistant-unavailable .layout-resizer--assistant {
      display: none;
    }

    .assistant-show-button {
      display: none;
      position: sticky;
      top: 0;
      width: 44px;
      height: 44px;
      border-radius: 999px;
      border: 1px solid rgba(11,61,145,.18);
      background: var(--equica-card);
      color: var(--equica-blue);
      box-shadow: 0 10px 24px rgba(13,48,96,.12);
      cursor: pointer;
      align-items: center;
      justify-content: center;
    }

    .editor-workspace.assistant-hidden .assistant-show-button {
      display: inline-flex;
    }

    .editor-workspace.assistant-unavailable .assistant-show-button {
      display: none;
    }

    .assistant-panel__header,
    .assistant-panel__composer {
      padding: .85rem .95rem;
      background: transparent;
    }

    .assistant-panel__header {
      border-bottom: 1px solid rgba(11,61,145,.08);
    }

    .assistant-panel__topline {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: .75rem;
      margin-bottom: .55rem;
    }

    .assistant-panel__title {
      margin: 0;
      color: var(--equica-blue);
      font-size: .95rem;
      font-weight: 700;
      letter-spacing: .01em;
    }

    .assistant-panel__section-row {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      align-items: start;
      column-gap: .65rem;
      margin-bottom: .62rem;
      min-width: 0;
    }

    .assistant-panel__section-label {
      color: var(--equica-muted);
      font-size: .83rem;
      line-height: 1.1;
      white-space: nowrap;
      display: flex;
      align-items: center;
      flex: 0 0 3rem;
      min-height: 2.1rem;
    }

    .assistant-panel__section-control {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      row-gap: .5rem;
      align-items: start;
      min-width: 0;
    }

    .assistant-panel__section-context {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      align-items: center;
      gap: .5rem;
      min-width: 0;
    }

    .assistant-panel__section-value {
      display: flex;
      align-items: center;
      min-height: 1.9rem;
      min-width: 0;
      padding: .2rem 0;
      color: var(--equica-text);
      font-size: .93rem;
      font-weight: 500;
      line-height: 1.2;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .assistant-panel__context-reset {
      border: 0;
      background: rgba(11,61,145,.05);
      color: var(--equica-muted);
      border-radius: 999px;
      padding: .22rem .58rem;
      font-size: .74rem;
      font-weight: 600;
      line-height: 1.2;
      cursor: pointer;
      transition: background .18s ease, color .18s ease;
    }

    .assistant-panel__context-reset:hover,
    .assistant-panel__context-reset:focus-visible {
      background: rgba(11,61,145,.1);
      color: var(--equica-blue);
    }

    @media (max-width: 560px) {
      .assistant-panel__section-context {
        grid-template-columns: minmax(0, 1fr);
      }

      .assistant-panel__section-value {
        white-space: normal;
      }

      .assistant-panel__context-reset {
        justify-self: start;
      }
    }

    .assistant-toggle-group {
      display: flex;
      gap: .25rem;
      padding: .18rem;
      justify-self: start;
      border-radius: 999px;
      background: rgba(11,61,145,.05);
      border: 1px solid rgba(11,61,145,.08);
      margin-bottom: 0;
      max-width: 100%;
    }

    .assistant-toggle {
      flex: 1 1 0;
      border: 0;
      background: transparent;
      color: var(--equica-muted);
      border-radius: 999px;
      padding: .32rem .6rem;
      font-size: .78rem;
      font-weight: 600;
      white-space: nowrap;
      cursor: pointer;
      transition: background .18s ease, color .18s ease;
    }

    .assistant-toggle.is-active {
      background: rgba(11,61,145,.12);
      color: var(--equica-blue);
    }

    .assistant-panel__conversation {
      flex: 1;
      min-height: 0;
      overflow-y: auto;
      padding: .8rem .95rem .65rem;
      background: transparent;
      font-size: .9rem;
    }

    #chatConversation {
      display: flex;
      flex-direction: column;
      gap: .55rem;
    }

    .assistant-panel__conversation .markdown-rendered {
      line-height: 1.2;
      font-size: .9rem;
      margin: 0;
      padding: 0;
    }

    .assistant-panel__conversation .markdown-rendered.content {
      margin: 0;
    }

    .assistant-panel__conversation .content,
    .assistant-panel__conversation .content ul,
    .assistant-panel__conversation .content ol,
    .assistant-panel__conversation .content p {
      margin: 0 0 .18em;
      padding: 0;
    }

    .assistant-panel__conversation .content > *:last-child,
    .assistant-panel__conversation .content ul:last-child,
    .assistant-panel__conversation .content ol:last-child,
    .assistant-panel__conversation .content p:last-child {
      margin-bottom: 0;
    }

    .assistant-panel__conversation .markdown-rendered h1,
    .assistant-panel__conversation .markdown-rendered h2,
    .assistant-panel__conversation .markdown-rendered h3,
    .assistant-panel__conversation .markdown-rendered h4,
    .assistant-panel__conversation .markdown-rendered h5,
    .assistant-panel__conversation .markdown-rendered h6 {
      margin: .45em 0 .18em;
      border: 0;
      padding: 0;
      color: var(--equica-text);
    }

    .assistant-panel__conversation .markdown-rendered h1 { font-size: 1.15rem; }
    .assistant-panel__conversation .markdown-rendered h2 { font-size: 1.05rem; }
    .assistant-panel__conversation .markdown-rendered h3 { font-size: 1rem; }

    .assistant-panel__conversation .markdown-rendered hr {
      display: none;
    }

    .assistant-panel__conversation .markdown-rendered table {
      margin: .2rem 0 .3rem;
      font-size: .84rem;
      line-height: 1.22;
    }

    .assistant-panel__conversation .markdown-rendered th,
    .assistant-panel__conversation .markdown-rendered td {
      padding: 4px 7px;
      vertical-align: top;
    }

    .assistant-panel__conversation .markdown-rendered ul,
    .assistant-panel__conversation .markdown-rendered ol {
      margin-left: 1rem;
    }

    .assistant-panel__conversation .markdown-rendered li {
      margin: 0;
      padding: 0;
    }

    .assistant-panel__empty {
      padding: .35rem 0;
      color: var(--equica-muted);
      background: transparent;
      line-height: 1.45;
    }

    .assistant-message {
      margin-bottom: .32rem;
      display: flex;
      flex-direction: column;
      gap: .12rem;
      min-width: 0;
    }

    .assistant-message__label {
      display: none;
    }

    .assistant-message__bubble {
      padding: 0;
      border-radius: 0;
      background: transparent;
      border: 0;
      box-shadow: none;
      line-height: 1.32;
      white-space: pre-wrap;
      color: var(--equica-text);
      max-width: 100%;
      min-width: 0;
    }

    .assistant-message--user {
      align-items: flex-end;
    }

    .assistant-message--user .assistant-message__bubble {
      max-width: min(92%, 42rem);
      padding: .45rem .72rem;
      border-radius: 14px;
      background: rgba(11,61,145,.05);
      border: 0;
      color: var(--equica-blue);
      font-weight: 500;
    }

    #chatConversation .assistant-message--assistant .assistant-message__bubble,
    #chatConversation .assistant-message--loading .assistant-message__bubble,
    #chatConversation .assistant-message--status .assistant-message__bubble {
      padding: 0;
      border-radius: 0;
      background: transparent;
      border: 0;
      box-shadow: none;
      overflow: visible;
    }

    .assistant-message--status .assistant-message__bubble {
      color: var(--equica-muted);
      font-size: .86rem;
    }

    .assistant-message--loading .assistant-message__bubble {
      display: flex;
      align-items: center;
      gap: .65rem;
    }

    .assistant-loading-spinner {
      width: 16px;
      height: 16px;
      border-radius: 50%;
      border: 2px solid rgba(11,61,145,.16);
      border-top-color: var(--equica-blue);
      animation: assistant-spin .85s linear infinite;
      flex: 0 0 auto;
    }

    .assistant-loading-text {
      font-size: .82rem;
      color: var(--equica-muted);
      font-style: italic;
    }

    .assistant-suggestion-card {
      padding: 1rem;
      border-radius: 18px;
      border: 1px solid rgba(11,61,145,.12);
      background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(242,245,251,.92));
      box-shadow: 0 12px 26px rgba(13,48,96,.08);
    }

    .assistant-suggestion-card__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: .75rem;
      margin-bottom: .75rem;
    }

    .assistant-suggestion-card__title {
      color: var(--equica-blue);
      font-weight: 700;
    }

    .assistant-suggestion-card__status {
      font-size: .72rem;
      font-weight: 700;
      color: var(--equica-blue);
      background: rgba(11,61,145,.1);
      border-radius: 999px;
      padding: .22rem .55rem;
    }

    .assistant-suggestion-card__preview {
      border-radius: 14px;
      border: 1px solid rgba(11,61,145,.1);
      background: #fff;
      padding: .9rem;
      margin-bottom: .8rem;
    }

    .assistant-suggestion-card__explanation {
      color: var(--equica-muted);
      font-size: .88rem;
      line-height: 1.55;
      margin-bottom: .9rem;
    }

    .assistant-suggestion-card__actions {
      display: flex;
      flex-wrap: wrap;
      gap: .55rem;
    }

    .assistant-quick-actions {
      display: flex;
      flex-wrap: wrap;
      gap: .35rem;
      margin-top: .45rem;
    }

    .assistant-quick-actions .button {
      border-radius: 999px;
      font-size: .74rem;
      box-shadow: none;
    }

    .assistant-panel__composer {
      background: rgba(255,255,255,.42);
      border-top: 1px solid rgba(11,61,145,.08);
    }

    .assistant-panel__composer .textarea {
      min-height: 72px;
      resize: vertical;
      border: 0;
      background: rgba(255,255,255,.68) !important;
      box-shadow: none;
      padding: .65rem .75rem;
    }

    .assistant-panel__actions {
      display: flex;
      justify-content: flex-end;
      margin-top: .5rem;
    }

    .rl-question {
      border-radius: 18px;
      border: 1px solid rgba(11,61,145,.1);
      box-shadow: 0 12px 28px rgba(13,48,96,.06);
    }

    .rl-question.is-ai-active {
      border-color: rgba(11,61,145,.3);
      box-shadow: 0 0 0 2px rgba(11,61,145,.12), 0 16px 34px rgba(13,48,96,.12);
    }

    .rl-question__header-actions {
      display: flex;
      align-items: center;
      gap: .5rem;
      flex-wrap: wrap;
    }

    .price-selection-panel {
      margin-top: 1rem;
      padding-top: 1rem;
      border-top: 1px solid rgba(11,61,145,.12);
    }

    .price-selection-panel.is-hidden {
      display: none;
    }

    .price-selection-table {
      width: 100%;
      margin-top: .75rem;
    }

    .price-selection-table td,
    .price-selection-table th {
      vertical-align: middle;
    }

    .price-selection-options {
      display: flex;
      flex-wrap: wrap;
      gap: .65rem;
      margin-top: 1rem;
    }

    .price-selection-options .button {
      border-radius: 999px;
    }

    .price-selection-options .button.is-active {
      box-shadow: 0 0 0 2px rgba(11,61,145,.15);
    }

    .price-selection-custom {
      margin-top: 1rem;
    }

    .price-selection-actions {
      margin-top: 1rem;
      display: flex;
      justify-content: flex-end;
    }

    .price-selection-help {
      margin-top: .6rem;
    }

    .assistant-entry-button {
      border-radius: 999px;
      font-weight: 600;
    }

    .section-preview-card {
      margin-top: 1rem;
      border-top: 1px solid rgba(11,61,145,.16);
      background: transparent;
      border-radius: 0;
      padding: 1rem 0 0;
    }

    .section-preview-card.is-hidden {
      display: none;
    }

    .section-preview-card__grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 1rem;
    }

    .section-preview-card__column {
      background: rgba(255,255,255,.84);
      border: 1px solid rgba(11,61,145,.08);
      border-radius: 14px;
      padding: .85rem;
    }

    .section-preview-card__label {
      color: var(--equica-blue);
      font-size: .78rem;
      text-transform: uppercase;
      letter-spacing: .06em;
      font-weight: 700;
      margin-bottom: .55rem;
    }

    .section-preview-card__changes {
      display: flex;
      flex-direction: column;
      gap: .85rem;
    }

    .section-preview-card__change {
      padding: 0;
    }

    .section-preview-card__change-block {
      height: 100%;
      display: flex;
      flex-direction: column;
      padding: .75rem;
      min-width: 0;
      border-left: 3px solid rgba(11,61,145,.14);
      border-radius: 0;
    }

    .section-preview-card__change-block--before {
      border-left-color: rgba(214,36,46,.5);
    }

    .section-preview-card__change-block--after {
      border-left-color: rgba(24,135,84,.52);
    }

    .section-preview-card__change-block--replace {
      border-left-color: rgba(11,61,145,.26);
    }

    .section-preview-card__inline-diff {
      white-space: pre-wrap;
      line-height: 1.6;
      color: var(--equica-text);
      word-break: break-word;
    }

    .section-preview-card__inline-diff-token--insert {
      background: rgba(24,135,84,.14);
      color: #146c43;
      border-radius: 3px;
    }

    .section-preview-card__inline-diff-token--delete {
      background: rgba(214,36,46,.1);
      color: #9f1e28;
      text-decoration: line-through;
      border-radius: 3px;
    }

    .section-preview-card__note {
      margin-top: .8rem;
      color: var(--equica-muted);
      font-size: .84rem;
    }

    .section-preview-card__actions {
      display: flex;
      flex-wrap: wrap;
      gap: .55rem;
      margin-top: 1rem;
    }

    .section-preview-card__loading-banner {
      margin-top: .35rem;
      padding: .9rem 1rem;
      border: 1px solid rgba(11,61,145,.12);
      background: rgba(11,61,145,.05);
      border-radius: 14px;
    }

    .section-preview-card__loading-text {
      color: var(--equica-text);
      font-size: .92rem;
      line-height: 1.5;
    }

    .section-preview-card__loading-progress {
      width: 100%;
      height: 6px;
      margin-top: .85rem;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(11,61,145,.12);
    }

    .section-preview-card__loading-progress-bar {
      width: 38%;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, rgba(11,61,145,.2), rgba(11,61,145,.82), rgba(11,61,145,.2));
      animation: affected-check-card-progress 1.2s ease-in-out infinite;
    }

    .section-auto-consistency-note {
      margin-top: .85rem;
      padding: .75rem .85rem;
      border-left: 3px solid rgba(24,135,84,.52);
      background: rgba(24,135,84,.08);
      color: #146c43;
      font-size: .88rem;
      line-height: 1.45;
    }

    .section-auto-consistency-note.is-hidden {
      display: none;
    }

    .affected-check-card {
      border-top: 1px solid rgba(11,61,145,.12);
      background: rgba(11,61,145,.04);
      padding: .85rem 1rem .9rem;
      flex-shrink: 0;
    }

    .affected-check-card.is-hidden {
      display: none;
    }

    .affected-check-card__title {
      color: var(--equica-blue);
      font-size: .78rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: .06em;
      margin-bottom: .4rem;
    }

    .affected-check-card__progress {
      width: 100%;
      height: 6px;
      margin-top: .7rem;
      overflow: hidden;
      border-radius: 999px;
      background: rgba(11,61,145,.12);
    }

    .affected-check-card__progress-bar {
      width: 38%;
      height: 100%;
      border-radius: inherit;
      background: linear-gradient(90deg, rgba(11,61,145,.2), rgba(11,61,145,.82), rgba(11,61,145,.2));
      animation: affected-check-card-progress 1.2s ease-in-out infinite;
    }

    @keyframes affected-check-card-progress {
      0% {
        transform: translateX(-100%);
      }
      100% {
        transform: translateX(260%);
      }
    }

    .affected-check-card__desc {
      color: var(--equica-text);
      font-size: .85rem;
      line-height: 1.45;
      margin-bottom: .55rem;
    }

    .section-history {
      position: relative;
    }

    .section-history > summary {
      list-style: none;
      cursor: pointer;
    }

    .section-history > summary::-webkit-details-marker {
      display: none;
    }

    .section-history__button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 34px;
      height: 34px;
      border-radius: 50%;
      border: 1px solid rgba(11,61,145,.12);
      background: rgba(255,255,255,.88);
      color: var(--equica-blue);
    }

    .section-history__menu {
      position: absolute;
      top: calc(100% + .45rem);
      right: 0;
      box-sizing: border-box;
      width: min(280px, 80vw);
      max-height: 280px;
      overflow-y: auto;
      overflow-x: hidden;
      border-radius: 16px;
      border: 1px solid rgba(11,61,145,.12);
      background: #fff;
      box-shadow: 0 18px 34px rgba(13,48,96,.16);
      padding: .35rem;
      z-index: 50;
    }

    .section-history__item {
      box-sizing: border-box;
      width: 100%;
      text-align: left;
      padding: .7rem .8rem;
      border: 0;
      background: transparent;
      border-radius: 12px;
      cursor: pointer;
      color: var(--equica-text);
    }

    .section-history__item:hover,
    .section-history__item:focus-visible {
      background: var(--equica-hover);
    }

    .section-history__item.is-current {
      background: rgba(11,61,145,.08);
      color: var(--equica-blue);
      cursor: default;
    }

    .section-history__item:disabled {
      cursor: not-allowed;
      opacity: .55;
    }

    .section-history__item:disabled:hover,
    .section-history__item:disabled:focus-visible {
      background: transparent;
    }

    .section-history__item.is-current:disabled:hover,
    .section-history__item.is-current:disabled:focus-visible {
      background: rgba(11,61,145,.08);
    }

    .section-history__meta {
      display: block;
      margin-top: .2rem;
      font-size: .75rem;
      color: var(--equica-muted);
    }

    .revision-history-page__header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 1rem;
      margin-bottom: 1.5rem;
    }

    .revision-history-page__meta {
      color: var(--equica-muted);
      font-size: .95rem;
      margin-top: .35rem;
    }

    .revision-history-page__actions {
      display: flex;
      gap: .75rem;
      flex-wrap: wrap;
      justify-content: flex-end;
    }

    .revision-history-list {
      display: grid;
      gap: 1rem;
    }

    .revision-history-section {
      background: #fff;
      border: 1px solid rgba(11,61,145,.12);
      border-radius: 16px;
      padding: 1rem 1.1rem;
      box-shadow: 0 12px 28px rgba(13,48,96,.06);
    }

    .revision-history-section__header {
      display: flex;
      align-items: flex-start;
      justify-content: space-between;
      gap: 1rem;
      margin-bottom: 1rem;
    }

    .revision-history-section__title {
      margin: 0;
      font-size: 1.05rem;
      color: var(--equica-blue);
    }

    .revision-history-section__meta {
      color: var(--equica-muted);
      font-size: .82rem;
      text-align: right;
    }

    .revision-history-section__items {
      display: block;
      border: 1px solid rgba(11,61,145,.12);
      border-radius: 14px;
      overflow: hidden;
      background: #fff;
    }

    .revision-row__main {
      display: grid;
      grid-template-columns: 140px minmax(0, 1fr) 180px 180px 130px;
      gap: .75rem;
      align-items: center;
    }

    .revision-row {
      border-top: 1px solid rgba(11,61,145,.08);
    }

    .revision-row:first-child {
      border-top: 0;
    }

    .revision-row.is-current .revision-row__main {
      background: rgba(11,61,145,.05);
    }

    .revision-row__main {
      padding: .85rem .95rem;
      background: #fff;
      cursor: pointer;
    }

    .revision-row__version {
      display: flex;
      align-items: center;
      gap: .45rem;
      font-weight: 600;
      color: var(--equica-text);
    }

    .revision-row__current-icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 1.4rem;
      height: 1.4rem;
      border-radius: 999px;
      background: rgba(11,61,145,.1);
      color: var(--equica-blue);
      font-size: .78rem;
    }

    .revision-row__summary {
      color: var(--equica-text);
      font-size: .9rem;
      font-weight: 500;
      min-width: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .revision-row__who,
    .revision-row__time {
      color: var(--equica-muted);
      font-size: .84rem;
    }

    .revision-row__time {
      white-space: nowrap;
    }

    .revision-row__action {
      display: flex;
      justify-content: flex-end;
    }

    .revision-row__details {
      display: none;
      padding: 0 .95rem .95rem;
      background: rgba(242,245,251,.5);
    }

    .revision-row.is-open .revision-row__details {
      display: block;
    }

    .revision-row__diff,
    .revision-row__content {
      border-radius: 12px;
      padding: .85rem .95rem;
      background: rgba(255,255,255,.88);
      border: 1px solid rgba(11,61,145,.08);
    }

    @media (max-width: 980px) {
      .revision-row__main {
        grid-template-columns: 1fr;
        gap: .45rem;
      }

      .revision-row__action {
        justify-content: flex-start;
      }

      .revision-row__summary {
        white-space: normal;
      }
    }

    .revision-history-empty {
      padding: 1.25rem;
      text-align: center;
      color: var(--equica-muted);
      background: #fff;
      border-radius: 16px;
      border: 1px dashed rgba(11,61,145,.2);
    }

    @keyframes assistant-spin {
      to { transform: rotate(360deg); }
    }

    @media (max-width: 1180px) {
      .editor-workspace {
        flex-direction: column;
      }

      .layout-resizer {
        display: none;
      }

      .assistant-panel,
      .assistant-show-button {
        position: static;
      }

      .assistant-panel {
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: 0;
        max-height: none;
        border-radius: 18px;
        box-shadow: 0 14px 30px rgba(13,48,96,.06);
      }

      .editor-workspace.assistant-hidden .assistant-show-button {
        display: inline-flex;
        align-self: flex-start;
      }
    }

    @media (max-width: 768px) {
      .section-preview-card__grid {
        grid-template-columns: 1fr;
      }
    }
