/* ==========================================================================
   Smart Solar — customer dashboard
   Palette: deep photovoltaic black-green, lime energy accent, teal data accent.
   ========================================================================== */

:root {
  --bg:            #05100b;
  --bg-2:          #071510;
  --surface:       rgba(255, 255, 255, 0.035);
  --surface-2:     rgba(255, 255, 255, 0.055);
  --border:        rgba(134, 239, 172, 0.13);
  --border-strong: rgba(134, 239, 172, 0.28);

  --lime:   #a3e635;
  --green:  #4ade80;
  --teal:   #2dd4bf;
  --cyan:   #38bdf8;
  --amber:  #fbbf24;
  --red:    #fb7185;

  --text:   #e8f6ee;
  --muted:  #8aa89a;
  --faint:  #5d7a6c;

  --glow-green: 0 0 28px rgba(74, 222, 128, 0.30);
  --glow-lime:  0 0 24px rgba(163, 230, 53, 0.28);

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 22px;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.6;
}

/* ---------- Ambient background ------------------------------------------ */
.aurora {
  position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none;
}
.aurora::before, .aurora::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(110px);
  opacity: 0.4;
}
.aurora::before {
  width: 60vw; height: 60vw; top: -22vw; left: -12vw;
  background: radial-gradient(circle, rgba(74,222,128,.42), transparent 68%);
  animation: drift1 28s ease-in-out infinite;
}
.aurora::after {
  width: 52vw; height: 52vw; bottom: -20vw; right: -10vw;
  background: radial-gradient(circle, rgba(45,212,191,.34), transparent 68%);
  animation: drift2 34s ease-in-out infinite;
}
@keyframes drift1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(7vw, 5vh) scale(1.12); }
}
@keyframes drift2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50%     { transform: translate(-6vw,-6vh) scale(1.16); }
}
.grid-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .35;
  background-image:
    linear-gradient(rgba(134,239,172,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(134,239,172,.045) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
}

/* ---------- Shell -------------------------------------------------------- */
.shell { max-width: 1500px; margin: 0 auto; padding: 0 28px 80px; }

header.top {
  display: flex; align-items: center; gap: 20px;
  padding: 26px 0 20px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--green), var(--teal));
  box-shadow: var(--glow-green); flex-shrink: 0;
}
.brand-mark svg { width: 26px; height: 26px; }
.brand h1 {
  font-size: 18px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2;
}
.brand p { font-size: 11.5px; color: var(--muted); letter-spacing: .03em; }

.status-strip { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  white-space: nowrap;
}
.chip b { color: var(--text); font-weight: 600; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.dot.live { animation: pulse 2s ease-in-out infinite; box-shadow: 0 0 10px var(--green); }
.dot.warn { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.dot.bad  { background: var(--red);   box-shadow: 0 0 10px var(--red); }
.dot.off  { background: var(--faint); box-shadow: none; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Tabs --------------------------------------------------------- */
nav.tabs {
  display: flex; gap: 6px; margin-bottom: 26px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border); padding-bottom: 0;
}
nav.tabs button {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  padding: 11px 17px; border-radius: var(--r-sm) var(--r-sm) 0 0;
  border-bottom: 2px solid transparent; transition: all .18s; position: relative;
}
nav.tabs button:hover { color: var(--text); background: var(--surface); }
nav.tabs button.active {
  color: var(--green); border-bottom-color: var(--green);
  background: linear-gradient(to bottom, transparent, rgba(74,222,128,.07));
}

.view { display: none; animation: fadein .35s ease; }
.view.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Cards -------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 22px; backdrop-filter: blur(14px);
  position: relative; overflow: hidden;
}
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(134,239,172,.4), transparent);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 {
  font-size: 13px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted);
}
.card-head .hint { font-size: 11.5px; color: var(--faint); }

.grid { display: grid; gap: 18px; }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-hero { grid-template-columns: 1.55fr 1fr; }
@media (max-width: 1180px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-hero, .g-3, .g-2 { grid-template-columns: 1fr; }
}
@media (max-width: 620px) { .g-4 { grid-template-columns: 1fr; } .shell { padding: 0 16px 60px; } }

