/* QIU design system, in Quantum's «Q» brand (quantumventures.io/quantum-hoy/marca.css, 28/09). Tokens first; every
   component below reads only tokens, so a theme is a token swap. The structure is white, black and grey; the blue
   #0041F5 is the only colour, for action (on black it is #5984F8). Black belongs to Qiu. Green, amber and red only say
   ok / careful / error (Qiu's own states use them too). Manrope for everything; Orbitron only for wordmarks (.cuadrada).
   Themes (Perfil › Tema): Noche = Qiu's black, Día = Quantum's white. Qiu's face and its 7 states (brand/) never change.
   Screens: use these classes and variables, never hard-coded colours. */
@font-face { font-family: 'Manrope'; src: url('/qiu/fonts/manrope.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }
@font-face { font-family: 'Orbitron'; src: url('/qiu/fonts/orbitron.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --brand: #0041F5; --brand-hover: #0034C8; --brand-soft: rgba(89, 132, 248, .16); --brand-text: #5984F8;
  --bg: #000000; --surface: #0E0E11; --surface-2: #17171B; --surface-3: #26262B;
  --fg: #F5F5F7; --fg-2: #C7C7CC; --muted: #8E8E93;
  --line: #26262B; --line-2: #3A3A40;
  --green: #00D1A1; --amber: #FFC107; --red: #FF4D4F;
  --cyan: var(--brand-text); --violet: var(--brand-text); /* old names, both the Q blue text/icons can take (on black #5984F8: contrast) */
  --glass: rgba(14, 14, 17, .8);
  --aurora-1: transparent; --aurora-2: transparent; /* no colour fields */
  --shadow-1: none;
  --shadow-2: 0 24px 60px rgba(0, 0, 0, .6), 0 0 0 1px var(--line);
  --glow: 0 0 #0000;
  --orb-shadow: rgba(0, 0, 0, .55);
  --focus: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand-text);
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 26px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: var(--font);
  --font-mark: 'Orbitron', var(--font);
  --ease: cubic-bezier(.22, .61, .36, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 140ms; --t: 240ms;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  --tabbar-h: 66px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --brand-soft: rgba(0, 65, 245, .09); --brand-text: #0041F5;
  --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F5F5F7; --surface-3: #ECEEF1;
  --fg: #0A0A0C; --fg-2: #5C5C63; --muted: #6E6E73;
  --line: #E3E4E8; --line-2: #C9CBD1;
  --green: #007552; --amber: #865C00; --red: #C4262A;
  --glass: rgba(255, 255, 255, .86);
  --shadow-1: 0 1px 2px rgba(10, 10, 12, .04);
  --shadow-2: 0 24px 60px rgba(10, 10, 12, .16), 0 0 0 1px var(--line);
  --orb-shadow: rgba(10, 10, 12, .16);
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    color-scheme: light;
    --brand-soft: rgba(0, 65, 245, .09); --brand-text: #0041F5;
    --bg: #FFFFFF; --surface: #FFFFFF; --surface-2: #F5F5F7; --surface-3: #ECEEF1;
    --fg: #0A0A0C; --fg-2: #5C5C63; --muted: #6E6E73;
    --line: #E3E4E8; --line-2: #C9CBD1;
    --green: #007552; --amber: #865C00; --red: #C4262A;
    --glass: rgba(255, 255, 255, .86);
    --shadow-1: 0 1px 2px rgba(10, 10, 12, .04);
    --shadow-2: 0 24px 60px rgba(10, 10, 12, .16), 0 0 0 1px var(--line);
    --orb-shadow: rgba(10, 10, 12, .16);
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--fg);
  font: 400 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; line-height: 1.15; margin: 0; }
h1 { font-size: clamp(27px, 5vw, 34px); }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
/* Wordmarks («QIU», «Q Pro»…): Orbitron, as Quantum's .cuadrada. Written normally in the HTML, shown in capitals. */
.cuadrada { font-family: var(--font-mark); font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
/* The blue second half of a headline (Quantum's .suave): always on its own line. */
.suave { display: block; color: var(--brand-text); }
p { margin: 0; }
a { color: inherit; }
img, svg { display: block; }
[hidden] { display: none !important; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.eyebrow { font: 700 12px/1 var(--font-display); letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin: 0 4px 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: var(--brand); color: #fff; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
#view:focus { outline: none; box-shadow: none; }

/* ---------- shell ---------- */
#app { position: relative; z-index: 1; min-height: 100dvh; }
#view {
  min-width: 0; animation: view-in var(--t) var(--ease);
  /* bottom: the tab bar, its 10px lift and the [Q] sphere standing ~34px above it, plus room to breathe */
  padding: calc(20px + var(--safe-t)) calc(16px + var(--safe-r)) calc(var(--tabbar-h) + 64px + var(--safe-b)) calc(16px + var(--safe-l));
}
.page { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

#tabbar {
  position: fixed; z-index: 20; left: calc(12px + var(--safe-l)); right: calc(12px + var(--safe-r)); bottom: calc(10px + var(--safe-b));
  height: var(--tabbar-h); display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(1.6); backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--line-2); border-radius: 24px; box-shadow: var(--shadow-2);
}
#tabbar a {
  display: grid; justify-items: center; gap: 3px; padding: 6px 0; color: var(--muted); text-decoration: none;
  font: 600 11px/1.1 var(--font); letter-spacing: .01em; transition: color var(--t-fast);
}
#tabbar a:hover, #tabbar a[aria-current] { color: var(--fg); }
.tab-ico { display: grid; place-items: center; width: 54px; height: 30px; border-radius: 999px; transition: background var(--t) var(--ease), transform var(--t) var(--spring); }
#tabbar a[aria-current] .tab-ico { background: var(--brand-soft); color: var(--brand-text); }
#tabbar a:active .tab-ico { transform: scale(.9); }
.side-brand, .tab-label-long, #split { display: none !important; }

/* the central [Q] */
#tabbar .tab-q { margin-top: -34px; gap: 5px; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.q-btn { position: relative; display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; transition: transform var(--t) var(--spring); }
.q-btn::before { /* luminous ring */
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  background: conic-gradient(from 0deg, #0041F5, #5984F8, #0041F5); animation: spin 7s linear infinite;
  box-shadow: 0 14px 34px rgba(0, 65, 245, .32);
}
.q-btn::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 50% 35%, #1C1C21, #000 72%); }
.q-btn img { position: relative; z-index: 1; width: 48px; height: 48px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
.tab-q:hover .q-btn { transform: translateY(-2px); }
.tab-q.pressing .q-btn { transform: scale(.9); }
.tab-q.pressing .q-btn::before { animation-duration: .9s; box-shadow: 0 0 36px 4px rgba(89, 132, 248, .55); }

/* desktop & iPad: sidebar | divider | content */
@media (min-width: 768px) {
  #app { display: grid; grid-template-columns: var(--side, 248px) 10px minmax(0, 1fr); }
  #view { grid-row: 1; grid-column: 3; padding: calc(32px + var(--safe-t)) clamp(20px, 4vw, 56px) 56px; }
  #tabbar {
    grid-row: 1; grid-column: 1; position: sticky; top: 0; left: auto; right: auto; bottom: auto; height: 100dvh;
    display: flex; flex-direction: column; align-items: stretch; gap: 4px; padding: calc(22px + var(--safe-t)) 12px 22px calc(12px + var(--safe-l));
    border: 0; border-right: 1px solid var(--line); border-radius: 0; box-shadow: none; overflow: hidden; container-type: inline-size;
    background: color-mix(in srgb, var(--surface) 72%, transparent);
  }
  .side-brand { display: flex !important; order: -2; margin: 0 6px 20px; }
  #tabbar .side-brand { font: 600 17px/1 var(--font-mark); letter-spacing: .1em; color: var(--fg); } /* the wordmark, not a tab */
  #tabbar a { display: flex; align-items: center; gap: 10px; padding: 4px; border-radius: var(--r); font-size: 14.5px; }
  #tabbar a:hover { background: var(--surface-2); }
  .tab-ico { width: 40px; height: 36px; border-radius: 12px; flex: none; }
  #tabbar .tab-q {
    order: -1; margin: 0 0 16px; padding: 8px; gap: 12px; color: var(--fg);
    background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 38%, transparent);
  }
  #tabbar .tab-q:hover { background: color-mix(in srgb, var(--brand) 22%, transparent); }
  .q-btn { width: 38px; height: 38px; flex: none; } .q-btn img { width: 30px; height: 30px; }
  .tab-q .tab-label { display: none; } .tab-label-long { display: inline !important; font-family: var(--font-display); font-weight: 600; }
  #split { display: block !important; grid-row: 1; grid-column: 2; position: sticky; top: 0; height: 100dvh; cursor: col-resize; touch-action: none; border-radius: 0; }
  #split::after { content: ''; position: absolute; inset: 0 4px; border-radius: 2px; transition: background var(--t-fast); }
  #split:hover::after, #split:focus-visible::after, #split.dragging::after { background: var(--brand); }
  #split:focus-visible { box-shadow: none; }
  .toast { bottom: calc(28px + var(--safe-b)) !important; }
  @container (max-width: 150px) {
    .tab-label, .tab-label-long, .side-brand span { display: none !important; }
    #tabbar a, .side-brand { justify-content: center; }
    #tabbar .tab-q { padding: 4px; }
  }
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer;
  font: 600 15px/1.35 var(--font); text-decoration: none; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease), box-shadow var(--t-fast), opacity var(--t-fast);
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn:active { transform: scale(.97); }
.btn:focus-visible { border-radius: 999px; }
.btn[disabled], .btn[aria-busy="true"] { opacity: .55; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line-2); }
.btn.ghost:hover { background: color-mix(in srgb, var(--fg) 5%, transparent); border-color: var(--fg); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn.quiet:hover { background: var(--surface-2); color: var(--fg); }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.danger:hover { background: var(--red); border-color: var(--red); filter: brightness(1.08); }
.btn.danger-soft { background: color-mix(in srgb, var(--red) 12%, transparent); border-color: transparent; color: var(--red); }
.btn.danger-soft:hover { background: color-mix(in srgb, var(--red) 20%, transparent); }
.btn.sm { min-height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.icon { width: 44px; padding: 0; } .btn.icon.sm { width: 34px; }
.btn.block { width: 100%; }

/* ---------- form controls ---------- */
.field { display: grid; gap: 6px; }
label, .label { font: 600 13px/1.3 var(--font); color: var(--fg-2); }
:where(.input, input:not([type=checkbox], [type=radio], [type=file], [type=range]), select, textarea) {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--fg); font: 400 15px/1.4 var(--font); -webkit-appearance: none; appearance: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
:where(textarea) { resize: vertical; min-height: 96px; }
:where(select) { padding-right: 40px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237D869A' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; }
::placeholder { color: var(--muted); }
:where(input, select, textarea, .input):focus-visible { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); border-radius: var(--r); }
.switch {
  -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 50px; height: 30px; margin: 0; cursor: pointer;
  border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line-2); transition: background var(--t) var(--ease);
}
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); transition: transform var(--t) var(--spring); }
.switch:checked { background: var(--brand); border-color: transparent; }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { border-radius: 999px; }
.seg { display: inline-grid; grid-auto-flow: column; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; color: var(--fg-2); font: 600 13px/1 var(--font); padding: 8px 9px; border-radius: 999px; cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(0, 0, 0, .25), 0 0 0 1px var(--line-2); }
.seg button:focus-visible { border-radius: 999px; }

