/* Nebula hub and sandbox pages: Star Trove card + pill structure in Nebula colors */
html, body { height: 100%; }
[hidden] { display: none !important; }
.portal { min-height: 100%; display: grid; grid-template-rows: auto 1fr; }
.portal-top { padding-block: 20px; }
.portal-main { display: grid; justify-items: center; align-content: start; gap: 28px; padding-block: 56px 120px; text-align: center; }

.neb-wm { display: inline-flex; align-items: baseline; font-family: "Sora", system-ui, sans-serif; font-weight: 600; letter-spacing: .01em; line-height: 1; color: #17264A; }
.neb-wm svg { width: .625em; height: .594em; margin: 0 .047em 0 .0625em; overflow: visible; }
.neb-sub { margin: 0; font-family: "Sora", system-ui, sans-serif; font-size: 16px; color: #4A5672; }
.box-title { margin: 0; font-family: "Sora", system-ui, sans-serif; font-weight: 600; font-size: clamp(30px, 5vw, 44px); line-height: 1.15; color: #17264A; }
.box-eyebrow { font-family: "Sora", system-ui, sans-serif; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #9A7A2E; text-decoration: none; }
.box-eyebrow:hover { text-decoration: underline; }

/* pill + spark */
.pill {
  display: inline-flex; align-items: center; gap: 12px; min-height: 52px;
  padding: 0 24px 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: #17264A; color: #ffffff; font: 700 16px/1 var(--font-sans); text-decoration: none;
}
.pill:hover { opacity: 0.92; }
.pill:disabled { opacity: 0.7; cursor: progress; }
.pill.ghost { background: transparent; color: #17264A; border: 1px solid #DDE2EC; padding: 0 22px; }
.spk { width: 26px; height: 26px; flex-shrink: 0; overflow: visible; }
.spk .r, .spk .core { fill: #7b879b; transform-box: fill-box; transform-origin: center; }
[data-state="listening"] .spk .r, [data-state="listening"] .spk .core,
[data-state="speaking"] .spk .r, [data-state="speaking"] .spk .core { fill: #C8A24A; }
@media (prefers-reduced-motion: no-preference) {
  [data-state="connecting"] .spk .core { animation: corepulse 1s ease-in-out infinite; }
  [data-state="speaking"] .spk .core { animation: corepulse 1.2s ease-in-out infinite; }
  [data-state="speaking"] .spk .r { animation: ringtwinkle 1.2s ease-in-out infinite; }
  [data-state="speaking"] .spk .r:nth-child(2) { animation-delay: .15s; }
  [data-state="speaking"] .spk .r:nth-child(3) { animation-delay: .3s; }
  [data-state="speaking"] .spk .r:nth-child(4) { animation-delay: .45s; }
  [data-state="speaking"] .spk .r:nth-child(5) { animation-delay: .6s; }
  [data-state="speaking"] .spk .r:nth-child(6) { animation-delay: .75s; }
  [data-state="speaking"] .spk .r:nth-child(7) { animation-delay: .9s; }
  [data-state="speaking"] .spk .r:nth-child(8) { animation-delay: 1.05s; }
}
@keyframes corepulse { 0%, 100% { transform: scale(0.85); opacity: .8; } 45% { transform: scale(1.2); opacity: 1; } }
@keyframes ringtwinkle { 0%, 100% { opacity: .35; transform: scale(.7); } 30% { opacity: 1; transform: scale(1.25); } }
.st { font-size: 14px; font-weight: 600; color: var(--ink-muted); margin: 0; min-height: 20px; word-break: break-word; }

/* hub */
.setup { display: grid; justify-items: center; gap: 10px; }
.boxes { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; width: min(760px, 100%); }
.boxes a { flex: 0 0 auto; width: 240px; max-width: 100%; }
@media (max-width: 640px) { .boxes a { width: 100%; } }
.boxes a {
  display: grid; place-items: center; min-height: 64px; padding: 14px 12px;
  border: 1px solid #DDE2EC; border-radius: var(--radius-md); background: var(--surface);
  font: 600 16px/1.25 "Sora", system-ui, sans-serif; color: #17264A; text-decoration: none;
}
.boxes a:hover { border-color: #17264A; }
.boxes-label { margin: 8px 0 0; font-family: "Sora", system-ui, sans-serif; font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #4A5672; }

/* sandbox cards */
.agents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 14px; width: min(760px, 100%); text-align: left; }
@media (max-width: 600px) { .agents { grid-template-columns: 1fr; } }
.agent { display: flex; flex-direction: column; gap: 8px; padding: 22px; height: 100%; border: 1px solid #DDE2EC; border-radius: var(--radius-lg); background: var(--surface); color: var(--ink); }
.agent.doc { border-style: dashed; }
.agent.wide { grid-column: 1 / -1; }
.agent.soon { background: transparent; }
.soon-tag { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #DDE2EC; font: 600 14px/1 var(--font-sans); color: #4A5672; }
.home-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.home-actions .learn { min-height: 52px; }
.agent[data-state="listening"], .agent[data-state="speaking"], .agent[data-state="connecting"] { border-color: #C8A24A; box-shadow: inset 0 0 0 1px #C8A24A; }
.agent .k { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #9A7A2E; }
.agent .n { font-family: "Sora", system-ui, sans-serif; font-size: 19px; font-weight: 600; }
.agent .d { font-size: 15px; line-height: 1.5; color: var(--ink-muted); }
.ctl { margin-top: auto; padding-top: 10px; display: grid; gap: 8px; justify-items: start; }
.snap[hidden] { display: none; }
.file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* records */
.records { width: min(760px, 100%); text-align: left; display: grid; gap: 12px; }
.records h2 { margin: 12px 0 0; font-family: "Sora", system-ui, sans-serif; font-size: 22px; font-weight: 600; color: #17264A; }
#rec-list { display: grid; gap: 12px; }
.records .empty { margin: 0; color: var(--ink-muted); font-size: 15px; }
.rec { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 16px; border: 1px solid #DDE2EC; border-radius: var(--radius-md); background: var(--surface); }
.rec.starred { border-color: #C8A24A; }
.rec img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; background: #F4F6FA; }
.rec .body { grid-column: 2; display: grid; gap: 6px; min-width: 0; }
.rec:not(.has-photo) .body { grid-column: 1 / -1; }
.rec .meta { font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #4A5672; }
.rec.starred .meta { color: #9A7A2E; }
.rec .t { font-family: "Sora", system-ui, sans-serif; font-weight: 600; font-size: 17px; color: var(--ink); }
.rec .x { margin: 0; white-space: pre-wrap; font-size: 15px; line-height: 1.5; color: var(--ink-muted); overflow-wrap: anywhere; }
.rec .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.rec .acts button { min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid #DDE2EC; background: var(--surface); color: #17264A; font: 600 14px/1 var(--font-sans); cursor: pointer; }
.rec .acts button.star { background: #17264A; border-color: #17264A; color: #fff; }

/* lock + delete */
.lock { display: grid; gap: 12px; width: min(340px, 100%); justify-items: center; }
.lock input, .danger input { width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid #DDE2EC; border-radius: 999px; font: 500 16px/1 var(--font-sans); text-align: center; background: var(--surface); color: var(--ink); }
.danger { display: grid; gap: 10px; justify-items: center; width: min(340px, 100%); margin-top: 24px; }
.linkbtn { border: 0; background: none; color: #4A5672; font: 600 14px/1 var(--font-sans); cursor: pointer; text-decoration: underline; padding: 8px; }
.err { margin: 0; font-size: 14px; font-weight: 600; color: #a3271c; min-height: 18px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .neb-wm, :root:not([data-theme="light"]) .box-title, :root:not([data-theme="light"]) .records h2 { color: #FFFFFF; }
  :root:not([data-theme="light"]) .neb-wm path[stroke] { stroke: #FFFFFF; }
  :root:not([data-theme="light"]) .neb-sub, :root:not([data-theme="light"]) .boxes-label, :root:not([data-theme="light"]) .rec .meta { color: #AEB8CC; }
  :root:not([data-theme="light"]) .agent .k, :root:not([data-theme="light"]) .box-eyebrow { color: #C8A24A; }
  :root:not([data-theme="light"]) .pill { background: #2A3B66; }
  :root:not([data-theme="light"]) .pill.ghost, :root:not([data-theme="light"]) .boxes a, :root:not([data-theme="light"]) .rec .acts button { color: #FFFFFF; border-color: #3A4766; }
  :root:not([data-theme="light"]) .agent, :root:not([data-theme="light"]) .rec, :root:not([data-theme="light"]) .boxes a { border-color: #3A4766; }
}

.example-note { margin: 0; padding: 10px 16px; border-radius: 999px; background: #F4F6FA; color: #4A5672; font-size: 14px; font-weight: 600; }
.boxes a .ex-tag { display: block; margin-top: 4px; font: 600 10px/1 var(--font-sans); letter-spacing: .14em; text-transform: uppercase; color: #9A7A2E; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .example-note { background: #1B2540; color: #AEB8CC; } }

/* contact records */
.rec.contact .t { display: flex; align-items: center; gap: 8px; }
.rec .person { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: #9A7A2E; stroke-width: 2; stroke-linecap: round; }
.rec .tel { justify-self: start; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; background: #17264A; color: #fff; font: 700 16px/1 var(--font-sans); text-decoration: none; letter-spacing: .02em; }
.rec .tel:not([href]) { background: #F4F6FA; color: #17264A; }
.rec .tel[href]::before { content: "☎"; margin-right: 8px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rec .tel { background: #2A3B66; } :root:not([data-theme="light"]) .rec .person { stroke: #C8A24A; } }

/* Approver sign-in (Star List, Star Check) */
.ap-form { display: grid; gap: 10px; width: min(340px, 100%); justify-items: stretch; text-align: center; margin-inline: auto; }
.ap-form input, .ap-form select { width: 100%; min-height: 46px; padding: 0 16px; border: 1px solid #DDE2EC; border-radius: 999px; font: 500 16px/1 var(--font-sans); text-align: center; background: var(--surface); color: var(--ink); }
.ap-form .pill { justify-self: center; }
.ap-forgot { justify-self: center; background: none; border: 0; padding: 0; font: 600 13px/1.4 var(--font-sans); color: var(--ink-muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ap-reset { display: grid; gap: 8px; }
.ap-reset[hidden] { display: none; }
.ap-h { margin: 0; font-family: "Sora", system-ui, sans-serif; font-weight: 600; font-size: 18px; color: var(--ink); }
.ap-note { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-muted); }
.rec .stamp { font-size: 13px; font-weight: 600; color: #9A7A2E; }
.rec.aside { opacity: .78; border-style: dashed; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ap-form input, :root:not([data-theme="light"]) .ap-form select { border-color: #3A4766; }
  :root:not([data-theme="light"]) .ap-h { color: #fff; }
  :root:not([data-theme="light"]) .rec .stamp { color: #E0BD63; }
}
