:root {
  color-scheme: dark;
  font:
    16px/1.5 Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    sans-serif;
  color: #f1f5ff;
  background: #080e20;
  --muted: #a5b1ce;
  --line: #26324f;
  --cyan: #71e8f2;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 80% 5%, #18214655, transparent 55%);
}
button,
input,
select,
textarea {
  font: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
.action {
  cursor: pointer;
  background: #74e7ed;
  color: #071422;
  border: 1px solid transparent;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 650;
  min-height: 46px;
}
button:hover,
.action:hover {
  filter: brightness(1.12);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #bc9eff;
  outline-offset: 4px;
}
.quiet {
  background: transparent;
  color: #c3cee6;
  border-color: var(--line);
}
.shell {
  max-width: 1440px;
  margin: auto;
  display: grid;
  grid-template-columns: 230px 1fr;
  min-height: 100vh;
}
aside {
  padding: 38px 26px;
  border-right: 1px solid #202b42;
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}
.wordmark,
.mobile-logo {
  font-size: 34px;
  font-weight: 850;
  letter-spacing: -2px;
  color: #a6f3fc;
}
.wordmark span {
  display: block;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--muted);
}
nav {
  display: flex;
  gap: 6px;
}
aside nav {
  flex-direction: column;
  margin-top: 48px;
}
nav a {
  padding: 13px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
}
nav a.active {
  color: #9cf4fc;
  background: #17283d;
}
.aside-note {
  margin-top: auto;
  font-size: 25px;
  line-height: 1.3;
  color: #9eafcc;
}
.bot-link {
  font-size: 12px;
  color: var(--cyan);
}
main {
  padding: 30px 48px 20px;
  min-width: 0;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 35px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #92a8cd;
}
header button {
  font-size: 12px;
}
h1 {
  font-size: 42px;
  line-height: 1.17;
  letter-spacing: -1.4px;
  margin: 12px 0 18px;
}
h2 {
  font-size: 21px;
  letter-spacing: -0.4px;
}
p {
  color: var(--muted);
}
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 200px;
  gap: 20px;
  padding: 30px 32px;
  border-radius: 24px;
  border: 1px solid #35476c;
  background: linear-gradient(120deg, #162740, #1e1c40);
  overflow: hidden;
}
.hero p {
  font-size: 14px;
  max-width: 390px;
}
.hero h1 {
  font-size: 38px;
}
.hero .eyebrow {
  color: #86e8ee;
}
.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}
.hero-actions a {
  font-size: 13px;
}
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand img {
  width: 180px;
  height: 180px;
  object-fit: contain;
}
.brand-missing {
  width: 160px;
  height: 160px;
  border: 1px dashed #6c7f9f;
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #aab7d2;
  font-size: 12px;
  padding: 20px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 26px 0 14px;
}
.section-head p {
  font-size: 12px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.tile {
  padding: 21px;
  border-radius: 17px;
  background: #111b30;
  border: 1px solid var(--line);
  transition:
    transform 0.18s,
    border-color 0.18s;
}
.tile:hover {
  transform: translateY(-3px);
  border-color: #5bc9e0;
}
.tile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.icon {
  display: inline-flex;
  width: 43px;
  height: 43px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  color: #8cecf0;
  background: #203348;
  font-size: 23px;
}
.tile:nth-child(2n) .icon {
  color: #c6acff;
  background: #2a2447;
}
.arrow {
  color: #7283a5;
}
.tile h2 {
  font-size: 15px;
  margin: 19px 0 4px;
}
.tile p {
  font-size: 11px;
  margin: 0;
}
.count {
  color: #7ee5e9;
  font-size: 12px;
  margin-top: 16px;
}
.panel {
  padding: 22px;
  background: #10192b;
  border: 1px solid var(--line);
  border-radius: 18px;
  margin: 14px 0;
}
.row {
  padding: 17px 0;
  border-bottom: 1px solid #25314a;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.row:last-child {
  border: 0;
}
.row p {
  margin: 4px 0;
  font-size: 13px;
}
.row strong {
  overflow-wrap: anywhere;
}
.row .buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.row button {
  font-size: 12px;
  padding: 8px 12px;
  min-height: 40px;
}
.empty {
  padding: 35px 15px;
  text-align: center;
  color: var(--muted);
}
.summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.summary .panel {
  flex: 1;
  min-width: 180px;
}
.summary strong {
  font-size: 25px;
  color: #8ee8dc;
}
.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar input,
.toolbar select {
  max-width: 250px;
}
input,
select,
textarea {
  width: 100%;
  padding: 12px;
  background: #0b1326;
  border: 1px solid #3b4c70;
  color: #edf4ff;
  border-radius: 9px;
}
label {
  display: block;
  margin: 16px 0;
  font-size: 13px;
  color: #bdcbe5;
}
label input,
label select,
label textarea {
  margin-top: 6px;
}
dialog {
  max-width: 500px;
  width: calc(100% - 32px);
  background: #131d32;
  color: #fff;
  border: 1px solid #415479;
  border-radius: 22px;
  padding: 24px;
}
dialog::backdrop {
  background: #020717bb;
  backdrop-filter: blur(5px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#form-error,
#status {
  color: #ffc2c2;
}
#status:empty {
  display: none;
}
#status {
  padding: 12px;
  margin-bottom: 16px;
  background: #352039;
  border-radius: 10px;
}
footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid #202c44;
  font-size: 11px;
  color: #8194b6;
  display: flex;
  justify-content: space-between;
}
#login {
  padding: 30px 0 80px;
  max-width: 600px;
}
#login-note {
  font-size: 12px;
}
.bottom,
.mobile-logo {
  display: none;
}
.badge {
  font-size: 12px;
  color: #b8a4ed;
}
.muted {
  color: var(--muted);
}
.done {
  text-decoration: line-through;
  opacity: 0.6;
}
.file-input {
  max-width: 300px;
}
.link {
  color: var(--cyan);
}
@media (max-width: 1000px) {
  main {
    padding: 25px;
  }
  .shell {
    grid-template-columns: 190px 1fr;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .hero {
    grid-template-columns: 1fr 140px;
    padding: 25px;
  }
  .brand-missing {
    width: 125px;
    height: 140px;
  }
  .brand img {
    width: 140px;
    height: 140px;
  }
}
@media (max-width: 650px) {
  .shell {
    display: block;
  }
  aside {
    display: none;
  }
  main {
    padding: 20px 18px 90px;
  }
  header {
    margin-bottom: 24px;
  }
  .mobile-logo {
    display: block;
    font-size: 27px;
  }
  header .eyebrow {
    display: none;
  }
  .hero {
    grid-template-columns: 1fr;
    padding: 24px;
    border-radius: 21px;
  }
  .hero h1 {
    font-size: 32px;
    margin-top: 15px;
  }
  .hero p {
    font-size: 13px;
  }
  .brand {
    position: absolute;
    right: 20px;
    top: 20px;
  }
  .brand-missing {
    width: 68px;
    height: 55px;
    padding: 5px;
    border-radius: 10px;
    font-size: 8px;
  }
  .brand img {
    width: 70px;
    height: 70px;
  }
  .hero .eyebrow {
    max-width: 170px;
  }
  .hero-actions {
    gap: 8px;
  }
  .hero-actions a {
    padding: 11px 13px;
    font-size: 12px;
  }
  .grid {
    gap: 11px;
  }
  .tile {
    padding: 17px;
    min-height: 175px;
  }
  .tile h2 {
    font-size: 14px;
  }
  .tile p {
    line-height: 1.5;
  }
  .section-head h2 {
    font-size: 20px;
  }
  .section-head p {
    font-size: 10px;
  }
  .row {
    align-items: flex-start;
    flex-direction: column;
  }
  .row .buttons {
    width: 100%;
  }
  .bottom {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #0d172bf5;
    border-top: 1px solid #2d3c59;
    justify-content: space-around;
    padding: 8px 5px max(8px, env(safe-area-inset-bottom));
    backdrop-filter: blur(18px);
  }
  .bottom a {
    font-size: 11px;
    padding: 10px 15px;
  }
  h1 {
    font-size: 31px;
  }
  footer span {
    display: none;
  }
  .toolbar input,
  .toolbar select {
    max-width: 100%;
  }
}
/* Approved square AIZI artwork: keep the complete logo, including its glow/text. */
.hero:has(.brand img) {
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: center;
}
.brand img {
  width: 220px;
  height: 220px;
  object-fit: contain;
  max-width: 100%;
}
@media (max-width: 1000px) and (min-width: 651px) {
  .hero:has(.brand img) {
    grid-template-columns: minmax(0, 1fr) 170px;
  }
  .brand img {
    width: 170px;
    height: 170px;
  }
}
@media (max-width: 650px) {
  .hero:has(.brand img) {
    grid-template-columns: 1fr;
  }
  .hero:has(.brand img) .brand {
    position: static;
    order: -1;
    justify-content: center;
  }
  .brand img {
    width: 180px;
    height: 180px;
  }
  .hero:has(.brand img) .eyebrow {
    max-width: none;
  }
}

.row p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.row > div {
  min-width: 0;
}
#content form {
  max-width: 740px;
}
textarea {
  min-height: 120px;
}
.brand-missing {
  visibility: hidden;
}

svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.arrow svg {
  width: 16px;
  height: 16px;
}

.staging-banner {
  border: 1px solid #705ca0;
  border-radius: 10px;
  padding: 12px;
  color: #d5c4ff;
  font-size: 12px;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
}

/* Mobile conversation: bounded history and current confirmation beside the composer. */
.chat-shell { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.chat-history { max-height: min(48dvh, 540px); min-height: 140px; overflow-y: auto; overscroll-behavior: contain; padding: 8px; display: flex; flex-direction: column; gap: 12px; border: 1px solid #29344e; border-radius: 20px; }
.chat-message { max-width: 90%; padding: 12px 16px; border-radius: 18px 18px 18px 4px; background: #172039; align-self: flex-start; overflow-wrap: anywhere; }
.chat-message.from-user { background: #163c48; border-radius: 18px 18px 4px 18px; align-self: flex-end; }
.chat-message p, .chat-preview p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
.chat-message small { color: #abb9d1; }
.chat-preview { border: 1px solid #65dce6; border-radius: 18px; padding: 16px; background: #102838; }
.chat-preview h2 { font-size: 19px; margin: 0 0 8px; }
#content .chat-composer { width: 100%; position: sticky; bottom: calc(78px + env(safe-area-inset-bottom)); background: #0b1326; padding: 12px; border: 1px solid #34445c; border-radius: 18px; z-index: 2; }
.chat-composer label { margin: 0; font-size: 13px; }
.chat-composer textarea { min-height: 64px; max-height: 160px; resize: vertical; margin: 6px 0 10px; }
.voice-tools { border: 1px solid #34445c; border-radius: 16px; padding: 14px; }
.voice-tools summary, .staging-banner summary { cursor: pointer; }
.voice-tools > * + * { margin-top: 12px; }
.staging-banner { padding: 8px 12px; font-size: 12px; }
.staging-banner p { margin: 8px 0 2px; }
.referral-qr { display: block; width: 220px; max-width: 100%; background: white; margin: 20px 0; }
@media (min-width: 1001px) { #content .chat-composer { bottom: 12px; } }

.chat-shell:has(.chat-preview) .chat-history { max-height: 22dvh; min-height: 100px; }

#status { color: #c7f5f5; background: #16303c; }

#content:has(.chat-shell) > h1 { font-size: 28px; margin: 12px 0 18px; }
#content:has(.chat-shell) > .eyebrow { display: none; }
main:has(.chat-shell) footer { display: none; }

.voice-primary { width: 100%; max-width: 400px; text-align: center; font-size: 18px; padding: 18px; }
.crm-filters { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); gap: 10px; margin: 18px 0; }
.crm-filters input, .crm-filters select { min-width: 0; width: 100%; }
.crm-card h2 { margin: 0 0 8px; }
.crm-reason { border-left: 3px solid var(--cyan); padding-left: 10px; }
.crm-facts .row { padding: 12px 0; }
.crm-consent { padding: 12px; border: 1px solid #34445c; border-radius: 12px; }
.crm-consent input { margin-left: 10px; }
@media (max-width:650px) { .crm-filters { grid-template-columns: 1fr; } .crm-card .toolbar { gap: 8px; } }

[hidden] { display: none !important; }
.crm-advanced { margin: 12px 0 20px; }
.crm-advanced summary { cursor: pointer; color: var(--cyan); }
button.is-recording { background: #a83958; color: white; border-color: #ed8da4; }

/* Shared, explicit-action voice control. No idle microphone or animation timer. */
header { gap: 10px; }
.theme-select { width: auto; min-height: 44px; max-width: 130px; margin-left: auto; padding: 8px; font-size: 13px; }
.hero.voice-home, .hero.voice-home:has(.brand img) { grid-template-columns: 1fr; text-align: center; padding: 30px 24px; gap: 8px; }
.voice-home > div:not(.brand) { min-width: 0; }
.voice-home h1 { font-size: clamp(25px, 4vw, 38px); max-width: 700px; margin: 10px auto; }
.voice-home p { margin-left: auto; margin-right: auto; max-width: 600px; }
.voice-home .brand, .hero.voice-home:has(.brand img) .brand { position: static; justify-content: center; }
.voice-home .brand:empty { display: none; }
.voice-home .brand img { width: 100px; height: 100px; object-fit: contain; }
.voice-surface { --voice-level: 0; display: flex; align-items: center; flex-direction: column; padding: 22px 8px 6px; text-align: center; width: 100%; }
.voice-orb { position: relative; isolation: isolate; display: grid; place-items: center; width: 188px; height: 188px; min-height: 188px; border-radius: 50%; background: radial-gradient(circle at 35% 25%, #bdffff, #74e7ed 45%, #36b2d0); border: 1px solid #abf9ff; box-shadow: 0 0 0 10px #71e8f20b, 0 0 0 21px #71e8f209, 0 8px 45px #4bdeed30; margin: 14px 0 22px; }
.voice-orb::before { content: ''; position: absolute; inset: -12px; border-radius: 50%; border: 2px solid #7ceaf260; pointer-events: none; }
.voice-orb svg { width: 65px; height: 65px; fill: none; stroke: #10303d; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.voice-orb:disabled { opacity: .75; }
.voice-surface[data-state=recording] .voice-orb::before { animation: voice-pulse 1.8s ease-in-out infinite; }
.voice-surface:is([data-state=transcribing],[data-state=processing],[data-state=stopping]) .voice-orb::before { border: 3px solid #75eaf229; border-top-color: #a5faff; animation: voice-spin 1.6s linear infinite; }
.voice-surface[data-state=error] .voice-orb { box-shadow: 0 0 0 10px #e690a51a; }
.voice-surface .voice-label { font-size: 23px; font-weight: 700; color: inherit; margin: 0 0 8px; }
.voice-surface .voice-state { margin: 0; min-height: 26px; max-width: 100%; overflow-wrap: anywhere; }
.voice-wave { height: 50px; display: none; align-items: center; gap: 5px; margin: 8px 0 0; opacity: 0; }
.voice-wave i { width: 5px; border-radius: 8px; background: var(--cyan); transform: scaleY(calc(.15 + var(--voice-level) * .85)); transition: transform 80ms linear; }
.voice-surface[data-state=recording] .voice-wave { display: flex; opacity: 1; }
.voice-surface .voice-hint { font-size: 12px; max-width: 420px; margin: 8px auto 14px; }
.voice-time { font-variant-numeric: tabular-nums; }
.voice-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; }
.voice-actions a { min-height: 44px; padding: 10px; text-decoration: underline; text-underline-offset: 4px; }
.voice-transcript { width: 100%; text-align: left; margin-top: 18px; border: 1px solid var(--line); border-radius: 16px; padding: 14px; overflow-wrap: anywhere; }
.voice-transcript summary { cursor: pointer; font-weight: 650; }
.voice-transcript p { white-space: pre-wrap; }
[hidden] { display: none !important; }
@keyframes voice-pulse { 50% { transform: scale(1.06); opacity: .45; } }
@keyframes voice-spin { to { transform: rotate(360deg); } }
:root[data-theme=light] { color-scheme: light; color: #142b45; background: #eef4fb; --muted: #50647e; --line: #c6d4e4; --cyan: #087789; }
[data-theme=light] body { background: radial-gradient(ellipse at 80% 5%, #c6e5ef66, transparent 55%); }
[data-theme=light] :is(.hero,.tile,.card,.panel,.chat-message,.chat-composer,dialog) { background: #fff; border-color: var(--line); }
[data-theme=light] .hero { background: linear-gradient(135deg,#f9ffff,#e3ebfa); }
[data-theme=light] :is(input,select,textarea) { background: #f8fbff; color: #142b45; border-color: var(--line); }
[data-theme=light] :is(.quiet,.eyebrow,.aside-note,.chat-message small,label,footer) { color: #50647e; }
[data-theme=light] :is(.wordmark,.mobile-logo,.bot-link,.hero .eyebrow,.link) { color: #086c7d; }
[data-theme=light] :is(nav a.active,.mobile-nav a.active) { color: #075b6b; background: #ceecef; }
[data-theme=light] .chat-message.from-user { background: #d9f2f3; }
[data-theme=light] .chat-preview { background: #e9f7f8; color: #142b45; border-color: #3494a0; }
[data-theme=light] #content .chat-composer { background: #fff; border-color: var(--line); }
[data-theme=light] #status { color: #164a55; background: #deeff4; }
[data-theme=light] .bottom { background: #f5fafff5; border-color: var(--line); }
[data-theme=light] .voice-surface:is([data-state=transcribing],[data-state=processing],[data-state=stopping]) .voice-orb::before { border-top-color: #087789; }
@media(max-width:650px) {
  header { flex-wrap: wrap; gap: 7px; }
  .theme-select { max-width: 104px; font-size: 12px; }
  header button { padding: 10px; }
  .hero.voice-home { padding: 20px 14px; }
  .hero.voice-home .eyebrow, .hero.voice-home:has(.brand img) .eyebrow { max-width: none; }
  .voice-home h1 { font-size: 28px; }
  .voice-orb { width: 180px; height: 180px; min-height: 180px; }
  .voice-actions { gap: 8px; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
  .voice-surface[data-state=recording] .voice-wave i { transform: scaleY(.5); }
}

[data-theme=light] :is(.count,.arrow) { color: #087789; }
[data-theme=light] .icon { color: #087789; background: #d9f0f1; }
[data-theme=light] .tile:nth-child(2n) .icon { color: #64429b; background: #ede5fa; }

[data-theme=light] :is(#form-error,.error) { color: #9a1639; }

/* Android acceptance 15 Nov: confirmation controls must remain unobstructed. */
#content .chat-shell:has(.chat-preview) .chat-composer { position: static; }
.chat-preview { scroll-margin-block: 20px 100px; }
dialog { max-height: calc(100dvh - 32px); overflow-y: auto; }
.dialog-head { gap: 16px; align-items: flex-start; }
.dialog-head h2 { min-width: 0; overflow-wrap: anywhere; margin-top: 6px; }
.dialog-head button { flex: 0 0 auto; }
:root[data-theme=light] dialog { color: #142b45; }
[data-theme=light] .staging-banner { color: #62418b; border-color: #9b82bc; }

.chat-preview .toolbar { scroll-margin-bottom: 110px; }

.install-card { display:flex; align-items:center; justify-content:space-between; gap:18px; margin:20px 0 28px; padding:20px; border:1px solid var(--border,#334766); border-radius:20px; background:var(--panel,#14213a); }
.install-card h2 { margin:0 0 6px; font-size:1.12rem; }
.install-card p { margin:0; line-height:1.5; }
.install-actions { display:flex; gap:10px; flex-wrap:wrap; flex-shrink:0; }
#install-instructions li { margin:12px 0; line-height:1.6; }
#install-instructions p { line-height:1.6; }
@media(max-width:700px) { .install-card { align-items:stretch; flex-direction:column; } .install-actions > button { flex:1; } }
[data-theme=light] .install-card { background:#fff; border-color:var(--line); color:#142b45; }