/* ---------- surfaces, lists, chips ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
ol.list, ul.list { margin: 0; padding: 0; list-style: none; } /* step lists (Bitwarden, add to home screen, /android) */
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-height: 60px; padding: 12px 16px; }
.list > * + * { border-top: 1px solid var(--line); }
.row .body { flex: 1; min-width: 4em; } /* narrower than this, .end drops to its own line */
.row .title { font-weight: 600; overflow-wrap: anywhere; }
.row .title label { font: inherit; color: inherit; }
.row .sub { color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.row .end { display: flex; align-items: center; gap: 8px; flex: none; margin-left: auto; }
a.row, button.row { width: 100%; color: inherit; text-decoration: none; text-align: left; background: none; border: 0; font: inherit; cursor: pointer; transition: background var(--t-fast); }
a.row:hover, button.row:hover { background: var(--surface-2); }
.tile { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); color: var(--fg-2); border: 1px solid var(--line); overflow: hidden; }
.tile.brand { background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.tile img { width: 20px; height: 20px; }
.tile .brand-logo { width: 100%; height: 100%; } /* icons.js brandLogo: the service's own logo fills its tile */
.tile.q-tile { background: #fff; } .tile.q-tile img { width: 24px; height: 24px; } /* the «Q» of a plan: it has no white version */
:root:not([data-theme="light"]) .tile img.logo { filter: invert(1); }
@media (prefers-color-scheme: light) { :root[data-theme="system"] .tile img.logo { filter: none; } }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 8px; border-radius: 999px; font: 600 12px/1.4 var(--font); white-space: nowrap; background: color-mix(in srgb, currentColor 13%, transparent); color: var(--fg-2); }
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ok { color: var(--green); } .status.warn { color: var(--amber); } .status.err { color: var(--red); } .status.info { color: var(--cyan); }
a.status { text-decoration: none; } /* a pill that opens something (Perfil › Invitar: «Conectados» → the contact) */
.badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--brand); color: #fff; font: 700 11px/18px var(--font); text-align: center; }
.avatar { --s: 64px; position: relative; flex: none; display: grid; place-items: center; width: var(--s); height: var(--s); border-radius: 50%; overflow: hidden; color: #fff; font: 600 calc(var(--s) * .38)/1 var(--font-display); background: var(--brand); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--line-2); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font: 600 18px/1 var(--font-mark); letter-spacing: .1em; text-decoration: none; color: var(--fg); }
.wordmark img { width: 30px; height: 30px; filter: drop-shadow(0 4px 10px var(--orb-shadow)); }
.empty { display: grid; justify-items: center; gap: 6px; padding: 26px 20px; text-align: center; color: var(--muted); }
.empty .ico { width: 28px; height: 28px; color: var(--fg-2); margin-bottom: 4px; }
.skeleton { width: 100%; min-height: 60px; border-radius: var(--r-lg); background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }

/* ---------- chat bubbles & composer ---------- */
.bubbles { display: grid; gap: 8px; align-content: start; }
.bubble { max-width: min(82%, 560px); padding: 10px 14px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; animation: pop var(--t) var(--ease); }
.bubble.me { justify-self: end; background: var(--brand); border-color: transparent; color: #fff; border-bottom-right-radius: 6px; }
.bubble.qiu { justify-self: start; border-bottom-left-radius: 6px; }
.bubble .meta { display: block; margin-top: 4px; font-size: 11.5px; opacity: .65; }
.composer { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); }
.composer:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.composer input:not([type]), .composer input[type=text] { flex: 1; min-height: 40px; padding: 0; border: 0; background: none; box-shadow: none !important; }
.composer .btn { width: 40px; min-height: 40px; padding: 0; }

/* ---------- dialogs, sheets, toast ---------- */
dialog { color: var(--fg); }
dialog::backdrop { background: rgba(4, 6, 10, .62); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.dialog { width: min(92vw, 420px); padding: 24px; border: 1px solid var(--line-2); border-radius: 26px; background: var(--surface); box-shadow: var(--shadow-2); animation: pop var(--t) var(--ease); }
.dialog h2 { margin-bottom: 8px; } .dialog p { color: var(--fg-2); }
.actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }
.actions .btn { flex: 1; }
.sheet {
  width: 100%; max-width: 560px; max-height: 88dvh; margin: auto auto 0; overflow-y: auto;
  padding: 10px 20px calc(24px + var(--safe-b)); border: 1px solid var(--line-2); border-bottom: 0; border-radius: 28px 28px 0 0;
  background: var(--surface); box-shadow: var(--shadow-2); animation: sheet-up var(--t) var(--ease);
}
.sheet::before { content: ''; display: block; width: 40px; height: 5px; margin: 0 auto 16px; border-radius: 3px; background: var(--line-2); }
.sheet > * { display: grid; gap: 16px; }
@media (min-width: 768px) {
  .sheet { margin: auto; padding-top: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line-2); border-radius: 28px; animation-name: pop; }
  .sheet::before { display: none; }
}
.toast {
  position: fixed; z-index: 100; left: 50%; bottom: calc(var(--tabbar-h) + 44px + var(--safe-b)); transform: translateX(-50%); width: max-content;
  max-width: min(92vw, 440px); padding: 12px 18px; border-radius: 16px; font-weight: 500;
  background: color-mix(in srgb, var(--surface-3) 94%, transparent); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--line-2); box-shadow: var(--shadow-2); animation: toast-in var(--t) var(--spring);
}
body[data-screen="q"] .toast { bottom: calc(110px + var(--safe-b)); }

