/* ============================================================================
   Core Host OS — Shared Design System & Shell Foundation (`/core-base.css`)
   Single Source of Truth across Today, Deck (Queue/Notes/Reminders), Workout,
   Language Lab (Tagalog), Letras (Spanish), Journal, Calendar, and Bouncer.
   ============================================================================ */

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter Fallback';
  src: local('Roboto'), local('Helvetica Neue'), local('Arial');
  size-adjust: 107%;
  ascent-override: 90%;
  descent-override: 22%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
}

:root {
  color-scheme: only dark;
  --font-sans-core: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono-core: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --core-bg: #090a0f;
  --core-surface: rgba(15, 23, 42, 0.78);
  --core-surface-elevated: rgba(30, 41, 59, 0.94);
  --core-border-subtle: rgba(148, 163, 184, 0.12);
  --core-border-strong: rgba(148, 163, 184, 0.22);
  --core-text: #f8fafc;
  --core-text-secondary: #cbd5e1;
  --core-text-muted: #94a3b8;
  --core-solar: #f59e0b;
  --core-solar-ring: #fbbf24;
  --core-radius-hud: 14px;
  --core-radius-card: 16px;
  interpolate-size: allow-keywords;
}

html:not([data-bouncer-branch]) {
  min-height: 100vh;
  min-height: 100dvh;
  background-repeat: no-repeat;
  background-size: cover;
}

@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 105ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  mix-blend-mode: normal;
}

@media (prefers-reduced-motion: reduce) {
  @view-transition {
    navigation: none;
  }
}

[hidden],
.hidden {
  display: none !important;
}

:where(.sr-only, .sr-only-input, .visually-hidden) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* 1. Top Edge Refresh Spectrum Laser Beam */
.refresh-beam {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 99999;
  pointer-events: none;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 25%, #ec4899 50%, #f59e0b 75%, #10b981 100%);
  background-size: 100vw 100%;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.6), 0 0 6px rgba(245, 158, 11, 0.4);
  opacity: 0;
  border-radius: 0 3px 3px 0;
  will-change: width, opacity;
}

.refresh-beam.animating {
  animation: refreshBeamSweep 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes refreshBeamSweep {
  0% { width: 0%; opacity: 1; }
  55% { width: 75%; opacity: 1; }
  85% { width: 100%; opacity: 1; }
  100% { width: 100%; opacity: 0; }
}

/* 2. Synchronized One-World Horizon Ambient Canvas */
.ambient-bg {
  position: fixed;
  top: -120px;
  left: -20px;
  right: -20px;
  bottom: -120px;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.0s ease-in-out;
  background-repeat: no-repeat;
  background-size: cover;
  will-change: opacity;
}

.ambient-bg.active {
  opacity: 1;
  background-color: #0d1629;
  background-image: radial-gradient(circle at 50% 20%, rgba(59, 130, 246, 0.52) 0%, rgba(38, 101, 128, 0.32) 50%, rgb(13, 24, 37) 90%);
}

.ambient-sun {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(255, 250, 204, 0.92) 14%,
    rgba(254, 240, 60, 0.82) 32%,
    rgba(250, 204, 21, 0.58) 52%,
    rgba(234, 179, 8, 0.30) 70%,
    rgba(202, 138, 4, 0.10) 86%,
    transparent 100%
  );
  filter: blur(24px);
  -webkit-filter: blur(24px);
  transform: translate3d(-50%, calc(50vh + 240px), 0) scale(0.4);
  opacity: 0;
  will-change: transform, opacity;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 1.2s ease;
}