/* ---------- Stat tiles --------------------------------------------------- */
.stat {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 18px 20px; position: relative; overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.stat:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.stat .label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--faint); font-weight: 600; margin-bottom: 10px;
}
.stat .value {
  font-family: var(--mono); font-size: 31px; font-weight: 600; line-height: 1;
  letter-spacing: -.02em; display: flex; align-items: baseline; gap: 5px;
}
.stat .unit { font-size: 14px; color: var(--muted); font-weight: 400; }
.stat .sub { font-size: 11.5px; color: var(--faint); margin-top: 8px; }
.stat.accent-green .value { color: var(--green); }
.stat.accent-lime  .value { color: var(--lime); }
.stat.accent-teal  .value { color: var(--teal); }
.stat.accent-amber .value { color: var(--amber); }
.stat.accent-cyan  .value { color: var(--cyan); }

/* ---------- Energy flow diagram ------------------------------------------ */
.flow-wrap { min-height: 330px; display: grid; place-items: center; }
#flow { width: 100%; height: auto; max-height: 380px; }
.flow-label { font-family: var(--font); font-size: 11px; fill: var(--muted); font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; }
.flow-value { font-family: var(--mono); font-size: 15px; font-weight: 600; fill: var(--text); }
.flow-path { fill: none; stroke: rgba(134,239,172,.16); stroke-width: 2.5; stroke-linecap: round; }
.flow-path.hot { stroke: rgba(163,230,53,.45); }

/* ---------- Battery ------------------------------------------------------ */
.gauge-wrap { display: grid; place-items: center; padding: 6px 0 2px; }
.facts { list-style: none; margin-top: 10px; }
.facts li {
  display: flex; justify-content: space-between; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.05); font-size: 13px; color: var(--muted);
}
.facts li:last-child { border-bottom: none; }
.facts b { color: var(--text); font-weight: 600; text-align: right; }

/* ---------- Tables (inside assistant answers) ---------------------------- */
table {
  width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 420px;
}
thead th {
  text-align: left; padding: 10px 13px; font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em; color: var(--muted);
  background: rgba(134,239,172,.055); border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0;
}
tbody td {
  padding: 9px 13px; border-bottom: 1px solid rgba(255,255,255,.045);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
tbody td:first-child { color: var(--muted); }
tbody tr:hover { background: rgba(134,239,172,.045); }
tbody tr:last-child td { border-bottom: none; }

/* ---------- Assistant chat ----------------------------------------------- */
.chat-shell { display: grid; grid-template-columns: 1fr 320px; gap: 18px; align-items: start; }
@media (max-width: 1100px) { .chat-shell { grid-template-columns: 1fr; } }

.chat-log {
  min-height: 380px; max-height: 62vh; overflow-y: auto; padding-right: 8px;
  display: flex; flex-direction: column; gap: 18px;
}
.chat-log::-webkit-scrollbar { width: 7px; }
.chat-log::-webkit-scrollbar-thumb { background: rgba(134,239,172,.2); border-radius: 4px; }
.chat-log::-webkit-scrollbar-track { background: transparent; }

.msg { display: flex; gap: 13px; animation: fadein .3s ease; }
.msg .who {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: grid;
  place-items: center; font-size: 11px; font-weight: 700;
}
.msg.user .who { background: rgba(56,189,248,.16); color: var(--cyan); }
.msg.bot  .who { background: linear-gradient(140deg, var(--green), var(--teal)); color: #05100b; }
.msg .body { flex: 1; min-width: 0; }
.msg.user .body {
  background: rgba(56,189,248,.07); border: 1px solid rgba(56,189,248,.18);
  padding: 11px 15px; border-radius: var(--r-sm); font-size: 13.5px;
}

.answer { font-size: 14px; line-height: 1.72; overflow-x: auto; }
.answer > *:first-child { margin-top: 0; }
.answer p { margin: 0 0 13px; }
.answer strong { color: var(--lime); font-weight: 600; }
.answer h2, .answer h3, .answer h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: .09em;
  color: var(--teal); margin: 22px 0 11px; font-weight: 700;
}
.answer ul, .answer ol { margin: 0 0 13px; padding-left: 20px; }
.answer li { margin-bottom: 5px; }
.answer table { margin: 13px 0; background: rgba(0,0,0,.22); border-radius: var(--r-sm); }
.answer code {
  font-family: var(--mono); font-size: 12px; background: rgba(163,230,53,.1);
  color: var(--lime); padding: 1.5px 6px; border-radius: 5px;
}
.answer pre {
  background: rgba(0,0,0,.4); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 13px 15px; overflow-x: auto; margin: 11px 0;
}
.answer pre code { background: none; padding: 0; color: var(--lime); font-size: 12px; line-height: 1.7; }
.answer blockquote {
  border-left: 2px solid var(--border-strong); padding-left: 14px;
  color: var(--muted); margin: 12px 0;
}

.composer { display: flex; gap: 10px; margin-top: 18px; }
.composer input {
  flex: 1; background: rgba(0,0,0,.34); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 13px 17px; color: var(--text);
  font-family: inherit; font-size: 13.5px; outline: none; transition: border-color .2s;
}
.composer input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(74,222,128,.09); }
.composer input::placeholder { color: var(--faint); }