/* ---------- [Q] voice screen ---------- */
body[data-screen="q"] #tabbar, body[data-screen="q"] #split { display: none !important; }
.q {
  position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: auto 1fr auto; gap: 12px; overflow: hidden;
  padding: calc(12px + var(--safe-t)) calc(16px + var(--safe-r)) calc(18px + var(--safe-b)) calc(16px + var(--safe-l));
  background: radial-gradient(55% 42% at 50% 36%, rgba(0, 65, 245, .22), transparent 72%), var(--bg);
}
.q-top { display: flex; align-items: center; justify-content: space-between; }
.q-status { font: 600 15px/1 var(--font-display); color: var(--fg-2); text-align: center; }
.q-stage { display: grid; place-items: center; align-content: center; gap: 20px; min-height: 0; }
.q-orb { --lvl: 0; position: relative; width: min(54vw, 36vh, 240px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; transform: scale(calc(1 + var(--lvl) * .12)); transition: transform 90ms linear; }
.q-orb:focus-visible { border-radius: 50%; }
.q-orb img { position: relative; width: 100%; height: 100%; filter: drop-shadow(0 26px 40px var(--orb-shadow)); animation: float 6s ease-in-out infinite; }
.q-halo { position: absolute; inset: -22%; border-radius: 50%; background: radial-gradient(circle, rgba(0, 65, 245, .55), rgba(89, 132, 248, .16) 45%, transparent 68%); opacity: calc(.35 + var(--lvl) * .9); filter: blur(10px); animation: breathe 3.4s ease-in-out infinite; }
.q[data-state="listening"] .q-halo { animation-duration: 1.4s; }
.q[data-state="thinking"] .q-orb img { animation: think 1.8s ease-in-out infinite; }
.q[data-state="thinking"] .q-orb { cursor: progress; }
.q-wave { width: min(86vw, 480px); height: 64px; opacity: 0; transition: opacity var(--t); }
.q-timer { font: 700 17px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--fg-2); letter-spacing: .04em; opacity: 0; }
.q[data-state="listening"] :is(.q-wave, .q-timer) { opacity: 1; }
.q-hint { color: var(--muted); text-align: center; min-height: 1.5em; }
.q-note { max-width: min(92vw, 420px); margin-top: -8px; padding: 7px 14px; border-radius: 14px; font-size: 13px; text-align: center; color: var(--fg-2);
  background: color-mix(in srgb, var(--amber) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent); animation: pop var(--t) var(--ease); }
