/* =====================================================================================================
   ORBIT v2 for PortalByte. Loaded LAST (after orbit.css), so it only restyles; no markup or behaviour changes.
   Source: ORBIT UI kit v2 (D:\ByteUI\orbit-ui-kit-v2-integrations): chamfered clip-path frames with a fine
   perimeter line and corner marks on the uncut corners, engraved hatch/dot texture over translucent fills, and a
   muted copper for everything you can act on (primary actions, the current selection, pressed toggles, focus).
   Status colours keep their meaning.

   PART 1 is the shared core (identical in every byte app; change it in the kit, then re-copy), with a light variant.
   PART 2 maps the core onto PortalByte's own components.
   ===================================================================================================== */

/* ---------- PART 1: CORE ---------- */
:root {
  --o2-action: #a77e5e; --o2-action-hi: #c8a487; --o2-action-text: #f3e9dc; --o2-focus: #d2b79c;
  --o2-action-wash: linear-gradient(90deg, rgba(130, 102, 76, 0.26), transparent);
  --o2-action-wash-up: linear-gradient(0deg, rgba(130, 102, 76, 0.3), transparent);
  --o2-cut: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  --o2-cut-s: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  --o2-cut-xs: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
  --o2-ring: polygon(evenodd, 0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px), 0 0, 1px 1px, 1px calc(100% - 16.5px), 16.5px calc(100% - 1px), calc(100% - 1px) calc(100% - 1px), calc(100% - 1px) 16.5px, calc(100% - 16.5px) 1px, 1px 1px);
  --o2-ring-s: polygon(evenodd, 0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px), 0 0, 1px 1px, 1px calc(100% - 9.5px), 9.5px calc(100% - 1px), calc(100% - 1px) calc(100% - 1px), calc(100% - 1px) 9.5px, calc(100% - 9.5px) 1px, 1px 1px);
  --o2-ring-grad: linear-gradient(135deg, #acdbe3c2, #6b9baa9c 26%, #507784 62%, #a6cdd2c2);
  --o2-hatch: repeating-linear-gradient(135deg, rgba(196, 226, 234, 0.032) 0 1px, transparent 1px 5px);
  --o2-hatch2: repeating-linear-gradient(45deg, rgba(166, 205, 216, 0.012) 0 1px, transparent 1px 8px);
  --o2-diag: linear-gradient(135deg, transparent 48%, rgba(168, 211, 219, 0.035) 48%, rgba(168, 211, 219, 0.035) 48.15%, transparent 48.15%, transparent 50%, rgba(168, 211, 219, 0.025) 50%, rgba(168, 211, 219, 0.025) 50.15%, transparent 50.15%);
  --o2-dots: radial-gradient(circle, rgba(198, 229, 232, 0.09) 0.6px, transparent 0.9px);
  --o2-fill: linear-gradient(140deg, rgba(22, 48, 62, 0.9), rgba(10, 30, 43, 0.91) 58%, rgba(8, 24, 35, 0.92));
  --o2-btn-fill: linear-gradient(105deg, #1b4354, #102b38);
  --o2-btn-ring: linear-gradient(120deg, #80c8d9 0%, #365e70 40%, #75b7c8 100%);
  --o2-btn-text: #e4f2fa;
  --o2-marks: linear-gradient(#c4e5e8c4, #c4e5e8c4) left top / 3px 3px no-repeat, linear-gradient(#91bfca80, #91bfca80) 3px top / 42px 1px no-repeat, linear-gradient(#91bfca80, #91bfca80) left 3px / 1px 23px no-repeat,
    linear-gradient(#c4e5e8c4, #c4e5e8c4) right bottom / 3px 3px no-repeat, linear-gradient(#91bfca80, #91bfca80) right 3px bottom / 42px 1px no-repeat, linear-gradient(#91bfca80, #91bfca80) right bottom 3px / 1px 23px no-repeat;
}
:root[data-theme="light"] {
  --o2-action: #8a5e3c; --o2-action-hi: #7a4f2f; --o2-action-text: #4a2f18; --o2-focus: #8a5e3c;
  --o2-action-wash: linear-gradient(90deg, rgba(138, 94, 60, 0.22), transparent);
  --o2-action-wash-up: linear-gradient(0deg, rgba(138, 94, 60, 0.24), transparent);
  --o2-ring-grad: linear-gradient(135deg, #2f7f9ad0, #5f9bb09c 26%, #6e9fb2 62%, #2f7f9ad0);
  --o2-hatch: repeating-linear-gradient(135deg, rgba(14, 60, 84, 0.05) 0 1px, transparent 1px 5px);
  --o2-hatch2: repeating-linear-gradient(45deg, rgba(14, 60, 84, 0.025) 0 1px, transparent 1px 8px);
  --o2-diag: linear-gradient(135deg, transparent 48%, rgba(14, 60, 84, 0.05) 48%, rgba(14, 60, 84, 0.05) 48.2%, transparent 48.2%);
  --o2-dots: radial-gradient(circle, rgba(14, 60, 84, 0.1) 0.6px, transparent 0.9px);
  --o2-fill: linear-gradient(140deg, rgba(248, 252, 254, 0.9), rgba(228, 240, 247, 0.92));
  --o2-btn-fill: linear-gradient(105deg, #eaf4f9, #d5e7f0);
  --o2-btn-ring: linear-gradient(120deg, #2f7f9a 0%, #8db8c8 40%, #2f7f9a 100%);
  --o2-btn-text: #0e2230;
  --o2-marks: linear-gradient(#2f7f9ad0, #2f7f9ad0) left top / 3px 3px no-repeat, linear-gradient(#2f7f9a80, #2f7f9a80) 3px top / 42px 1px no-repeat, linear-gradient(#2f7f9a80, #2f7f9a80) left 3px / 1px 23px no-repeat,
    linear-gradient(#2f7f9ad0, #2f7f9ad0) right bottom / 3px 3px no-repeat, linear-gradient(#2f7f9a80, #2f7f9a80) right 3px bottom / 42px 1px no-repeat, linear-gradient(#2f7f9a80, #2f7f9a80) right bottom 3px / 1px 23px no-repeat;
}
:focus-visible { outline: 2px solid var(--o2-focus); outline-offset: 2px; }

/* A framed surface: the cut, layered fill, a perimeter line (::after) and corner marks (::before). Needs position. */
.chat, .panel, .rail, .login-card, .confirm-banner, .a2-card {
  isolation: isolate; clip-path: var(--o2-cut); border-color: transparent; border-radius: 0; box-shadow: none; position: relative;
  background-image: var(--o2-diag), var(--o2-hatch), var(--o2-hatch2), var(--o2-fill);
}
.chat::after, .panel::after, .rail::after, .login-card::after, .confirm-banner::after, .a2-card::after {
  content: ""; position: absolute; z-index: 5; inset: 0; width: auto; height: auto; border: 0; pointer-events: none; clip-path: var(--o2-ring); background: var(--o2-ring-grad);
}
.chat::before, .panel::before, .rail::before, .login-card::before {
  content: ""; position: absolute; z-index: 4; top: 6px; left: 6px; right: 6px; bottom: 6px; width: auto; height: auto; border: 0; pointer-events: none; opacity: 0.82; background: var(--o2-marks);
}
@supports not (clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%)) {
  .chat::after, .panel::after, .rail::after, .login-card::after, .confirm-banner::after, .a2-card::after { clip-path: none; background: transparent; border: 1px solid #79bdd188; }
  .chat::before, .panel::before, .rail::before, .login-card::before { display: none; }
}

/* Buttons: gradient perimeter, shaped inner fill with dot texture, short underline glint. Hover/pressed turn copper. */
.top button, .composer-buttons button, .login-card button, .panel-head button, .confirm-banner button, .a2ui .a2-btn, .jump-latest {
  position: relative; isolation: isolate; clip-path: var(--o2-cut-s); border: 0; border-radius: 0; padding-inline: 18px; color: var(--o2-btn-text); letter-spacing: 0.06em; font-weight: 600;
  background: var(--o2-btn-ring); box-shadow: none; text-shadow: none; filter: none; text-decoration: none; transition: color 0.15s, filter 0.15s, transform 0.1s;
}
.top button::before, .composer-buttons button::before, .login-card button::before, .panel-head button::before, .confirm-banner button::before, .a2ui .a2-btn::before, .jump-latest::before::before {
  content: ""; position: absolute; z-index: -1; inset: 1px; pointer-events: none; clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
  background: var(--o2-dots), var(--o2-hatch), var(--o2-btn-fill); background-size: 4px 4px, auto, auto;
}
.top button::after, .composer-buttons button::after, .login-card button::after, .panel-head button::after, .confirm-banner button::after, .a2ui .a2-btn::after, .jump-latest::after::after {
  content: ""; position: absolute; pointer-events: none; right: 8px; bottom: 4px; width: 18px; height: 1px; background: linear-gradient(90deg, transparent, currentColor); opacity: 0.6;
}
.top button:hover:not(:disabled), .composer-buttons button:hover:not(:disabled), .login-card button:hover:not(:disabled), .panel-head button:hover:not(:disabled), .confirm-banner button:hover:not(:disabled), .a2ui .a2-btn:hover:not(:disabled), .jump-latest:hover:hover {
  filter: none; color: #ead8c6; background: linear-gradient(120deg, #c5a78c, #90715c 45%, #b99b82);
}
.top button:hover:not(:disabled)::before, .composer-buttons button:hover:not(:disabled)::before, .login-card button:hover:not(:disabled)::before, .panel-head button:hover:not(:disabled)::before, .confirm-banner button:hover:not(:disabled)::before, .a2ui .a2-btn:hover:not(:disabled)::before, .jump-latest:hover::before:hover::before {
  background-image: var(--o2-dots), var(--o2-hatch), linear-gradient(105deg, #443a33, #29363b);
}
.top button:active, .composer-buttons button:active, .login-card button:active, .panel-head button:active, .confirm-banner button:active, .a2ui .a2-btn:active, .jump-latest:active:active { transform: translateY(1px); }
.top button:disabled, .composer-buttons button:disabled, .login-card button:disabled { opacity: 0.4; filter: saturate(0.4); cursor: not-allowed; }
/* primary = copper */
.composer-buttons button.primary, .login-card button.primary, .confirm-banner button.primary, .a2ui .a2-btn.a2-primary, .top button.primary { color: #1b120b; background: linear-gradient(120deg, #d2b396, #9e775b 45%, #c5a488); }
.composer-buttons button.primary::before, .login-card button.primary::before, .confirm-banner button.primary::before, .a2ui .a2-btn.a2-primary::before, .top button.primary::before { background-image: var(--o2-dots), var(--o2-hatch), linear-gradient(105deg, #d2b396, #9e775b 45%, #c5a488); }
.composer-buttons button.primary:hover:not(:disabled), .login-card button.primary:hover:not(:disabled), .confirm-banner button.primary:hover:not(:disabled), .a2ui .a2-btn.a2-primary:hover:not(:disabled) { filter: brightness(1.1); background: linear-gradient(120deg, #d2b396, #9e775b 45%, #c5a488); color: #1b120b; }
/* a toggled-on control (Mic listening, Voice on) is copper too */
.composer-buttons button[aria-pressed="true"] { color: var(--o2-action-text); background: linear-gradient(120deg, #c5a78c, #90715c 45%, #b99b82); }
.composer-buttons button[aria-pressed="true"]::before { background-image: var(--o2-dots), var(--o2-hatch), linear-gradient(105deg, #5a4838, #3a3a3a); }

/* ---------- PART 2: PORTALBYTE ---------- */

/* top bar: engraved texture and the brand mark */
.top { background-image: linear-gradient(110deg, rgba(22, 60, 74, 0.25), transparent 55%), repeating-linear-gradient(135deg, transparent 0 8px, rgba(177, 232, 250, 0.02) 8px 9px); }
.top h1 { display: inline-flex; align-items: center; gap: 0.85rem; text-shadow: 0 0 14px rgba(126, 223, 251, 0.27); }
.top h1::before { content: ""; width: 14px; height: 14px; flex: none; border: 1px solid #8fe0f2; transform: rotate(45deg); box-shadow: 0 0 12px rgba(97, 210, 237, 0.35), inset 0 0 8px rgba(90, 196, 220, 0.25); background: radial-gradient(circle, #cdf6ff 0 2px, transparent 3px); }
:root[data-theme="light"] .top h1::before { border-color: #2f7f9a; background: radial-gradient(circle, #2f7f9a 0 2px, transparent 3px); box-shadow: none; }
.composer, .miniplayer { background-image: var(--o2-hatch); }

/* panel heads read as the kit's eyebrow */
.panel-head h2 { color: var(--o2-action-hi); }
:root[data-theme="light"] .panel-head h2 { color: var(--o2-action); }
.panel-head { border-bottom-color: rgba(139, 199, 219, 0.2); position: relative; z-index: 2; }
.log-wrap, .composer, .panel-body { position: relative; z-index: 2; }

/* chat bubbles and result cards: engraved fill, small chamfer */
.msg:not(.user) { border-radius: 0; background-image: var(--o2-hatch), linear-gradient(140deg, rgba(20, 46, 60, 0.7), rgba(8, 24, 35, 0.6)); box-shadow: inset 2px 0 #8dd7e555; }
:root[data-theme="light"] .msg:not(.user) { background-image: var(--o2-hatch), linear-gradient(140deg, rgba(255, 255, 255, 0.7), rgba(228, 240, 247, 0.7)); box-shadow: inset 2px 0 #2f7f9a66; }
.msg.user { border-radius: 0; clip-path: var(--o2-cut-xs); background-image: var(--o2-hatch); box-shadow: inset 2px 0 #c9a98d; }
.pitem { border-radius: 0; background-image: var(--o2-hatch), linear-gradient(140deg, rgba(20, 46, 60, 0.7), rgba(8, 24, 35, 0.6)); border-color: rgba(139, 199, 219, 0.24); clip-path: var(--o2-cut-xs); }
:root[data-theme="light"] .pitem { background-image: var(--o2-hatch), linear-gradient(140deg, rgba(255, 255, 255, 0.7), rgba(228, 240, 247, 0.7)); }

/* chips are the kit's badges: shaped, dotted, with a status edge */
.chip { border-radius: 0; clip-path: var(--o2-cut-xs); border-color: transparent; padding: 3px 12px 3px 12px; background-image: var(--o2-dots), linear-gradient(110deg, rgba(43, 100, 117, 0.67), rgba(16, 46, 59, 0.92)); background-size: 4px 4px, auto; box-shadow: inset 2px 0 #8dd7e555; }
:root[data-theme="light"] .chip { background-image: var(--o2-dots), linear-gradient(110deg, rgba(214, 232, 242, 0.9), rgba(236, 245, 250, 0.9)); }

/* inputs: a cyan edge light, shaped by nothing (kept rectangular so text selection stays honest) */
.login-card input, .composer textarea { border-radius: 0; background-image: linear-gradient(120deg, #102d3a, #0a1c28); border-color: #42697a; box-shadow: inset 2px 0 #6dbfd331, inset 0 2px 8px rgba(0, 0, 0, 0.2); }
:root[data-theme="light"] .login-card input, :root[data-theme="light"] .composer textarea { background-image: none; border-color: #8db8c8; box-shadow: inset 2px 0 #2f7f9a33; }
.login-card input:focus, .composer textarea:focus { border-color: var(--o2-action); box-shadow: 0 0 0 1px var(--o2-action), inset 2px 0 #6dbfd331; outline: none; }


/* focus and links */

@media (max-width: 700px) { .chat, .panel, .rail, .login-card, .confirm-banner, .a2-card { clip-path: var(--o2-cut-s); } .chat::after, .panel::after, .rail::after, .login-card::after, .confirm-banner::after, .a2-card::after { clip-path: var(--o2-ring-s); } }
@media (prefers-reduced-motion: reduce) { .top button, .composer-buttons button { transition: none; } }

/* cover screen: keep the top actions on one row */
@media (max-width: 520px) {
  .top { gap: 0.5rem; }
  .top-actions { flex-wrap: nowrap; gap: 0.25rem; }
  .top button { padding-inline: 12px; font-size: 0.8125rem; letter-spacing: 0.03em; min-width: 0; }
  .top h1 { letter-spacing: 0.16em; gap: 0.55rem; font-size: 0.9rem; }
}

/* wordmark (D:\ByteUI\byte-wordmarks-digital): the image carries the mark, so the CSS diamond is dropped */
.top h1::before { content: none; }
.top h1 { letter-spacing: 0; gap: 0; }
.wordmark { display: block; height: 2.6rem; width: auto; max-width: 100%; }
.login-card h1 .wordmark { height: 3.4rem; width: auto; max-width: 100%; object-fit: contain; margin-inline: auto; }
.wm-light, :root[data-theme="light"] .wm-dark { display: none; }
:root[data-theme="light"] .wm-light { display: block; }
@media (max-width: 520px) {
  .wordmark { height: 2.1rem; }
  .login-card h1 .wordmark { height: auto; max-height: 2.1rem; width: auto; object-fit: contain; }
}

/* ---- Scene video (dark theme): a locked-camera loop beneath the readability scrim and the star layer. ---- */
.scene { position: fixed; inset: 0; width: 100vw; height: 100dvh; object-fit: cover; object-position: 62% 60%; z-index: 0; pointer-events: none; display: none; }
:root.has-scene .scene { display: block; }
:root.has-scene body::before, :root.has-scene .space { z-index: 1; }

/* Scene visible: the kit's final transparent-surface values (nested cards .77-.80) and its lighter readability scrim.
   Fills are alpha gradients, never `opacity`, so text and frame lines stay crisp. */
:root.has-scene {
  --o2-fill: linear-gradient(140deg, rgba(22, 48, 62, 0.77), rgba(10, 30, 43, 0.78) 58%, rgba(8, 24, 35, 0.80));
}
:root.has-scene body::before {
  background: linear-gradient(100deg, rgba(4, 12, 20, 0.5), rgba(4, 14, 23, 0.3)), linear-gradient(0deg, rgba(8, 19, 29, 0.7) 0%, transparent 62%);
}
/* The textured gradient above is the whole fill: drop the flat surface colour beneath it and the blur (the kit sets background-color: transparent). */
:root.has-scene .chat, :root.has-scene .panel, :root.has-scene .rail, :root.has-scene .login-card, :root.has-scene .confirm-banner, .a2-card {
  background-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
}
:root.has-scene .panel-head { background: rgba(6, 17, 27, 0.42); }
:root.has-scene .top, :root.has-scene .composer, :root.has-scene .miniplayer { background: rgba(6, 17, 27, 0.66); }

/* ---- A2UI surfaces in the chat (js/a2ui.js). Card and Button reuse the chamfered frame and button treatment above. ---- */
.a2-host { margin-top: 0.5rem; max-width: min(100%, 34rem); }
.a2ui { display: block; color: var(--text); }
.a2ui .a2-flex { display: flex; gap: 0.6rem; min-width: 0; }
.a2ui .a2-col { flex-direction: column; }
.a2ui .a2-row { flex-direction: row; flex-wrap: wrap; }
.a2ui .a2-list.a2-col { overflow-y: auto; max-height: 24rem; }
.a2ui .a2-list.a2-row { flex-wrap: nowrap; overflow-x: auto; }
.a2ui .a2-j-start { justify-content: flex-start; } .a2ui .a2-j-center { justify-content: center; } .a2ui .a2-j-end { justify-content: flex-end; }
.a2ui .a2-j-between { justify-content: space-between; } .a2ui .a2-j-around { justify-content: space-around; } .a2ui .a2-j-evenly { justify-content: space-evenly; } .a2ui .a2-j-stretch { justify-content: stretch; }
.a2ui .a2-a-start { align-items: flex-start; } .a2ui .a2-a-center { align-items: center; } .a2ui .a2-a-end { align-items: flex-end; } .a2ui .a2-a-stretch { align-items: stretch; }
.a2ui .a2-row > * { min-width: 0; }
.a2-card { padding: 0.9rem 1rem; display: block; }
.a2-card > * { position: relative; z-index: 2; }
.a2ui .a2-text { overflow-wrap: anywhere; line-height: 1.45; }
.a2ui .a2-text p { margin: 0 0 0.4rem; } .a2ui .a2-text p:last-child { margin-bottom: 0; }
.a2ui .a2-caption { font-size: 0.78rem; color: var(--muted); }
.a2ui .a2-image { display: block; max-width: 100%; height: auto; background: rgba(4, 14, 22, 0.5); }
.a2ui .a2-img-icon { width: 2rem; height: 2rem; } .a2ui .a2-img-avatar { width: 3rem; height: 3rem; border-radius: 50%; }
.a2ui .a2-img-smallFeature { width: 6rem; } .a2ui .a2-img-mediumFeature { width: 12rem; } .a2ui .a2-img-largeFeature { width: 100%; } .a2ui .a2-img-header { width: 100%; max-height: 10rem; }
.a2ui .a2-fit-cover { object-fit: cover; } .a2ui .a2-fit-contain { object-fit: contain; } .a2ui .a2-fit-fill { object-fit: fill; } .a2ui .a2-fit-none { object-fit: none; } .a2ui .a2-fit-scaleDown { object-fit: scale-down; }
.a2ui .a2-video { width: 100%; max-height: 18rem; background: #000; }
.a2ui .a2-audio audio { width: 100%; }
.a2ui .a2-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; color: var(--o2-action-hi); font-size: 1.1rem; line-height: 1; }
.a2ui .a2-svg { width: 1.25rem; height: 1.25rem; fill: currentColor; }
.a2ui .a2-divider.a2-horizontal { height: 1px; background: rgba(139, 199, 219, 0.22); margin: 0.15rem 0; }
.a2ui .a2-divider.a2-vertical { width: 1px; align-self: stretch; background: rgba(139, 199, 219, 0.22); }
.a2ui .a2-field { display: grid; gap: 0.3rem; }
.a2ui .a2-label { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.a2ui .a2-input { width: 100%; padding: 0.55rem 0.7rem; background: rgba(4, 14, 22, 0.7); color: var(--text); border: 1px solid rgba(139, 199, 219, 0.3); border-radius: 0; font: inherit; }
.a2ui .a2-input:focus-visible, .a2ui .a2-range:focus-visible, .a2ui .a2-tab:focus-visible, .a2ui .a2-chip:focus-visible, .a2ui .a2-option input:focus-visible, .a2ui .a2-check input:focus-visible, .a2ui .a2-close:focus-visible { outline: 2px solid var(--o2-focus); outline-offset: 2px; }
.a2ui .a2-input[aria-invalid="true"] { border-color: var(--danger, #e0605a); }
.a2ui .a2-error { min-height: 0; color: var(--danger, #ff8d86); font-size: 0.8rem; } .a2ui .a2-error:empty { display: none; }
.a2ui .a2-check, .a2ui .a2-option { display: flex; align-items: center; gap: 0.55rem; padding: 0.2rem 0; cursor: pointer; }
.a2ui .a2-check input, .a2ui .a2-option input { width: 1.05rem; height: 1.05rem; accent-color: var(--o2-action); }
.a2ui .a2-choice { display: grid; gap: 0.35rem; }
.a2ui .a2-options { display: grid; gap: 0.1rem; }
.a2ui .a2-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.a2ui .a2-chip { padding: 0.35rem 0.8rem; background: rgba(8, 24, 35, 0.8); color: var(--text); border: 1px solid rgba(139, 199, 219, 0.35); border-radius: 999px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.a2ui .a2-chip.on { border-color: var(--o2-action-hi); background: rgba(167, 126, 94, 0.28); }
.a2ui .a2-chip.on::before { content: "✓ "; }
.a2ui .a2-range { width: 100%; accent-color: var(--o2-action); }
.a2ui .a2-out { font: 600 0.8rem var(--mono, ui-monospace, monospace); color: var(--muted); }
.a2ui .a2-tablist { display: flex; gap: 0.25rem; border-bottom: 1px solid rgba(139, 199, 219, 0.25); overflow-x: auto; }
.a2ui .a2-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0.5rem 0.8rem; color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.a2ui .a2-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--o2-action-hi); }
.a2ui .a2-tabpanel { padding-top: 0.7rem; }
.a2ui .a2-btn { cursor: pointer; font: inherit; font-weight: 600; min-height: 2.25rem; }
.a2ui .a2-btn:disabled { opacity: 0.45; cursor: not-allowed; filter: saturate(0.4); }
.a2ui .a2-borderless { background: none; clip-path: none; color: var(--o2-action-hi); text-decoration: underline; }
.a2ui .a2-borderless::before, .a2ui .a2-borderless::after { display: none; }
.a2ui .a2-missing { min-height: 1rem; border-bottom: 1px dashed rgba(139, 199, 219, 0.25); }
/* Modal content lives on the body, outside .a2ui, so it carries its own look */
.a2-backdrop { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 1rem; background: rgba(2, 8, 14, 0.66); }
.a2-modal { position: relative; width: min(32rem, 100%); max-height: 86dvh; overflow: auto; padding: 1.1rem 1.2rem 1.2rem; background: linear-gradient(140deg, rgba(22, 48, 62, 0.97), rgba(8, 24, 35, 0.98)); border: 1px solid rgba(139, 199, 219, 0.4); clip-path: var(--o2-cut); color: var(--text); }
.a2-close { position: absolute; top: 0.45rem; right: 0.55rem; width: 2.25rem; height: 2.25rem; background: none; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; }
.a2-close:hover { color: var(--text); }
.a2-modal-body .a2-flex { display: flex; gap: 0.6rem; flex-direction: column; }
.a2-modal-body .a2-field { display: grid; gap: 0.3rem; }
:root[data-theme="light"] .a2ui .a2-input { background: rgba(255, 255, 255, 0.9); border-color: rgba(14, 34, 48, 0.3); }
:root[data-theme="light"] .a2-modal { background: rgba(247, 251, 253, 0.98); }
@media (prefers-reduced-motion: reduce) { .a2ui * { transition: none !important; animation: none !important; } }

/* ---------- ONE SPACE: the chat is the main surface; results live in per-app surfaces in the right column ---------- */
a { color: var(--byte-link); }
.panel-body { align-content: start; gap: 12px; }
.surface { position: relative; isolation: isolate; clip-path: var(--o2-cut-s); border-radius: 0; min-width: 0;
  background-image: var(--o2-hatch), linear-gradient(140deg, rgba(22, 48, 62, 0.74), rgba(8, 24, 35, 0.8)); }
.surface::after { content: ""; position: absolute; z-index: 3; inset: 0; pointer-events: none; clip-path: var(--o2-ring-s); background: var(--o2-ring-grad); opacity: 0.8; }
:root[data-theme="light"] .surface { background-image: var(--o2-hatch), linear-gradient(140deg, rgba(255, 255, 255, 0.74), rgba(228, 240, 247, 0.8)); }
.surface-head { position: relative; z-index: 2; display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem 0.55rem 0.9rem; flex-wrap: wrap; }
.surface:not(.collapsed) > .surface-head { border-bottom: 1px solid rgba(139, 199, 219, 0.2); }
.surface-titles { display: grid; gap: 0.05rem; min-width: 0; flex: 1 1 8rem; }
.surface-kicker { font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.surface-name { margin: 0; font-size: 1rem; font-weight: 600; color: var(--byte-head); }
.surface-name:focus-visible { outline: 2px solid var(--o2-focus); outline-offset: 3px; }
.surface-count { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.surface-actions { display: flex; align-items: center; gap: 0.25rem; margin-inline-start: auto; }
.surface-open { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; padding: 0.35rem 0.4rem; min-height: 2rem; display: inline-flex; align-items: center; }
.surface-btn { min-width: 2rem; min-height: 2rem; padding: 0; background: none; border: 1px solid transparent; border-radius: 0; color: var(--muted); font-size: 0.7rem; line-height: 1; cursor: pointer; }
.surface-btn:hover:not(:disabled) { color: var(--o2-action-hi); border-color: rgba(167, 126, 94, 0.5); filter: none; }
.surface-btn:disabled { opacity: 0.3; cursor: default; }
.surface-dot { position: relative; width: 2rem; height: 2rem; padding: 0; background: none; border: 0; cursor: pointer; }
.surface-dot::before { content: ""; position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: var(--o2-action); box-shadow: 0 0 0 3px rgba(167, 126, 94, 0.18); }
.surface.collapsed .surface-dot::before { background: transparent; border: 2px solid var(--o2-action); box-shadow: none; }
.surface-dot:hover::before { background: var(--o2-action-hi); }
.surface-body { position: relative; z-index: 2; display: grid; gap: 10px; padding: 0.7rem 0.7rem 0.8rem; min-width: 0; }
.surface-body[hidden] { display: none; }
.surface .pitem { background-image: var(--o2-hatch), linear-gradient(140deg, rgba(20, 46, 60, 0.55), rgba(8, 24, 35, 0.5)); }

/* the bridge from an answer to its results */
.view-results { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.55rem; }
.view-results-btn { min-height: 2.25rem; padding: 0.3rem 0.8rem; background: none; border: 1px solid rgba(167, 126, 94, 0.55); border-radius: 0; color: var(--o2-action-text); font-size: 0.8125rem; font-weight: 600; cursor: pointer; clip-path: var(--o2-cut-xs); }
.view-results-btn::after { content: " →"; }
.view-results-btn:hover { background: rgba(130, 102, 76, 0.2); filter: none; }
@media (prefers-reduced-motion: reduce) { .surface, .surface * { transition: none !important; animation: none !important; } }

/* the compact Chat | Media switch: the selected view is a quiet copper edge, like the kit's current-page marker */
.tabs { background: rgba(5, 15, 24, 0.88); background-image: var(--o2-hatch); }
:root[data-theme="light"] .tabs { background: rgba(240, 247, 251, 0.9); }
.tabs button { border-radius: 0; clip-path: var(--o2-cut-xs); border-color: rgba(139, 199, 219, 0.3); background: rgba(10, 30, 43, 0.7); color: var(--text); }
.tabs button[aria-pressed="true"] { background: var(--o2-action-wash-up), rgba(22, 40, 50, 0.9); color: var(--o2-action-text); border-color: #b39376; box-shadow: inset 0 -2px #b39376; }
:root[data-theme="light"] .tabs button { background: rgba(255, 255, 255, 0.8); }
:root[data-theme="light"] .tabs button[aria-pressed="true"] { background: var(--o2-action-wash-up), rgba(255, 255, 255, 0.9); }
