.platform-section { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
html[data-access="login"] #overview,
html[data-access="login"] #platform,
html[data-access="login"] #projects,
html[data-access="login"] #methodology { display: none; }
.auth-entry { max-width: 740px; margin: 35px auto; padding: 30px; }
.auth-entry h1 { font-size: 28px; line-height: 1.5; }
.auth-entry #login-message:empty { display: none; }
.auth-entry #login-message.error { color: var(--danger); }
.oauth-guide-link { margin-bottom: 18px; }
.safety-pill { padding: 7px 12px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); font-size: 14px; white-space: nowrap; }
.platform-policy { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 16px 20px; background: var(--surface); border-radius: 10px; font-size: 14px; color: var(--ink); }
.platform-policy > span::before { content: "✓ "; color: var(--ink); }
.platform-message { margin: 18px 0; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; font-size: 16px; overflow-wrap: anywhere; }
.platform-message.error { background: var(--surface); border-color: var(--line); color: var(--ink); }
.platform-box { padding: 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 18px; min-width: 0; }
.platform-box h3 { font-size: 21px; line-height: 1.6; margin-bottom: 8px; }
.platform-box p { font-size: 15px; color: var(--muted); line-height: 1.85; margin: 10px 0; overflow-wrap: anywhere; }
.platform-box summary { font-size: 17px; font-weight: 550; cursor: pointer; }
.platform-box[open] summary { margin-bottom: 18px; }
.platform-box label { display: flex; flex-direction: column; gap: 7px; font-size: 15px; color: var(--ink); }
.platform-box input:not([type=checkbox]), .platform-box textarea { width: 100%; min-width: 0; border: 1px solid var(--line); border-radius: 7px; padding: 11px 12px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); }
.platform-box textarea { resize: vertical; }
.platform-form { display: grid; gap: 17px; margin-top: 15px; }
.platform-form .consent-label { display: flex; flex-direction: row; align-items: flex-start; font-size: 14px; line-height: 1.8; }
.consent-label input { margin-top: 6px; width: 18px; height: 18px; flex-shrink: 0; }
.platform-columns { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.primary-button { background: var(--surface); color: var(--ink); border-color: var(--line); }
.primary-button:hover { background: var(--surface); color: var(--ink); }
.platform-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 15px 0; }
.approval-steps { padding-left: 22px; line-height: 2.1; color: var(--ink); }
.platform-box .platform-warning { color: var(--ink); background: var(--surface); padding: 12px; border-radius: 7px; }
.platform-connection { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 18px; }
#connection-status { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; }
#connection-status span { padding: 5px 8px; border-radius: 5px; background: var(--surface); }
.platform-section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.proposal { border: 1px solid var(--line); border-radius: 9px; margin-top: 18px; padding: 20px; }
.proposal-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; flex-wrap: wrap; }
.proposal-header h4 { font-size: 18px; }
.proposal-state { font-size: 14px; background: var(--surface); border-radius: 5px; padding: 4px 7px; }
.proposal-state[data-state="uncertain"], .proposal-state[data-state="partial"], .proposal-state[data-state="conflict"] { background: var(--surface); color: var(--ink); }
.proposal-meta { font-size: 14px; color: var(--ink); }
.change-list { display: grid; gap: 12px; margin: 16px 0; }
.change-row { padding: 14px; background: var(--surface); border-radius: 7px; }
.change-row > strong { display: block; margin-bottom: 7px; }
.change-dates { display: flex; flex-wrap: wrap; gap: 10px; font-size: 16px; }
.change-dates del { color: var(--ink); text-decoration-thickness: 1px; }
.change-dates ins { color: var(--ink); text-decoration: none; font-weight: 550; }
.change-row p { font-size: 15px; white-space: pre-wrap; }
.change-row a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.proposal-confirm { max-width: 440px; }
.proposal pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 12px; background: var(--surface); font-size: 14px; border-radius: 7px; }
.platform-audit-row { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.platform-audit-row code { font-size: 14px; }
.platform-roadmap { padding-left: 22px; line-height: 1.9; font-size: 16px; }
.platform-roadmap li { margin: 10px 0; }
#platform-login { display: grid; gap: 14px; }
#platform-login label { max-width: 620px; }
#platform-login button { justify-self: start; }
/* The operating console shares the sky-blue glass material. */
.platform-box { background-color: var(--surface); background-image: var(--glass-highlight); border-top-color: rgb(255 255 255 / 96%); box-shadow: var(--glass-shadow); }
.platform-box h3 { color: var(--ink); font-weight: 550; letter-spacing: -.3px; }
.platform-box p, .platform-box label, .proposal-meta, .approval-steps, .platform-roadmap, .platform-audit-row { color: var(--muted); }
.platform-box summary { color: var(--ink); }
.safety-pill { color: #236c7f; background: #e0f2f6; border-color: #afd5df; border-radius: 7px; }
.platform-policy { background: linear-gradient(110deg, rgb(205 234 255 / 75%), rgb(223 244 238 / 67%)); border: 1px solid #b9d9e9; color: #3b6980; }
.platform-policy strong, .platform-policy > span::before { color: #287288; }
.platform-message { background: rgb(226 241 255 / 70%); border-color: #bddbf1; color: #325d7d; }
.platform-message.error { background: #fff0e9; border: 1px dashed #d4a08e; border-left: 3px solid #ba735f; color: var(--danger); }
.platform-message.error::before { content: "! "; font-weight: 700; }
.platform-box input:not([type=checkbox]), .platform-box textarea { color: var(--ink); background: rgb(255 255 255 / 78%); border-color: var(--line-strong); box-shadow: inset 0 1px 8px rgb(101 153 198 / 4%); }
.platform-box input::placeholder, .platform-box textarea::placeholder { color: #5c7288; opacity: 1; }
.primary-button { background: linear-gradient(125deg, #1478b9, #0d71b0); color: #fff; border-color: #1478b9; font-weight: 600; box-shadow: 0 4px 14px rgb(28 121 183 / 14%); }
.primary-button:hover { background: #1067a4; color: #fff; border-color: #1067a4; }
.primary-button:disabled { background: #dce7f0; color: #607a91; border-color: #c0d3e3; opacity: 1; }
.platform-box .platform-warning { background: #fff4e5; color: #875e27; border-left: 2px solid #d8b473; }
#connection-status span { color: #35617d; background: rgb(224 240 253 / 82%); border: 1px solid #c3dced; }
.proposal { background: rgb(242 247 255 / 62%); border-color: #bed5ed; box-shadow: inset 0 1px 0 rgb(255 255 255 / 80%); }
.proposal-state { background: #eee9fa; color: #6c518b; border: 1px solid #cdbde4; }
.proposal-state[data-state="approved"] { background: #e1f0ff; color: #266694; border-color: #b7d7ed; }
.proposal-state[data-state="applied"] { background: #e3f4eb; color: var(--success); border-color: #b7d9c9; }
.proposal-state[data-state="uncertain"], .proposal-state[data-state="partial"], .proposal-state[data-state="conflict"] {
  background: repeating-linear-gradient(135deg, #fff3e9 0 5px, #f9e5d6 5px 10px); border: 1px dashed #c99976; color: #88592c;
}
.change-row { background: rgb(255 255 255 / 68%); border: 1px solid var(--line); }
.change-dates del { color: #816d6c; }
.change-dates ins { color: #246c58; background: #e6f5ee; padding: 1px 5px; border-radius: 3px; }
.change-row a { color: #276d9e; }
.proposal pre { color: #365b78; background: #eaf3fc; border: 1px solid #c7ddec; }
.platform-roadmap strong, .platform-audit-row strong { color: #355775; }
.platform-box .recommend-source, .platform-box .proposal-source {
  padding: 11px 13px; margin: 0; background: #e8f3fe; border: 1px solid #c2ddef;
  border-radius: 7px; color: #315f80; font-size: 14px;
}
.platform-box .proposal-source { margin: 12px 0; }
.proposal[data-source-mode="snapshot"] { border-color: #cbbce0; }
.proposal-state[data-state="preview"] { color: #70518e; background: #f0eafb; border-color: #cab8df; }
.platform-box .proposal-readonly { padding: 12px; border-radius: 7px; background: #f2edf9; color: #69537e; }
.admin-user-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 15px 0; border-bottom: 1px solid var(--line); }
.admin-user-row small { display: block; color: var(--muted); font-size: 14px; }
.admin-user-row .platform-actions { margin: 0; }
#admin-users { margin: 18px 0 28px; }
#sso-login { margin: 8px 0; }
#emergency-login { margin: 14px 0; }
#emergency-login summary { cursor: pointer; }

@media (max-width: 900px) {
  .platform-columns { grid-template-columns: minmax(0, 1fr); gap: 0; }
}
@media (max-width: 700px) {
  .platform-box { padding: 18px; }
  .proposal { padding: 15px; }
  .platform-connection { align-items: flex-start; flex-direction: column; }
  .platform-policy { padding: 14px; }
}
@media (max-width: 480px) {
  .sidebar { flex-wrap: wrap; justify-content: center; }
  .sidebar .brand { margin-right: auto; }
  .sidebar nav { gap: 0; }
  .sidebar .nav-link { min-width: 32px; padding: 6px; }
}
@media print { .platform-section { display: none; } }

/* Persistent project chat, with explicit send / accepted / processing states. */
.chat-shell { padding: 0; overflow: hidden; }
.chat-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 260px) auto; align-items: end; gap: 22px; padding: 24px; border-bottom: 1px solid var(--line); }
.chat-toolbar > div { min-width: 0; }
.chat-toolbar h3, .chat-toolbar p { margin: 0; }
.chat-toolbar label { min-width: 0; }
.chat-toolbar select { width: 100%; }
.chat-shell > .recommend-source { border-radius: 0; border-width: 0 0 1px; }
.chat-log { height: 610px; min-height: 360px; overflow-y: auto; overscroll-behavior: contain; padding: 24px; background: linear-gradient(140deg, #f6fbff, #eef6ff 60%, #f5f2fb); }
.chat-turn { margin-bottom: 28px; }
.chat-message { display: flex; align-items: flex-start; gap: 12px; margin: 14px 0; }
.chat-role { flex-shrink: 0; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: #dfeefc; font-size: 11px; font-weight: 700; color: #285a80; }
.chat-bubble { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px 20px; border: 1px solid #d2e1ee; border-radius: 4px 18px 18px; background: #fff; font-size: 16px; line-height: 1.9; }
.chat-user { flex-direction: row-reverse; margin-left: 12%; }
.chat-user .chat-bubble { background: #e1efff; border-color: #bad5f0; border-radius: 18px 4px 18px 18px; }
.chat-answer { min-width: 0; flex: 1; }
.chat-provenance { display: block; color: var(--muted); margin: 9px 4px; font-size: 12px; }
.chat-wait { padding: 18px; color: #35617d; border: 1px dashed #a8cbe3; border-radius: 14px; background: #f7fbff; }
.chat-wait small { display: block; margin: 10px 0 0 28px; line-height: 1.7; }
.chat-spinner { display: inline-block; width: 16px; height: 16px; margin-right: 10px; border: 2px solid #cee2f2; border-top-color: #237eb9; border-radius: 50%; animation: chat-spin 1s linear infinite; vertical-align: middle; }
@keyframes chat-spin { to { transform: rotate(360deg); } }
.chat-error { border: 1px dashed #d1a68d; padding: 18px; border-radius: 12px; background: #fff3ec; color: #874b35; }
.chat-empty { text-align: center; padding: 90px 20px; color: var(--muted); }
.chat-empty > span { font-size: 40px; color: #2886b9; }
.chat-empty h4 { margin: 14px 0; font-size: 21px; color: var(--ink); }
.chat-composer { padding: 20px 24px; border-top: 1px solid var(--line); background: #f8fcff; }
.chat-composer textarea { border-radius: 12px !important; }
.chat-composer-footer { display: flex; align-items: center; gap: 20px; margin-top: 14px; }
.chat-composer-footer .consent-label { flex: 1; flex-direction: row; align-items: flex-start; font-size: 13px; line-height: 1.7; }
.chat-composer-footer .button { flex-shrink: 0; min-width: 154px; }
.chat-shell .chat-hint { font-size: 12px; margin-bottom: 0; }
.chat-shell #chat-network:not(:empty) { padding: 12px 24px; color: #874b35; background: #fff3ec; margin: 0; }
.chat-suggestions { margin-top: 16px; }
.chat-suggestions summary { font-size: 14px; }
.chat-answer .proposal { margin-top: 18px; background: #fff; border: 1px solid #90bfdf; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
/* Code-native recreation of ptucore.png; no runtime network calls. */
.ecosystem-section { padding: 22px; border: 1px solid #b8d7e9; border-radius: 20px; background: linear-gradient(120deg, #f7fcff, #e7f3ff 55%, #f4f1fd); margin-bottom: 32px; box-shadow: var(--glass-shadow); }
.ecosystem-section h2 { font-size: 24px; }
.ecosystem-scroll { overflow-x: auto; }
#ecosystem-map { position: relative; min-width: 760px; height: 510px; isolation: isolate; }
.ecosystem-lines { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.ecosystem-lines line { stroke: #91b3cb; stroke-width: 1.4; }
.map-avocado { position: absolute; left: 32%; top: 32%; width: 36%; height: 31%; border: 1px dashed #6baa8b; border-radius: 24px; background: #e8f5ebc4; z-index: -1; }
.map-avocado-link { display: block; margin: 6px auto 0; padding: 4px 12px; border: 1px solid transparent; border-radius: 999px; background: none; font: inherit; font-size: 11px; color: #346b50; cursor: pointer; }
.map-avocado-link::after { content: ' ↗'; }
.map-avocado-link:hover, .map-avocado-link:focus-visible, .map-avocado-link.map-selected { border-color: #6baa8b; background: #fffc; outline: none; }
.map-node[data-project]::after { content: '↗'; position: absolute; top: 7px; right: 10px; font-size: 12px; opacity: .55; }
.map-node[data-project]:hover::after, .map-node[data-project]:focus-visible::after { opacity: 1; }
.map-node { position: absolute; transform: translate(-50%, -50%); width: 166px; min-height: 62px; padding: 12px; border: 1px solid #abcadf; border-radius: 12px; cursor: pointer; background: #edf7ff; color: #224f6c; box-shadow: 0 5px 15px #5988ad16; transition: box-shadow .15s, border-color .15s; font: inherit; }
.map-node strong { display: block; font-size: 15px; }
.map-node small { display: block; font-size: 10px; margin-top: 6px; }
.map-gold { background: linear-gradient(125deg,#fff3d2,#ffe2a0); border-color: #d9ac52; color: #64471b; }
.map-purple { background: linear-gradient(125deg,#f3eaff,#e3d3fd); border-color: #b89bd9; color: #5e417f; }
.map-green { background: linear-gradient(125deg,#e9faef,#c9efd9); border-color: #8dc7a6; color: #306848; }
.map-coral { background: linear-gradient(125deg,#fff0e9,#f6d9cb); border-color: #d8b09d; color: #7c5140; }
.map-node[data-node=kbc] { width: 205px; min-height: 91px; }
.map-node[data-node=kbc] strong { font-size: 30px; letter-spacing: 1px; }
.map-node[data-node=live], .map-node[data-node=operator] { width: 300px; min-height: 48px; }
.map-node:hover, .map-node:focus-visible, .map-node.map-selected { border-color: #256f9c; box-shadow: 0 0 0 3px #5ba4d225, 0 8px 22px #5988ad30; outline: none; }
.ecosystem-description { min-height: 54px; padding: 14px 18px; border: 1px solid #bfd8e8; border-radius: 12px; color: #335972; font-size: 14px; line-height: 1.8; background: #ffffffb5; }
@media (max-width: 700px) {
  .chat-log { height: 530px; padding: 12px; }
  .chat-toolbar, .chat-composer { padding: 16px; }
  .chat-composer-footer { align-items: stretch; flex-direction: column; gap: 12px; }
  .chat-user { margin-left: 5%; }
  .chat-role { width: 28px; height: 28px; font-size: 9px; }
  .chat-message { gap: 7px; }
  .ecosystem-section { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { .chat-spinner { animation: none; } .map-node { transition: none; } }

/* Control placement: stable baselines, safe wrapping and reachable local feedback. */
html { scroll-padding-top: calc(var(--navigation-height, 0px) + 24px); }
.platform-section .button { max-width: 100%; white-space: normal; word-break: keep-all; overflow-wrap: anywhere; text-align: center; }
.platform-connection { align-items: flex-start; }
.platform-connection > div { min-width: 0; }
.platform-connection > .button { flex-shrink: 0; }
#connection-status span { min-width: 0; overflow-wrap: anywhere; }
.admin-user-row > div { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.platform-form > .button { justify-self: start; }
.audit-toolbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 20px; margin: 18px 0; }
.audit-toolbar p { margin: 0; }
.chat-composer-footer .button { width: 174px; min-height: 46px; }
.chat-composer-footer .consent-label { min-height: 46px; align-items: center; }
.chat-composer-footer .consent-label input { margin-top: 0; }
.proposal .proposal-feedback { padding: 12px 14px; margin: 12px 0 0; border-radius: 8px; border: 1px solid #b8d6e8; background: #eaf5ff; color: #315e7c; font-size: 14px; }
.proposal-feedback:empty { display: none; }
.proposal .proposal-feedback[data-state="error"] { background: #fff0e9; border-style: dashed; border-color: #d4a08e; color: #874b35; }
.proposal .proposal-feedback[data-state="pending"] { border-style: dashed; }
@media (max-width: 900px) {
  .chat-toolbar { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
  .chat-toolbar > div { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .chat-composer-footer .button { width: 100%; }
}
@media (max-width: 480px) {
  .chat-toolbar { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .chat-toolbar > .button { width: 100%; }
  .proposal .platform-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .proposal .platform-actions > .button { width: 100%; }
  .sidebar nav { gap: 4px; }
  .sidebar .nav-link { min-width: 44px; min-height: 44px; }
  .platform-section .safety-pill { max-width: 100%; white-space: normal; }
}