.q-note[hidden] { display: none; }
.q-log { width: min(100%, 640px); max-height: 32dvh; margin: 0 auto; overflow-y: auto; overscroll-behavior: contain; }
.q-log:empty { display: none; }
.q-bottom { display: grid; gap: 12px; justify-items: center; width: min(100%, 640px); margin: 0 auto; }
.q-controls { display: flex; gap: 12px; }
.q[data-state="listening"] .q-controls .btn { min-width: 132px; }
.q-type { width: 100%; }

/* ---------- profile ---------- */
.identity { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 20px; }
.identity > .btn { margin-left: auto; }
@media (max-width: 420px) { .identity [data-edit] { width: 34px; padding: 0; } .identity [data-edit] .lbl { display: none; } }
.identity .who { flex: 1 1 5em; min-width: 0; } /* narrow enough that the edit button stays on the name's row at 320 px */
.identity .who p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity h1 { font-size: 24px; overflow-wrap: anywhere; }
.identity .avatar-wrap { position: relative; flex: none; }
.identity .avatar { --s: 72px; }
.identity .avatar-edit { position: absolute; right: -6px; bottom: -6px; width: 28px; height: 28px; min-height: 28px; box-shadow: 0 0 0 3px var(--surface); }
.group { display: grid; grid-template-columns: minmax(0, 1fr); }
.group-sub { margin: -4px 4px 12px; color: var(--muted); font-size: 13px; }
.stack { display: grid; gap: 16px; }
.row select { width: auto; min-height: 38px; padding-top: 7px; padding-bottom: 7px; }
.row .body > .status { margin-top: 6px; }
.row.danger .title, .row.danger .tile { color: var(--red); }
/* Perfil's sections inside a block (Instinct-like): a title with its lead and «+» on the right, quiet empty lines,
   folded extras (<details>), and rows that are there but switched off («Próximamente»). */