button.primary {
  background: linear-gradient(135deg, var(--green), var(--teal)); border: none;
  color: #05100b; font-family: inherit; font-weight: 700; font-size: 13.5px;
  padding: 13px 24px; border-radius: var(--r-sm); cursor: pointer;
  transition: transform .15s, box-shadow .15s; white-space: nowrap;
}
button.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: var(--glow-green); }
button.primary:disabled { opacity: .45; cursor: not-allowed; }

button.ghost {
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 500; padding: 8px 15px;
  border-radius: var(--r-sm); cursor: pointer; transition: all .18s;
}
button.ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
button.ghost.on { color: var(--green); border-color: var(--green); background: rgba(74,222,128,.1); }

.suggestions { display: flex; flex-direction: column; gap: 8px; }
.suggestions button {
  text-align: left; background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-family: inherit; font-size: 12.5px; padding: 11px 14px;
  border-radius: var(--r-sm); cursor: pointer; transition: all .18s; line-height: 1.5;
}
.suggestions button:hover {
  color: var(--text); border-color: var(--border-strong);
  background: rgba(74,222,128,.07); transform: translateX(3px);
}

.thinking { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12.5px; }
.thinking span {
  width: 6px; height: 6px; border-radius: 50%; background: var(--green);
  animation: bounce 1.4s ease-in-out infinite;
}
.thinking span:nth-child(2) { animation-delay: .18s; }
.thinking span:nth-child(3) { animation-delay: .36s; }
@keyframes bounce { 0%,60%,100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-6px); opacity: 1; } }

