:root {
    --font-ui: 'Hanken Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, 'Liberation Mono', 'Courier New', monospace;
  }

body {
    background: var(--surface-base);
    font-family: var(--font-ui);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #FFFFFF;
    border-bottom: 1px solid rgba(0,0,0,0.12);
  }
  header h1 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-family: var(--font-ui);
    font-weight: 700;
    letter-spacing: 2px;
    color: #226871;
    text-shadow: 0 0 10px #22687155;
  }
  header .subtitle { font-size: 11px; color: #495057; }
  .header-project-context {
    display: none;
    margin-left: 44px;
    margin-top: -6px;
    font-family: var(--font-ui);
    font-size: 11px;
    line-height: 1.25;
    color: #5C6B73;
    letter-spacing: 0;
  }
  .header-project-context.is-visible { display: block; }
  .header-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 6px;
  }
  .header-logo--centaur {
    width: 38px;
    height: 38px;
    border-radius: 0;
    background: transparent;
  }
  .tab-bar {
    display: flex;
    gap: 2px;
    padding: 0 20px;
    background: #FFFFFF;
    border-bottom: 1px solid rgba(0,0,0,0.12);
  }
  .tab-bar-hint {
    display: none;
  }
  .tab {
    padding: 7px 18px;
    font-size: 11px;
    font-family: var(--font-ui);
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    border: none;
    background: transparent;
    color: #495057;
    border-bottom: 2px solid transparent;
    transition: color 0.15s;
  }
  .tab:hover { color: #C9D1D9; }
  .tab.active { color: #226871; border-bottom: 2px solid #226871; }
  .tab.is-hidden { display: none; }
  .tab-content { display: none; flex: 1; overflow: hidden; }
  .tab-content.active { display: flex; }

  /* Agents tab */
  .agents-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    align-content: start;
  }
  .agent-card {
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    padding: 14px 16px;
    border-left: 3px solid var(--agent-color);
  }
  .agent-card--clickable {
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  }
  .agent-card--clickable:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--agent-color) 28%, transparent);
    outline-offset: 2px;
  }
  .agent-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }
  .agent-card-avatar {
    width: 100px; height: 120px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #F8F9FA;
    flex-shrink: 0;
  }
  .agent-card-title { flex: 1; }
  .agent-card-title h4 { font-size: 13px; color: #212529; margin-bottom: 2px; }
  .agent-card-title h4 { line-height: 1.35; }
  .agent-card-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #868E96;
    font-weight: 500;
  }
  .agent-card p {
    font-size: 11px;
    color: #495057;
    line-height: 1.6;
    margin-bottom: 8px;
  }
  .agent-card-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 6px;
  }
  .tag {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0,0,0,0.04);
    color: #495057;
    border: 1px solid rgba(0,0,0,0.12);
  }
  .tag.input-tag  { border-color: #9B59B655; color: #9B59B6; }
  .tag.output-tag { border-color: #2ECC7155; color: #2ECC71; }
  .agent-card .how {
    font-size: 11px;
    color: #868E96;
    border-top: 1px solid rgba(0,0,0,0.04);
    margin-top: 8px;
    padding-top: 8px;
    line-height: 1.5;
  }
  .agent-card-detail-button {
    margin-top: 12px;
    border: 1px solid color-mix(in srgb, var(--agent-color) 42%, rgba(0,0,0,0.12));
    border-radius: 6px;
    background: color-mix(in srgb, var(--agent-color) 8%, #FFFFFF);
    color: var(--agent-color);
    cursor: pointer;
    font: 700 10px/1 var(--font-ui);
    letter-spacing: 0.04em;
    padding: 8px 10px;
    text-transform: uppercase;
  }
  .agent-card-detail-button:hover,
  .agent-card-detail-button:focus-visible {
    background: var(--agent-color);
    color: #FFFFFF;
    outline: none;
  }
  .agent-card-label {
    font-size: 9px;
    color: #868E96;
    margin-right: 2px;
    letter-spacing: 0.6px;
  }
  .agent-card-note {
    grid-column: 1/-1;
    font-size: 10px;
    color: #868E96;
    padding: 2px 0 16px;
    line-height: 1.6;
  }
  .agent-detail-card {
    width: min(920px, 96vw);
    max-height: min(860px, calc(100vh - 32px));
    border-top: 4px solid var(--agent-color);
  }
  .agent-detail-header .modal-header-title {
    color: #122A2D;
  }
  .agent-detail-body {
    background: #F8FAFA;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
  }
  .agent-detail-section {
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(34,104,113,0.13);
    border-radius: 8px;
    padding: 12px;
    min-width: 0;
  }
  .agent-detail-section--wide {
    grid-column: 1 / -1;
  }
  .agent-detail-section p {
    margin: 0;
    color: #334A4F;
    font-size: 12px;
    line-height: 1.6;
  }
  .agent-detail-kicker {
    color: var(--agent-color);
    font: 800 10px/1.2 var(--font-ui);
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    text-transform: uppercase;
  }
  .agent-detail-path {
    border: 1px solid rgba(34,104,113,0.12);
    border-radius: 6px;
    background: #FFFFFF;
    color: #122A2D;
    font: 11px/1.35 var(--font-mono);
    margin-bottom: 8px;
    overflow-wrap: anywhere;
    padding: 7px 8px;
  }
  .agent-detail-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding-left: 17px;
  }
  .agent-detail-list li,
  .agent-detail-empty {
    color: #4F6469;
    font-size: 11px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  .agent-detail-io {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  @media (max-width: 720px) {
    .agent-detail-body,
    .agent-detail-io {
      grid-template-columns: 1fr;
    }
  }
  .agent-chat {
    margin-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.08);
    padding-top: 10px;
  }
  .agent-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
  }
  .agent-chat-title {
    font-size: 10px;
    color: #343A40;
    font-weight: 700;
    letter-spacing: 0.8px;
  }
  .agent-chat-status {
    font-size: 9px;
    color: #868E96;
    min-height: 12px;
    text-align: right;
  }
  .agent-chat-compose {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px;
    align-items: end;
  }
  .agent-chat-replies {
    margin-top: 10px;
    border: 1px solid color-mix(in srgb, var(--agent-color) 28%, rgba(0,0,0,0.12));
    border-radius: 6px;
    background: color-mix(in srgb, var(--agent-color) 7%, #FFFFFF);
    padding: 9px;
    display: grid;
    gap: 8px;
  }
  .agent-chat-reply {
    display: grid;
    gap: 3px;
  }
  .agent-chat-reply-label {
    font-size: 9px;
    line-height: 1.2;
    letter-spacing: 0.7px;
    font-weight: 700;
    color: #5C636A;
  }
  .agent-chat-reply-text {
    font-size: 11px;
    line-height: 1.45;
    color: #212529;
  }
  .agent-chat-reply--agent .agent-chat-reply-label {
    color: var(--agent-color);
  }
  .agent-chat-input {
    width: 100%;
    min-height: 42px;
    max-height: 92px;
    resize: vertical;
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 6px;
    padding: 7px 8px;
    font: 11px/1.4 var(--font-ui);
    color: #212529;
    background: #FFFFFF;
  }
  .agent-chat-input:focus {
    outline: none;
    border-color: var(--agent-color);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--agent-color) 16%, transparent);
  }
  .agent-chat-send {
    border: none;
    border-radius: 6px;
    background: var(--agent-color);
    color: #FFFFFF;
    width: 34px;
    height: 34px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
  }
  .agent-chat-send:disabled {
    opacity: 0.5;
    cursor: wait;
  }
  .project-manager-chat {
    position: fixed;
    left: 22px;
    bottom: 16px;
    width: min(410px, calc(100vw - 32px));
    max-height: calc(100vh - 190px);
    background: rgba(255,255,255,0.96);
    border: 1px solid rgba(16,33,51,0.14);
    border-radius: 8px;
    box-shadow: 0 18px 48px rgba(16,33,51,0.22), 0 4px 16px rgba(16,33,51,0.10);
    z-index: 1200;
    overflow: hidden;
    backdrop-filter: blur(16px);
  }
  .project-manager-chat-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    background: rgba(16,33,51,0.36);
  }
  .project-manager-chat-backdrop[hidden] {
    display: none !important;
  }
  @media (min-width: 861px) {
    body.chat-docked-open .tab-content.active {
      box-sizing: border-box;
      padding-left: min(444px, 40vw);
    }
    body.chat-docked-open .project-manager-chat {
      left: 22px;
      right: auto;
      top: auto;
      bottom: 22px;
      max-height: min(620px, calc(100vh - 44px));
    }
  }
  .project-manager-chat.is-attention {
    animation: milestoneChatPulse 1.15s ease-in-out infinite;
  }
  .project-manager-chat.is-urgent {
    animation: importantChatPulse 0.7s ease-in-out 5;
  }
  .project-manager-chat-badge {
    display: none;
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #E03131;
    color: #FFFFFF;
    border: 2px solid #FFFFFF;
    box-shadow: 0 6px 14px rgba(224,49,49,0.32);
    align-items: center;
    justify-content: center;
    font: 800 11px/1 var(--font-ui);
  }
  .project-manager-chat-badge[hidden] {
    display: none !important;
  }
  @keyframes milestoneChatPulse {
    0%, 100% {
      border-color: rgba(34,104,113,0.30);
      box-shadow: 0 18px 48px rgba(16,33,51,0.22), 0 0 0 0 rgba(107,250,62,0.0);
    }
    50% {
      border-color: rgba(107,250,62,0.82);
      box-shadow: 0 22px 58px rgba(16,33,51,0.28), 0 0 0 5px rgba(107,250,62,0.18);
    }
  }
  @keyframes importantChatPulse {
    0%, 100% {
      border-color: rgba(224,49,49,0.28);
      box-shadow: 0 18px 48px rgba(16,33,51,0.22), 0 0 0 0 rgba(224,49,49,0);
    }
    50% {
      border-color: rgba(224,49,49,0.92);
      box-shadow: 0 24px 62px rgba(16,33,51,0.30), 0 0 0 7px rgba(224,49,49,0.18);
    }
  }
  @media (prefers-reduced-motion: reduce) {
    .project-manager-chat.is-attention,
    .project-manager-chat.is-urgent {
      animation: none;
    }
  }
  .project-manager-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 13px 14px 11px;
    background: linear-gradient(135deg, #102133 0%, #226871 68%, #2F7D6D 100%);
    color: #FFFFFF;
  }
  .project-manager-chat-kicker {
    display: block;
    font-size: 9px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.9px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.72);
  }
  .project-manager-chat-title {
    display: block;
    margin-top: 3px;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: 0;
  }
  .project-manager-chat-subtitle {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(255,255,255,0.78);
  }
  .project-manager-chat-agent {
    appearance: none;
    max-width: 150px;
    border: 1px solid rgba(255,255,255,0.32);
    border-radius: 6px;
    background: rgba(255,255,255,0.12);
    color: #FFFFFF;
    padding: 7px 28px 7px 10px;
    font: 700 11px/1.2 var(--font-ui);
    cursor: pointer;
  }
  .project-manager-chat-agent option { color: #102133; background: #FFFFFF; }
  .project-manager-chat-body {
    padding: 12px;
    display: grid;
    gap: 10px;
  }
  .project-manager-chat-replies {
    max-height: min(420px, 42vh);
    overflow-y: auto;
  }
  .project-manager-chat-replies:empty { display: none; }
  .project-manager-chat-empty {
    border: 1px solid #E1E8ED;
    background: #F8FAFB;
    border-radius: 7px;
    padding: 10px 11px;
    color: #4F5F66;
    font-size: 12px;
    line-height: 1.45;
  }
  .project-manager-chat-compose {
    display: grid;
    grid-template-columns: 1fr 40px;
    gap: 8px;
    align-items: end;
  }
  .project-manager-chat-input {
    min-height: 78px;
    max-height: 180px;
    resize: vertical;
    border: 1px solid #D3DDE3;
    border-radius: 7px;
    background: #FFFFFF;
    color: #102133;
    padding: 9px 10px;
    font: 12px/1.45 var(--font-ui);
    outline: none;
  }
  .project-manager-chat-input:focus {
    border-color: #226871;
    box-shadow: 0 0 0 3px rgba(34,104,113,0.14);
  }
  .project-manager-chat-send {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 7px;
    background: #226871;
    color: #FFFFFF;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
  }
  .project-manager-chat-send:hover { background: #1B5961; }
  .project-manager-chat-send:disabled { opacity: 0.58; cursor: not-allowed; }
  .project-manager-chat-questions {
    display: grid;
    gap: 10px;
    margin-top: 10px;
  }
  .project-manager-chat-question {
    border: 1px solid rgba(34,104,113,0.18);
    border-left: 3px solid #226871;
    border-radius: 8px;
    background: #F8FAFB;
    padding: 11px;
  }
  .project-manager-chat-question-title {
    color: #102133;
    font: 700 12px/1.45 var(--font-ui);
  }
  .project-manager-chat-question-meta {
    margin-top: 5px;
    color: #4F5F66;
    font: 11px/1.45 var(--font-ui);
  }
  .project-manager-chat-question-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
  }
  .project-manager-chat-answer {
    border: 1px solid rgba(34,104,113,0.18);
    border-radius: 999px;
    background: #FFFFFF;
    color: #102133;
    padding: 7px 10px;
    font: 700 11px/1.2 var(--font-ui);
    cursor: pointer;
  }
  .project-manager-chat-answer:hover {
    border-color: rgba(107,250,62,0.72);
    background: #F6FEF9;
  }
  .project-manager-chat-answer.recommended {
    border-color: rgba(46,160,67,0.42);
    background: #F6FEF9;
  }
  .project-manager-chat-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #6C757D;
    font-size: 10px;
    line-height: 1.35;
  }
  .project-manager-chat-toggle {
    appearance: none;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    width: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    padding: 0;
    text-align: left;
    cursor: pointer;
    font: inherit;
  }
  .project-manager-chat-toggle-icon {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.13);
    border: 1px solid rgba(255,255,255,0.28);
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
  }
  .project-manager-chat.is-minimized {
    left: 22px;
    right: auto;
    top: auto;
    bottom: 22px;
    width: min(340px, calc(100vw - 28px));
    max-height: none;
  }
  .project-manager-chat.is-minimized .project-manager-chat-body,
  .project-manager-chat.is-minimized .project-manager-chat-agent {
    display: none;
  }
  .project-manager-chat.is-minimized .project-manager-chat-header {
    padding: 12px 13px;
  }
  .project-manager-chat.is-minimized .project-manager-chat-subtitle {
    display: none;
  }
  .project-manager-chat.is-minimized .project-manager-chat-badge:not([hidden]) {
    display: inline-flex;
  }
  @media (max-width: 520px) {
    .project-manager-chat,
    .project-manager-chat.is-minimized {
      left: 14px;
      width: calc(100vw - 28px);
    }
  }
  @media (max-width: 860px) {
    body.chat-docked-open .tab-content.active {
      padding-right: 0;
    }
    .project-manager-chat:not(.is-minimized) {
      left: 0;
      right: 0;
      bottom: 0;
      width: 100vw;
      max-height: min(72vh, 620px);
      border-radius: 10px 10px 0 0;
    }
    .project-manager-chat:not(.is-minimized) .project-manager-chat-body {
      max-height: calc(72vh - 78px);
      overflow: auto;
    }
    .project-manager-chat:not(.is-minimized) .project-manager-chat-replies {
      max-height: min(34vh, 300px);
    }
  }
  .preview-media-shell {
    flex: 1;
    min-height: 0;
    background: #F8F9FA;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    overflow: auto;
  }
  .preview-media-shell img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    background: #fff;
  }
  .planlosning-preview-window,
  .planlosning-dxf-window {
    height: min(52vh, 520px);
    min-height: 360px;
    max-height: 65vh;
    box-sizing: border-box;
  }
  .planlosning-preview-window img {
    max-height: 100%;
    object-fit: contain;
  }
  .preview-pdf {
    width: 100%;
    height: 100%;
    min-height: 70vh;
    border: none;
    background: #fff;
    border-radius: 10px;
  }
  .review-guidance {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(190,177,164,0.35);
    border-radius: 10px;
    background: linear-gradient(180deg, #FFFDF9 0%, #F8F4EC 100%);
  }
  .review-guidance strong {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    color: #8B7340;
  }

  /* Outputs tab */
  .outputs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
  }
  .outputs-header h2 { font-size: 13px; color: #212529; letter-spacing: 1px; }
  .outputs-header .legend { display: flex; gap: 12px; font-size: 10px; color: #495057; }
  .legend-dot { display:inline-block; width:8px; height:8px; border-radius:2px; margin-right:4px; vertical-align:middle; }
  .reports-root { flex:1; min-height:0; overflow-y:auto; padding:16px 20px; }
  .reports-layout { display:grid; grid-template-columns:300px minmax(0,1fr); gap:14px; align-items:start; }
  .reports-index { display:flex; flex-direction:column; gap:8px; }
  .report-index-item { border:1px solid #DEE2E6; background:#FFFFFF; border-radius:8px; padding:10px 12px; cursor:pointer; text-align:left; }
  .report-index-item:hover, .report-index-item.is-active { border-color:#226871; background:#F0FAF9; }
  .report-index-item strong { display:block; font-size:12px; color:#212529; }
  .report-index-item span { display:block; margin-top:3px; font-size:10px; color:#6C757D; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .report-panel { border:1px solid #DEE2E6; background:#FFFFFF; border-radius:8px; min-height:420px; display:flex; flex-direction:column; overflow:hidden; }
  .report-panel-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; padding:16px; border-bottom:1px solid #E9ECEF; background:#FBFCFD; }
  .report-panel-titlebar { display:flex; gap:11px; align-items:flex-start; min-width:0; }
  .report-brand-logo { width:74px; height:40px; object-fit:contain; flex:0 0 auto; background:transparent; border-radius:0; }
  .report-panel-head h3 { margin:3px 0 5px; font-size:18px; letter-spacing:0; }
  .report-panel-body { padding:18px; overflow:auto; line-height:1.55; color:#343A40; }
  .report-section { margin:0 0 18px; }
  .report-section h4 { margin:0 0 8px; font-size:13px; letter-spacing:.4px; text-transform:uppercase; color:#226871; }
  .report-section p, .report-section li { font-size:13px; }
  .report-figure { margin:12px 0 16px; border:1px solid #DEE2E6; background:#FFFFFF; border-radius:8px; padding:12px; }
  .report-figure img { display:block; width:100%; max-height:360px; object-fit:contain; }
  .report-figure figcaption { margin-top:8px; color:#6C757D; font-size:12px; line-height:1.4; }
  .report-action-row { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
  @media (max-width: 900px) { .reports-layout { grid-template-columns:1fr; } }

  /* Overview tab */
  .overview-shell {
    flex: 1;
    overflow: auto;
    padding: 18px 20px 22px;
    background: linear-gradient(180deg, #FAFBFC 0%, #F8F9FA 100%);
  }
  .overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .95fr);
    gap: 16px;
    align-items: start;
  }
  .overview-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.03);
  }
  .overview-hero {
    background: linear-gradient(180deg, #FFFFFF 0%, #FFFDF9 100%);
    border: 1px solid rgba(190,177,164,0.28);
  }
  .overview-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
  }
  .overview-kpi {
    position: relative;
    padding: 10px 12px;
    border-radius: 10px;
    background: #F8F9FA;
    border: 1px solid rgba(0,0,0,0.06);
    overflow: hidden;
  }
  .overview-kpi::before {
    content: '';
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: var(--accent);
  }
  .overview-kpi .label { font-size: 10px; color: #868E96; margin-bottom: 4px; }
  .overview-kpi .value { font-size: 18px; font-weight: 700; color: #212529; }
  .overview-actions { display:flex; flex-wrap:wrap; gap:8px; }
  .overview-actions button {
    border: 1px solid rgba(0,0,0,0.12);
    background: #fff;
    color: #212529;
    border-radius: 8px;
    padding: 9px 12px;
    cursor: pointer;
    font-size: 11px;
    font-family: var(--font-ui);
  }
  .overview-list { display:grid; gap:8px; }
  .overview-item {
    display:flex; justify-content:space-between; gap:12px; align-items:flex-start;
    border:1px solid rgba(0,0,0,0.08); border-radius:10px; padding:10px 12px; background:#fff;
  }
  .overview-item .meta { font-size: 10px; color: #868E96; margin-top: 3px; }
  .overview-section-title { font-size: 11px; color: #868E96; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }

  .milestone-folder {
    margin-bottom: 20px;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    overflow: hidden;
  }
  .milestone-folder-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #FFFFFF;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid rgba(0,0,0,0.12);
  }
  .milestone-folder-header:hover { background: #F1F3F5; }
  .milestone-folder-header .mf-icon { font-size: 14px; }
  .milestone-folder-header .mf-title { flex:1; font-size: 12px; font-weight: bold; color: #212529; }
  .milestone-folder-header .mf-status {
    font-size: 10px; padding: 2px 8px; border-radius: 10px;
    background: rgba(0,0,0,0.04); color: #495057;
  }
  .milestone-folder-header .mf-status.active { background: #1F4E79; color: #58A6FF; }
  .milestone-folder-header .mf-status.done { background: #1A3C2A; color: #2ECC71; }
  .milestone-folder-header .mf-status.pending { background: rgba(0,0,0,0.04); color: #868E96; }
  .milestone-folder-header .mf-chevron { font-size: 10px; color: #495057; transition: transform 0.2s; }
  .milestone-folder-header.collapsed .mf-chevron { transform: rotate(-90deg); }

  .milestone-folder-body {
    padding: 12px 14px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    background: #F8F9FA;
  }
  .milestone-folder-body.hidden { display: none; }

  .discipline-group { margin-bottom: 4px; }
  .discipline-label {
    font-size: 9px;
    letter-spacing: 1px;
    color: #868E96;
    text-transform: uppercase;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
  }
  .discipline-label::after { content:''; flex:1; height:1px; background:rgba(0,0,0,0.04); }

  .doc-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid rgba(0,0,0,0.12);
    background: #FFFFFF;
    font-size: 10px;
    cursor: default;
    transition: border-color 0.2s;
  }
  .doc-item:hover { border-color: #58A6FF44; }
  .doc-item.status-done { border-left: 3px solid #2ECC71; }
  .doc-item.status-active { border-left: 3px solid #58A6FF; animation: pulse 2s infinite; }
  .doc-item.status-rejected { border-left: 3px solid #E74C3C; }
  .doc-item.status-pending { border-left: 3px solid rgba(0,0,0,0.12); opacity: 0.5; }
  .doc-icon { font-size: 13px; flex-shrink:0; }
  .doc-info { flex:1; min-width:0; }
  .doc-name { color: #C9D1D9; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .doc-meta { color: #868E96; font-size: 9px; margin-top:1px; }
  .doc-badge {
    font-size: 8px; padding: 1px 5px; border-radius: 8px; flex-shrink:0;
    background: rgba(0,0,0,0.04); color: #495057;
  }
  .doc-badge.done { background: #1A3C2A; color: #2ECC71; }
  .doc-badge.active { background: #1A2B4A; color: #58A6FF; }
  .doc-badge.rejected { background: #3C1215; color: #F85149; }
  .doc-badge.pending { background: rgba(0,0,0,0.04); color: #868E96; }
  .milestone-bar {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 280px;
    font-size: 11px;
    color: #495057;
  }
  .milestone-bar-top { display:flex; justify-content:space-between; gap:10px; align-items:center; }
  .milestone-bar-title { font-size: 10px; letter-spacing: 1px; color: #868E96; text-transform: uppercase; }
  .milestone-bar-state { font-size: 10px; color: #495057; }
  .milestone-track {
    height: 10px;
    background: #F1F3F5;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
  }
  .milestone-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #226871 0%, #398184 100%);
    box-shadow: 0 0 16px rgba(190,177,164,0.25);
    transition: width 0.35s ease;
  }
  .milestone-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    font-size: 9px;
    line-height: 1.25;
  }
  .milestone-step {
    position: relative;
    padding-top: 14px;
    text-align: center;
    color: #868E96;
  }
  .milestone-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #DEE2E6;
    box-shadow: 0 0 0 1px #CED4DA;
  }
  .milestone-step.done { color: #2B8A3E; }
  .milestone-step.done::before { background: #2EA043; box-shadow: 0 0 0 1px #2EA043; }
  .milestone-step.active { color: #8B7340; font-weight: 700; }
  .milestone-step.active::before {
    background: #226871;
    box-shadow: 0 0 0 1px #226871, 0 0 0 6px rgba(107,250,62,0.18);
  }
  .milestone-step.pending { opacity: 0.9; }
  @keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.6; } }

  @keyframes flyIn {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
  }
  .doc-item { animation: flyIn 0.3s ease-out both; }

  /* WebSocket connection status indicator */
  .ws-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-family: var(--font-ui);
    letter-spacing: 1px;
    padding: 3px 8px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.12);
    user-select: none;
    cursor: default;
  }
  .ws-status.ws-connected  { color: #2ECC71; border-color: #2ECC7144; background: #0A1F0E; }
  .ws-status.ws-disconnected { color: #495057; border-color: rgba(0,0,0,0.12);   background: rgba(0,0,0,0.04); }
  .ws-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
  .ws-dot.ws-live { background: #2ECC71; animation: wsPulse 1.2s ease-in-out infinite; }
  .ws-dot.ws-sim  { background: #495057; }
  @keyframes wsPulse {
    0%,100% { opacity:1; box-shadow: 0 0 5px #2ECC71; }
    50%      { opacity:0.4; box-shadow: none; }
  }

  .main {
    display: flex;
    flex: 1;
    overflow: hidden;
  }
  .live-workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(360px, 30vw, 520px);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }
  /* Workspace area: persistent container that holds every tab content node
     PLUS the system terminal as a sidebar sibling. This makes the terminal
     visible across all tabs. Layout:
        [ active .tab-content ]  [ #terminalPanel ]            (>= 860px)
        [ #terminalPanel (collapsed) ]                          (<= 860px)
        [ active .tab-content ]                                  (<= 640px) */
  .workspace-area {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
  }
  .workspace-area > .tab-content {
    min-height: 0;
    min-width: 0;
  }
  /* When #tab-live is the active tab we let liveWorkspace own its own
     inner grid (canvas + terminal-filter row). The workspace-area grid
     collapses to a single column for live so the inner layout is intact. */
  .workspace-area > #tab-live {
    grid-column: 1 / -1;
    grid-row: 1;
  }
  .operator-now-panel {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 58px;
    padding: 10px 20px;
    background: rgba(249,251,251,0.92);
    border-bottom: 1px solid rgba(34,104,113,0.14);
    box-shadow: 0 6px 18px rgba(18,42,45,0.06);
  }
  .operator-now-main {
    min-width: 0;
  }
  .operator-now-kicker {
    color: #226871;
    font: 800 10px/1 var(--font-ui);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .operator-now-summary {
    margin-top: 4px;
    color: #122A2D;
    font: 800 15px/1.25 var(--font-ui);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .operator-now-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    min-width: min(520px, 48vw);
  }
  .operator-now-chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    max-width: 230px;
    padding: 5px 10px;
    border: 1px solid rgba(34,104,113,0.16);
    border-radius: 999px;
    background: #FFFFFF;
    color: #4F5F66;
    font: 800 11px/1.2 var(--font-ui);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .operator-now-chip--primary {
    background: #EBFBEE;
    color: #226871;
    border-color: rgba(107,250,62,0.38);
  }
  .live-workspace .main {
    grid-row: 2;
    min-width: 0;
    min-height: 0;
  }
  /* Terminal panel: now a direct child of .workspace-area (not .live-workspace).
     Default (>= 860px): sticky right-hand sidebar inside the workspace grid.
     Minimised state (.is-terminal-minimized): collapses to a 42 px wide rail
     that still shows the toggle button so users can re-expand it from any tab. */
  .terminal-panel {
    grid-column: 2;
    grid-row: 1;
    width: clamp(320px, 30vw, 520px);
    height: auto;
    min-width: 320px;
    min-height: 0;
    max-width: 42vw;
    max-height: 100%;
    border-top: 0;
    border-left: 2px solid rgba(0,0,0,0.12);
    background: #FFFFFF;
    align-self: stretch;
    justify-self: stretch;
    overflow: hidden;
  }
  .terminal-panel.is-terminal-minimized {
    width: 42px;
    min-width: 42px;
    max-width: 42px;
  }
  .terminal-header {
    padding: 4px 10px;
    background: #FFFFFF;
    border-bottom: 1px solid rgba(0,0,0,0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
  }
  .terminal-title {
    color: #40C057;
    font-weight: bold;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .terminal-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }
  .terminal-toggle,
  .terminal-export-btn {
    flex: 0 0 auto;
    border: 1px solid rgba(34,104,113,0.24);
    border-radius: 4px;
    background: rgba(255,255,255,0.86);
    color: #226871;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    padding: 4px 8px;
  }
  .terminal-export-btn {
    color: #495057;
  }
  .terminal-toggle:hover,
  .terminal-export-btn:hover {
    background: rgba(34,104,113,0.08);
  }
  #terminalResizer {
    height: 100% !important;
    width: 8px !important;
    top: 0 !important;
    left: -4px;
    cursor: ew-resize !important;
  }
  .live-workspace.is-terminal-hidden {
    grid-template-columns: minmax(0, 1fr) 48px;
  }
  /* Legacy fallback: if anything still toggles `.is-terminal-hidden` on
     .live-workspace, mirror it on the terminal panel itself. The new
     mechanism below (.terminal-panel.is-terminal-minimized) is what
     toggleTerminalPanel() and switchTab() actually drive. */
  .live-workspace.is-terminal-hidden .terminal-panel {
    min-width: 48px;
    max-width: 48px;
    overflow: hidden;
  }
  /* New primary mechanism: terminal lives outside .live-workspace and is
     toggled via .is-terminal-minimized on the panel itself. */
  .terminal-panel.is-terminal-minimized .term-filters,
  .terminal-panel.is-terminal-minimized #terminalContent {
    display: none;
  }
  .terminal-panel.is-terminal-minimized .terminal-export-btn {
    display: none;
  }
  .terminal-panel.is-terminal-minimized .terminal-header {
    height: 100%;
    padding: 10px 6px;
    justify-content: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }
  .terminal-panel.is-terminal-minimized .terminal-title {
    display: none;
  }
  .terminal-panel.is-terminal-minimized .terminal-toggle {
    transform: rotate(180deg);
    writing-mode: horizontal-tb;
    padding: 6px;
  }
  .live-workspace.is-terminal-hidden .term-filters,
  .live-workspace.is-terminal-hidden #terminalContent {
    display: none;
  }
  .live-workspace.is-terminal-hidden .terminal-export-btn {
    display: none;
  }
  .live-workspace.is-terminal-hidden .terminal-header {
    height: 100%;
    padding: 10px 6px;
    justify-content: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
  }
  .live-workspace.is-terminal-hidden .terminal-title {
    display: none;
  }
  .live-workspace.is-terminal-hidden .terminal-toggle {
    transform: rotate(180deg);
    writing-mode: horizontal-tb;
    padding: 6px;
  }
  .mobile-operator-panel {
    display: none;
  }
  #worldCanvas {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: block;
    image-rendering: auto;
    background: #eef7f4;
    cursor: grab;
    touch-action: none;
    user-select: none;
  }
  #worldCanvas.is-dragging-agent { cursor: grabbing; }
  .three-office-fallback {
    position: relative;
    background: #eef7f4;
  }
  .three-office-fallback-message {
    position: absolute;
    inset: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(107,250,62,0.24);
    border-radius: 8px;
    background: rgba(7,18,17,0.86);
    color: #DDF7F4;
    font: 600 13px/1.5 var(--font-ui);
    text-align: center;
    padding: 16px;
  }
  @media (max-width: 860px) {
    .live-workspace {
      grid-template-columns: 1fr;
      grid-template-rows: minmax(0, 1fr) auto;
    }
    /* Workspace area: on narrow viewports the terminal lives BELOW the
       active tab content, full-width. */
    .workspace-area {
      grid-template-columns: minmax(0, 1fr);
      grid-template-rows: minmax(0, 1fr) auto;
    }
    .workspace-area > #terminalPanel {
      grid-column: 1;
      grid-row: 2;
    }
    .terminal-panel {
      width: auto !important;
      height: 200px !important;
      min-width: 0;
      min-height: 100px !important;
      max-width: none;
      max-height: 80vh !important;
      border-left: 0 !important;
      border-top: 2px solid rgba(0,0,0,0.12) !important;
    }
    #terminalResizer {
      height: 8px !important;
      width: 100% !important;
      top: -4px !important;
      left: 0;
      cursor: ns-resize !important;
    }
    .live-workspace.is-terminal-hidden {
      grid-template-columns: 1fr;
      grid-template-rows: minmax(0, 1fr) 42px;
    }
    .terminal-panel.is-terminal-minimized {
      width: auto !important;
      min-width: 0 !important;
      max-width: none !important;
      height: 42px !important;
      min-height: 42px !important;
    }
    .live-workspace.is-terminal-hidden .terminal-panel {
      min-width: 0;
      max-width: none;
      height: 42px !important;
      min-height: 42px !important;
    }
    .live-workspace.is-terminal-hidden .terminal-header {
      height: auto;
      padding: 6px 10px;
      justify-content: space-between;
      writing-mode: horizontal-tb;
      transform: none;
    }
    .live-workspace.is-terminal-hidden .terminal-title {
      display: inline;
    }
    .live-workspace.is-terminal-hidden .terminal-toggle {
      transform: none;
    }
    .terminal-panel.is-terminal-minimized .terminal-header {
      height: auto;
      padding: 6px 10px;
      justify-content: space-between;
      writing-mode: horizontal-tb;
      transform: none;
    }
    .terminal-panel.is-terminal-minimized .terminal-title {
      display: inline;
    }
    .terminal-panel.is-terminal-minimized .terminal-toggle {
      transform: none;
    }
  }
  @media (max-width: 640px) {
    header {
      min-height: 54px;
      padding: 8px 12px;
      gap: 8px;
      align-items: flex-start;
    }
    header h1 {
      font-size: 14px;
      line-height: 1.05;
      gap: 6px;
      max-width: 56vw;
    }
    .header-logo,
    .header-logo--centaur {
      width: 28px;
      height: 28px;
    }
    .header-project-context {
      margin-left: 34px;
      margin-top: -2px;
      max-width: 54vw;
      font-size: 10px;
      line-height: 1.2;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .header-actions {
      justify-content: flex-end;
      gap: 6px;
      max-width: 42vw;
      overflow-x: auto;
      padding-bottom: 2px;
      scrollbar-width: none;
    }
    .header-actions::-webkit-scrollbar,
    .tab-bar::-webkit-scrollbar,
    .status-row::-webkit-scrollbar {
      display: none;
    }
    .header-link,
    .control-select,
    .project-control-btn,
    .overflow-menu-btn,
    .lang-btn {
      min-height: 28px;
      padding: 4px 8px;
      font-size: 11px;
      white-space: nowrap;
    }
    #auth-user,
    #auth-logout,
    .milestone-bar {
      display: none !important;
    }
    .status-row {
      flex-wrap: nowrap;
      gap: 8px;
      padding: 6px 12px;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .status-row .status-sep {
      display: none;
    }
    .project-control {
      flex-wrap: nowrap;
      gap: 4px;
    }
    .tab-bar {
      height: 42px;
      padding: 0 12px;
      gap: 6px;
      overflow-x: auto;
      flex-wrap: nowrap;
      scrollbar-width: none;
      scroll-snap-type: x proximity;
    }
    .tab-bar-hint {
      display: block;
      padding: 4px 12px 5px;
      background: rgba(249,251,251,0.82);
      border-bottom: 1px solid rgba(34,104,113,0.10);
      color: #5C6B73;
      font: 800 10px/1 var(--font-ui);
      text-align: right;
    }
    .tab {
      flex: 0 0 auto;
      min-width: auto;
      height: 32px;
      padding: 0 12px;
      font-size: 11px;
      white-space: nowrap;
      scroll-snap-align: start;
    }
    .operator-now-panel {
      display: none;
    }
    .live-workspace {
      grid-template-columns: 1fr;
      grid-template-rows: auto minmax(0, 1fr);
    }
    .mobile-operator-panel {
      display: grid;
      gap: 8px;
      padding: 8px 10px;
      background: #F6FAFA;
      border-bottom: 1px solid rgba(34,104,113,0.14);
      box-shadow: 0 6px 18px rgba(18,42,45,0.06);
    }
    .mobile-operator-summary {
      display: grid;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px;
      align-items: center;
      min-width: 0;
    }
    .mobile-operator-kicker {
      color: #226871;
      font: 800 10px/1 var(--font-ui);
      letter-spacing: 0.08em;
      text-transform: uppercase;
    }
    .mobile-operator-title {
      margin-top: 3px;
      color: #122A2D;
      font: 800 14px/1.18 var(--font-ui);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .mobile-operator-subtitle {
      margin-top: 2px;
      color: #4F5F66;
      font: 11px/1.25 var(--font-ui);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .mobile-operator-pill {
      justify-self: end;
      border: 1px solid rgba(34,104,113,0.18);
      border-radius: 999px;
      padding: 4px 9px;
      background: #FFFFFF;
      color: #226871;
      font: 800 10px/1 var(--font-ui);
      white-space: nowrap;
    }
    .mobile-operator-pill.waiting { background: #FFF9DB; color: #8B7340; border-color: #F2C94C66; }
    .mobile-operator-pill.paused { background: #FFF9DB; color: #8B7340; border-color: #F2C94C66; }
    .mobile-operator-pill.stopped,
    .mobile-operator-pill.failed { background: #FFF5F5; color: #E03131; border-color: #FFA8A866; }
    .mobile-operator-pill.complete { background: #EBFBEE; color: #2B8A3E; border-color: #69DB7C66; }
    .mobile-operator-actions {
      display: grid;
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
    }
    .mobile-operator-actions .btn-ui {
      min-height: 34px;
      justify-content: center;
      padding: 6px 8px;
      font-size: 10px;
      white-space: nowrap;
    }
    .mobile-operator-progress {
      display: grid;
      gap: 5px;
    }
    .mobile-operator-progress-meta {
      display: flex;
      justify-content: space-between;
      gap: 8px;
      color: #4F5F66;
      font: 10px/1.2 var(--font-ui);
    }
    .mobile-operator-track {
      height: 6px;
      border-radius: 999px;
      background: #E6ECEC;
      overflow: hidden;
    }
    .mobile-operator-fill {
      height: 100%;
      width: 0;
      border-radius: inherit;
      background: linear-gradient(90deg, #226871, #6BFA3E);
      transition: width 0.3s ease;
    }
    .live-workspace > .main {
      display: none !important;
    }
    .terminal-panel {
      height: auto !important;
      min-height: 0 !important;
      max-height: none !important;
      border-top: 0 !important;
    }
    .terminal-header {
      min-height: 38px;
      padding: 6px 12px;
    }
    .terminal-title {
      font-size: 12px;
      letter-spacing: 0.02em;
    }
    .term-filters {
      flex-wrap: nowrap;
      overflow-x: auto;
      padding: 8px 12px;
      scrollbar-width: none;
    }
    .term-filters::-webkit-scrollbar {
      display: none;
    }
    #terminalContent {
      font-size: 12px;
      padding: 10px 12px !important;
      line-height: 1.55 !important;
    }
    .live-workspace.is-terminal-hidden {
      grid-template-rows: auto minmax(0, 1fr) 42px;
    }
    .live-workspace.is-terminal-hidden > .main {
      display: flex !important;
    }
    .live-workspace.is-terminal-hidden .terminal-panel {
      height: 42px !important;
      min-height: 42px !important;
      border-top: 2px solid rgba(0,0,0,0.12) !important;
    }
  }
  .sidebar {
    width: 280px;
    flex: 0 0 280px;
    background: #FFFFFF;
    border-left: 1px solid rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .sidebar-section {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.12);
  }
  .sidebar-section h3 {
    font-size: 10px;
    letter-spacing: 1px;
    color: #495057;
    margin-bottom: 8px;
    text-transform: uppercase;
  }
  .agent-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 11px;
  }
  .agent-dot {
    width: 10px; height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
  }
  .agent-avatar {
    position: relative;
    width: 25px;
    height: 20px;
    flex-shrink: 0;
  }
  .agent-avatar--centaur {
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.18));
  }
  .agent-avatar__horse-body {
    position: absolute;
    left: 2px;
    top: 10px;
    width: 18px;
    height: 6px;
    border-radius: 2px;
    background: #226871;
  }
  .agent-avatar__horse-leg {
    position: absolute;
    top: 15px;
    width: 2px;
    height: 5px;
    border-radius: 1px;
    background: #174A52;
  }
  .agent-avatar__horse-leg:nth-child(2) { left: 3px; }
  .agent-avatar__horse-leg:nth-child(3) { left: 8px; }
  .agent-avatar__horse-leg:nth-child(4) { left: 14px; }
  .agent-avatar__horse-leg:nth-child(5) { left: 19px; }
  .agent-avatar__torso {
    position: absolute;
    left: 12px;
    top: 4px;
    width: 7px;
    height: 8px;
    border-radius: 1px;
    background: #2B8A91;
  }
  .agent-avatar__head {
    position: absolute;
    left: 12px;
    top: 0;
    width: 7px;
    height: 5px;
    border-radius: 1px;
    background: #F5CBA7;
  }
  .agent-avatar__hat {
    position: absolute;
    left: 11px;
    top: -1px;
    width: 9px;
    height: 2px;
    background: #174A52;
  }
  .agent-avatar__tail {
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 7px;
    border-left: 2px solid #174A52;
    border-bottom: 2px solid #174A52;
    border-radius: 0 0 0 8px;
  }
  .agent-name { flex: 1; color: #212529; }
  .agent-status {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 2px;
    background: rgba(0,0,0,0.04);
    color: #495057;
  }
  .agent-status.working { color: #2B8A3E; background: #EBFBEE; }
  .agent-status.waiting { color: #8B7340; background: #FFF9DB; }
  .agent-status.blocked { color: #E03131; background: #FFF5F5; }
  .agent-status.qa { color: #E67700; background: #FFF4E6; }
  .agent-status.approved { color: #1F6FEB; background: #E7F5FF; }

  .qa-queue {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(0,0,0,0.12);
  }
  .qa-queue h3 {
    font-size: 10px;
    letter-spacing: 1px;
    color: #495057;
    margin-bottom: 8px;
    text-transform: uppercase;
  }
  .qa-item {
    font-size: 10px;
    padding: 4px 8px;
    margin-bottom: 4px;
    border-radius: 3px;
    border-left: 3px solid #E74C3C;
    background: #1C1017;
    color: #C9D1D9;
  }
  .qa-item.pending { border-color: #E67E22; }

  .log-section {
    padding: 10px 14px;
    overflow-y: auto;
    max-height: 180px;
  }
  .log-section h3 {
    font-size: 10px;
    letter-spacing: 1px;
    color: #495057;
    margin-bottom: 8px;
    text-transform: uppercase;
  }
  .log-entry {
    font-size: 10px;
    color: #495057;
    padding: 2px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .log-entry span { color: #C9D1D9; }

  /* Language toggle */
  .lang-toggle {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 3px;
    overflow: hidden;
    font-size: 10px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    user-select: none;
  }
  .lang-btn {
    padding: 3px 8px;
    cursor: pointer;
    background: transparent;
    border: none;
    color: #495057;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    transition: background 0.15s, color 0.15s;
  }
  .lang-btn:hover { background: rgba(0,0,0,0.04); }
  .lang-btn.active { background: #226871; color: #FFFFFF; font-weight: bold; }

  /* Enhanced terminal */
  .term-filters { display:flex; gap:4px; padding:4px 10px; background:#FFFFFF; border-bottom:1px solid rgba(0,0,0,0.06); }
  .term-filter { font-size:10px; padding:3px 9px; border-radius:999px; border:1px solid rgba(0,0,0,0.08); background:transparent; color:#495057; cursor:pointer; font-family: var(--font-ui); font-weight:600; }
  .term-filter:hover { background:rgba(0,0,0,0.04); }
  .term-filter.active { background:#226871; color:#FFFFFF; border-color:#226871; }
  .term-entry { display:block; padding:3px 0; border-bottom:1px solid rgba(0,0,0,0.04); font-size:11px; }
  .term-ts { display:inline-block; color:#868E96; font-size:10px; margin-right:6px; }
  .term-badge { display:inline-block; font-size:9px; padding:1px 5px; border-radius:3px; font-weight:bold; margin-right:6px; vertical-align:baseline; }
  .term-msg { display:inline; color:#212529; word-break:break-word; }
  .term-entry.term-active .term-msg::after {
    content: '...';
    display: inline-block;
    min-width: 18px;
    margin-left: 4px;
    color: #1098AD;
    animation: terminalActiveDots 1.15s ease-in-out infinite;
  }
  @keyframes terminalActiveDots {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
  }
  .term-agent-status .term-badge { background:#E3FAFC; color:#1098AD; }
  .term-qa .term-badge { background:#EBFBEE; color:#2B8A3E; }
  .term-qa.term-fail .term-badge { background:#FFF5F5; color:#E03131; }
  .term-milestone .term-badge { background:#FFF9DB; color:#E67700; }
  .term-cost .term-badge { background:#F8F9FA; color:#495057; }
  .term-reflection .term-badge { background:#F3F0FF; color:#7048E8; }
  .term-escalation .term-badge { background:#FFF5F5; color:#E03131; animation:pulse 1.5s infinite; }
  .term-system .term-badge { background:#F8F9FA; color:#868E96; }

  /* Demo banner */
  .demo-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #1A1A2E;
    color: #226871;
    padding: 7px 20px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    z-index: 200;
    border-bottom: 1px solid rgba(190,177,164,0.25);
  }
  .demo-banner-btn {
    background: rgba(190,177,164,0.15);
    color: #226871;
    border: 1px solid rgba(190,177,164,0.4);
    border-radius: 4px;
    padding: 4px 12px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    cursor: pointer;
    letter-spacing: 1px;
    white-space: nowrap;
  }
  .demo-banner-btn:hover { background: rgba(190,177,164,0.28); }

  /* Secondary status row */
  .status-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 20px;
    background: #F8F9FA;
    border-bottom: 1px solid rgba(0,0,0,0.07);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    color: #495057;
    flex-wrap: wrap;
  }
  .status-row .status-sep { color: rgba(0,0,0,0.15); }
  .project-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
  }
  .project-control-status {
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 999px;
    padding: 2px 8px;
    background: #FFFFFF;
    color: #495057;
    font-size: 10px;
  }
  .project-control-status.paused { background: #FFF9DB; color: #8B7340; border-color: #F2C94C66; }
  .project-control-status.waiting { background: #FFF9DB; color: #8B7340; border-color: #F2C94C66; }
  .project-control-status.stopped { background: #FFF5F5; color: #E03131; border-color: #FFA8A866; }
  .project-control-status.failed { background: #FFF5F5; color: #E03131; border-color: #FFA8A866; }
  .project-control-status.running { background: #EBFBEE; color: #2B8A3E; border-color: #69DB7C66; }
  .project-control-status.complete { background: #EBFBEE; color: #2B8A3E; border-color: #69DB7C66; }
  .project-control-btn {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 10px;
  }

  .question-alert {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 20px;
    background: #FFF9DB;
    border-bottom: 1px solid #F2C94C66;
    color: #7A5A00;
    font-size: 12px;
  }
  .question-alert.open { display: flex; }
  .question-alert strong { color: #5C4300; }
  .question-panel {
    border: 1px solid #F2C94C88;
    background: #FFFDF2;
    border-radius: 8px;
    padding: 14px;
  }
  .question-list {
    display: grid;
    gap: 12px;
    margin-top: 12px;
  }
  .question-card {
    background: #FFFFFF;
    border: 1px solid rgba(0,0,0,0.10);
    border-left: 3px solid #F2C94C;
    border-radius: 6px;
    padding: 12px;
  }
  .question-card__title {
    color: #212529;
    font-size: 13px;
    line-height: 1.45;
    font-weight: 700;
  }
  .question-card__why {
    color: #495057;
    font-size: 11px;
    line-height: 1.55;
    margin-top: 6px;
  }
  .question-card__preferred {
    margin-top: 8px;
    padding: 8px;
    background: #F8F9FA;
    border-radius: 5px;
    color: #495057;
    font-size: 11px;
    line-height: 1.5;
  }
  .question-answer {
    width: 100%;
    min-height: 64px;
    margin-top: 10px;
    resize: vertical;
    border: 1px solid rgba(0,0,0,0.14);
    border-radius: 6px;
    padding: 9px 10px;
    font: 12px/1.45 var(--font-ui);
    color: #212529;
    background: #FFFFFF;
  }
  .question-answer:focus {
    outline: none;
    border-color: #F2C94C;
    box-shadow: 0 0 0 2px #F2C94C33;
  }
  .question-answer:disabled {
    color: #5C636A;
    background: #F1F3F5;
    resize: none;
  }
  .question-choice-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
  }
  .question-choice {
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 999px;
    background: #FFFFFF;
    padding: 7px 10px;
    color: #343A40;
    font: 11px/1.25 var(--font-ui);
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
  }
  .question-choice:hover {
    border-color: #F2C94C;
    background: #FFF9DB;
    transform: translateY(-1px);
  }
  .question-choice.recommended {
    border-color: #2EA04366;
    background: #F6FEF9;
  }
  .question-choice:disabled {
    cursor: default;
    color: #868E96;
    background: #F1F3F5;
    transform: none;
  }
  .question-options {
    display: grid;
    gap: 8px;
    margin-top: 12px;
  }
  .question-option {
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 6px;
    background: #FFFFFF;
    padding: 10px;
    color: #343A40;
    font-size: 11px;
    line-height: 1.45;
  }
  .question-option.recommended {
    border-color: #2EA04366;
    background: #F6FEF9;
  }
  .question-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    margin-top: 12px;
    flex-wrap: wrap;
  }
  .question-status {
    min-height: 15px;
    color: #495057;
    font-size: 11px;
    margin-right: auto;
  }
  .question-submitted {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 6px;
    background: #E9ECEF;
    color: #5C636A;
    padding: 0 12px;
    font-size: 11px;
  }

  /* Overflow menu */
  .overflow-menu-wrap { position: relative; display: inline-block; }
  .overflow-menu-btn {
    background: rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 4px;
    padding: 3px 8px;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #495057;
    line-height: 1;
  }
  .overflow-menu-btn:hover { background: rgba(0,0,0,0.08); }
  .overflow-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 300;
    min-width: 180px;
    overflow: hidden;
  }
  .overflow-dropdown.open { display: block; }
  .overflow-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 9px 14px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #212529;
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  .overflow-dropdown button:last-child { border-bottom: none; }
  .overflow-dropdown button:hover { background: #F1F3F5; }

  /* Empty state */
  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 60px 20px;
    text-align: center;
    flex: 1;
  }
  .empty-state h2 { font-size: 20px; color: #212529; margin-bottom: 4px; }
  .empty-state p { font-size: 13px; color: #868E96; max-width: 42ch; line-height: 1.6; margin-bottom: 8px; }
  .empty-state-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
  .empty-state-actions a, .empty-state-actions button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    border: none;
  }
  .empty-cta-primary { background: #226871; color: #fff; }
  .empty-cta-primary:hover { background: #A89A8A; }
  .empty-cta-secondary { background: #fff; color: #495057; border: 1px solid rgba(0,0,0,0.12) !important; }
  .empty-cta-secondary:hover { background: #F1F3F5; }

  /* Artifact tabs */
  .tab-artifact.is-pending {
    color: var(--text-muted);
    opacity: 0.46;
  }
  .tab-artifact.is-pending::after {
    content: 'väntar';
    display: inline-block;
    margin-left: 7px;
    padding: 1px 5px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 8px;
    letter-spacing: 0;
    text-transform: none;
  }
  .tab-artifact--paused {
    color: var(--text-muted);
    opacity: 0.56;
  }
  .tab-artifact--paused::after {
    content: 'ej utvecklad';
    display: inline-block;
    margin-left: 7px;
    padding: 1px 5px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 8px;
    letter-spacing: 0;
    text-transform: none;
  }
  .artifact-view {
    flex-direction: column;
    background: #F8F9FA;
  }
  .outputs-view {
    min-height: 0;
  }
  .outputs-root {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 20px;
  }
  #planlosningRoot {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }
  #componentDatabaseRoot {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  #doorCoordinationRoot {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
  }
  .artifact-locked {
    flex: 1;
    display: grid;
    place-items: center;
    padding: 28px;
    background: #F8F9FA;
  }
  .artifact-locked-card {
    max-width: 520px;
    border: 1px dashed rgba(0,0,0,0.16);
    border-radius: 8px;
    background: #FFFFFF;
    padding: 24px;
    text-align: center;
    color: #495057;
  }
  .artifact-locked-card h2 { margin: 0 0 8px; font-size: 20px; color: #212529; }
  .artifact-locked-card p { margin: 0; font-size: 13px; line-height: 1.6; }

  /* Rumsdatabas tab */
  .roomdb-shell { flex:1; min-height:0; height:100%; display:grid; grid-template-columns:240px minmax(300px,.8fr) minmax(520px,1.35fr); gap:14px; padding:16px; overflow:hidden; background:#F8F9FA; color:#212529; }
  .roomdb-sidebar, .roomdb-main, .roomdb-detail { min-width:0; min-height:0; background:#fff; border:1px solid rgba(0,0,0,0.10); border-radius:8px; }
  .roomdb-sidebar { padding:12px; overflow:auto; }
  .roomdb-main { display:grid; grid-template-rows:auto minmax(0,1fr); overflow:hidden; }
  .roomdb-header { padding:12px 14px; border-bottom:1px solid rgba(0,0,0,0.08); display:flex; justify-content:space-between; gap:10px; align-items:flex-start; }
  .roomdb-title { font-size:22px; font-weight:800; letter-spacing:0; margin-top:3px; }
  .roomdb-table-wrap { min-height:0; overflow:auto; }
  .roomdb-table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:11px; }
  .roomdb-col-room { width:30%; }
  .roomdb-col-type { width:18%; }
  .roomdb-col-floor { width:44px; }
  .roomdb-col-area { width:58px; }
  .roomdb-col-disciplines { width:22%; }
  .roomdb-col-count { width:44px; }
  .roomdb-table th { position:sticky; top:0; z-index:1; background:#F1F3F5; color:#495057; text-align:left; font-size:10px; letter-spacing:.7px; text-transform:uppercase; }
  .roomdb-table th, .roomdb-table td { padding:8px 8px; border-bottom:1px solid #E9ECEF; vertical-align:top; overflow:hidden; text-overflow:ellipsis; }
  .roomdb-table td:nth-child(3), .roomdb-table td:nth-child(4), .roomdb-table td:nth-child(6), .roomdb-table td:nth-child(7) { white-space:nowrap; }
  .roomdb-table-name { display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .roomdb-table tr { cursor:pointer; }
  .roomdb-table tr:hover td, .roomdb-table tr.is-active td { background:#FFFDF9; }
  .roomdb-detail { padding:18px; overflow:auto; }
  .roomdb-stat-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin-top:12px; }
  .roomdb-stat { border:1px solid #E9ECEF; border-radius:8px; padding:10px; background:#FBFCFD; }
  .roomdb-stat span { display:block; font-size:10px; color:#868E96; text-transform:uppercase; letter-spacing:.6px; }
  .roomdb-stat strong { display:block; margin-top:3px; font-size:17px; }
  .roomdb-pill-row { display:flex; flex-wrap:wrap; gap:6px; }
  .roomdb-pill { display:inline-flex; align-items:center; max-width:100%; border-radius:999px; padding:3px 7px; font-size:10px; border:1px solid #D7E0E7; background:#F6F8F9; color:#495057; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .roomdb-detail-chip { cursor:pointer; }
  .roomdb-detail-chip.is-active { border-color:#2B8A3E; background:#EBFBEE; color:#2B8A3E; }
  .roomdb-list { display:grid; gap:8px; margin-top:10px; }
  .roomdb-list-item { border:1px solid #E9ECEF; border-radius:8px; padding:10px; background:#FBFCFD; font-size:12px; line-height:1.45; }
  .roomdb-object-groups { display:grid; gap:10px; margin-top:10px; }
  .roomdb-object-group { border:1px solid #E9ECEF; border-radius:8px; overflow:hidden; background:#fff; }
  .roomdb-object-group-title { display:flex; justify-content:space-between; gap:10px; align-items:center; padding:7px 10px; background:#F8F9FA; border-bottom:1px solid #E9ECEF; font-size:11px; font-weight:800; color:#343A40; }
  .roomdb-object-table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:11px; }
  .roomdb-object-table td { padding:5px 10px; border-bottom:1px solid #F1F3F5; vertical-align:top; }
  .roomdb-object-table tr:last-child td { border-bottom:none; }
  .roomdb-object-name { width:42%; font-weight:700; color:#111827; }
  .roomdb-object-system { width:24%; color:#495057; }
  .roomdb-object-qty { width:44px; text-align:right; font-weight:700; color:#226871; white-space:nowrap; }
  .roomdb-object-hint { color:#868E96; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .roomdb-status-card { margin-top:14px; border:1px solid #E9ECEF; border-radius:8px; padding:12px; background:#FBFCFD; }
  .roomdb-rfp-status { margin-top:14px; border:1px solid #D9CFC3; border-radius:8px; padding:12px; background:#FFFDF9; display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:8px; }
  .roomdb-rfp-status div { font-size:11px; color:#495057; }
  .roomdb-rfp-status strong { display:block; font-size:18px; color:#212529; margin-top:3px; }
  .componentdb-content { flex:1; min-height:0; display:flex; flex-direction:column; gap:12px; padding:18px 20px; overflow:hidden; box-sizing:border-box; }
  .componentdb-shell { grid-template-columns:250px minmax(620px,1fr) minmax(280px,.38fr); min-height:0; height:auto; overflow:hidden; }
  .componentdb-discipline-list { display:grid; gap:8px; margin-top:12px; }
  .componentdb-discipline-button { width:100%; border:1px solid #E1E7EC; background:#fff; border-radius:8px; padding:9px 10px; display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center; text-align:left; cursor:pointer; color:#212529; }
  .componentdb-discipline-button:hover, .componentdb-discipline-button.is-active { border-color:#226871; background:#F0FAF9; }
  .componentdb-discipline-button strong { font-size:12px; }
  .componentdb-discipline-button span { font-size:10px; color:#5C636A; }
  .componentdb-table { font-size:11px; }
  .componentdb-table th:nth-child(1) { width:16%; }
  .componentdb-table th:nth-child(2) { width:12%; }
  .componentdb-table th:nth-child(3) { width:11%; }
  .componentdb-table th:nth-child(4) { width:18%; }
  .componentdb-table th:nth-child(5) { width:48px; }
  .componentdb-table th:nth-child(6), .componentdb-table th:nth-child(7) { width:11%; }
  .componentdb-table th:nth-child(8) { width:12%; }
  .componentdb-table th:nth-child(9) { width:13%; }
  .componentdb-table td { white-space:nowrap; }
  .componentdb-table td:last-child { white-space:normal; }
  .componentdb-table-wrap { min-height:0; overflow:auto; }
  .componentdb-detail-list { display:grid; gap:8px; margin-top:12px; }
  .componentdb-detail-list div { border-bottom:1px solid #EEF1F3; padding-bottom:7px; }
  .componentdb-detail-list span { display:block; font-size:10px; color:#868E96; text-transform:uppercase; letter-spacing:.6px; }
  .componentdb-detail-list strong { display:block; margin-top:2px; font-size:12px; color:#212529; word-break:break-word; }
  @media (max-width: 980px) {
    .roomdb-shell { height:auto; min-height:100%; grid-template-columns:1fr; overflow:auto; }
    .roomdb-main { min-height:560px; }
    .componentdb-shell { grid-template-columns:1fr; }
    .doordb-shell { grid-template-columns:1fr; }
  }


/* Door coordination tab ----------------------------------------------- */
.doordb-content { flex:1; min-height:0; display:flex; flex-direction:column; gap:12px; padding:18px 20px; overflow:hidden; box-sizing:border-box; }
  .doordb-shell { grid-template-columns:280px minmax(620px,1fr) minmax(340px,.42fr); min-height:0; height:auto; overflow:hidden; }
  .door-sidebar { padding:14px; overflow:auto; display:flex; flex-direction:column; gap:14px; }
  .door-sidebar-title { font-size:15px; font-weight:600; color:#102133; }
  .door-stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:6px; }
  .door-stat { background:#F8F9FA; border:1px solid #E9ECEF; border-radius:6px; padding:8px 10px; display:flex; flex-direction:column; gap:2px; }
  .door-stat span { font-size:9px; letter-spacing:.6px; text-transform:uppercase; color:#6C757D; }
  .door-stat strong { font-size:15px; color:#102133; }
  .door-filter-group { display:flex; flex-direction:column; gap:6px; }
  .door-filter-label { font-size:10px; letter-spacing:.7px; text-transform:uppercase; color:#6C757D; margin-bottom:2px; }
  .door-filter-button { width:100%; border:1px solid #E1E7EC; background:#fff; border-radius:6px; padding:7px 10px; display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center; text-align:left; cursor:pointer; color:#212529; font-size:11px; transition:background .12s, border-color .12s; }
  .door-filter-button:hover { background:#F0FAF9; border-color:#226871; }
  .door-filter-button.is-active { border-color:#226871; background:#E6F4F1; color:#102133; }
  .door-filter-button strong { font-size:11px; font-weight:500; }
  .door-filter-button span { font-size:10px; color:#6C757D; font-variant-numeric:tabular-nums; }
  .door-main { display:grid; grid-template-rows:auto minmax(0,1fr); overflow:hidden; }
  .door-table-wrap { min-height:0; overflow:auto; }
  .door-table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:11px; }
  .door-table thead th { position:sticky; top:0; z-index:1; background:#F1F3F5; color:#495057; text-align:left; font-size:10px; letter-spacing:.7px; text-transform:uppercase; padding:8px; border-bottom:1px solid #DEE2E6; }
  .door-table th:nth-child(1) { width:13%; }
  .door-table th:nth-child(2) { width:7%; }
  .door-table th:nth-child(3) { width:13%; }
  .door-table th:nth-child(4) { width:11%; }
  .door-table th:nth-child(5) { width:13%; }
  .door-table th:nth-child(6) { width:11%; }
  .door-table th:nth-child(7) { width:18%; }
  .door-table th:nth-child(8) { width:14%; }
  .door-table th:nth-child(9) { width:14%; }
  .door-table th:nth-child(10) { width:14%; }
  .door-table td { padding:8px; border-bottom:1px solid #E9ECEF; vertical-align:top; overflow:hidden; text-overflow:ellipsis; word-break:break-word; }
  .door-table tr { cursor:pointer; }
  .door-table tr:hover td, .door-table tr.is-active td { background:#FFFDF9; }

  .door-detail { padding:18px 18px 14px; overflow:auto; display:flex; flex-direction:column; gap:14px; }
  .door-detail-header { display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
  .door-detail-title { font-size:16px; font-weight:600; color:#102133; margin-top:2px; }
  .door-detail-fields { display:flex; flex-direction:column; gap:12px; }
  .door-detail-group { background:#FAFBFC; border:1px solid #E9ECEF; border-radius:8px; padding:12px; }
  .door-detail-group h4 { font-size:10px; letter-spacing:.7px; text-transform:uppercase; color:#6C757D; margin:0 0 8px; }
  .door-field { display:grid; grid-template-columns:120px 1fr; gap:8px; align-items:center; padding:4px 0; }
  .door-field > span { font-size:11px; color:#495057; }
  .door-field > strong { font-size:12px; color:#102133; word-break:break-word; }
  .door-field select, .door-field input, .door-field textarea { width:100%; padding:5px 7px; border:1px solid #CED4DA; border-radius:5px; font-size:12px; background:#fff; color:#102133; box-sizing:border-box; font-family:inherit; }
  .door-field textarea { resize:vertical; min-height:48px; }
  .door-field select:focus, .door-field input:focus, .door-field textarea:focus { outline:none; border-color:#226871; box-shadow:0 0 0 3px rgba(34,104,113,0.15); }
  .door-detail-actions { display:flex; gap:8px; justify-content:flex-end; padding-top:8px; border-top:1px solid #E9ECEF; }
  .door-search-input { width:220px; padding:6px 10px; border:1px solid #CED4DA; border-radius:6px; font-size:11px; background:#fff; }
  .door-search-input:focus { outline:none; border-color:#226871; box-shadow:0 0 0 3px rgba(34,104,113,0.15); }

  .door-badge { display:inline-block; padding:2px 7px; border-radius:999px; font-size:10px; letter-spacing:.4px; font-weight:500; border:1px solid transparent; }
  .door-badge--muted { background:#F1F3F5; color:#495057; border-color:#DEE2E6; }
  .door-badge--fire { background:#FFF1E6; color:#C2410C; border-color:#FCD9B6; }
  .door-badge--fire-high { background:#FFE5E5; color:#9B1C1C; border-color:#F4B6B6; }
  .door-badge--a11y { background:#E6F4F1; color:#226871; border-color:#A7D8D0; }
  .door-badge--a11y-full { background:#D2F1E4; color:#1F6F45; border-color:#A1DDBE; }
  .door-badge--sec-low { background:#F8F9FA; color:#495057; border-color:#CED4DA; }
  .door-badge--sec-mid { background:#FFFBEF; color:#996300; border-color:#FCE4A1; }
  .door-badge--sec-high { background:#FFE5E5; color:#9B1C1C; border-color:#F4B6B6; }
  .door-badge--est { background:#E6F0FF; color:#234966; border-color:#B5CEEB; }
  .door-badge--ok { background:#E8F5E9; color:#1F6F45; border-color:#A1DDBE; }
  .door-badge--review { background:#FFF5F5; color:#9B1C1C; border-color:#F4B6B6; }

  .door-empty { display:flex; align-items:center; justify-content:center; }
  @media (max-width: 760px) {
  .doordb-shell { grid-template-columns:1fr; }
  .door-table { font-size:10px; }
  .door-field { grid-template-columns:1fr; }
  }

  /* Projektplan tab */
  .projektplan { padding:20px; display:flex; gap:20px; flex:1; overflow:auto; background:#F8F9FA; }
  .pp-sidebar { width:160px; flex-shrink:0; }
  .pp-discipline { padding:10px 12px; border-radius:6px; margin-bottom:8px; border:1px solid rgba(0,0,0,0.08); background:#FFFFFF; cursor:default; display:flex; align-items:center; gap:8px; font-size:12px; }
  .pp-discipline-icon { width:24px; height:24px; border-radius:4px; display:flex; align-items:center; justify-content:center; font-size:13px; }
  .pp-discipline-name { font-weight:600; color:#212529; }
  .pp-discipline-status { font-size:9px; margin-left:auto; padding:2px 6px; border-radius:8px; }
  .pp-status-done { background:#EBFBEE; color:#2B8A3E; }
  .pp-status-active { background:#FFF9DB; color:#E67700; }
  .pp-status-pending { background:#F8F9FA; color:#868E96; }
  .pp-status-problem { background:#FFF5F5; color:#E03131; }
  .pp-main { flex:1; }
  .pp-phase-header { display:flex; gap:0; margin-bottom:16px; border-bottom:2px solid rgba(0,0,0,0.08); }
  .pp-phase-label { flex:1; text-align:center; padding:8px 4px; font-size:11px; font-weight:700; letter-spacing:0.5px; color:#868E96; position:relative; }
  .pp-phase-label.active { color:#226871; }
  .pp-phase-label.active::after { content:''; position:absolute; bottom:-2px; left:10%; right:10%; height:2px; background:#226871; }
  .pp-row { display:flex; align-items:center; gap:12px; padding:8px 0; border-bottom:1px solid rgba(0,0,0,0.04); }
  .pp-row-label { width:120px; font-size:11px; font-weight:600; color:#495057; flex-shrink:0; }
  .pp-bar-track { flex:1; height:20px; background:#F1F3F5; border-radius:4px; overflow:hidden; display:flex; }
  .pp-bar-segment { height:100%; transition:width 0.5s ease; }
  .pp-bar-done { background:#226871; }
  .pp-bar-active { background:#22687166; animation:pulse 2s infinite; }
  .pp-row-pct { width:40px; text-align:right; font-size:11px; font-weight:700; color:#495057; flex-shrink:0; }
  .projektplan-report { width:100%; min-height:100%; color:#102133; }
  .pp-report-body { display:flex; flex-direction:column; gap:16px; min-width:0; }
  .pp-report-hero, .pp-report-section { background:#FFFFFF; border:1px solid #DEE2E6; border-radius:8px; padding:20px; }
  .pp-report-hero { display:block; background:linear-gradient(135deg,#FFFFFF 0%,#F6F8F9 100%); overflow:hidden; }
  .pp-report-hero-image { display:block; width:min(100%,1180px); aspect-ratio:21/9; height:auto; max-height:520px; object-fit:contain; object-position:center; border-radius:8px; border:1px solid #D7E0E7; background:#F8FAFB; margin:0 auto 20px; }
  .pp-report-hero h1 { margin:5px 0 10px; font-size:28px; line-height:1.12; letter-spacing:0; }
  .pp-report-hero p { margin:0; color:#495057; line-height:1.55; }
  .pp-hero-attention { margin-top:16px; padding-top:14px; border-top:1px solid #E3E8EC; }
  .pp-hero-attention .pp-report-kicker { display:block; margin-bottom:8px; }
  .pp-hero-attention .pp-agent-list { margin-top:0; }
  .pp-report-kicker, .pp-report-section-head span { font-family:'Courier New',monospace; font-size:10px; letter-spacing:1px; font-weight:700; color:#8A7A68; text-transform:uppercase; }
  .pp-report-section-head { margin-bottom:14px; }
  .pp-report-section-head h2 { margin:4px 0 0; font-size:21px; letter-spacing:0; }
  .pp-report-timeline { display:flex; flex-direction:column; gap:12px; }
  .pp-report-timeline-item { display:grid; grid-template-columns:56px minmax(0,1fr); gap:14px; padding:14px; border:1px solid #E9ECEF; border-radius:8px; background:#FBFCFD; }
  .pp-report-timeline-index { height:42px; border-radius:8px; background:#234966; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; font-family:'Courier New',monospace; }
  .pp-process-map { display:grid; grid-template-columns:repeat(6,minmax(120px,1fr)); gap:10px; position:relative; }
  .pp-process-map::before { content:''; position:absolute; left:7%; right:7%; top:24px; height:3px; background:#CED9E2; }
  .pp-process-step { position:relative; z-index:1; border:1px solid #E1E8ED; border-radius:8px; background:#FBFCFD; padding:12px; min-height:142px; }
  .pp-process-step-badge { width:34px; height:34px; border-radius:50%; display:flex; align-items:center; justify-content:center; background:#234966; color:#fff; font-weight:800; font-family:'Courier New',monospace; margin-bottom:10px; }
  .pp-process-step strong { display:block; margin-bottom:6px; }
  .pp-process-step p { margin:0; color:#495057; font-size:12px; line-height:1.45; }
  .pp-report-timeline-item h3, .pp-report-opportunity h3 { margin:0 0 6px; font-size:16px; letter-spacing:0; }
  .pp-report-timeline-item p, .pp-report-mini-card p, .pp-report-opportunity p, .pp-report-visual p { margin:0; color:#495057; line-height:1.45; }
  .pp-report-muted { color:#6C757D !important; font-size:13px; }
  .pp-report-chip-row, .pp-report-deliverables { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
  .pp-report-chip { display:inline-flex; align-items:center; border:1px solid #C9D6E2; background:#EEF5FA; color:#234966; border-radius:999px; padding:4px 8px; font-size:11px; font-weight:700; }
  .pp-report-chip--soft { background:#F6F1EC; border-color:#D9CFC3; color:#6E5B49; }
  .pp-report-mini-card, .pp-report-opportunity, .pp-report-visual { border:1px solid #E9ECEF; border-radius:8px; background:#FFFFFF; padding:12px; }
  .pp-report-mini-card span, .pp-report-opportunity span, .pp-report-visual span { font-family:'Courier New',monospace; font-size:10px; color:#868E96; text-transform:uppercase; }
  .pp-agent-list { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 7px; color:#102133; }
  .pp-agent-list li { font-size: 15px; line-height: 1.35; }
  .pp-agent-org { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:12px; margin-top:12px; }
  .pp-agent-org-card { border:1px solid #D7E0E7; border-radius:8px; background:#FBFCFD; padding:12px; min-height:132px; }
  .pp-agent-org-title { display:flex; align-items:center; gap:8px; margin-bottom:10px; color:#102133; font-weight:800; }
  .pp-agent-org-dot { width:10px; height:10px; border-radius:50%; background:#226871; flex:0 0 auto; }
  .pp-agent-org-list { display:grid; gap:7px; }
  .pp-agent-org-agent { border:1px solid #E1E8ED; border-radius:8px; background:#FFFFFF; padding:8px 9px; }
  .pp-agent-org-agent strong { display:block; font-size:12px; line-height:1.25; color:#102133; }
  .pp-agent-org-agent span { display:block; margin-top:3px; font-size:10px; line-height:1.35; color:#6C757D; }
  .pp-generated-image-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:12px; }
  .pp-generated-image-card { border:1px solid #D7E0E7; border-radius:8px; background:#FFFFFF; overflow:hidden; }
  .pp-generated-image-card img { width:100%; aspect-ratio:16/10; object-fit:cover; display:block; }
  .pp-generated-image-card div { padding:12px; }
  .pp-generated-image-card strong { display:block; margin-bottom:4px; }
  .pp-report-subhead { margin:18px 0 10px; font-size:15px; }
  .pp-report-mini-grid, .pp-report-opportunities, .pp-report-visual-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px; }
  .pp-report-table-wrap { overflow:auto; border:1px solid #E9ECEF; border-radius:8px; }
  .pp-report-table { width:100%; border-collapse:collapse; font-size:12px; }
  .pp-report-table th { background:#F1F3F5; text-align:left; font-size:10px; letter-spacing:.6px; text-transform:uppercase; color:#495057; }
  .pp-report-table th, .pp-report-table td { padding:10px; border-bottom:1px solid #E9ECEF; vertical-align:top; }
  .pp-report-opportunity strong { display:inline-flex; margin-top:8px; color:#234966; }
  /* Statusrad (issue #99) */
  .pp-status-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(140px, 1fr));
    gap: 10px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #DEE2E6;
    border-radius: 8px;
    background: linear-gradient(135deg, #FFFFFF 0%, #F6F8F9 100%);
  }
  .pp-status-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px 12px;
    border-left: 3px solid #C9D6E2;
    background: #FFFFFF;
    border-radius: 6px;
  }
  .pp-status-cell:first-child { border-left-color: #226871; }
  .pp-status-cell--attention { border-left-color: #E67700; background: #FFFBEF; }
  .pp-status-cell--ok { border-left-color: #2B8A3E; background: #F4FBF6; }
  .pp-status-label {
    font-family: 'Courier New', monospace;
    font-size: 9px;
    letter-spacing: 0.6px;
    color: #6C757D;
    text-transform: uppercase;
  }
  .pp-status-value { font-size: 22px; color: #102133; font-weight: 800; line-height: 1.1; }
  .pp-status-meta { font-size: 11px; color: #6C757D; line-height: 1.3; }
  .pp-status-bar { height: 4px; background: #E9ECEF; border-radius: 999px; overflow: hidden; margin-top: 4px; }
  .pp-status-bar-fill { height: 100%; background: #226871; transition: width 0.4s ease; }
  @media (max-width: 760px) {
    .pp-status-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }
  /* Tidplans-meta (issue #100) */
  .pp-timeline-meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 12px;
    row-gap: 4px;
    margin: 10px 0 0;
    padding: 8px 12px;
    border: 1px dashed #DEE2E6;
    border-radius: 6px;
    background: #FBFCFD;
    font-size: 12px;
  }
  .pp-timeline-meta dt {
    color: #6C757D;
    font-family: 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    align-self: center;
  }
  .pp-timeline-meta dt.pp-timeline-meta-head {
    grid-column: 1 / -1;
    color: #226871;
    font-weight: 700;
    margin-bottom: 2px;
    border-bottom: 1px solid #EEF1F3;
    padding-bottom: 4px;
  }
  .pp-timeline-meta dd {
    margin: 0;
    color: #102133;
    font-weight: 600;
  }
  .pp-process-meta {
    color: #226871;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin: 4px 0 6px;
  }
  /* Riskregister (issue #101) */
  .pp-risk-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 12px;
    padding: 8px 12px;
    border: 1px solid #E9ECEF;
    border-radius: 6px;
    background: #FBFCFD;
  }
  .pp-risk-filter-group { display: inline-flex; gap: 6px; }
  .pp-risk-filter-btn {
    border: 1px solid #C9D6E2;
    background: #FFFFFF;
    color: #234966;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
  }
  .pp-risk-filter-btn:hover { background: #EEF5FA; }
  .pp-risk-filter-btn.is-active {
    background: #226871;
    border-color: #226871;
    color: #FFFFFF;
  }
  .pp-risk-count {
    margin-left: 4px;
    font-weight: 600;
    opacity: 0.85;
  }
  .pp-risk-summary { font-size: 11px; color: #6C757D; }
  /* Status-chips */
  .pp-risk-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: 1px solid transparent;
  }
  .pp-risk-status--open { background: #FFFBEF; border-color: #F0C36D; color: #B56100; }
  .pp-risk-status--mitigating { background: #EEF5FA; border-color: #5C8FB8; color: #234966; }
  .pp-risk-status--closed { background: #F1F8F3; border-color: #8AC59B; color: #2B6A3F; }
  .pp-risk-status--escalated { background: #FFF5F5; border-color: #E89A9A; color: #C92A2A; }
  /* Inline-statusväxlar (issue #101 TODO 1) */
  .pp-risk-status-editor {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid #C9D6E2;
    border-radius: 999px;
    background: #FFFFFF;
    color: #102133;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    padding: 4px 24px 4px 10px;
    cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, #234966 50%), linear-gradient(135deg, #234966 50%, transparent 50%);
    background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
  }
  .pp-risk-status-editor:disabled { opacity: 0.5; cursor: wait; }
  .pp-risk-status-editor.pp-risk-status--open,
  .pp-risk-status-editor.pp-risk-status--mitigating,
  .pp-risk-status-editor.pp-risk-status--closed,
  .pp-risk-status-editor.pp-risk-status--escalated {
    border-color: inherit;
  }
  /* Filter-states: dolj bara closed-rader nar filtret ar 'open'. Eskalera är fortfarande oppna. */
  .pp-risk-section[data-pp-risk-active-filter="open"] tbody tr[data-pp-risk-status="closed"] { display: none; }
  /* När inga rader syns, visa en kompakt 'inga öppna risker'-notis */
  .pp-risk-empty {
    margin: 8px 0 0;
    padding: 10px 12px;
    font-size: 12px;
    color: #2B6A3F;
    background: #F1F8F3;
    border: 1px dashed #8AC59B;
    border-radius: 6px;
  }
  /* Godkänn-M0-CTA (issue #102) */
  .pp-approval-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 18px 0 8px;
    padding: 14px 18px;
    border: 1px solid #2B8A3E;
    border-radius: 10px;
    background: linear-gradient(135deg, #F1F8F3 0%, #E6F4EA 100%);
    box-shadow: 0 1px 0 rgba(43, 138, 62, 0.08);
  }
  .pp-approval-cta-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
  .pp-approval-cta-kicker {
    font-family: 'Courier New', monospace;
    font-size: 9px;
    letter-spacing: 0.7px;
    color: #2B8A3E;
    text-transform: uppercase;
    font-weight: 800;
  }
  .pp-approval-cta-body strong { font-size: 16px; color: #102133; }
  .pp-approval-cta-meta { font-size: 12px; color: #4F6469; line-height: 1.45; }
  .pp-approval-cta-meta a { color: #226871; font-weight: 700; text-decoration: underline; }
  .pp-approval-cta-btn {
    flex: 0 0 auto;
    border: 0;
    border-radius: 8px;
    background: #2B8A3E;
    color: #FFFFFF;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s ease;
  }
  .pp-approval-cta-btn:hover:not([disabled]) { background: #226E32; }
  .pp-approval-cta-btn[disabled] {
    background: #E9ECEF;
    color: #868E96;
    cursor: not-allowed;
  }
  .pp-approval-cta--blocked {
    border-color: #F0C36D;
    background: linear-gradient(135deg, #FFFBEF 0%, #FFF6E0 100%);
  }
  .pp-approval-cta--blocked .pp-approval-cta-kicker { color: #B56100; }
  /* Inline-kommentarsfält (#102 TODO) */
  .pp-approval-comment-label {
    display: block;
    margin-top: 8px;
    font-size: 10px;
    letter-spacing: 0.4px;
    color: #6C757D;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
  }
  .pp-approval-comment {
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid #C9D6E2;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    resize: vertical;
    background: #FFFFFF;
    color: #102133;
  }
  .pp-approval-comment:focus {
    outline: none;
    border-color: #226871;
    box-shadow: 0 0 0 2px rgba(34, 104, 113, 0.15);
  }
  /* Audit-log viewer (issue #102 TODO 2) */
  .pp-audit-log {
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #DEE2E6;
    border-radius: 8px;
    background: #FBFCFD;
  }
  .pp-audit-log--empty { background: #F8F9FA; }
  .pp-audit-log-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E9ECEF;
  }
  .pp-audit-log-kicker {
    font-family: 'Courier New', monospace;
    font-size: 9px;
    letter-spacing: 0.7px;
    color: #6C757D;
    text-transform: uppercase;
    font-weight: 700;
  }
  .pp-audit-log-head strong { font-size: 15px; color: #102133; }
  .pp-audit-log-empty-msg {
    margin: 0;
    font-size: 12px;
    color: #6C757D;
    font-style: italic;
  }
  .pp-audit-log-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .pp-audit-log-entry {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid #E9ECEF;
    border-radius: 6px;
    background: #FFFFFF;
  }
  .pp-audit-log-id {
    align-self: center;
    text-align: center;
    padding: 6px 0;
    border-radius: 6px;
    background: #234966;
    color: #FFFFFF;
    font-family: 'Courier New', monospace;
    font-weight: 800;
    font-size: 11px;
  }
  .pp-audit-log-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .pp-audit-log-title { font-size: 13px; color: #102133; }
  .pp-audit-log-meta { font-size: 11px; color: #6C757D; }
  .pp-audit-log-notes {
    margin: 4px 0 0;
    font-size: 12px;
    color: #102133;
    line-height: 1.45;
    padding: 6px 8px;
    border-left: 2px solid #C9D6E2;
    background: #FBFCFD;
    border-radius: 0 4px 4px 0;
  }
  .pp-audit-log-notes--empty {
    color: #868E96;
    font-style: italic;
    border-left-color: #DEE2E6;
  }
  /* Realtidsindikator (issue #103 TODO 2) */
  .pp-realtime-indicator {
    position: absolute;
    top: 8px;
    right: 12px;
    background: #2B8A3E;
    color: #FFFFFF;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(43, 138, 62, 0.25);
    animation: pp-realtime-pulse 0.4s ease-out;
  }
  @keyframes pp-realtime-pulse {
    0% { transform: scale(0.85); opacity: 0; }
    60% { transform: scale(1.06); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
  }
  @media (max-width: 640px) {
    .pp-approval-cta { flex-direction: column; align-items: stretch; }
    .pp-approval-cta-btn { width: 100%; }
  }
  /* User Questions-kort (issue #103) */
  .pp-questions-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 18px;
    padding: 14px 16px;
    border: 1px solid #DEE2E6;
    border-radius: 8px;
    background: #FFFFFF;
    border-left: 4px solid #C9D6E2;
  }
  .pp-questions-card--attention { border-left-color: #E67700; background: #FFFBEF; }
  .pp-questions-card--ok { border-left-color: #2B8A3E; background: #F4FBF6; }
  .pp-questions-card--empty { border-left-color: #C9D6E2; background: #FBFCFD; }
  .pp-questions-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }
  .pp-questions-kicker {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 9px;
    letter-spacing: 0.7px;
    color: #6C757D;
    text-transform: uppercase;
    font-weight: 700;
  }
  .pp-questions-title { font-size: 16px; color: #102133; line-height: 1.25; }
  .pp-questions-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    border: 1px solid transparent;
  }
  .pp-questions-card--attention .pp-questions-badge { background: #FFFBEF; border-color: #F0C36D; color: #B56100; }
  .pp-questions-card--ok .pp-questions-badge { background: #F1F8F3; border-color: #8AC59B; color: #2B6A3F; }
  .pp-questions-card--empty .pp-questions-badge { background: #F1F3F5; border-color: #DEE2E6; color: #6C757D; }
  .pp-questions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .pp-questions-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border: 1px solid #E9ECEF;
    border-radius: 6px;
    background: #FFFFFF;
  }
  .pp-questions-item strong { font-size: 13px; color: #102133; line-height: 1.4; }
  .pp-questions-meta { font-size: 11px; color: #6C757D; line-height: 1.4; }
  .pp-questions-overflow {
    margin: 6px 0 0;
    font-size: 11px;
    color: #226871;
    font-weight: 700;
  }
  .pp-questions-empty {
    margin: 0;
    font-size: 13px;
    color: #6C757D;
    font-style: italic;
  }
  .pp-questions-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
  }
  .pp-questions-link {
    color: #226871;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid transparent;
  }
  .pp-questions-link:hover { border-bottom-color: #226871; }
  .hospital-map-view { background:#F8F9FA; }
  .hospital-map-root { flex:1; min-height:0; overflow:auto; padding:20px; color:#102133; }
  .hospital-map-shell { min-height:100%; display:flex; flex-direction:column; gap:16px; }
  .hospital-map-hero { background:#FFFFFF; border:1px solid #DEE2E6; border-radius:8px; padding:18px 20px; display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; align-items:start; }
  .hospital-map-hero h1 { margin:4px 0 8px; font-size:26px; line-height:1.15; letter-spacing:0; }
  .hospital-map-hero p { margin:0; color:#495057; line-height:1.55; max-width:78ch; }
  .hospital-map-kpis { display:grid; grid-template-columns:repeat(3,minmax(92px,1fr)); gap:8px; min-width:300px; }
  .hospital-map-kpi { border:1px solid #E9ECEF; border-radius:8px; padding:10px; background:#FBFCFD; }
  .hospital-map-kpi span { display:block; font-family:'Courier New',monospace; font-size:10px; color:#868E96; text-transform:uppercase; }
  .hospital-map-kpi strong { display:block; margin-top:3px; font-size:18px; color:#102133; }
  .hospital-map-hero-side { display:grid; gap:10px; min-width:320px; }
  .hospital-parent-mode {
    display:inline-flex;
    align-items:center;
    gap:8px;
    margin-top:12px;
    border:1px solid rgba(34,104,113,0.18);
    border-radius:999px;
    background:#F0F8F8;
    color:#226871;
    padding:6px 10px;
    font-size:11px;
    font-weight:800;
  }
  .hospital-lead-card {
    display:grid;
    grid-template-columns:52px minmax(0,1fr);
    gap:12px;
    align-items:center;
    border:1px solid rgba(34,104,113,0.20);
    border-radius:8px;
    background:#FFFFFF;
    padding:12px;
    box-shadow:0 8px 22px rgba(16,33,51,0.06);
  }
  .hospital-lead-avatar {
    width:86px;
    height:48px;
    object-fit:contain;
    background:transparent;
    border-radius:0;
  }
  .hospital-lead-card span { display:block; font-family:'Courier New',monospace; font-size:10px; color:#226871; text-transform:uppercase; letter-spacing:.7px; font-weight:700; }
  .hospital-lead-card strong { display:block; margin-top:3px; color:#102133; line-height:1.2; }
  .hospital-lead-card p { margin:4px 0 0; color:#495057; font-size:11px; line-height:1.45; }
  .hospital-org { background:#FFFFFF; border:1px solid #DEE2E6; border-radius:8px; padding:18px; overflow:auto; }
  .hospital-parent-node { width:min(560px,100%); margin:0 auto; border:2px solid #226871; border-radius:8px; padding:16px; background:#F9FBFB; text-align:center; box-shadow:0 10px 24px rgba(16,33,51,0.08); }
  .hospital-parent-node-link { display:block; color:#102133; text-decoration:none; }
  .hospital-parent-node-link:hover { border-color:#174D54; box-shadow:0 12px 28px rgba(16,33,51,0.12); }
  .hospital-parent-node-head { display:flex; align-items:center; justify-content:center; gap:12px; }
  .hospital-parent-node-head .hospital-lead-avatar { width:82px; height:44px; }
  .hospital-node-kicker { font-family:'Courier New',monospace; font-size:10px; color:#8A7A68; text-transform:uppercase; letter-spacing:1px; font-weight:700; }
  .hospital-parent-node h2 { margin:5px 0 5px; font-size:22px; letter-spacing:0; }
  .hospital-parent-node p { margin:0; color:#495057; font-size:13px; }
  .hospital-org-connector { width:2px; height:28px; margin:0 auto; background:#CED9E2; }
  .hospital-child-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:12px; position:relative; }
  .hospital-child-card { display:flex; flex-direction:column; gap:10px; min-height:188px; border:1px solid #D7E0E7; border-radius:8px; padding:14px; background:#FFFFFF; text-decoration:none; color:#102133; box-shadow:0 6px 18px rgba(16,33,51,0.04); }
  .hospital-child-card[href]:hover { border-color:#226871; box-shadow:0 10px 26px rgba(16,33,51,0.10); transform:translateY(-1px); }
  .hospital-child-card h3 { margin:0; font-size:16px; letter-spacing:0; line-height:1.2; }
  .hospital-child-card p { margin:0; color:#495057; font-size:12px; line-height:1.45; }
  .hospital-child-meta { display:flex; flex-wrap:wrap; gap:6px; margin-top:auto; }
  .hospital-chip { display:inline-flex; align-items:center; max-width:100%; border-radius:999px; border:1px solid #D7E0E7; background:#F6F8F9; padding:4px 8px; font-size:10px; color:#495057; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .hospital-chip--status { border-color:#BFE3D0; background:#EBFBEE; color:#2B8A3E; font-weight:700; }
  .hospital-map-panels { display:grid; grid-template-columns:repeat(auto-fit,minmax(280px,1fr)); gap:12px; }
  .hospital-map-panel { background:#FFFFFF; border:1px solid #DEE2E6; border-radius:8px; padding:14px; }
  .hospital-map-panel h3 { margin:4px 0 8px; font-size:16px; }
  .hospital-map-panel ul { margin:0; padding-left:18px; color:#495057; line-height:1.55; font-size:12px; }
  @media (max-width: 900px) {
    .pp-report-hero-image { width:100%; aspect-ratio:21/9; max-height:none; }
    .pp-process-map { grid-template-columns:1fr 1fr; }
    .pp-process-map::before { display:none; }
    .hospital-map-hero { grid-template-columns:1fr; }
    .hospital-map-hero-side, .hospital-map-kpis { min-width:0; }
  }

  /* ── Shared modal shell ─────────────────────────────────────── */
  .modal-backdrop {
    position: fixed; inset: 0; z-index: 9998;
    background: rgba(15,23,42,0.58);
    display: none; align-items: center; justify-content: center;
    padding: 20px;
  }
  .modal-backdrop.open { display: flex; }
  .token-detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
  .token-detail-table th { padding: 8px 12px; border-bottom: 2px solid var(--border-strong); text-align: left; font-weight: 700; color: var(--text-muted); font-size: 11px; letter-spacing: 0.5px; }
  .token-detail-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); }
  .token-detail-table tr:hover td { background: var(--bg-3); }
  .token-detail-total { display: flex; justify-content: space-between; align-items: center; padding: 12px; background: var(--bg-3); border-radius: 0 0 var(--radius) var(--radius); font-weight: 700; font-size: 13px; }
  .modal-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.22);
    display: flex; flex-direction: column;
    overflow: hidden;
    max-height: calc(100vh - 32px);
  }
  .modal-header {
    padding: 16px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
    flex-shrink: 0;
  }
  .modal-header-meta { font-size: 10px; letter-spacing: 0.6px; color: #868E96; text-transform: uppercase; font-family: var(--font-ui); font-weight: 700; }
  .modal-header-title { margin-top: 4px; font-size: 20px; font-weight: 700; color: #212529; }
  .modal-header-subtitle { margin-top: 4px; font-size: 12px; color: #495057; }
  .modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #868E96; line-height: 1; padding: 0; flex-shrink: 0; }
  .modal-body { overflow: auto; flex: 1; min-height: 0; }
  .modal-footer {
    padding: 10px 18px;
    border-top: 1px solid rgba(0,0,0,0.08);
    display: flex; justify-content: flex-end; align-items: center; gap: 8px;
    flex-shrink: 0; flex-wrap: wrap;
  }
  .feedback-modal[hidden] { display: none !important; }
  .feedback-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15,23,42,0.58);
  }
  .feedback-dialog {
    width: min(460px, 100%);
    padding: 18px;
    border: 1px solid rgba(34,104,113,0.13);
    border-radius: 12px;
    background: rgba(255,255,255,0.96);
    color: var(--brand-slate, #122A2D);
    box-shadow: 0 24px 60px rgba(0,0,0,0.22);
  }
  .feedback-dialog h2 {
    margin: 0 0 8px;
    color: var(--brand-primary, #226871);
    font: 800 20px/1.2 var(--font-ui);
  }
  .feedback-dialog p {
    margin: 0;
    color: var(--brand-secondary, #398184);
    font: 13px/1.5 var(--font-ui);
  }
  .feedback-dialog label {
    display: grid;
    gap: 6px;
    margin-top: 12px;
    color: var(--brand-secondary, #398184);
    font: 700 13px/1.4 var(--font-ui);
  }
  .feedback-dialog select,
  .feedback-dialog textarea {
    width: 100%;
    border: 1px solid rgba(34,104,113,0.18);
    border-radius: 6px;
    padding: 10px;
    font: 13px/1.45 var(--font-ui);
    color: var(--brand-slate, #122A2D);
    background: rgba(255,255,255,0.86);
  }
  .feedback-dialog textarea {
    min-height: 130px;
    resize: vertical;
  }
  .feedback-status {
    min-height: 18px;
    margin-top: 10px;
    color: var(--brand-secondary, #398184);
    font: 12px/1.45 var(--font-ui);
  }
  .feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 14px;
  }
  .milestone-gate-card {
    width: min(1180px, 96vw);
    height: min(860px, calc(100vh - 32px));
    max-height: calc(100vh - 32px);
  }
  .milestone-gate-body {
    display: grid;
    grid-template-columns: minmax(190px, 0.85fr) minmax(260px, 1.05fr) minmax(300px, 1.1fr);
    gap: 12px;
    padding: 14px;
    background: #F8F9FA;
    min-height: 0;
    overflow: auto;
  }
  .milestone-gate-panel {
    min-width: 0;
    min-height: 0;
    border: 1px solid rgba(0,0,0,0.10);
    border-radius: 8px;
    background: #FFFFFF;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
  }
  .milestone-result-list,
  .milestone-file-list,
  .milestone-question-list {
    display: grid;
    gap: 8px;
  }
  .milestone-result-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    background: #FBFCFD;
    font-size: 12px;
  }
  .milestone-result-row strong {
    color: #212529;
  }
  .milestone-result-state {
    flex-shrink: 0;
    font-weight: 700;
  }
  .milestone-result-state.done { color: #2B8A3E; }
  .milestone-result-state.active { color: #1F4E79; }
  .milestone-result-state.warning { color: #D9480F; }
  .milestone-question-card {
    border-left: 3px solid #D9480F;
    border-radius: 6px;
    background: #FFF4E6;
    padding: 9px 10px;
    font-size: 12px;
    line-height: 1.45;
  }
  .milestone-question-card.answered {
    border-left-color: #2EA043;
    background: #F6FEF9;
  }
  .milestone-question-card textarea {
    width: 100%;
    margin-top: 8px;
    min-height: 54px;
    resize: vertical;
  }
  .milestone-pm-chat {
    margin-top: auto;
    display: grid;
    gap: 8px;
  }
  #milestoneGateQuestions,
  .milestone-pm-chat {
    display: none;
  }
  .milestone-chat-routing-note {
    border: 1px solid rgba(34,104,113,0.14);
    border-radius: 8px;
    background: #F8FAFB;
    padding: 11px;
    margin-bottom: 12px;
    color: #4F5F66;
    font: 12px/1.5 var(--font-ui);
  }
  .milestone-pm-messages {
    display: grid;
    gap: 7px;
    max-height: 170px;
    overflow: auto;
  }
  .milestone-chat-bubble {
    padding: 8px 9px;
    border-radius: 7px;
    font-size: 12px;
    line-height: 1.45;
  }
  .milestone-chat-bubble--pm {
    background: #F1F3F5;
    color: #343A40;
  }
  .milestone-chat-bubble--user {
    background: #E7F5FF;
    color: #1C3D5A;
    justify-self: end;
  }
  .milestone-gate-footer {
    justify-content: flex-end;
    flex-shrink: 0;
  }
  .milestone-gate-status {
    margin-right: auto;
    min-height: 16px;
  }
  @media (max-width: 920px) {
    .milestone-gate-body {
      grid-template-columns: 1fr;
    }
    .milestone-gate-card {
      width: min(760px, 96vw);
      height: min(860px, calc(100vh - 24px));
      max-height: calc(100vh - 24px);
    }
  }
  .header-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
  }
  .header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .header-link {
    letter-spacing: 1px;
  }
  .token-tracker {
    font-size: 10px;
    font-weight: 700;
    color: #7ec8e3;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
  }
  .token-tracker:hover { color: #a8dff0; }
  .approval-banner {
    display: none;
    background: #172533;
    color: #fff;
    padding: 12px 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: relative;
    z-index: 50;
    border-bottom: 1px solid rgba(255,255,255,0.12);
  }
  .completion-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    background: linear-gradient(90deg, #122A2D, #226871 55%, #398184);
    color: #F9FBFB;
    border-bottom: 1px solid rgba(107,250,62,0.42);
    box-shadow: 0 12px 30px rgba(18,42,45,0.16), inset 0 0 0 1px rgba(107,250,62,0.18);
    position: relative;
    z-index: 49;
  }
  .completion-banner-title {
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .completion-banner-body {
    font-size: 12px;
    color: rgba(249,251,251,0.86);
  }
  .completion-banner-pill {
    flex-shrink: 0;
    border: 1px solid rgba(107,250,62,0.55);
    border-radius: 999px;
    padding: 5px 10px;
    background: rgba(249,251,251,0.12);
    color: #F9FBFB;
    font-size: 11px;
    font-weight: 800;
  }
  body.project-complete .completion-banner {
    display: flex;
  }
  body.project-complete .agent-card {
    animation: completedAgentCardDance 1.4s ease-in-out infinite;
    transform-origin: 50% 100%;
  }
  body.project-complete .agent-card:nth-child(2n) {
    animation-delay: -0.34s;
  }
  body.project-complete .agent-card:nth-child(3n) {
    animation-delay: -0.68s;
  }
  body.project-complete .agent-card-sprite {
    filter: drop-shadow(0 0 12px rgba(107,250,62,0.36));
  }
  @keyframes completedAgentCardDance {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-3px) rotate(-0.7deg); }
    50% { transform: translateY(1px) rotate(0.8deg); }
    75% { transform: translateY(-2px) rotate(0.5deg); }
  }
  .modal-header-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
  }
  .modal-title-mono {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .modal-meta-mono {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #868E96;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .preview-loading,
  .preview-error {
    padding: 18px;
    font-family: var(--font-mono);
  }
  .preview-loading { color: #868E96; }
  .preview-error { color: #E03131; }

  /* Figma dashboard redesign pass */
  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
  }
  header {
    min-height: 72px;
    padding: 12px 32px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
  }
  header h1 {
    color: var(--text);
    font-size: 18px;
    letter-spacing: 0;
    text-shadow: none;
    text-transform: none;
  }
  .header-actions {
    gap: var(--space-3);
  }
  .header-actions [hidden],
  .btn-ui[hidden] {
    display: none !important;
  }
  .header-link,
  .control-select,
  .project-control-btn,
  .overflow-menu-btn {
    font-family: var(--font-ui);
    letter-spacing: 0;
  }
  .tab-bar {
    height: 48px;
    align-items: center;
    gap: var(--space-2);
    padding: 0 32px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
  }
  .tab {
    min-width: 76px;
    height: 30px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    border-bottom: 0;
    letter-spacing: 0;
    color: var(--text-muted);
  }
  .tab:hover {
    background: var(--bg-3);
    color: var(--text);
  }
  .tab.active {
    background: var(--accent-dim);
    color: var(--text);
    border-bottom: 0;
  }
  .overview-shell {
    padding: 24px 32px 32px;
    background: var(--bg);
  }
  .overview-grid {
    gap: 18px;
  }
  .overview-card,
  .milestone-folder,
  .sidebar,
  .milestone-gate-panel,
  .pp-report-hero,
  .pp-report-section {
    border-color: var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
  }
  .overview-kpis {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--space-3);
  }
  .overview-kpi {
    background: var(--bg-2);
    min-height: 92px;
    padding: 14px 14px 14px 18px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
  }
  .overview-kpi .label,
  .overview-section-title {
    letter-spacing: 0.4px;
    font-family: var(--font-ui);
    font-weight: 700;
  }
  .overview-kpi .value {
    font-size: 24px;
    letter-spacing: 0;
  }
  .approval-banner {
    background: #172533;
    font-family: var(--font-ui);
    letter-spacing: 0;
    box-shadow: var(--shadow-sm);
  }
  .status-row {
    background: var(--bg);
    font-family: var(--font-ui);
    letter-spacing: 0;
  }
  .sidebar {
    width: 320px;
    flex-basis: 320px;
    background: var(--bg-2);
  }
  .sidebar-section h3,
  .qa-queue h3,
  .log-section h3 {
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-family: var(--font-ui);
  }
  .artifact-view {
    background: var(--bg);
  }
  .modal-card {
    border-radius: var(--radius-lg);
  }
  .milestone-gate-body {
    background: var(--bg);
  }
  .milestone-gate-footer .btn-ui,
  .modal-footer .btn-ui,
  .question-alert .btn-ui {
    font-family: var(--font-ui);
    letter-spacing: 0;
  }
  .term-filters {
    padding: 6px 10px;
  }
  .terminal-panel,
  #terminalContent {
    font-family: var(--font-mono);
  }

  /* Chiron brand manual alignment pass */
  :root {
    --brand-primary: #226871;
    --brand-secondary: #398184;
    --brand-lime: #6BFA3E;
    --brand-slate: #122A2D;
    --brand-white: #F9FBFB;
    --brand-glass: rgba(255, 255, 255, 0.82);
    --brand-glass-strong: rgba(255, 255, 255, 0.92);
    --brand-lime-glow: rgba(107, 250, 62, 0.22);
  }

  body {
    background:
      radial-gradient(circle at 18% 12%, rgba(107,250,62,0.10), transparent 28%),
      linear-gradient(135deg, #F9FBFB 0%, #EEF5F5 48%, #F9FBFB 100%);
    color: var(--brand-slate);
  }

  header {
    min-height: 76px;
    background: rgba(249,251,251,0.88);
    border-bottom: 1px solid rgba(34,104,113,0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  header h1 {
    color: var(--brand-primary);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-transform: uppercase;
  }

  .header-logo {
    width: 92px;
    height: 50px;
    border-radius: 0;
    background: transparent;
    mix-blend-mode: normal;
    filter: saturate(1.08) drop-shadow(0 7px 14px rgba(34,104,113,0.18));
  }

  .header-logo--centaur {
    width: 92px;
    height: 50px;
    object-fit: contain;
  }

  .tab-bar {
    background: rgba(249,251,251,0.82);
    border-bottom: 1px solid rgba(34,104,113,0.14);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .tab {
    color: var(--brand-secondary);
    font-weight: 700;
  }

  .tab:hover {
    background: rgba(34,104,113,0.08);
    color: var(--brand-slate);
  }

  .tab.active {
    background: rgba(34,104,113,0.12);
    color: var(--brand-primary);
    box-shadow: inset 0 0 0 1px rgba(107,250,62,0.32);
  }

  .overview-shell,
  .artifact-view,
  #tab-agents,
  #tab-outputs {
    background:
      linear-gradient(180deg, rgba(249,251,251,0.94), rgba(238,245,245,0.98)),
      var(--brand-white) !important;
  }

  .overview-card,
  .overview-kpi,
  .milestone-folder,
  .sidebar,
  .milestone-gate-panel,
  .pp-report-hero,
  .pp-report-section,
  .agent-card,
  .outputs-hero,
  .output-card,
  .surface-card,
  .panel-card,
  .modal-card {
    background: var(--brand-glass-strong);
    border-color: rgba(34,104,113,0.13);
    border-radius: 12px;
    box-shadow: 0 12px 34px rgba(18,42,45,0.08);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }

  .overview-card:hover,
  .agent-card:hover,
  .output-card:hover,
  .milestone-folder:hover {
    border-color: rgba(107,250,62,0.42);
    box-shadow: 0 16px 42px rgba(18,42,45,0.10), 0 0 0 1px rgba(107,250,62,0.18);
  }

  .overview-section-title,
  .sidebar-section h3,
  .qa-queue h3,
  .log-section h3,
  .outputs-header h2,
  .panel-title,
  .agent-chat-title {
    color: var(--brand-primary);
    font-family: var(--font-ui);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .overview-kpi .value,
  .agent-card-title h4,
  .agent-name,
  .doc-name,
  .term-msg,
  .title-card,
  .font-strong {
    color: var(--brand-slate);
  }

  .overview-kpi .label,
  .agent-card p,
  .agent-card .how,
  .doc-meta,
  .term-ts,
  .body-copy-sm,
  .body-copy-xs,
  .text-meta {
    color: var(--brand-secondary);
  }

  .btn-ui--primary,
  .btn-ui--success,
  .btn-gold,
  .project-control-btn.primary,
  .term-filter.active,
  .lang-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: var(--brand-white);
  }

  .btn-ui--primary:hover,
  .btn-ui--success:hover,
  .btn-gold:hover,
  .project-control-btn.primary:hover {
    background: var(--brand-secondary);
    border-color: rgba(107,250,62,0.58);
    box-shadow: 0 0 0 3px rgba(107,250,62,0.16), 0 12px 26px rgba(34,104,113,0.18);
    transform: translateY(-1px);
  }

  .btn-ui--accent-soft,
  .badge-pill--info,
  .term-agent-status .term-badge,
  .agent-status.approved,
  .ws-status.ws-connected {
    background: rgba(34,104,113,0.10);
    border-color: rgba(107,250,62,0.38);
    color: var(--brand-primary);
  }

  .milestone-progress-fill,
  .overview-kpi .bar,
  .progress-fill {
    background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary), var(--brand-lime));
    box-shadow: 0 0 18px var(--brand-lime-glow);
  }

  .milestone-step.active::before,
  .ws-dot.ws-live {
    background: var(--brand-lime);
    box-shadow: 0 0 0 1px var(--brand-lime), 0 0 0 6px rgba(107,250,62,0.18);
  }

  .terminal-panel,
  #terminalContent,
  .json-preview {
    background: var(--brand-slate);
    color: #DDF7F4;
    border-color: rgba(107,250,62,0.18);
  }

  .term-filters,
  .status-row,
  .control-select,
  .agent-chat-input,
  .textarea-ui,
  .doc-item {
    background: rgba(255,255,255,0.78);
    border-color: rgba(34,104,113,0.14);
    color: var(--brand-slate);
  }

  .control-select:focus,
  .agent-chat-input:focus,
  .textarea-ui:focus {
    border-color: rgba(107,250,62,0.7);
    box-shadow: 0 0 0 3px rgba(107,250,62,0.14);
  }

  .demo-banner,
  .approval-banner {
    background: linear-gradient(90deg, var(--brand-slate), var(--brand-primary));
    border-color: rgba(107,250,62,0.32);
    color: var(--brand-white);
  }

  canvas#floor {
    background:
      linear-gradient(180deg, rgba(249,251,251,0.96), rgba(238,245,245,0.96)),
      var(--brand-white);
  }

  #terminalPanel #terminalContent,
  #terminalPanel .term-entry,
  #terminalPanel .term-msg {
    color: #E6FFFB !important;
  }

  #terminalPanel .term-msg span {
    color: #BFE9E5 !important;
  }

  #terminalPanel .term-ts {
    color: #7FE6D8 !important;
  }

  #terminalPanel .term-entry {
    border-bottom-color: rgba(221,247,244,0.10);
  }

  /* David Lumina dashboard visual port.
     Keep this as a CSS-only layer so the split JS modules and Three.js office stay untouched. */
  body {
    background: var(--surface-base);
    color: var(--text-primary);
  }

  header {
    background: var(--surface-raised);
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 0 rgba(15,23,42,0.03);
  }

  header h1 {
    font-family: var(--font-ui);
    letter-spacing: 0.5px;
    color: var(--brand-primary);
    text-shadow: none;
  }

  header .subtitle,
  .header-project-context {
    color: var(--text-muted);
  }

  .tab-bar {
    background: var(--surface-canvas);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .tab {
    color: var(--text-secondary);
    letter-spacing: 0.6px;
    background: transparent;
    box-shadow: none;
  }

  .tab:hover { color: var(--brand-primary); }
  .tab.active { color: var(--brand-primary); border-bottom: 2px solid var(--brand-primary); }

  .tab[data-tab-key="live"]::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 50%;
    background: var(--status-success);
    animation: wsPulse 1.2s ease-in-out infinite;
    vertical-align: middle;
  }

  .demo-banner {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-active);
    border-bottom: 1px solid color-mix(in srgb, var(--brand-primary) 22%, transparent);
    font-family: var(--font-mono);
  }

  .demo-banner-btn {
    background: var(--surface-raised);
    color: var(--brand-primary);
    border: 1px solid color-mix(in srgb, var(--brand-primary) 32%, transparent);
    font-family: var(--font-mono);
  }

  .demo-banner-btn:hover { background: var(--surface-subtle); }

  .status-row,
  .term-filters,
  .control-select,
  .agent-chat-input,
  .textarea-ui,
  .doc-item {
    background: var(--surface-subtle);
    border-color: var(--border-subtle);
    color: var(--text-secondary);
  }

  .status-row {
    font-family: var(--font-mono);
  }

  .agent-card,
  .report-index-item,
  .report-panel,
  .overview-card,
  .milestone-folder,
  .question-card,
  .roomdb-status-card,
  .panel-card {
    background: var(--surface-canvas);
    border-color: var(--border-default);
  }

  .agent-card-title h4,
  .agent-name,
  .overview-kpi .value,
  .report-index-item strong,
  .roomdb-title {
    color: var(--text-primary);
  }

  .agent-card p,
  .agent-card-subtitle,
  .overview-kpi .label,
  .report-index-item span,
  .body-copy-sm {
    color: var(--text-secondary);
  }

  .terminal-panel,
  #terminalContent,
  .json-preview {
    background: #1E1E1E;
    color: #D4D4D4;
    border-color: var(--border-default);
    font-family: var(--font-mono);
  }

  .terminal-header {
    background: #1E1E1E;
    color: #D4D4D4;
    border-bottom-color: #333333;
  }

  .terminal-title {
    color: var(--status-success);
  }

  .terminal-toggle,
  .terminal-export-btn {
    background: #2A2A2A;
    border-color: #444444;
    color: #D4D4D4;
    font-family: var(--font-ui);
  }

  .terminal-toggle:hover,
  .terminal-export-btn:hover {
    background: #333333;
  }

  #worldCanvas,
  .three-office-fallback {
    background: var(--surface-base);
  }

  #terminalPanel .term-badge {
    background: rgba(249,251,251,0.92) !important;
    border: 1px solid rgba(107,250,62,0.28);
    color: var(--brand-primary) !important;
  }

  #terminalPanel .term-agent-status .term-badge,
  #terminalPanel .term-system .term-badge {
    color: var(--brand-primary) !important;
  }

  #terminalPanel .term-qa .term-badge {
    color: #1B7F3A !important;
  }

  #terminalPanel .term-qa.term-fail .term-badge,
  #terminalPanel .term-escalation .term-badge {
    color: #C92A2A !important;
  }

  #terminalPanel .term-milestone .term-badge {
    color: #8B5E00 !important;
  }

  .demo-artifact-shell {
    min-height: 100%;
    padding: 22px;
    overflow: auto;
    background:
      linear-gradient(180deg, rgba(249,251,251,0.96), rgba(238,245,245,0.98)),
      var(--brand-white);
  }

  .demo-artifact-hero,
  .demo-artifact-panel,
  .demo-plan-board,
  .demo-model-stage {
    background: var(--brand-glass-strong);
    border: 1px solid rgba(34,104,113,0.14);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(18,42,45,0.08);
  }

  .demo-artifact-hero {
    padding: 20px;
    display: grid;
    grid-template-columns: minmax(0,1.3fr) minmax(260px,.7fr);
    gap: 18px;
    align-items: stretch;
    margin-bottom: 16px;
  }

  .demo-artifact-kicker {
    color: var(--brand-primary);
    font: 800 11px/1 var(--font-ui);
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .demo-artifact-title {
    margin: 7px 0 8px;
    color: var(--brand-slate);
    font: 800 28px/1.08 var(--font-ui);
    letter-spacing: 0;
  }

  .demo-artifact-copy {
    margin: 0;
    max-width: 760px;
    color: var(--brand-secondary);
    font-size: 14px;
    line-height: 1.6;
  }

  .demo-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
  }

  .demo-stat {
    min-width: 0;
    padding: 13px;
    border: 1px solid rgba(34,104,113,0.13);
    border-radius: 10px;
    background: rgba(255,255,255,0.74);
  }

  .demo-stat span {
    display: block;
    color: var(--brand-secondary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .demo-stat strong {
    display: block;
    margin-top: 5px;
    color: var(--brand-primary);
    font-size: 22px;
    line-height: 1.1;
  }

  .demo-artifact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
  }

  .demo-artifact-panel {
    padding: 16px;
    min-width: 0;
  }

  .demo-artifact-panel h3 {
    margin: 0 0 8px;
    color: var(--brand-slate);
    font-size: 16px;
  }

  .demo-artifact-list {
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
  }

  .demo-artifact-list li,
  .demo-milestone-row {
    padding: 10px 12px;
    border: 1px solid rgba(34,104,113,0.10);
    border-radius: 9px;
    background: rgba(255,255,255,0.72);
    color: var(--brand-slate);
    font-size: 12px;
    line-height: 1.45;
  }

  .demo-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
  }

  .demo-tag {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(107,250,62,0.38);
    background: rgba(34,104,113,0.08);
    color: var(--brand-primary);
    font-size: 10px;
    font-weight: 800;
  }

  .demo-plan-board {
    padding: 16px;
    display: grid;
    grid-template-columns: minmax(0,1fr) 240px;
    gap: 16px;
    align-items: start;
  }

  .demo-plan-svg {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    background: #F9FBFB;
  }

  .demo-model-stage {
    min-height: 100%;
    padding: 22px;
    color: var(--brand-slate);
    background:
      radial-gradient(circle at 72% 24%, rgba(107,250,62,0.14), transparent 32%),
      linear-gradient(135deg, #F9FBFB, #EAF3F3 60%, #F9FBFB);
  }

  .demo-model-viewport {
    min-height: 360px;
    border: 1px solid rgba(34,104,113,0.15);
    border-radius: 14px;
    background:
      linear-gradient(155deg, rgba(18,42,45,0.94), rgba(34,104,113,0.90)),
      var(--brand-slate);
    color: #E6FFFB;
    display: grid;
    place-items: center;
    overflow: hidden;
    position: relative;
  }

  .demo-model-viewport::before,
  .demo-model-viewport::after {
    content: "";
    position: absolute;
    inset: 20%;
    border: 1px solid rgba(107,250,62,0.28);
    transform: skewY(-10deg) rotate(-6deg);
  }

  .demo-model-viewport::after {
    inset: 32%;
    border-color: rgba(255,255,255,0.18);
    transform: skewY(-10deg) rotate(-6deg) translate(26px, -20px);
  }

  .demo-model-label {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 420px;
  }

  #tab-rumsdatabas {
    overflow: hidden;
  }

  #roomDatabaseRoot {
    min-height: 0;
    overflow: hidden;
  }

  @media (max-width: 900px) {
    .demo-artifact-hero,
    .demo-plan-board {
      grid-template-columns: 1fr;
    }

    #tab-rumsdatabas,
    #roomDatabaseRoot {
      overflow: auto;
    }
  }

@keyframes pulseBanner { 0%,100%{opacity:1} 50%{opacity:0.82} }

/* ============================================================
   Kalkyl tab — materialkostnadskalkyl
   ============================================================ */

.kalkyl-root {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--bg);
}

.kalkyl-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 28px 64px;
}

.kalkyl-header { margin-bottom: 18px; }
.kalkyl-title {
  font-size: 24px;
  font-weight: 700;
  margin: 4px 0 6px;
  color: var(--text, #102133);
}
.kalkyl-sub {
  color: #6C757D;
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
  max-width: 800px;
}

.kalkyl-summary {
  background: #F0F7F5;
  border: 1px solid #CFE6DE;
  border-left: 4px solid #226871;
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 18px;
}
.kalkyl-summary-headline {
  font-size: 15px;
  font-weight: 700;
  color: #102133;
  margin: 4px 0 4px;
}
.kalkyl-summary-moms {
  font-size: 12px;
  color: #33504A;
  margin: 0 0 10px;
}
.kalkyl-summary-moms-sub { color: #6C757D; margin-left: 4px; }
.kalkyl-summary-block { margin-top: 10px; }
.kalkyl-summary-block-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #226871;
  margin-bottom: 6px;
}
.kalkyl-summary-drivers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.kalkyl-summary-driver {
  background: #fff;
  border: 1px solid #DCEAE5;
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
}
.kalkyl-summary-driver-label { color: #102133; font-weight: 600; }
.kalkyl-summary-driver-pct { color: #B57100; font-weight: 700; }
.kalkyl-summary-driver-sek { color: #6C757D; }
.kalkyl-summary-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  color: #234057;
  line-height: 1.6;
}
.kalkyl-summary-list--flags { color: #8A5A00; }
.kalkyl-summary-block--flags {
  background: #FFF8E8;
  border: 1px solid #F2DDA6;
  border-radius: 8px;
  padding: 8px 12px;
}

.kalkyl-kostnadsslag-wrap { overflow-x: auto; }
.kalkyl-kostnadsslag {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.kalkyl-kostnadsslag th, .kalkyl-kostnadsslag td {
  padding: 8px 12px;
  border-bottom: 1px solid #EEF1F4;
  text-align: left;
}
.kalkyl-kostnadsslag th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6C757D;
  font-weight: 700;
}
.kalkyl-kostnadsslag tfoot td {
  border-top: 2px solid #DDE3E8;
  border-bottom: none;
  padding-top: 10px;
}

.kalkyl-kpi-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 1100px) {
  .kalkyl-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kalkyl-kpi {
  background: #fff;
  border: 1px solid #E6E9EE;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: 0 1px 2px rgba(15, 30, 50, 0.04);
}
.kalkyl-kpi--primary { border-top: 3px solid #226871; }
.kalkyl-kpi--accent { border-top: 3px solid #F2A03D; }
.kalkyl-kpi--neutral { }
.kalkyl-kpi--muted { opacity: 0.85; }
.kalkyl-kpi-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #6C757D;
  text-transform: uppercase;
}
.kalkyl-kpi-value {
  font-size: 22px;
  font-weight: 700;
  color: #102133;
  font-feature-settings: "tnum";
}
.kalkyl-kpi--accent .kalkyl-kpi-value { color: #B57100; }
.kalkyl-kpi-sub { font-size: 11px; color: #6C757D; }

.kalkyl-section {
  background: #fff;
  border: 1px solid #E6E9EE;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.kalkyl-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.kalkyl-section-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #102133;
}
.kalkyl-section-meta { font-size: 11px; color: #6C757D; }
.kalkyl-section-actions { display: flex; gap: 6px; }

.kalkyl-trad-wrap { overflow-x: auto; }
.kalkyl-trad {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.kalkyl-trad th, .kalkyl-trad td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #F0F2F5;
  vertical-align: middle;
}
.kalkyl-trad th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6C757D;
  background: #F7F9FB;
}
.kalkyl-cat-row { background: #FAFBFC; cursor: pointer; }
.kalkyl-cat-row:hover { background: #F0F4F6; }
.kalkyl-cat-row.is-expanded { background: #F0F4F6; }
.kalkyl-cell-caret {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.kalkyl-cell-sub-caret {
  padding-left: 28px;
  color: #6C757D;
}
.kalkyl-caret {
  display: inline-block;
  width: 14px;
  font-size: 11px;
  color: #226871;
  font-weight: 700;
}
.kalkyl-cat-code {
  display: inline-block;
  margin: 0 6px;
  padding: 1px 6px;
  background: #226871;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  letter-spacing: 0.04em;
}
.kalkyl-cell-bip {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #6C757D;
  width: 50px;
}
.kalkyl-cell-count { width: 100px; color: #6C757D; font-size: 11px; }
.kalkyl-cell-share { width: 80px; color: #6C757D; font-size: 11px; }
.kalkyl-cell-sum {
  width: 130px;
  text-align: right;
  font-feature-settings: "tnum";
  font-weight: 600;
  color: #102133;
}
.kalkyl-cell-bar { width: 100px; vertical-align: middle; }
.kalkyl-bar {
  width: 100%;
  height: 8px;
  background: #ECEEF1;
  border-radius: 4px;
  overflow: hidden;
}
.kalkyl-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #226871, #4E9DA6);
}
.kalkyl-trad tfoot td {
  border-top: 2px solid #102133;
  background: #F7F9FB;
  font-size: 13px;
}

.kalkyl-sub-row { background: #fff; cursor: pointer; }
.kalkyl-sub-row:hover { background: #FAFBFC; }

.kalkyl-line-row { background: #fff; }
.kalkyl-line-row:hover { background: #FCFCFD; }
.kalkyl-line-row td { font-size: 11px; padding: 6px 10px; }
.kalkyl-cell-line { padding-left: 52px; color: #234966; }
.kalkyl-cell-meta {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #6C757D;
  width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}
.kalkyl-cell-qty {
  width: 100px;
  text-align: right;
  font-feature-settings: "tnum";
  color: #234966;
}
.kalkyl-cell-unitprice {
  width: 100px;
  text-align: right;
  font-feature-settings: "tnum";
  color: #6C757D;
}
.kalkyl-cell-source {
  font-size: 10px;
  color: #6C757D;
  width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kalkyl-prislista {
  border-top: 1px solid #F0F2F5;
  padding-top: 14px;
}
.kalkyl-prislista-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.kalkyl-prislista-title {
  font-size: 14px;
  font-weight: 700;
  color: #102133;
  margin-top: 2px;
}
.kalkyl-prislista-meta {
  font-size: 11px;
  color: #6C757D;
  margin-top: 2px;
}
.kalkyl-prislista-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.kalkyl-prislista-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.kalkyl-prislista-filters input[type="search"] {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #D6DBE0;
  border-radius: 6px;
  font-size: 12px;
}
.kalkyl-prislista-filters select {
  padding: 6px 10px;
  border: 1px solid #D6DBE0;
  border-radius: 6px;
  font-size: 12px;
  background: #fff;
}
.kalkyl-prislista-table-wrap {
  max-height: 540px;
  overflow: auto;
  border: 1px solid #E6E9EE;
  border-radius: 6px;
}
.kalkyl-prislista-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.kalkyl-prislista-table th, .kalkyl-prislista-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #F0F2F5;
  text-align: left;
}
.kalkyl-prislista-table th {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6C757D;
  background: #F7F9FB;
  position: sticky;
  top: 0;
  z-index: 1;
}
.kalkyl-prislista-row.is-override { background: #FFFBEF; }
.kalkyl-prislista-row.is-override:hover { background: #FFF8E5; }
.kalkyl-cat-tag {
  display: inline-block;
  padding: 1px 6px;
  background: #234966;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
}
.kalkyl-match {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #6C757D;
  background: #F7F9FB;
  padding: 1px 4px;
  border-radius: 3px;
}
.kalkyl-default-price {
  color: #6C757D;
  font-feature-settings: "tnum";
  text-align: right;
}
.kalkyl-price-input, .kalkyl-note-input {
  width: 100%;
  padding: 3px 6px;
  border: 1px solid #D6DBE0;
  border-radius: 4px;
  font-size: 12px;
  font-family: inherit;
  font-feature-settings: "tnum";
}
.kalkyl-price-input.has-pending, .kalkyl-note-input.has-pending {
  border-color: #F2A03D;
  background: #FFFBEF;
}
.kalkyl-pill {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 1px 5px;
  border-radius: 8px;
  text-transform: uppercase;
}
.kalkyl-pill--override {
  background: #F2A03D;
  color: #fff;
}
.kalkyl-note {
  display: inline-block;
  font-size: 11px;
  color: #226871;
  margin-left: 4px;
  cursor: help;
}

.kalkyl-room-section {
  background: #fff;
  border: 1px solid #E6E9EE;
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.kalkyl-room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.kalkyl-room-card {
  background: #F7F9FB;
  border: 1px solid #E6E9EE;
  border-radius: 8px;
  padding: 10px 12px;
}
.kalkyl-room-name {
  font-size: 12px;
  font-weight: 700;
  color: #102133;
}
.kalkyl-room-type {
  font-size: 10px;
  color: #6C757D;
  margin: 2px 0 6px;
}
.kalkyl-room-cost {
  font-size: 14px;
  font-weight: 700;
  color: #226871;
  font-feature-settings: "tnum";
}
.kalkyl-room-objects {
  font-size: 10px;
  color: #6C757D;
  margin-top: 2px;
}

.kalkyl-warning {
  background: #FFFBEF;
  border: 1px solid #F2A03D;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #8B5A00;
}
.kalkyl-warning code {
  background: rgba(0, 0, 0, 0.04);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
  color: #102133;
}
.kalkyl-warning-note {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.85;
}
.kalkyl-flash {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #226871;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(15, 30, 50, 0.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}
.kalkyl-flash.is-shown { opacity: 1; transform: translateY(0); }
.kalkyl-flash.is-error { background: #B03030; }