.p-sub { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 12px; margin: 22px 4px 10px; }
.p-sub:first-child { margin-top: 0; }
.p-sub > div:first-child { flex: 1 1 14em; }
.p-fold > summary > .p-sub { margin-top: 22px; }
.p-sub h3 { font: 700 17px/1.25 var(--font-display); }
.p-sub p { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.p-sub > :last-child:not(:first-child) { flex: none; }
.p-sub-end, .p-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.p-none { padding: 16px; color: var(--muted); font-size: 14px; }
.p-fold > summary { list-style: none; cursor: pointer; border-radius: var(--r-lg); }
.p-fold > summary::-webkit-details-marker { display: none; }
.p-fold > summary .ico { transform: rotate(90deg); transition: transform var(--t) var(--ease); color: var(--muted); }
.p-fold[open] > summary .ico { transform: rotate(-90deg); }
.p-secret { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; color: var(--fg-2); }
.row.off { opacity: .55; }
.row.off .status { background: var(--surface-2); }
.p-field { display: flex; gap: 8px; } .p-field input { flex: 1; min-width: 0; }
/* Perfil › Voz: one row per voice, radio + name + play */
.voice-opt { border-top: 1px solid var(--line); min-height: 52px; padding-block: 8px; }
.voice-opt input { width: 20px; height: 20px; margin: 0 10px; accent-color: var(--brand); flex: none; }
.voice-opt label { cursor: pointer; }
.voice-opt:has(:checked) { background: var(--brand-soft); }
.profile-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; color: var(--muted); font-size: 13px; }
.profile-foot a { color: inherit; text-underline-offset: 3px; }
/* invite: Share drops under the text, full width, when the row gets narrow. A link shown in a row: one line, no https:// */
.invite-row .body { flex: 999 1 10em; }
.invite-row > .btn { flex: 1 0 auto; }
.url-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.group, .identity { scroll-margin-top: 24px; } /* old links (/vault, /trusted…) land on their section */
.link-box { font: 500 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--fg-2); overflow-wrap: anywhere; }
/* «Conecta tu IA» (components/own-ai.js): numbered steps, and ChatGPT's one-time code big enough to copy by eye */
.own-flow { display: grid; gap: 22px; } .own-err { margin: 0; color: var(--red); font-size: 14px; }
.own-step { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; }
.own-step > div { display: grid; gap: 10px; justify-items: start; } .own-step p { margin: 0; } .own-step .field { width: 100%; }
.own-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-text); font: 700 14px/1 var(--font-display); }
.own-h { display: flex; align-items: center; gap: 12px; } .own-h .brand-logo { width: 36px; height: 36px; border-radius: 10px; flex: none; }
.own-code { font: 700 26px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; color: var(--fg); user-select: all; }