/* ---------- Alerts / banners --------------------------------------------- */
.banner {
  padding: 13px 17px; border-radius: var(--r-sm); font-size: 13px;
  display: flex; align-items: flex-start; gap: 11px; margin-bottom: 16px;
}
.banner.ok    { background: rgba(74,222,128,.09);  border: 1px solid rgba(74,222,128,.26);  color: #bbf7d0; }
.banner.warn  { background: rgba(251,191,36,.09);  border: 1px solid rgba(251,191,36,.26);  color: #fde68a; }
.banner.bad   { background: rgba(251,113,133,.09); border: 1px solid rgba(251,113,133,.26); color: #fecdd3; }
.banner.info  { background: rgba(56,189,248,.08);  border: 1px solid rgba(56,189,248,.24);  color: #bae6fd; }
.banner .ico { font-size: 15px; line-height: 1.3; flex-shrink: 0; }

/* ---------- "Right now" panel -------------------------------------------- */
.mode-title {
  font-size: 21px; font-weight: 700; color: var(--lime);
  letter-spacing: -.01em; margin-bottom: 8px;
}
.mode-text { font-size: 13.5px; color: var(--muted); line-height: 1.68; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- Log in / create account -------------------------------------- */
.auth-shell {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 24px; padding: 40px 16px;
}
.auth-card { width: 100%; max-width: 420px; padding: 26px; }
.auth-tabs { margin-bottom: 22px; flex-wrap: nowrap; }
.auth-tabs button { flex: 1; }
.auth-card[data-mode="login"] .signup-only,
.auth-card[data-mode="signup"] .login-only,
.auth-card:not(.needs-code) .code-only { display: none; }

.field { margin-bottom: 15px; }
.field label {
  display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px;
}
.field input {
  width: 100%; background: rgba(0,0,0,.34); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 12px 15px; color: var(--text);
  font-family: inherit; font-size: 14px; outline: none; transition: border-color .2s;
}
.field input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(74,222,128,.09); }
.field .hint { font-size: 11.5px; color: var(--faint); margin-top: 5px; }
.auth-submit { width: 100%; margin-top: 4px; }
.auth-switch { font-size: 12.5px; color: var(--muted); text-align: center; margin-top: 18px; }
.auth-switch a { color: var(--green); font-weight: 600; text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }
.auth-help { font-size: 12px; color: var(--faint); text-align: center; margin-top: 8px; }

/* ---------- Settings ----------------------------------------------------- */
.g-settings { grid-template-columns: 1.6fr 1fr; align-items: start; }
@media (max-width: 1180px) { .g-settings { grid-template-columns: 1fr; } }
.side-stack { display: grid; gap: 18px; }
.grid.tight { gap: 0 16px; }
@media (max-width: 620px) { .grid.tight { grid-template-columns: 1fr; } }
.lead { font-size: 13.5px; color: var(--muted); line-height: 1.65; margin-bottom: 18px; }
.hint-text { font-size: 12.5px; color: var(--faint); margin-bottom: 12px; }
.msg-slot .banner { margin: 14px 0 0; }

.map-list { display: flex; flex-direction: column; gap: 8px; }
.map-row {
  display: grid; grid-template-columns: 1fr minmax(180px, 260px); gap: 12px; align-items: center;
  padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--r-sm);
  background: rgba(0,0,0,.18);
}
@media (max-width: 620px) { .map-row { grid-template-columns: 1fr; } }
.map-src { min-width: 0; }
.map-src b { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.map-src span { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.map-row select {
  width: 100%; background: rgba(0,0,0,.34); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 11px; color: var(--text);
  font-family: inherit; font-size: 13px; outline: none;
}
.map-row select:focus { border-color: var(--green); }
.map-row select option { background: var(--bg-2); }

details.advanced {
  margin-top: 16px; border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 12px 14px;
}
details.advanced summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted);
}
details.advanced[open] summary { margin-bottom: 10px; }

.steps { padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.steps li { margin-bottom: 7px; }
.steps b { color: var(--text); font-weight: 600; }

a.link { color: var(--green); font-weight: 600; text-decoration: none; white-space: nowrap; }
a.link:hover { text-decoration: underline; }
button.ghost.danger { color: var(--red); border-color: rgba(251,113,133,.3); }
button.ghost.danger:hover { background: rgba(251,113,133,.1); border-color: var(--red); }
button.ghost:disabled { opacity: .5; cursor: not-allowed; }

canvas { max-width: 100%; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono  { font-family: var(--mono); }
.center { text-align: center; }
.mt { margin-top: 18px; }
.empty { padding: 44px 20px; text-align: center; color: var(--faint); font-size: 13px; }

/* ---------- Live voice agent ------------------------------------------------ */
.mini-orb {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: inline-block;
  background:
    radial-gradient(circle at 38% 62%, #f7ffe9 0 16%, rgba(247,255,233,0) 52%),
    radial-gradient(circle at 66% 34%, #d9f99d 0 20%, rgba(217,249,157,0) 58%),
    linear-gradient(170deg, var(--teal), var(--green) 58%, #14a37f);
}

.talk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
  font-family: inherit; font-size: 13.5px; font-weight: 600; padding: 12px 18px;
  border-radius: var(--r-sm); cursor: pointer; white-space: nowrap;
  transition: border-color .18s, box-shadow .18s, transform .15s;
}
.talk-btn:hover { border-color: var(--green); box-shadow: var(--glow-green); transform: translateY(-1px); }
.talk-btn:focus-visible, .v-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

.composer input { min-width: 0; }

.voice-launch {
  position: fixed; right: 22px; bottom: 22px; z-index: 40; border-radius: 999px;
  padding: 11px 19px 11px 13px; background: #0b1f16; box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.voice-launch:hover { background: #0e2a1d; }
.voice-launch .mini-orb { width: 24px; height: 24px; }

.voice {
  position: fixed; inset: 0; z-index: 100; color: var(--text);
  background: radial-gradient(70vmax 70vmax at 50% 36%, rgba(45,212,191,.10), rgba(45,212,191,0) 62%), var(--bg);
  display: flex; flex-direction: column; gap: 12px;
  padding: max(18px, env(safe-area-inset-top)) 24px max(26px, env(safe-area-inset-bottom));
  animation: fadein .25s ease;
}
.voice-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap;
}
.voice-pick { display: flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); min-width: 0; }
.voice-pick select {
  background: #0b1f16; color: var(--text); border: 1px solid var(--border); border-radius: var(--r-sm);
  font-family: inherit; font-size: 12.5px; padding: 7px 10px; max-width: 200px; min-width: 0; cursor: pointer;
}
.voice-pick select:hover { border-color: var(--border-strong); }

.voice-stage {
  flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px;
}
#orb {
  display: block; flex-shrink: 1; min-height: 0;
  width: min(58vh, 80vw); height: min(58vh, 80vw); border-radius: 50%;
}
#orb.flat {
  background:
    radial-gradient(circle at 36% 62%, #f7ffe9 0 18%, rgba(247,255,233,0) 54%),
    radial-gradient(circle at 68% 36%, #d9f99d 0 22%, rgba(217,249,157,0) 60%),
    radial-gradient(circle at 50% 96%, #14a37f 0 14%, rgba(20,163,127,0) 44%),
    linear-gradient(175deg, var(--teal), var(--green) 60%, #14a37f);
}
.voice-words {
  width: min(680px, 100%); text-align: center; min-height: 118px;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.v-status { font-size: 13px; font-weight: 500; color: var(--muted); letter-spacing: .01em; min-height: 20px; }
.v-you {
  font-size: 13.5px; line-height: 1.5; color: var(--muted); max-width: 100%;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.v-said { font-size: 19px; line-height: 1.45; font-weight: 500; color: var(--text); overflow-wrap: anywhere; }

.voice-controls { display: flex; justify-content: center; gap: 16px; }
.v-btn {
  width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text);
  display: grid; place-items: center; cursor: pointer;
  transition: background .16s, border-color .16s, transform .12s;
}
.v-btn:hover { background: rgba(134,239,172,.12); border-color: var(--border-strong); transform: translateY(-1px); }
.v-btn svg {
  width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.v-btn.end { background: rgba(251,113,133,.13); border-color: rgba(251,113,133,.32); color: var(--red); }
.v-btn.end:hover { background: rgba(251,113,133,.24); border-color: var(--red); }
#v-mini.flip svg { transform: rotate(180deg); }
.v-btn .mic-off { display: none; }
.v-btn[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: var(--bg); }
.v-btn[aria-pressed="true"]:hover { background: var(--lime); border-color: var(--lime); }
.v-btn[aria-pressed="true"] .mic-on { display: none; }
.v-btn[aria-pressed="true"] .mic-off { display: block; }

/* While the customer looks at the dashboard, the conversation shrinks to a corner. */
.voice.mini {
  inset: auto 20px 20px auto; width: 340px; max-width: calc(100vw - 32px); padding: 14px; gap: 10px;
  background: rgba(7,21,16,.97); border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  box-shadow: 0 18px 50px rgba(0,0,0,.65), var(--glow-green);
}
.voice.mini .voice-top { display: none; }
.voice.mini .voice-stage { flex: none; flex-direction: row; justify-content: flex-start; gap: 11px; }
.voice.mini #orb { width: 76px; height: 76px; flex: none; cursor: pointer; }
.voice.mini .voice-words { text-align: left; align-items: flex-start; min-height: 0; flex: 1; min-width: 0; gap: 2px; }
.voice.mini .v-status { font-size: 11.5px; min-height: 0; }
.voice.mini .v-you { display: none; }
.voice.mini .v-said {
  font-size: 13px; line-height: 1.4;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.voice.mini .voice-controls { justify-content: flex-end; gap: 9px; }
.voice.mini .v-btn { width: 38px; height: 38px; }
.voice.mini .v-btn svg { width: 18px; height: 18px; }

@media (max-width: 620px) {
  .voice { padding-left: 16px; padding-right: 16px; }
  .voice-top { justify-content: center; }
  #orb { width: min(48vh, 84vw); height: min(48vh, 84vw); }
  .v-said { font-size: 17px; }
  .composer { flex-wrap: wrap; }
  .composer input { flex-basis: 100%; }
  .composer button { flex: 1; }
  .voice-launch { right: 16px; bottom: 16px; }
  .voice.mini { left: 16px; right: 16px; bottom: 16px; width: auto; max-width: none; }
}
@media (max-height: 560px) {
  #orb { width: min(40vh, 62vw); height: min(40vh, 62vw); }
  .voice-words { min-height: 70px; }
  .v-said { font-size: 15px; }
  .v-btn { width: 46px; height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .voice { animation: none; }
}
