/* PortalByte "One Space" page, built from the ORBIT kit release (orbit-portal-unified.html): bridge header, intro, a chat surface
   with an avatar transcript and the kit's composer, and a column of numbered surface cards. Loaded last, so it only overrides.
   Rectangular frames with a single L mark and a hatch texture, copper for interaction, scene visible through translucent alpha fills
   (never `opacity`), 10px tracked captions. The apps' own UIs are not recreated here: each surface only links out to its app. */
:root { --pk-line: #92b8c068; --pk-eyebrow: #80b4c0; --pk-quiet: #91aeb3; --pk-ink: #e6f1f4; --pk-copper: #c8a487; --pk-fill-a: 0.9; --pk-fill-b: 0.9; }
:root.has-scene { --pk-fill-a: 0.78; --pk-fill-b: 0.8; }
:root[data-theme="light"] { --pk-line: #4d7a8c66; --pk-eyebrow: #2d6f87; --pk-quiet: #4a6978; --pk-ink: #0e2230; --pk-copper: #8a5e3c; }
.chat-status { margin: 0; padding: 2px 10px; color: var(--pk-quiet); font-size: 12px; }

.eyebrow, .surface-kicker, .aw-index, .surface-count, .speaker, .preview-label, .portal-domains > span { text-transform: uppercase; font-weight: 700; }
.eyebrow { margin: 0; font-size: 10px; letter-spacing: 0.14em; color: var(--pk-eyebrow); }
.login-context { margin: 0; padding: 10px 12px; border-left: 2px solid var(--pk-copper); color: var(--pk-quiet); background: rgba(128, 180, 192, 0.08); font-size: 13px; line-height: 1.5; }
:root[data-theme="light"] .login-context { background: rgba(45, 111, 135, 0.08); }

/* ---- bridge header ---- */
.top { height: 74px; padding: 0 4.5%; gap: 34px; justify-content: flex-start; background-color: rgba(6, 23, 33, 0.93); border-bottom: 1px solid #90bac433; }
:root.has-scene .top { background-color: rgba(6, 23, 33, 0.7); }
:root[data-theme="light"] .top { background-color: rgba(240, 247, 251, 0.92); }
.top h1 .wordmark { height: 2.2rem; }
.bridge-location { display: flex; align-items: center; gap: 15px; flex: 1; min-width: 0; }
.bridge-location .divider { height: 18px; width: 1px; background: #60808c; }
.bridge-location strong { font-size: 12px; font-weight: 600; color: var(--pk-ink); }
.top-actions { margin-left: auto; gap: 7px; }
.top button, .top button:hover:not(:disabled), .top button:active { clip-path: none; border-radius: 0; filter: none; transform: none; min-height: 36px; padding: 0 13px; font-size: 11px; font-weight: 400;
  letter-spacing: 0.04em; color: #bed0d7; background: #0d2733bd; border: 1px solid #84b5c044; box-shadow: none; }
.top button::before, .top button::after { display: none; }
.top button:hover:not(:disabled) { border-color: var(--pk-copper); color: #f7e7d7; }
.top button[aria-pressed="true"]#motion-toggle { color: #ead7c6; border-color: #bb9d8666; background: #755b4730; }
:root[data-theme="light"] .top button, :root[data-theme="light"] .top button:hover:not(:disabled) { color: #24495b; background: rgba(255, 255, 255, 0.7); border-color: #4d7a8c66; }

/* ---- intro ---- */
:root[data-theme="light"] body::before {
  z-index: 1;
  background: linear-gradient(180deg, rgba(240, 247, 251, 0.96) 0, rgba(240, 247, 251, 0.9) 230px, rgba(240, 247, 251, 0.42) 360px, transparent 500px),
    linear-gradient(0deg, var(--bg) 0%, transparent 55%);
}
.aw-intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 26px 4.5% 16px; }
.aw-intro h2 { margin: 8px 0 4px; font-size: clamp(28px, 3vw, 40px); line-height: 1.1; letter-spacing: -0.04em; font-weight: 600; color: var(--pk-ink); }
.aw-intro p:not(.eyebrow) { margin: 0; font-size: 13px; color: var(--pk-quiet); }
.aw-intro > span, .aw-index { font-size: 9px; letter-spacing: 0.1em; color: var(--pk-quiet); white-space: nowrap; }
[data-layout="book"] .aw-intro, [data-layout="tabletop"] .aw-intro { display: none; }
@media (max-height: 759px) { .aw-intro { display: none; } }
@media (max-width: 700px) { .aw-intro > span { display: none; } }

/* ---- the page frame ---- */
[data-layout="medium"] .layout, [data-layout="expanded"] .layout { padding-inline: 4.5%; padding-bottom: 14px; }

/* a surface is a rectangle with a hairline border, one L mark top-left and the engraved hatch (the kit's .aw-surface) */
.chat, .surface { position: relative; border: 1px solid var(--pk-line); border-radius: 0; clip-path: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  background-color: transparent;
  background-image: repeating-linear-gradient(135deg, #c5e0e606 0 1px, transparent 1px 5px), linear-gradient(130deg, rgba(32, 60, 72, var(--pk-fill-a)), rgba(11, 32, 44, var(--pk-fill-b))); }
:root[data-theme="light"] .chat, :root[data-theme="light"] .surface {
  background-image: repeating-linear-gradient(135deg, #2d6f870a 0 1px, transparent 1px 5px), linear-gradient(130deg, rgba(255, 255, 255, 0.82), rgba(226, 238, 245, 0.84)); }
.chat::before, .surface::before { content: ""; position: absolute; z-index: 4; top: 7px; left: 7px; right: auto; width: 26px; height: 15px; background: none; box-shadow: none;
  border: 0; border-top: 1px solid #a9cbd4a0; border-left: 1px solid #a9cbd4a0; pointer-events: none; }
:root[data-theme="light"] .chat::before, :root[data-theme="light"] .surface::before { border-color: #2d6f87a0; }
.chat::after, .surface::after { display: none; }
.panel { background: none; border: 0; clip-path: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; overflow: visible; }
.panel::before, .panel::after { display: none; }
.panel-head { padding: 0 0 8px; background: none; border: 0; min-height: 0; }
.panel-head h2 { margin: 0; font-size: 10px; letter-spacing: 0.14em; color: var(--pk-eyebrow); }
.panel-body { padding: 0 4px 12px 0; }

/* The optional third rail has a fixed narrow track. Keep descriptive heading and refresh text readable without stacking them. */
.rail > .panel-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.rail > .panel-head h2 { min-width: 0; white-space: nowrap; }
.rail > .panel-head button { min-height: 44px; padding-inline: 8px; font-size: 11px; white-space: nowrap; }

/* surface card: kicker, title, index, preview, then results */
.surface-head { padding: 20px 20px 0 22px; align-items: flex-start; border-bottom: 0; }
.surface:not(.collapsed) > .surface-head { border-bottom: 0; }
.surface-kicker { font-size: 10px; letter-spacing: 0.14em; color: var(--pk-eyebrow); }
.surface-name { margin: 7px 0 4px; font-size: 17px; font-weight: 600; color: var(--pk-ink); }
.surface-count { font-size: 9px; letter-spacing: 0.1em; color: var(--pk-quiet); padding-top: 4px; }
.surface-actions { padding-top: 0; }
.surface-open { font-size: 10px; letter-spacing: 0.04em; text-transform: none; color: #d6bca9; background: #7e614a24; border: 1px solid #b89c864f; padding: 6px 9px; min-height: 0; }
:root[data-theme="light"] .surface-open { color: #6b4527; }
.surface-open:hover { border-color: var(--pk-copper); color: #f5e5d8; }
.surface-btn { color: var(--pk-quiet); }
.surface-body { padding: 14px 20px 20px 22px; }
.surface-preview { position: relative; z-index: 2; padding: 10px 22px 20px; }
.surface-preview[hidden] { display: none; }
.preview-label { margin: 0 0 8px; font-size: 9px; letter-spacing: 0.12em; color: #8cb8bf; }
:root[data-theme="light"] .preview-label { color: var(--pk-eyebrow); }
.preview-text { margin: 0; font-size: 11px; line-height: 1.55; color: #a9bfc2; }
:root[data-theme="light"] .preview-text { color: var(--pk-quiet); }
.surface.collapsed > .surface-head { padding-bottom: 14px; }
.surface .pitem { clip-path: none; border-color: #82a8af38; }

/* ---- chat surface ---- */
.chat > .aw-heading { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; padding: 20px 20px 4px 24px; }
.chat > .aw-heading h3 { margin: 7px 0 4px; font-size: 17px; font-weight: 600; color: var(--pk-ink); }
[data-layout="compact"] .chat > .aw-heading { display: none; }
.log { padding: 12px 24px; gap: 18px; }
[data-layout="compact"] .log { padding: 12px 14px; }

/* transcript: avatar + tracked speaker line, no bubbles (the kit's .chat-message) */
.msg:not(.error) { position: relative; max-width: 100%; min-height: 31px; padding: 0 0 0 43px; background: none; border: 0; border-radius: 0; clip-path: none; box-shadow: none; }
.msg:not(.error)::before { display: block; margin-bottom: 5px; font-size: 9px; font-weight: 700; letter-spacing: 0.12em; color: #95bac1; }
.msg:not(.error)::after { position: absolute; top: 0; left: 0; width: 31px; height: 31px; display: grid; place-items: center; box-sizing: border-box;
  background: #1b424e; border: 1px solid #8fb5bf6b; color: #cce1e1; }
.msg.assistant::before { content: "ORBIT / ASSISTANT"; }
.msg.assistant::after { content: "\25C8"; }
.msg.user { align-self: flex-end; max-width: 80%; padding: 0 43px 0 0; }
.msg.user::before { content: "YOU"; text-align: right; color: #d8b99f; }
.msg.user::after { content: "\25C9"; left: auto; right: 0; background: #614d3f; border-color: #be9b80; color: #f0dfd0; }
.msg.user > * { text-align: left; }
:root[data-theme="light"] .msg:not(.error)::before { color: var(--pk-eyebrow); }
:root[data-theme="light"] .msg.user::before { color: #7a5230; }
:root[data-theme="light"] .msg:not(.error)::after { background: #d6e8f0; border-color: #4d7a8c80; color: #24495b; }
:root[data-theme="light"] .msg.user::after { background: #efdfd0; border-color: #8a5e3c; color: #5d3b20; }
[data-layout="compact"] .msg.user { max-width: 94%; }

.hint.welcome { display: flex; align-items: flex-start; gap: 12px; color: var(--text); }
.hint.welcome .avatar { width: 31px; height: 31px; display: grid; place-items: center; flex: none; background: #1b424e; border: 1px solid #8fb5bf6b; color: #cce1e1; }
:root[data-theme="light"] .hint.welcome .avatar { background: #d6e8f0; border-color: #4d7a8c80; color: #24495b; }
.welcome-body { min-width: 0; }
.speaker { font-size: 9px; letter-spacing: 0.12em; color: #95bac1; }
.speaker span { color: #6f96a0; }
:root[data-theme="light"] .speaker { color: var(--pk-eyebrow); }
.welcome-body > p { margin: 6px 0 12px; font-size: 13px; color: var(--pk-ink); }
.portal-domains { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.portal-domains > span { margin-right: 4px; font-size: 9px; letter-spacing: 0.12em; color: #7f9ca5; }
.starter-prompts { display: flex; flex-wrap: wrap; gap: 7px; }
.portal-domains button, .starter-prompts button { min-height: 2.25rem; padding: 8px 10px; border-radius: 0; clip-path: none; font-size: 11px; font-weight: 400; color: #c5dadd; background: #183b47a8; border: 1px solid #7ba5ad4d; }
.portal-domains button:hover:not(:disabled), .starter-prompts button:hover:not(:disabled) { border-color: var(--pk-copper); color: #f5e5d8; }
:root[data-theme="light"] .portal-domains button, :root[data-theme="light"] .starter-prompts button { color: #24495b; background: rgba(255, 255, 255, 0.7); border-color: #4d7a8c66; }

/* ---- composer: label, one bordered line (mark, text, Send), caption ---- */
.composer { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 0; row-gap: 8px; padding: 14px 24px 16px; border-top: 1px solid #85aab533; background-color: rgba(8, 31, 42, 0.72); }
:root.has-scene .composer { background-color: rgba(8, 31, 42, 0.62); }
:root[data-theme="light"] .composer { background-color: rgba(240, 247, 251, 0.8); }
.composer-label { grid-area: 1 / 1 / 2 / -1; font-size: 10px; color: #a9c3c8; }
:root[data-theme="light"] .composer-label { color: var(--pk-quiet); }
.composer::before { content: "\2727"; grid-area: 2 / 1 / 3 / -1; align-self: stretch; display: flex; align-items: center; padding-left: 11px; border: 1px solid #82aeb961; background: #071d28; color: #9fb8bd; pointer-events: none; }
:root[data-theme="light"] .composer::before { background: rgba(255, 255, 255, 0.9); border-color: #4d7a8c80; color: var(--pk-quiet); }
.composer:focus-within::before { outline: 2px solid #d2b79c; outline-offset: 2px; }
.composer textarea { grid-area: 2 / 1 / 3 / 3; position: relative; margin: 0 0 0 36px; width: auto; max-height: 8rem; padding: 12px 8px 12px 0; border: 0; border-radius: 0; background: none; box-shadow: none; outline: none; color: var(--pk-ink); }
.composer textarea:focus { box-shadow: none; border: 0; }
.composer-buttons { grid-area: 2 / 3 / 3 / 4; position: relative; padding: 6px 7px; }
.composer-buttons button { min-height: 44px; clip-path: none; border-radius: 0; font-size: 11px; font-weight: 400; background: #0d2733bd; border: 1px solid #84b5c044; color: #bed0d7; filter: none; transform: none; box-shadow: none; }
.composer-buttons button::before, .composer-buttons button::after { display: none; }
.composer-buttons button.primary, .composer-buttons button.primary:hover:not(:disabled) { padding: 0 16px; font-weight: 600; color: #1b120b; border: 1px solid var(--pk-copper); background: linear-gradient(110deg, #aa8568, #9e775b); filter: none; }
.composer-buttons button.primary:hover:not(:disabled) { filter: brightness(1.1); }
.composer-buttons button[aria-pressed="true"]:not(.primary) { color: #ead7c6; border-color: #bb9d8666; background: #755b4730; }
:root[data-theme="light"] .composer-buttons button:not(.primary) { color: #24495b; background: rgba(255, 255, 255, 0.7); }
.voice-status { grid-column: 1 / -1; margin: 0; }
.voice-status:empty { display: none; }
.composer-caption { grid-column: 1 / -1; margin: 0; font-size: 10px; color: #88a3a9; }
:root[data-theme="light"] .composer-caption { color: var(--pk-quiet); }
@media (max-width: 520px) {
  .composer { padding: 10px 12px 12px; }
  .composer textarea { grid-area: 2 / 1 / 3 / -1; }
  .composer-buttons { grid-area: 3 / 1 / 4 / -1; justify-content: flex-end; padding: 0; }
  .composer::before { grid-area: 2 / 1 / 3 / -1; }
}
[data-layout="compact"] .composer-caption { display: none; }

/* Seven labeled workspace sectors sit between context and work panes. */
.sector-nav { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 0 4.5% 10px; border-bottom: 1px solid var(--pk-line); }
.sector-nav button { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 44px; padding: 7px 10px; border: 0; border-top: 2px solid transparent; border-radius: 0; background: transparent; color: var(--pk-quiet); font-size: 12px; font-weight: 500; }
.sector-nav button span { color: #a9cbd1; font-size: 16px; }
.sector-nav button:hover { color: var(--pk-ink); background: #536f7c24; }
.sector-nav button[aria-current="page"] { border-top-color: var(--pk-copper); color: var(--pk-ink); background: linear-gradient(90deg, #94755730, transparent); }
.sector-nav button[aria-current="page"] span { color: var(--pk-copper); }
/* Keep sector hit targets in the left/right panes when a vertical hinge splits the viewport. */
[data-layout="book"] .sector-nav { grid-template-columns: repeat(14, minmax(0, 1fr)); grid-template-rows: repeat(2, auto); }
[data-layout="book"] .sector-nav button:nth-child(1) { grid-area: 1 / 1 / 2 / 3; }
[data-layout="book"] .sector-nav button:nth-child(2) { grid-area: 1 / 3 / 2 / 5; }
[data-layout="book"] .sector-nav button:nth-child(3) { grid-area: 1 / 5 / 2 / 7; }
[data-layout="book"] .sector-nav button:nth-child(4) { grid-area: 1 / 9 / 2 / 11; }
[data-layout="book"] .sector-nav button:nth-child(5) { grid-area: 1 / 11 / 2 / 13; }
[data-layout="book"] .sector-nav button:nth-child(6) { grid-area: 2 / 1 / 3 / 4; }
[data-layout="book"] .sector-nav button:nth-child(7) { grid-area: 2 / 9 / 3 / 13; }
.results-meta { color: var(--pk-quiet); font-size: 11px; }
.surface[hidden] { display: none !important; }
.overview-content { align-content: start; min-height: 100%; padding: clamp(18px, 4vw, 38px); border: 1px solid var(--pk-line); background: linear-gradient(145deg, #203c48c4, #0b202cd1); }
.overview-content[hidden] { display: none; }
.overview-content h3 { margin: 8px 0; color: var(--pk-ink); font-size: clamp(20px, 2vw, 28px); font-weight: 550; }
.overview-content > p:not(.surface-kicker) { max-width: 42rem; color: var(--pk-quiet); line-height: 1.6; }
.overview-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.overview-links button { min-height: 56px; text-align: left; padding: 12px 14px; color: var(--pk-ink); background: #183b47a8; border: 1px solid #7ba5ad4d; }
.overview-links button:hover { border-color: var(--pk-copper); }
.workspace-state { margin: 0; color: var(--pk-quiet); font-size: 12px; }
.workspace-state.bad { color: #ffaaa2; }
:root[data-theme="light"] .rail-status.bad { color: #a3261d; }
.results-tools { display: flex; align-items: center; gap: 8px; }
.results-tools button { min-height: 44px; padding: 0 10px; font-size: 11px; background: #173744a8; color: var(--pk-ink); border: 1px solid var(--pk-line); }
.results-tools button[hidden] { display: none; }
.pitem[data-app="NewsByte"] > ul { list-style: none; display: grid; gap: 10px; padding: 0; }
.pitem[data-app="NewsByte"] > ul > li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: start; padding: 14px; border: 1px solid var(--pk-line); background: #122b38b8; color: var(--pk-ink); font-size: 15px; font-weight: 600; line-height: 1.4; }
.pitem[data-app="NewsByte"] .btn { color: #ead7c6; background: #7e614a24; border: 1px solid #b89c864f; text-decoration: none; font-size: 11px; }
.pitem[data-app="NewsByte"] .btn:hover { border-color: var(--pk-copper); color: #fff1e3; }
.pitem[data-app="NewsByte"] .story-thumb { grid-column: 1 / -1; width: 100%; max-height: 190px; object-fit: cover; }
.story-meta { color: #a6c5cb; font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.story-summary { grid-column: 1 / -1; margin: 3px 0; color: var(--pk-quiet); font-size: 12px; font-weight: 400; }
.act-btn { min-height: 44px; }
.news-state-controls { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.news-state-controls .act-btn { margin: 0; min-height: 44px; }
.news-story { margin: 12px 0; }
.news-story .act-btn { margin-inline: 0 8px; min-height: 44px; }
.news-state-status { margin: 6px 0; color: var(--pk-quiet); font-size: 12px; }
.news-state-controls .act-btn:focus-visible, .news-story .act-btn:focus-visible { outline: 2px solid var(--pk-copper); outline-offset: 2px; }
:root[data-theme="light"] .pitem[data-app="NewsByte"] > ul > li { color: #102731; background: #f7fbfbd9; }
:root[data-theme="light"] .pitem[data-app="NewsByte"] .btn { color: #173c4b; background: #ffffff; border-color: #315968; }
:root[data-theme="light"] .pitem[data-app="NewsByte"] .btn:focus-visible { outline: 2px solid #0b647d; outline-offset: 2px; }
:root[data-theme="light"] .story-meta { color: #315968; }
:root[data-theme="light"] .overview-content { background: linear-gradient(145deg, #f7fbfde8, #dceaf0ed); }
:root[data-theme="light"] .overview-links button { color: #24495b; background: rgba(255,255,255,.82); border-color: #4d7a8c80; }
@media (max-width: 700px) {
  .top button, .composer-buttons button, .surface-btn, .surface-dot, .results-tools button, .st-btn, .st-input { min-height: 44px; }
  .surface-btn, .surface-dot { min-width: 44px; width: 44px; height: 44px; }
  .aw-intro { padding: 12px 4% 9px; }
  .aw-intro h2 { margin: 4px 0 3px; font-size: 21px; }
  .aw-intro p:not(.eyebrow) { font-size: 11px; }
  .sector-nav { margin: 0 3% 7px; gap: 0; }
  .sector-nav button { flex-direction: column; gap: 1px; padding: 3px 1px; font-size: 9px; }
  .sector-nav button span { font-size: 15px; line-height: 1; }
  .panel-head { align-items: baseline; flex-wrap: wrap; }
  .overview-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 16px; }
  .overview-links button { min-height: 48px; }
}

/* the bridge from an answer to its results keeps the copper outline */
.view-results-btn { clip-path: none; }
@media (prefers-reduced-motion: reduce) { .composer-buttons button, .top button { transition: none; } }
.panel, :root.has-scene .panel { background: none !important; }
:root.has-scene .panel-head { background: none; }
.surface-open, .surface-open:hover { text-decoration: none; }
.composer textarea { font-size: 13px; line-height: 1.5; }
@media (max-width: 700px) { .bridge-location { display: none; } .top { gap: 12px; padding: 0 4%; height: 64px; } .top-actions { gap: 5px; } .top button { padding: 0 10px; }
  .top h1 .wordmark { height: 1.8rem; } }

/* ---- exchange arrows: a side panel's left arrow opens it in the main area; the main panel's right arrow sends it back ---- */
.surface .go-right, .surface.is-main .go-left, .surface.is-main .surface-btn:not(.go-right), .surface.is-main .surface-dot { display: none; }
.surface.is-main .go-right { display: inline-block; }
[data-layout="compact"] .go-left, [data-layout="compact"] .go-right { display: none !important; }
.surface-btn.go-left, .surface-btn.go-right { color: #d6bca9; }
.surface-btn.go-left:hover, .surface-btn.go-right:hover { border-color: var(--pk-copper); }
.chat.holds-surface > .aw-heading, .chat.holds-surface > .log-wrap, .chat.holds-surface > .composer, .chat.holds-surface > .jump-latest { display: none; }
.main-host { flex: 1; min-height: 0; overflow-y: auto; position: relative; z-index: 2; overscroll-behavior: contain; }
.main-host[hidden] { display: none; }
.main-host .surface { border: 0; background: none; min-height: 100%; }
.main-host .surface::before { display: none; }
.main-host .surface-head { padding: 22px 24px 4px; }
.main-host .surface-body { padding: 14px 24px 24px; gap: 14px; }
.main-host .surface-name { font-size: 22px; }
/* full features, wider: more photo columns, a taller map, a bigger reading pane */
@container chat (min-width: 34rem) { .main-host .grid { grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); } }
.main-host .map-stage { aspect-ratio: 16 / 10; max-height: 70vh; }
.main-host .reader-text { max-height: none; min-height: 45vh; font-size: 1.0625rem; line-height: 1.75; }
.chat-card .preview-text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.chat-card .surface-preview small { color: var(--pk-quiet); font-size: 10px; }
.reader-nav button { border-radius: 0; clip-path: none; min-height: 2.75rem; font-size: 12px; background: #0d2733bd; border: 1px solid #84b5c044; color: #bed0d7; }
.reader-nav button.primary { color: #1b120b; font-weight: 600; border-color: var(--pk-copper); background: linear-gradient(110deg, #aa8568, #9e775b); }
.reader-nav button:disabled { opacity: 0.4; }

/* ---- surface controls: the section's own search, filters and forms (js/surface-tools.js) ---- */
.surface-tools { position: relative; z-index: 2; display: grid; gap: 10px; padding: 10px 20px 4px 22px; }
.surface-tools[hidden] { display: none; }
.main-host .surface-tools { padding-inline: 24px; }
.st-form { display: grid; gap: 8px; }
.st-search { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.st-search .st-field:first-child { grid-column: 1; }
.st-search .st-row { grid-column: 1 / -1; }
.st-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.st-row > .st-field { flex: 1 1 8rem; }
.st-field { display: grid; gap: 4px; min-width: 0; }
.st-label { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700; color: var(--pk-quiet); }
.st-input { width: 100%; min-height: 2.5rem; padding: 8px 10px; color: var(--pk-ink); font-size: 13px; background: #071d28; border: 1px solid #82aeb961; border-radius: 0; box-shadow: none; }
.st-input[aria-invalid="true"] { border-color: var(--danger, #ff9a90); }
textarea.st-input { resize: vertical; min-height: 5rem; }
.st-input:focus-visible { outline: 2px solid #d2b79c; outline-offset: 2px; }
.st-swap { justify-self: start; }
:root[data-theme="light"] .st-input { background: rgba(255, 255, 255, 0.92); border-color: #4d7a8c80; }
.st-btn { min-height: 2.5rem; padding: 0 14px; font-size: 11px; font-weight: 400; border-radius: 0; clip-path: none; color: #bed0d7; background: #0d2733bd; border: 1px solid #84b5c044; }
.st-btn:hover:not(:disabled) { border-color: var(--pk-copper); color: #f7e7d7; }
.st-btn.st-primary { color: #1b120b; font-weight: 600; border-color: var(--pk-copper); background: linear-gradient(110deg, #aa8568, #9e775b); }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chip[aria-pressed="true"] { color: #ead7c6; border-color: #bb9d8666; background: #755b4730; }
:root[data-theme="light"] .st-btn:not(.st-primary) { color: #24495b; background: rgba(255, 255, 255, 0.75); }
.st-more-details > summary { cursor: pointer; min-height: 2.25rem; display: flex; align-items: center; font-size: 11px; letter-spacing: 0.06em; color: #d6bca9; }
:root[data-theme="light"] .st-more-details > summary { color: #6b4527; }
.st-more-details[open] > summary { margin-bottom: 8px; }
.st-hint { margin: 0; font-size: 10px; color: var(--pk-quiet); }
.st-status { margin: 0; min-height: 0; font-size: 11px; color: var(--pk-quiet); }
.st-status:empty { display: none; }
.st-status.st-bad { color: var(--danger, #ff9a90); }
.st-busy { opacity: 0.85; }
.st-more[hidden] { display: none; }
.act-btn { margin-inline-start: 0.5rem; min-height: 2rem; padding: 0 10px; font-size: 11px; font-weight: 600; border-radius: 0; clip-path: none; color: #d6bca9; background: #7e614a24; border: 1px solid #b89c864f; }
.act-btn:hover:not(:disabled) { border-color: var(--pk-copper); color: #f5e5d8; }
.grid .cell { display: grid; gap: 4px; min-width: 0; }
.grid .cell .act-btn { margin: 0; aspect-ratio: auto; min-height: 2rem; white-space: normal; line-height: 1.2; padding: 4px 6px; }
.pitem li { padding: 4px 0; }

@media (max-width: 900px) {
  .st-search { grid-template-columns: minmax(0, 1fr); }
  .st-search > .st-btn { width: 100%; }
}

/* Keep interactive controls at a 44px hit size on touch-first devices, including tablet widths. */
@media (pointer: coarse) {
  .portal-domains button, .starter-prompts button, .act-btn, .grid .cell .act-btn, .surface-open, .surface-btn, .surface-dot, .view-results-btn,
  .a2ui .a2-btn, .a2ui .a2-chip, .a2ui .a2-tab, .a2ui .a2-check, .a2ui .a2-option, .a2ui .a2-range, .a2-close,
  .st-input, .st-btn, .st-more-details > summary { min-height: 44px; }
  .surface-btn, .surface-dot, .a2-close { min-width: 44px; width: 44px; height: 44px; }
}

/* ORBIT exchange workspace: both columns remain present; only the main component exposes app controls. */
.app > .aw-intro { padding-top: 18px; }
.workspace-brand { margin: 0 0 4px; line-height: 1; }
.workspace-brand { display: flex; }
.workspace-brand .wordmark { width: auto; height: 28px; }
.panel-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.panel-head > div:first-child { min-width: 0; }
.panel-head h2 { font-size: 12px; letter-spacing: .12em; }
.results-meta { margin: 5px 0 0; line-height: 1.45; }
.workspace-utilities { position: relative; flex: none; z-index: 8; }
.workspace-utilities > summary { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid var(--pk-line); color: var(--pk-ink); cursor: pointer; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.workspace-utilities[open] > summary { border-color: var(--pk-copper); }
.workspace-utility-menu { position: absolute; top: calc(100% + 4px); right: 0; display: grid; min-width: 11rem; padding: 6px; border: 1px solid var(--pk-line); background: #0b202c; box-shadow: 0 10px 28px #0008; }
:root[data-theme="light"] .workspace-utility-menu { background: #f2f7f9; box-shadow: 0 10px 28px #17324035; }
.workspace-utility-menu button { min-height: 44px; text-align: left; }
.surface.preview-surface { min-width: 0; }
.preview-surface:not(.is-main) { padding-bottom: 10px; }
.preview-surface:not(.is-main) .surface-head { padding: 12px 14px 0; align-items: center; }
.preview-surface:not(.is-main) .surface-titles { flex-basis: 7rem; }
.preview-surface:not(.is-main) .surface-name { margin: 3px 0; font-size: 14px; }
.preview-surface:not(.is-main) .surface-count { display: none; }
.preview-surface:not(.is-main) .surface-preview { padding: 7px 14px 0; }
.preview-surface:not(.is-main) .preview-label { margin-bottom: 4px; font-size: 9px; }
.preview-surface:not(.is-main) .preview-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.surface-tools[hidden], .surface-body[hidden], .surface-empty[hidden], .surface-preview[hidden], .surface-actions [hidden] { display: none !important; }
.surface-empty { position: relative; z-index: 2; display: grid; justify-items: start; gap: 6px; padding: 16px 24px 24px; color: var(--pk-quiet); }
.surface-empty p { margin: 0; }
.surface-empty .exchange-btn { min-height: 44px; width: auto; padding: 0 12px; border-color: var(--pk-line); }
.surface-actions .exchange-btn { min-width: 44px; width: auto; min-height: 44px; padding: 0 10px; white-space: nowrap; color: var(--pk-ink); border: 1px solid var(--pk-line); font-size: 10px; letter-spacing: .04em; }
.surface-actions .exchange-btn:hover { border-color: var(--pk-copper); color: var(--pk-copper); }
.chat-card .surface-preview { padding-top: 8px; }
.chat-card .preview-text { -webkit-line-clamp: 3; }
.main-host .surface-empty { padding-inline: 24px; }
.splitter { cursor: col-resize; }

/* No tab switch on phones: stack the active workspace and the preview rail, both always reachable. */
[data-layout="compact"] .layout { display: grid; grid-template: minmax(21rem, 1.12fr) minmax(12rem, .88fr) / minmax(0, 1fr); grid-template-areas: "chat" "media"; align-content: stretch; gap: 10px; overflow-y: auto; padding: 8px 4%; }
[data-layout="compact"] .chat { grid-area: chat; min-height: 21rem; }
[data-layout="compact"] .panel { grid-area: media; min-height: 12rem; overflow: visible; }
[data-layout="compact"] .panel-body { max-height: 28vh; overflow: auto; overscroll-behavior: contain; padding: 0 2px 12px; }
[data-layout="compact"] .surface-head { padding: 10px 10px 0; }
[data-layout="compact"] .surface-preview { padding: 6px 10px 0; }
[data-layout="compact"] .surface-empty { padding: 12px 14px 18px; }
[data-layout="compact"] .main-host .surface-head { padding: 16px 14px 4px; }
[data-layout="compact"] .main-host .surface-tools { padding: 8px 14px 4px; }
[data-layout="compact"] .main-host .surface-body { padding: 10px 14px 18px; }
[data-layout="compact"] .main-host .surface-name { font-size: 18px; }
[data-layout="compact"] .chat > .aw-heading { display: flex; }
[data-layout="compact"] .chat.holds-surface > .aw-heading { display: none; }
[data-layout="compact"] .composer-caption { display: block; }
[data-layout="compact"] .preview-surface:not(.is-main) .go-left { display: inline-flex !important; }
[data-layout="compact"] .splitter { display: none; }
[data-layout="medium"] .layout, [data-layout="expanded"] .layout { min-width: 0; }
[data-layout="book"] .layout { min-width: 0; }
[data-layout="book"] .surface-actions .exchange-btn { padding-inline: 6px; font-size: 9px; }
.workspace-utilities button:focus-visible, .workspace-utilities summary:focus-visible, .surface-actions button:focus-visible { outline: 2px solid var(--pk-copper); outline-offset: 2px; }
@media (max-width: 460px) {
  .app > .aw-intro { padding: 12px 4% 8px; }
  .workspace-brand .wordmark { height: 22px; }
  .aw-intro h2 { font-size: 20px; }
  .aw-intro p:not(.eyebrow) { font-size: 11px; line-height: 1.4; }
  [data-layout="compact"] .layout { grid-template-rows: minmax(20rem, 1.1fr) minmax(11rem, .9fr); }
}