/* «Montar tu servidor» (screens/developers.js): the order's four steps, done ones ticked and the current one in brand */
.srv-steps { display: grid; gap: 10px; margin: 0; padding: 14px 16px; list-style: none; counter-reset: srv; }
.srv-steps li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; counter-increment: srv; }
.srv-steps li::before { content: counter(srv); display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); font: 700 12px/1 var(--font-display); }
.srv-steps li.done { color: var(--fg-2); } .srv-steps li.done::before { content: '✓'; background: var(--brand-soft); color: var(--brand-text); border-color: transparent; }
.srv-steps li[aria-current] { color: var(--fg); font-weight: 600; } .srv-steps li[aria-current]::before { background: var(--brand); color: #fff; border-color: transparent; }

/* ---------- Qiu's states (components/qiu-state.js): the brand pack's drawings, each with its own small motion ---------- */
.qiu-st { display: block; transform-origin: 50% 70%; }
.qiu-st[data-s="escuchando"] { animation: qiu-listen 1.3s ease-in-out infinite; }
.qiu-st[data-s="pensando"] { animation: think 1.8s ease-in-out infinite; }
.qiu-st[data-s="actuando"] { animation: qiu-hop .75s cubic-bezier(.3, 0, .4, 1) infinite; }
.qiu-st[data-s="exito"] { animation: qiu-hop .5s cubic-bezier(.3, 0, .4, 1) 2; }
.qiu-st[data-s="alerta"] { animation: qiu-nudge .9s ease-in-out 2; }
.qiu-st[data-s="error"] { animation: qiu-shake .42s ease-in-out 2; }
.boot { display: grid; place-items: center; min-height: 70dvh; animation: view-in var(--t) var(--ease); }
.boot img { width: 112px; height: 112px; filter: drop-shadow(0 22px 34px var(--orb-shadow)); }

/* ---------- motion ---------- */
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px); } }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes breathe { 50% { transform: scale(1.07); } }
@keyframes float { 50% { transform: translateY(-7px); } }
@keyframes think { 50% { transform: rotate(-10deg) scale(.97); filter: drop-shadow(0 0 34px rgba(89, 132, 248, .55)) brightness(1.06); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes qiu-listen { 50% { transform: scale(1.07); } }
@keyframes qiu-hop { 40% { transform: translateY(-16%) scale(1.02, .98); } 70% { transform: translateY(0) scale(1.05, .94); } }
@keyframes qiu-nudge { 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes qiu-shake { 25% { transform: translateX(-7%); } 75% { transform: translateX(7%); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .q-orb { transform: none; }
}

/* outage banner (components/status-banner.js): only while something fails for everyone */
.status-banner {
  position: fixed; z-index: 30; top: calc(8px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(640px, calc(100% - 24px));
  display: flex; align-items: center; gap: 10px; padding: 8px 6px 8px 14px; border-radius: 16px; font: 500 13.5px/1.4 var(--font); color: var(--fg);
  background: color-mix(in srgb, var(--amber) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 45%, transparent); box-shadow: var(--shadow-2);
}
.status-banner span { flex: 1; }
.status-banner a { color: var(--fg); font-weight: 700; white-space: nowrap; text-underline-offset: 3px; }