.ambient-sun.rising {
  animation: sunRiseEthereal 5.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sunRiseEthereal {
  0% {
    transform: translate3d(-50%, calc(50vh + 260px), 0) scale(0.4);
    opacity: 0;
  }
  30% {
    opacity: 0.7;
  }
  100% {
    transform: translate3d(-50%, -50%, 0) scale(1.0);
    opacity: 0.85;
  }
}

.ambient-sun.settled {
  transform: translate3d(-50%, -50%, 0) scale(1.0);
  opacity: 0.88;
  filter: blur(22px);
  -webkit-filter: blur(22px);
  animation: sunRestBreathing 6s ease-in-out 2 alternate;
}

@keyframes sunRestBreathing {
  0% {
    transform: translate3d(-50%, -50%, 0) scale(1.0);
    opacity: 0.76;
  }
  100% {
    transform: translate3d(-50%, -52%, 0) scale(1.08);
    opacity: 0.92;
  }
}

.ambient-sun.setting {
  transform: translate3d(-50%, calc(50vh + 260px), 0) scale(0.35);
  opacity: 0;
  transition: transform 1.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.9s ease;
}

/* 3. Universal Today Solar Home Badge */
:where(.hud-home-pill, .q-home-pill, .back-btn) {
  inline-size: 34px;
  block-size: 34px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.28);
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

:where(.hud-home-pill, .q-home-pill, .back-btn) svg {
  inline-size: 58%;
  block-size: 58%;
  display: block;
}

:where(.hud-home-pill, .q-home-pill, .back-btn):hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

:where(.hud-home-pill, .q-home-pill, .back-btn):active {
  transform: scale(0.95);
}

/* 4. Universal Segmented Mode Switcher Foundation */
:where(.mode-bar, .q-mode-bar) {
  inline-size: 100%;
  min-inline-size: 0;
}

:where(.mode-tabs, .q-mode-tabs) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  inline-size: 100%;
  background: var(--core-surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--core-border-subtle);
  border-radius: 12px;
  padding: 3px;
  box-sizing: border-box;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.24);
}

