/* Midnight workspace theme. Screen-only palette leaves document printing intact. */
@media screen {
  :root { color-scheme: dark; --paper: #090f1b; --white: #131e30; --ink: #eef4ff; --muted: #a6b4ca; --blue: #83b1ff; --line: #2a3951; --dark: #080e19; --surface: #131e30; --surface-raised: #1a2940; --primary: #285fe5; }
  body { background: var(--paper); color: var(--ink); -webkit-font-smoothing: antialiased; }
  h1,h2,h3 { letter-spacing: -.035em; }
  .site-header { background: #0b1322f5; border-color: var(--line); }
  .logo { padding: 4px 8px; border-radius: 8px; }
  .btn, button.btn { background: var(--primary); border-color: var(--primary); color: #fff; border-radius: 12px; }
  .btn:hover { background: #174bc8; border-color: #5688f4; color: #fff; }
  .btn.outline, .btn.dark { background: var(--surface-raised); border: 1px solid var(--line); color: var(--ink); }
  .btn.outline:hover, .btn.dark:hover { background: #233b5f; border-color: #5277aa; }
  .text-link, .contact-email { color: var(--blue); }
  .form-grid input, .form-grid select, .form-grid textarea, .input, .project-toolbar .input,
  .conversation-toolbar input, .conversation-composer textarea { background: #0c1525; color: var(--ink); border: 1px solid #3b4d68; border-radius: 12px; }
  input::placeholder, textarea::placeholder { color: #8e9fb8; opacity: 1; }
  input[type="file"]::file-selector-button { background: var(--surface-raised); color: var(--ink); border: 1px solid #4a6080; border-radius: 8px; padding: 8px 12px; margin-right: 10px; }
  .status { background: #112e2a; color: #a6f1cf; border-color: #2f6656; }
  .status.error, .form-feedback { background: #371f2a; color: #ffc2cc; border-color: #895164; }
  .status:empty { display: none; }
  .homepage .hero { background: radial-gradient(ellipse at 85% 0%, #1e3b6b70 0, transparent 65%); padding-top: 60px; }
  .homepage .hero h1 { font-size: clamp(46px, 5.7vw, 78px); line-height: 1.04; }
  .homepage .hero-intro { color: var(--muted); max-width: 420px; }
  .homepage .hero-meta { color: #a6b4ca; gap: 10px 18px; }
  .homepage .hero-meta::before { content: none; }
  .homepage .site-nav.icon-nav a { color: #bfcee5; background: transparent; }
  .homepage .site-nav.icon-nav a:hover, .homepage .site-nav.icon-nav a:focus-visible { color: #b9d4ff; background: #1b2c46; }
  .homepage .ticker { background: #101c2e; border-color: var(--line); }
  .homepage .service-tile, .homepage .work-card, .homepage .enquiry-next { background: var(--surface); border-color: var(--line); }
  .homepage .service-tile:hover { background: #1a2c46; border-color: #5277aa; }
  .homepage .service-tile > .ui-icon { color: #98beff; }
  .homepage .work-section { background: #0d1727; }
  .homepage .project-category, .homepage .project-link, .homepage .work-title .ui-icon { color: var(--blue); }
  .homepage .project-tags li { background: #1b2d46; color: #c6d8f3; border-color: #36506e; }
  .homepage .project-detail, .homepage .work-next, .homepage .work-compact[open] > .work-title { border-color: var(--line); }
  .homepage .work-title:hover { background: #1a2a43; }
  .homepage .expanded-story strong { color: #e5efff; }
  .homepage .workspace-promo { background: #101d32; color: var(--ink); border: 1px solid #2e4565; border-radius: 22px; }
  .homepage .workspace-promo p, .homepage .promo-panel { color: #b9c8df; }
  .homepage .promo-panel { background: #0c1525; border: 1px solid var(--line); border-radius: 16px; }
  .homepage .promo-row { border-color: var(--line); }
  .homepage .promo-row span { color: #a8c9ff; }
  .homepage .faq details { border-color: var(--line); }
  .homepage .footer { background: #070d17; }
  .launchpad { padding: 28px; background: linear-gradient(145deg,#1b2c47,#101b2d); border: 1px solid #385174; border-radius: 24px; box-shadow: 0 20px 55px #0003; }
  .launchpad h2 { font-size: 28px; line-height: 1.15; margin-bottom: 24px; }
  .launchpad .eyebrow { margin-bottom: 12px; }
  .launchpad-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .launchpad-grid a { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; min-height: 120px; padding: 18px; background: #102039; border: 1px solid #365171; border-radius: 16px; font-size: 14px; font-weight: 600; }
  .launchpad-grid a:hover { background: #1d3657; border-color: #7099cf; }
  .launchpad-grid .ui-icon { width: 26px; height: 26px; color: var(--blue); }
  .launchpad-portal { margin-top: 20px; padding-top: 20px; border-top: 1px solid #365171; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
  .launchpad-portal strong { color: var(--blue); }
  .portal-shell .auth-card, .portal-shell .metric, .portal-shell .panel, .portal-shell .project-card, .portal-shell .card { background: var(--surface); border-color: var(--line); box-shadow: 0 6px 24px #00000014; }
  .portal-shell .auth-view { margin-top: 56px; gap: 56px; }
  .portal-shell .auth-story h1 { font-size: clamp(38px,4.5vw,58px); }
  .portal-shell .auth-card { border-radius: 22px; }
  .portal-shell .app-view { background: #090f1b; }
  .portal-shell .sidebar { background: #0e1828; border-color: var(--line); }
  .portal-shell .role-chip { background: #162b48; border-color: #36577f; color: #a9ceff; }
  .portal-shell .sidebar nav button { color: #a6b8d2; }
  .portal-shell .sidebar nav button:hover, .portal-shell .sidebar nav button.active { color: #b9d4ff; background: #1b3152; box-shadow: none; }
  .portal-shell .content-top h1 { font-size: clamp(28px,3vw,40px); }
  .portal-shell .metric strong { color: #e7f0ff; }
  .portal-shell .workspace-shortcuts, .portal-shell .project-summary, .portal-shell .file-upload-panel, .portal-shell .workflow-stat { background: #14243b; color: var(--ink); border-color: #304966; }
  .portal-shell button.workflow-stat:hover { background: #1a3456; border-color: #668fc2; }
  .portal-shell .workflow-next-action { background: #132c4c; color: #d3e5ff; }
  .portal-shell .badge, .portal-shell .workflow-deadline { background: #1b3050; color: #b7d2ff; border-color: #3a577d; }
  .portal-shell .badge.success { background: #133b30; color: #9ce9c4; border-color: #316850; }
  .portal-shell .deadline-warning, .portal-shell .deadline-overdue { background: #3a281d; color: #ffd0a9; }
  .portal-shell .deadline-today, .portal-shell .document-draft { background: #362f1b; color: #f6dda0; }
  .portal-shell .deadline-soon { background: #1d3150; color: #b7d2ff; }
  .portal-shell .progress, .portal-shell .project-native-progress, .portal-shell .project-native-progress::-webkit-progress-bar { background: #25344d; }
  .portal-shell .tabs button { color: #b2c4df; }
  .portal-shell .tabs button.active { color: #bdd7ff; background: #1a3357; border-color: #547caf; }
  .portal-shell .conversation-history { background: #0b1525; border-color: var(--line); }
  .portal-shell .conversation-message { background: #17273e; border-color: #324b6b; }
  .portal-shell .conversation-message.is-own { background: #17365d; border-color: #3a6193; }
  .portal-shell .conversation-day, .portal-shell .conversation-meta time { color: #a7bbd7; }
  .portal-shell .document-preview { background: #111f33; border-color: var(--line); }
  .portal-shell .data-table th { color: #a9bfdc; background: #122138; }
  .portal-shell .data-table tbody tr:hover { background: #14263e; }
  .portal-shell .empty { border-color: #3b4e69; color: var(--muted); }
  .portal-shell .project-timeline-item::before { background: #15273e; border-color: #819fc6; }
  .portal-shell .project-timeline-item[aria-current="step"]::before { box-shadow: 0 0 0 4px #203c61; }
  .portal-shell dialog { background: #101c2e; color: var(--ink); border-color: #47648a; border-radius: 20px; }
  .portal-shell dialog::backdrop { background: #020610c9; }
  .portal-shell dialog .modal-footer { background: #101c2e; border-color: var(--line); }
  .portal-shell .file-selection-feedback.error { color: #ffb7c4; }
}
@media screen and (max-width: 760px) {
  .homepage .hero { padding: 28px 0 22px; }
  .homepage .hero-grid { grid-template-columns: 1fr; }
  .homepage .hero h1 { font-size: clamp(36px,9.2vw,52px); margin-bottom: 16px; }
  .homepage .hero .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: stretch; }
  .homepage .hero .actions .btn { min-width: 0; padding: 13px 10px; font-size: 12px; justify-content: center; min-height: 50px; height: 100%; }
  .homepage .hero-meta, .homepage .launchpad { display: none; }
  .homepage .service-tile { border-radius: 18px; min-height: 138px; }
  .homepage .service-tile > .ui-icon { padding: 6px; width: 38px; height: 38px; border-radius: 10px; background: #1e3657; }
  .homepage .section-head h2 { font-size: 27px; }
  .portal-shell .auth-view { margin: 28px auto; gap: 20px; }
  .portal-shell .auth-story h1 { font-size: 36px; margin-bottom: 16px; }
  .portal-shell .auth-story > p:not(.eyebrow) { font-size: 14px; }
  .portal-shell .sidebar nav { background: #0e1a2df5; border-color: #344a68; box-shadow: 0 -8px 30px #0004; }
  .portal-shell .sidebar nav .nav-extra { background: #15243b; border-color: #3b5375; }
  .portal-shell .tabs button { background: #142238; border-color: #2e4463; }
  .portal-shell .tabs button.active { background: #1c3961; border-color: #5d8bc5; }
  .portal-shell .app-content { padding-top: 18px; }
  .portal-shell .metric { border-radius: 18px; }
  .portal-shell .panel { border-radius: 18px; }
  .portal-shell .content-top h1 { font-size: 26px; }
}

@media screen {
  .homepage #contact { scroll-margin-top: 76px; }
  .homepage .enquiry-card { min-width: 0; padding: clamp(20px, 4vw, 36px); gap: 20px; border: 1px solid #344965; border-radius: 24px; background: linear-gradient(150deg, #182840, #101c2e); box-shadow: 0 18px 50px #0003; }
  .homepage .enquiry-card-heading { display: flex; align-items: center; gap: 14px; }
  .homepage .enquiry-card-heading > .ui-icon { width: 46px; height: 46px; padding: 11px; border-radius: 14px; background: #263f66; color: var(--blue); flex-shrink: 0; }
  .homepage .enquiry-card h3 { font-size: 22px; margin: 0 0 4px; letter-spacing: -.03em; }
  .homepage .enquiry-card .enquiry-intro { font-size: 13px; margin: 0; color: var(--muted); }
  .homepage .enquiry-card label { gap: 9px; font-size: 13px; font-weight: 600; }
  .homepage .enquiry-card input, .homepage .enquiry-card select, .homepage .enquiry-card textarea { width: 100%; min-width: 0; background: #0b1626; border: 1px solid #3c506d; border-radius: 12px; color: var(--ink); padding: 14px; font-size: 16px; }
  .homepage .enquiry-card textarea { resize: vertical; min-height: 130px; }
  .homepage .enquiry-card :is(input,select,textarea):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
  .homepage .enquiry-card .tiny { margin: 0; line-height: 1.65; font-size: 12px; }
  .homepage .enquiry-card > .btn { width: 100%; min-height: 50px; border-radius: 13px; }
  .homepage .enquiry-card .two { min-width: 0; gap: 16px; }
  @media (max-width: 580px) { .homepage .enquiry-card .two { grid-template-columns: 1fr; } .homepage .enquiry-card { border-radius: 20px; gap: 18px; } }
}

/* Compact project workspace: shared by owner, client and assigned team. */
@media screen {
  .portal-shell .badge { border-radius: 999px; padding: 5px 9px; font-size: 11px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
  .portal-shell .badge.warning { background: #3b3019; color: #ffe0a0; border-color: #7a6335; }
  .portal-shell .badge.attention { background: #3b2232; color: #ffc3d4; border-color: #86536a; }
  .portal-shell .badge.active-status { background: #173859; color: #b8ddff; border-color: #3b6d98; }
  .portal-shell .badge.neutral-status { background: #253044; color: #c7d3e7; border-color: #4b5c75; }
  .portal-shell .project-grid { align-items: stretch; gap: 14px; }
  .portal-shell .compact-project-card { padding: 20px; border-radius: 20px; gap: 14px; }
  .portal-shell .compact-project-card .card-top { align-items: flex-start; gap: 12px; }
  .portal-shell .compact-project-card h3 { margin: 0; font-size: 20px; line-height: 1.25; min-width: 0; }
  .portal-shell .compact-project-card .card-top .badge { flex-shrink: 0; max-width: 45%; }
  .portal-shell .project-card-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); }
  .portal-shell .project-card-progress { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
  .portal-shell .project-card-progress strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
  .portal-shell .compact-project-card .progress-track { margin: -5px 0 0; height: 6px; background: #293a53; }
  .portal-shell .project-card-details { padding-top: 12px; border-top: 1px solid var(--line); }
  .portal-shell .project-card-details summary { cursor: pointer; font-size: 12px; color: #b8d5ff; padding: 8px 0; }
  .portal-shell .project-card-details p { margin: 8px 0 0; color: var(--muted); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
  .portal-shell .compact-project-card > .project-open { align-self: stretch; justify-content: center; min-height: 44px; margin-top: auto; }
  .portal-shell .content-top { gap: 14px; align-items: center; }
  .portal-shell .content-top .actions { gap: 8px; }
  .portal-shell .content-top .btn { min-height: 44px; }
  .portal-shell .project-toolbar { padding: 12px; border-radius: 16px; background: #101d31; border: 1px solid var(--line); }
  .portal-shell .project-count { font-size: 12px; margin: 12px 2px; }
  .portal-shell .workspace-shortcuts { border-radius: 16px; padding: 14px; gap: 10px; }
  @media (max-width: 760px) {
    .portal-shell .compact-project-card { padding: 16px; gap: 12px; border-radius: 18px; }
    .portal-shell .compact-project-card h3 { font-size: 18px; }
    .portal-shell .content-top { align-items: flex-start; }
    .portal-shell .content-top > .actions { width: 100%; }
    .portal-shell .content-top > .actions > .btn { flex: 1; }
    .portal-shell .project-toolbar { padding: 10px; gap: 8px; }
  }
}
@media screen and (max-width: 760px) {
  .portal-shell .app-view { grid-template-rows: auto 1fr; }
  .portal-shell .sidebar { align-self: start; }
}

/* Project screens: compact content, explicit decisions and readable chat. */
@media screen {
  .portal-shell .project-screen-brief { margin: 0 0 16px; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; background: #101d30; }
  .portal-shell .project-screen-brief summary { padding: 13px 0; font-size: 13px; cursor: pointer; color: #b8d5ff; }
  .portal-shell .project-screen-brief p { margin: 0 0 16px; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
  .portal-shell .project-detail-panel { padding: 22px; }
  .portal-shell .project-detail-panel .panel-head { gap: 12px; margin-bottom: 18px; }
  .portal-shell .project-detail-panel .panel-head h2 { font-size: 22px; line-height: 1.25; }
  .portal-shell .project-detail-panel .panel-head .btn { min-height: 44px; }
  .portal-shell .project-detail-panel .project-summary { gap: 20px; padding: 20px; margin-bottom: 18px; border-radius: 18px; }
  .portal-shell .project-detail-panel .project-percent { font-size: 42px; color: #b5d3ff; }
  .portal-shell .project-detail-panel .project-summary .subtle { font-size: 12px; margin: 8px 0 0; }
  .portal-shell .project-detail-panel .project-summary-details p { margin: 12px 0; font-size: 13px; }
  .portal-shell .project-overview-grid { gap: 14px; }
  .portal-shell .project-overview-card { padding: 18px; border-radius: 16px; background: #101c2e; }
  .portal-shell .project-overview-head { margin-bottom: 14px; gap: 10px; }
  .portal-shell .project-overview-head h3 { font-size: 16px; }
  .portal-shell .project-overview-head .btn { padding: 10px 12px; min-height: 44px; }
  .portal-shell .project-overview-card h4 { font-size: 15px; line-height: 1.45; }
  .portal-shell .project-overview-card .subtle { font-size: 12px; line-height: 1.6; }
  .portal-shell .project-update-preview { font-size: 13px; line-height: 1.65; }
  .portal-shell .project-timeline { border-color: #344962; margin-top: 14px; }
  .portal-shell .project-timeline-item { padding-bottom: 18px; }
  .portal-shell .project-detail-panel .workflow-summary { gap: 10px; margin: 16px 0; }
  .portal-shell .project-detail-panel .workflow-stat { padding: 14px; border-radius: 14px; gap: 7px; }
  .portal-shell .project-detail-panel .workflow-stat strong { font-size: 24px; color: #b5d3ff; }
  .portal-shell .project-detail-panel .workflow-stat span { font-size: 12px; }
  .portal-shell .project-detail-panel .row { padding: 16px; margin: 12px 0; border: 1px solid var(--line); border-radius: 16px; background: #101c2e; min-width: 0; }
  .portal-shell .project-detail-panel .row h3 { font-size: 16px; line-height: 1.4; margin: 0; overflow-wrap: anywhere; }
  .portal-shell .project-detail-panel .row p { font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
  .portal-shell .project-detail-panel .row .card-top { gap: 10px; flex-wrap: wrap; }
  .portal-shell .project-detail-panel .row .actions { gap: 8px; }
  .portal-shell .project-detail-panel .row .btn { min-height: 44px; }
  .portal-shell .workflow-deadline { margin-bottom: 8px; font-size: 11px; border-radius: 8px; }
  .portal-shell .workflow-next-action { border-radius: 8px; padding: 10px 12px; }
  .portal-shell .project-detail-panel .file-upload-panel { padding: 16px; border-radius: 16px; gap: 12px; }
  .portal-shell .project-detail-panel .project-record-list { display: grid; gap: 12px; }
  .portal-shell .project-detail-panel .project-record-list > .row { margin: 0; }
  .portal-shell .project-detail-panel[data-section="messages"] .conversation-toolbar { margin: 14px 0 8px; gap: 8px; }
  .portal-shell .conversation-status { font-size: 12px; }
  .portal-shell .conversation-history { padding: 12px; border-radius: 16px; max-height: 48dvh; }
  .portal-shell .conversation-message { max-width: 92%; padding: 11px 13px; margin-bottom: 10px; }
  .portal-shell .conversation-meta { font-size: 11px; gap: 6px 12px; margin-bottom: 5px; }
  .portal-shell .conversation-body { font-size: 14px; line-height: 1.55; }
  .portal-shell .conversation-day { margin: 10px 0 14px; }
  .portal-shell .conversation-composer { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #111f33; }
  .portal-shell .conversation-composer textarea { min-height: 88px; font-size: 16px; padding: 12px; }
  .portal-shell .conversation-compose-footer { gap: 8px; }
  @media (max-width: 760px) {
    .portal-shell .project-detail-panel { padding: 14px; border-radius: 18px; }
    .portal-shell .project-detail-panel .panel-head { flex-wrap: wrap; align-items: flex-start; }
    .portal-shell .project-detail-panel .panel-head h2 { font-size: 20px; }
    .portal-shell .project-detail-panel .project-summary { padding: 16px; gap: 14px; }
    .portal-shell .project-detail-panel .project-percent { font-size: 36px; }
    .portal-shell .project-overview-card { padding: 14px; }
    .portal-shell .project-detail-panel .workflow-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .portal-shell .project-detail-panel .row { padding: 14px; }
    .portal-shell .conversation-history { max-height: 42dvh; min-height: 160px; padding: 10px; }
    .portal-shell .conversation-composer { padding: 12px; }
    .portal-shell .conversation-compose-footer .btn { width: auto; flex: 1; }
  }
}

/* Owner management: compact records with on-demand actions and detail. */
@media screen {
  .portal-shell .admin-panel { padding: 22px; }
  .portal-shell .admin-panel .panel-head { margin-bottom: 16px; }
  .portal-shell .admin-panel .panel-head h2 { font-size: 22px; }
  .portal-shell .admin-panel > .subtle { font-size: 13px; line-height: 1.6; }
  .portal-shell .admin-panel .row { padding: 16px; margin: 12px 0; border: 1px solid var(--line); border-radius: 16px; background: #101c2e; }
  .portal-shell .admin-panel .card-top { flex-wrap: wrap; align-items: center; gap: 8px; }
  .portal-shell .admin-panel .card-top h3 { flex: 1 1 170px; min-width: 0; margin: 0; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
  .portal-shell .admin-panel .row p { margin: 10px 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
  .portal-shell .admin-panel .row-meta { font-size: 11px; color: var(--muted); }
  .portal-shell .admin-details { margin-top: 12px; border-top: 1px solid var(--line); }
  .portal-shell .admin-details summary { padding: 13px 0 3px; min-height: 44px; color: #b8d5ff; font-size: 13px; cursor: pointer; }
  .portal-shell .admin-details summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
  .portal-shell .admin-details .actions { gap: 8px; margin: 12px 0 0; }
  .portal-shell .admin-details .btn { min-height: 44px; }
  .portal-shell .admin-panel .enquiry-message { white-space: pre-wrap; padding: 14px; border-radius: 12px; border: 1px solid #2c4260; background: #0b1525; }
  .portal-shell .admin-record-list { display: grid; gap: 12px; }
  .portal-shell .admin-record-list > .row { margin: 0; }
  .portal-shell .audit-card .admin-details p { font-size: 12px; font-variant-numeric: tabular-nums; }
  @media (max-width: 760px) {
    .portal-shell .admin-panel { padding: 14px; border-radius: 18px; }
    .portal-shell .admin-panel .panel-head h2 { font-size: 20px; }
    .portal-shell .admin-panel .row { padding: 14px; }
    .portal-shell .admin-details .actions { flex-direction: column; align-items: stretch; }
    .portal-shell .admin-details .actions .btn { width: 100%; justify-content: center; }
  }
}

/* Shared finishing rules for long content and consistent interactive states. */
@media screen {
  .portal-shell .content-top > div { min-width: 0; max-width: 100%; }
  .portal-shell .content-top h1, .portal-shell .panel-head h2 { overflow-wrap: anywhere; }
  .btn { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: center; }
  .btn .ui-icon { flex-shrink: 0; }
  .portal-shell .actions > .btn { min-width: 0; }
  .portal-shell .tabs { scrollbar-color: #567298 #101c2e; scroll-padding-inline: 8px; }
  .portal-shell .tabs button { flex-shrink: 0; }
  .portal-shell .tabs button:focus-visible { outline-offset: -3px; }
  :where(a,button,input,select,textarea,summary):focus-visible { outline-color: #a6ceff; }
  .btn:disabled, button:disabled { opacity: .6; cursor: wait; }
  .portal-shell .status { overflow-wrap: anywhere; }
  @media (max-width: 760px) {
    .portal-shell .panel > .panel-head { flex-wrap: wrap; gap: 10px; }
    .portal-shell .panel > .panel-head > .actions { flex-wrap: wrap; min-width: 0; }
    .portal-shell .panel > .panel-head .btn { min-height: 44px; }
  }
}
@media (forced-colors: active) {
  :where(a,button,input,select,textarea,summary):focus-visible { outline-color: Highlight; }
}

/* Blend the original portal wordmark into its dark header for every role. */
@media screen {
 .portal-shell .logo {background:transparent;box-shadow:none;border:0;}
 .portal-shell .logo img {background:transparent;mix-blend-mode:screen;border-radius:0;}
}

/* Shared dimensional workspace: presentation only, across all account roles. */
@media screen {
 .portal-shell .app-view {background:radial-gradient(ellipse at 85% 0,#17355635,transparent 55%),#090f1b;}
 .portal-shell .sidebar {background:linear-gradient(165deg,#142239,#0c1524 65%);box-shadow:inset -1px 0 #adcfff08;}
 .portal-shell .app-content {padding:32px;}
 .portal-shell .content-top {margin-bottom:24px;gap:18px;}
 .portal-shell .content-top h1 {font-size:clamp(28px,3vw,38px);line-height:1.15;letter-spacing:-.045em;}
 .portal-shell .metric,.portal-shell .project-card,.portal-shell .auth-card {background:linear-gradient(145deg,#1b2d47,#111d30 75%);border:1px solid #354e6e;border-radius:18px;box-shadow:inset 0 1px #d8edff18,0 12px 26px #0003;}
 .portal-shell .metric {padding:19px 20px;min-width:0;}
 .portal-shell .metric strong {font-size:32px;margin-top:8px;font-variant-numeric:tabular-nums;color:#eff7ff;}
 .portal-shell .metric span {color:#b4c5dd;line-height:1.4;}
 .portal-shell .metrics {gap:14px;margin-bottom:22px;}
 .portal-shell .panel {padding:22px;border-radius:18px;border-color:#304762;background:linear-gradient(150deg,#15243a,#111d2f);box-shadow:inset 0 1px #c2e3ff0d,0 10px 26px #0002;}
 .portal-shell .panel .panel {background:#101d30;box-shadow:none;border-color:#2d4562;}
 .portal-shell .panel h2 {font-size:22px;letter-spacing:-.03em;}
 .portal-shell .project-card {padding:20px;gap:14px;}
 .portal-shell .project-card h3 {font-size:22px;line-height:1.25;}
 .portal-shell .project-summary,.portal-shell .workspace-shortcuts,.portal-shell .workflow-stat {background:linear-gradient(145deg,#1d3451,#14263e);border-color:#3a5677;box-shadow:inset 0 1px #cce7ff15,0 5px 14px #0002;border-radius:14px;}
 .portal-shell .workflow-stat {gap:7px;padding:15px;}
 .portal-shell .sidebar nav button {border:1px solid transparent;border-radius:12px;transition:background .18s ease,border-color .18s ease,color .18s ease;}
 .portal-shell .sidebar nav button.active {background:linear-gradient(120deg,#23456e,#1b3150);border-color:#466991;color:#e0efff;box-shadow:inset 3px 0 #84baff,inset 0 1px #bddbff18,0 4px 10px #0002;}
 .portal-shell .sidebar nav button.active .ui-icon {color:#c1e3ff;}
 .portal-shell .tabs {gap:8px;}
 .portal-shell .tabs button {border-radius:11px;min-height:42px;}
 .portal-shell .tabs button.active {background:linear-gradient(145deg,#25456d,#1a3253);border-color:#658cb7;box-shadow:inset 0 1px #daedff20;}
 .portal-shell .project-native-progress {height:10px;background:#0b1627;box-shadow:inset 0 1px 3px #0007;}
 .portal-shell .project-native-progress::-webkit-progress-bar {background:#0b1627;}
 .portal-shell .project-native-progress::-webkit-progress-value {background:linear-gradient(90deg,#3875e6,#72c7f7);box-shadow:0 0 8px #509fff55;}
 .portal-shell .project-native-progress::-moz-progress-bar {background:linear-gradient(90deg,#3875e6,#72c7f7);}
 .portal-shell .conversation-history {background:#0c1727;box-shadow:inset 0 2px 8px #0003;border-radius:15px;}
 .portal-shell .conversation-message {border-radius:14px;box-shadow:inset 0 1px #d5eaff0d;}
 .portal-shell .conversation-message.is-own {background:linear-gradient(140deg,#204776,#183655);border-color:#4a719a;}
 .portal-shell .conversation-composer {background:#122239;border-color:#345373;box-shadow:inset 0 1px #c9e7ff10;}
 .portal-shell .data-table th {background:#172940;color:#c0d3ed;}
 .portal-shell .empty {padding:28px 18px;border-radius:14px;background:#0d192940;line-height:1.6;}
 .portal-shell .btn {box-shadow:inset 0 1px #e0eeff24,0 3px 8px #0002;}
 .portal-shell .btn.outline {box-shadow:inset 0 1px #d1e9ff10;}
}
@media screen and (max-width:760px){
 .portal-shell .app-content {padding:20px 16px;padding-bottom:110px;}
 .portal-shell .content-top {gap:12px;margin-bottom:18px;}
 .portal-shell .content-top h1 {font-size:29px;}
 .portal-shell .panel,.portal-shell .project-card {padding:16px;border-radius:16px;}
 .portal-shell .panel h2,.portal-shell .project-card h3 {font-size:21px;}
 .portal-shell .metrics {gap:10px;margin-bottom:18px;}
 .portal-shell .metric {padding:15px 13px;border-radius:15px;}
 .portal-shell .metric strong {font-size:28px;}
 .portal-shell .workflow-stat {padding:12px;}
 .portal-shell .sidebar nav {background:#0d1a2cf5;border-top-color:#37516f;box-shadow:0 -7px 24px #0005;}
 .portal-shell .sidebar nav button.active {box-shadow:inset 0 2px #84baff;}
 .portal-shell .tabs button {min-height:44px;}
 .portal-shell .auth-card {padding:22px;}
}
@media(prefers-reduced-motion:reduce){.portal-shell .sidebar nav button {transition:none;}}
@media(forced-colors:active){.portal-shell .sidebar nav button.active,.portal-shell .tabs button.active {border:2px solid Highlight;box-shadow:none;}.portal-shell .project-native-progress {forced-color-adjust:auto;}}