:where(.mode-tabs, .q-mode-tabs)[data-tab-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

:where(.mode-tabs, .q-mode-tabs)[data-tab-count="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

:where(.mode-tab, .q-mode-tab) {
  appearance: none;
  block-size: 35px;
  inline-size: 100%;
  min-inline-size: 0;
  padding: 0 6px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--core-text-muted);
  font-family: inherit;
  font-size: 0.81rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

:where(.mode-tab, .q-mode-tab):hover {
  color: var(--core-text);
  background: rgba(255, 255, 255, 0.04);
}

:where(.mode-tab, .q-mode-tab).active {
  background: var(--core-surface-elevated);
  border-color: rgba(56, 189, 248, 0.36);
  color: var(--core-text);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

/* 5. Universal Native <dialog> Backdrop & CoreSDK Toast Portal */
:where(dialog)::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#toast-banner.core-sdk-toast {
  position: fixed;
  left: 50%;
  bottom: 78px;
  transform: translateX(-50%) translateY(14px);
  background: rgba(15, 23, 42, 0.96);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 100020;
  max-width: calc(100vw - 28px);
}

#toast-banner.core-sdk-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

#toast-banner.core-sdk-toast #undo-btn {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

/* 6. Universal Progressive-Disclosure Show More Button */
.q-show-more-btn {
  appearance: none;
  inline-size: 100%;
  block-size: 32px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: #94a3b8;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.q-show-more-btn:hover,
.q-show-more-btn:focus-visible {
  background: rgba(30, 41, 59, 0.68);
  border-color: rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
}

/* 7. Universal Vault App Header Brand & Icon System (Compact Unified & Split Home Pill) */
.core-app-brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-inline-size: 0;
  min-block-size: 32px;
  padding: 4px 11px 4px 7px !important;
  border-radius: 10px !important;
  background: color-mix(in srgb, var(--app-brand-accent, #f59e0b) 14%, rgba(15, 23, 42, 0.9)) !important;
  border: 1px solid color-mix(in srgb, var(--app-brand-accent, #f59e0b) 44%, transparent) !important;
  box-shadow: 0 0 16px color-mix(in srgb, var(--app-brand-accent, #f59e0b) 16%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
  flex: 0 1 auto;
  inline-size: fit-content;
  box-sizing: border-box;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.core-app-brand-wrap.has-today-split {
  padding: 0 11px 0 0 !important;
  gap: 7px !important;
  overflow: hidden;
}

.core-today-split-cap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  inline-size: 31px;
  background: color-mix(in srgb, var(--app-brand-accent, #f59e0b) 19%, transparent);
  border-inline-end: 1px solid color-mix(in srgb, var(--app-brand-accent, #f59e0b) 42%, rgba(255, 255, 255, 0.06));
  flex-shrink: 0;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.core-app-brand-wrap.has-today-split:hover .core-today-split-cap,
.core-app-brand-wrap.has-today-split:focus-visible .core-today-split-cap {
  background: color-mix(in srgb, var(--app-brand-accent, #f59e0b) 32%, transparent);
  border-inline-end-color: color-mix(in srgb, var(--app-brand-accent, #f59e0b) 64%, rgba(255, 255, 255, 0.12));
}

.core-app-brand-wrap.has-today-split:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--app-brand-accent, #f59e0b) 75%, #ffffff);
  outline-offset: 2px;
}

.core-today-split-cap svg {
  inline-size: 17px;
  block-size: 17px;
  display: block;
}

.wk-app-brand-wrap .wk-brand-label,
.condos-app-brand-wrap .condos-brand-label,
.utility-app-brand-wrap .utility-brand-label {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: -0.012em;
  color: #f8fafc;
  white-space: nowrap;
}

@media (max-width: 440px) {
  .wk-app-brand-wrap .wk-brand-label,
  .condos-app-brand-wrap .condos-brand-label,
  .letras-app-brand-wrap .brand-title {
    display: none !important;
  }
  html body .wk-app-brand-wrap.has-today-split,
  html body .condos-app-brand-wrap.has-today-split,
  html body .letras-app-brand-wrap.has-today-split {
    padding: 0 7px 0 0 !important;
    gap: 6px !important;
  }
}

@container workout (max-width: 395px) {
  html body .wk-app-brand-wrap.has-today-split {
    padding: 0 7px 0 0 !important;
    gap: 6px !important;
  }
}

body.force-mobile-view .wk-app-brand-wrap .wk-brand-label,
body.force-mobile-view .condos-app-brand-wrap .condos-brand-label,
body.force-mobile-view .letras-app-brand-wrap .brand-title {
  display: none !important;
}

html body.force-mobile-view .wk-app-brand-wrap.has-today-split,
html body.force-mobile-view .condos-app-brand-wrap.has-today-split,
html body.force-mobile-view .letras-app-brand-wrap.has-today-split {
  padding: 0 7px 0 0 !important;
  gap: 6px !important;
}

.core-app-icon-badge {
  inline-size: 20px;
  block-size: 20px;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  background: transparent;
  border: none;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.core-app-icon-badge svg {
  inline-size: 18px;
  block-size: 18px;
  display: block;
}

/* Always hide duplicate standalone Today sun icon */
#solar-refresh-badge,
#today-home-btn,
.wk-top-row .wk-solar-badge,
#song-detail .back-btn[href="/"] {
  display: none !important;
}

html body .wk-app-brand-wrap.has-today-split {
  cursor: pointer !important;
}

html body .wk-app-brand-wrap.has-today-split .core-today-split-cap {
  display: inline-flex !important;
}

/* Bouncer header alignment & external domain chip */
.bouncer-top-row .bouncer-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-inline-size: 0;
  flex: 1 1 auto;
}

.bouncer-top-row #pass-domain-sep {
  display: none !important;
}

.bouncer-top-row #pass-domain-text:not(:empty) {
  font-size: 11.5px;
  font-weight: 700;
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 8px;
  padding: 4px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-inline-size: 130px;
  flex-shrink: 0;
}

/* Daily Briefing / Reader Modal single-line header */
#reader-overlay .reader-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-inline-size: 0;
  flex: 1 1 auto;
}

#reader-overlay .reader-title-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-inline-size: 0;
  flex: 1 1 auto;
}

#reader-overlay .reader-title {
  font-size: 15px;
  line-height: 1.2;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#reader-overlay .reader-badge {
  display: none !important;
}

#reader-overlay[data-is-briefing="1"] #reader-obsidian-btn {
  display: none !important;
}

/* Today Header single-line Brand Pill + right-aligned date */
.app-header .header-left.today-brand-upgraded {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.app-header:has(#fp-hdr-pill) #current-date,
.app-header:has(#fp-hdr-pill) .header-subtitle,
.app-header.has-pass-pill #current-date,
.app-header.has-pass-pill .header-subtitle {
  display: none !important;
}

@supports not selector(:has(*)) {
  .app-header.has-pass-pill #current-date,
  .app-header.has-pass-pill .header-subtitle {
    display: none !important;
  }
}

.app-header .today-brand-upgraded .header-title {
  font-size: 16px;
  line-height: 1.2;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.app-header .today-brand-upgraded .header-subtitle,
.app-header #current-date {
  margin: 0 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 11.5px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: none;
}

.app-header #current-date .today-date-wk {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  text-box: trim-both cap alphabetic;
}

.app-header #current-date .today-date-sep {
  width: 1px;
  height: 11px;
  background: rgba(148, 163, 184, 0.28);
  flex-shrink: 0;
}

.app-header #current-date .today-date-md {
  font-size: 11.5px;
  font-weight: 700;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  text-box: trim-both cap alphabetic;
}

.app-header #current-date.cleared {
  border-color: rgba(16, 185, 129, 0.42);
  background: rgba(16, 185, 129, 0.10);
  color: #6ee7b7;
  text-shadow: none;
}

.app-header #current-date.cleared .today-date-md {
  color: #6ee7b7;
}

/* Workout title label inside pill — collapses to icon-only badge when top row gets tight */
.wk-app-brand-wrap .wk-brand-label {
  display: inline;
  font-size: 0.78rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

@container workout (max-width: 395px) {
  .wk-app-brand-wrap {
    padding: 4px 6px !important;
    gap: 0 !important;
  }
  .wk-app-brand-wrap .wk-brand-label {
    display: none !important;
  }
}

@media (max-width: 420px) {
  .wk-app-brand-wrap {
    padding: 4px 6px !important;
    gap: 0 !important;
  }
  .wk-app-brand-wrap .wk-brand-label {
    display: none !important;
  }
}

body.force-mobile-view .wk-app-brand-wrap {
  padding: 4px 6px !important;
  gap: 0 !important;
}

body.force-mobile-view .wk-app-brand-wrap .wk-brand-label {
  display: none !important;
}

/* 8. Shared Queue Row, Domain Tag & Completed Archive Primitives (`deck.css` + `Briefing → AIQ`) */
.q-row-text-stack {
  flex: 1 1 auto;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.q-row-question-note {
  display: inline-block;
  align-self: flex-start;
  max-inline-size: 100%;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.25;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.34);
  border-radius: 6px;
  padding: 2px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.q-row-actions {
  margin-inline-start: auto;
  display: inline-flex;
  align-items: safe center;
  gap: 5px;
  flex-shrink: 0;
}

.q-tag {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  line-height: 1.3;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.1);
  color: #cbd5e1;
}

.q-tag[data-tone="amber"] {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(251, 191, 36, 0.34);
  color: #fde68a;
}

.q-tag[data-tone="sky"] {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(56, 189, 248, 0.34);
  color: #bae6fd;
}

.q-tag[data-tone="emerald"] {
  background: rgba(16, 185, 129, 0.14);
  border-color: rgba(52, 211, 153, 0.34);
  color: #a7f3d0;
}

.q-tag[data-tone="violet"] {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(167, 139, 250, 0.34);
  color: #ddd6fe;
}

.q-tag[data-tone="rose"] {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(251, 113, 133, 0.34);
  color: #fecdd3;
}

.q-archive-summary {
  list-style: none;
  display: flex;
  align-items: safe center;
  justify-content: space-between;
  gap: 8px;
  padding: 11px 14px;
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.q-archive-summary:focus {
  outline: none;
}

.q-archive-summary:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1.5px rgba(56, 189, 248, 0.55);
  border-radius: 13px;
}

.q-archive-summary::-webkit-details-marker {
  display: none;
}

.q-archive-summary:hover {
  background: rgba(255, 255, 255, 0.03);
}

.q-archive-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
}

.q-archive-meta {
  display: inline-flex;
  align-items: safe center;
  gap: 8px;
}

.q-archive-badge {
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.68rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.28);
  padding: 2px 8px;
  border-radius: 999px;
}

.q-archive-chevron {
  color: #94a3b8;
  display: inline-flex;
  transition: transform 0.2s ease;
}

details[open] > .q-archive-summary .q-archive-chevron {
  transform: rotate(180deg);
}

.q-archive-body {
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(9, 13, 22, 0.35);
}

/* 9. Shared Quick-Capture Bar, Modal-Docking & Toast Banner (`sdk/capture-bar.js`) */
.capture-bar {
  position: fixed;
  bottom: 16px;
  left: 0;
  right: 0;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-top: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 10500;
}

.capture-bar .capture-wrapper,
.capture-bar.docked-in-modal {
  display: none !important;
}

.capture-wrapper {
  width: 100%;
  max-width: 640px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #12141c;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  padding: 6px 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.capture-bar.docked-in-modal .capture-wrapper {
  max-width: 100%;
  border-color: rgba(56, 189, 248, 0.32);
  background: rgba(15, 23, 42, 0.78);
}

.capture-wrapper:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2), 0 4px 24px rgba(0, 0, 0, 0.7);
}

.task-input {
  flex-grow: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-sans-core);
  font-size: 14.5px;
  resize: none;
  max-height: 120px;
  padding: 6px 4px;
  line-height: 1.4;
}

.task-input::placeholder {
  color: #64748b;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.force-mobile-view .task-input {
  font-size: 13.5px;
}

@media (max-width: 640px) {
  .task-input {
    font-size: 13.5px;
  }
}

.mic-btn,
.send-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  transition: all 0.15s ease;
  position: relative;
}

.mic-btn {
  color: #c084fc;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.25);
}

.mic-btn:hover {
  color: #d8b4fe;
  background: rgba(168, 85, 247, 0.22);
  border-color: rgba(168, 85, 247, 0.45);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}

.mic-btn.listening {
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.16);
  border-color: rgba(56, 189, 248, 0.68);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.mic-btn.listening .mic-icon {
  display: none;
}

.mic-tape {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  height: 18px;
  pointer-events: none;
}

.mic-btn.listening .mic-tape {
  display: inline-flex;
}

.mic-tape-bar {
  width: 2.5px;
  height: 18px;
  border-radius: 999px;
  background: #38bdf8;
  transform-origin: center center;
  transform: scaleY(0.14);
  opacity: 0.34;
  will-change: transform, opacity;
  transition: transform 55ms ease-out, opacity 55ms ease-out, background-color 120ms ease;
}

.mic-tape-bar.is-peak {
  background: #e0f2fe;
}

@media (prefers-reduced-motion: reduce) {
  .mic-tape-bar {
    transition: opacity 120ms ease;
  }
}

.send-btn {
  color: #38bdf8;
  background: rgba(14, 165, 233, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.send-btn:hover {
  color: #7dd3fc;
  background: rgba(14, 165, 233, 0.28);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 12px rgba(14, 165, 233, 0.35);
  transform: scale(1.04);
}

.send-btn:active {
  transform: scale(0.96);
}

.mic-icon,
.send-icon {
  width: 19px;
  height: 19px;
}

.toast-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  font-weight: 500;
  color: #10b981;
  background: rgba(11, 17, 26, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 8px 14px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  margin-top: 8px;
  opacity: 0;
  transform: translateY(6px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.toast-banner.show {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* 10. Universal Stroke Chevron Affordance */
.ctrl-stroke-chevron {
  display: block;
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

.ctrl-stroke-chevron.is-open,
details[open] > summary .ctrl-stroke-chevron,
[aria-expanded="true"] .ctrl-stroke-chevron {
  transform: rotate(180deg);
}

.reservoir-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: none !important;
}

/* 11. Zero-Flash Persistent Edge Chrome (Vault Tab & Pixel Capture Tab) */
.vault-edge-tab {
  position: fixed;
  right: 0;
  top: 42%;
  transform: translateY(-50%);
  z-index: 9995;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-right: none;
  border-radius: 10px 0 0 10px;
  padding: 10px 3.5px;
  color: #e0f2fe;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: -4px 0 18px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background-color 0.18s ease, color 0.18s ease;
  font-family: var(--font-sans-core);
}

body.force-mobile-view .vault-edge-tab {
  right: max(0px, calc(50vw - var(--mobile-frame-w, 360px) / 2));
}

.vault-edge-tab:hover {
  background: rgba(14, 165, 233, 0.26);
  color: #ffffff;
}

#pixel-edge-tab {
  position: fixed;
  right: 0;
  top: var(--pixel-hud-top, 32%);
  transform: translateY(-50%);
  width: 20px;
  height: 72px;
  border-radius: 11px 0 0 11px;
  background: rgba(10, 17, 28, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.44);
  border-right: none;
  box-shadow: -2px 0 12px rgba(56, 189, 248, 0.18);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10899;
  user-select: none;
  touch-action: none;
}

body.force-mobile-view #pixel-edge-tab {
  right: max(0px, calc(50vw - var(--mobile-frame-w, 360px) / 2));
}

#pixel-edge-tab::before {
  content: '';
  position: absolute;
  top: -10px;
  bottom: -10px;
  left: -20px;
  right: 0;
}

#pixel-edge-tab::after {
  content: '';
  width: 3.5px;
  height: 30px;
  border-radius: 2px;
  background: linear-gradient(180deg, #38bdf8, #a855f7);
  opacity: 0.9;
}

html:not(.unauthenticated) body.show-pixel-hud #pixel-edge-tab {
  display: flex;
}
