:root {
  color-scheme: light;
  --ink: #201b22;
  --muted: #6a626c;
  --paper: #fbfbf7;
  --wash: #eef3ef;
  --panel: #ffffff;
  --line: #dfe4df;
  --coral: #c7474b;
  --coral-dark: #963238;
  --teal: #197366;
  --teal-soft: #e2f1ec;
  --plum: #50375a;
  --blue: #2f6791;
  --gold: #b7862c;
  --sage: #7b927f;
  --shadow: 0 24px 80px rgba(24, 34, 34, 0.13);
  --soft-shadow: 0 14px 42px rgba(24, 34, 34, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(90deg, rgba(32, 27, 34, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(32, 27, 34, 0.03) 1px, transparent 1px),
    linear-gradient(145deg, #fbfbf7 0%, #edf4ef 48%, #f7edf0 100%);
  background-size: 32px 32px, 32px 32px, auto;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.88fr) minmax(360px, 0.72fr);
  align-items: stretch;
  width: 100%;
}

.auth-visual {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: clamp(28px, 6vw, 80px);
  background:
    linear-gradient(135deg, rgba(33, 120, 102, 0.11), transparent 38%),
    linear-gradient(45deg, rgba(201, 79, 79, 0.16), rgba(77, 54, 89, 0.11));
}

.portrait {
  width: min(440px, 84vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background:
    linear-gradient(150deg, #fff7ed, #e7f4ef 52%, #f1e9f2);
  box-shadow: var(--shadow);
}

.portrait-face {
  width: 150px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: white;
  background: var(--coral);
  border-radius: 8px;
  font-size: 54px;
  font-weight: 840;
  box-shadow: 0 18px 48px rgba(148, 53, 53, 0.24);
}

.signal-lines {
  position: absolute;
  right: 12%;
  bottom: 15%;
  display: grid;
  gap: 8px;
}

.signal-lines span {
  width: 120px;
  height: 10px;
  border-radius: 999px;
  background: rgba(33, 120, 102, 0.22);
}

.signal-lines span:nth-child(2) {
  width: 82px;
  background: rgba(54, 95, 126, 0.24);
}

.signal-lines span:nth-child(3) {
  width: 54px;
  background: rgba(179, 131, 45, 0.25);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: clamp(28px, 5vw, 70px);
  background: rgba(255, 253, 249, 0.82);
  border-left: 1px solid var(--line);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-row div {
  min-width: 0;
}

.brand-row strong,
.brand-row span {
  display: block;
}

.brand-row strong {
  font-weight: 820;
}

.brand-row span {
  color: var(--muted);
  font-size: 13px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: white;
  background: var(--coral);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 820;
}

.auth-panel h1 {
  max-width: 620px;
  margin: 30px 0 12px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 0.98;
}

.auth-panel > p {
  max-width: 560px;
  margin: 0 0 26px;
  line-height: 1.55;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 420px;
  margin-bottom: 14px;
}

.auth-tabs button,
.main-nav button,
.ghost,
.secondary {
  color: var(--ink);
  background: #fffdf9;
  border: 1px solid var(--line);
}

.auth-tabs button.active,
.main-nav button.active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.auth-form {
  display: grid;
  gap: 12px;
  max-width: 420px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

input,
button {
  min-height: 46px;
  border-radius: 8px;
}

input {
  width: 100%;
  padding: 0 13px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

input::placeholder {
  color: #a3979d;
}

button {
  border: 1px solid transparent;
  font-weight: 760;
}

.primary {
  color: white;
  background: var(--coral);
  border-color: var(--coral);
}

.primary:hover {
  background: var(--coral-dark);
  border-color: var(--coral-dark);
}

.secondary:hover,
.ghost:hover,
.auth-tabs button:hover,
.main-nav button:hover {
  background: #f4eee8;
}

.wide {
  width: 100%;
}

.auth-note {
  max-width: 420px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.legal-consent {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: flex-start;
  gap: 10px;
  max-width: 420px;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.45;
}

.legal-consent input {
  width: 18px;
  min-height: 18px;
  margin: 1px 0 0;
  accent-color: var(--coral);
}

.legal-consent a,
.legal-links a,
.payment-legal-note a {
  color: var(--coral-dark);
  font-weight: 780;
  text-decoration: none;
}

.legal-consent a:hover,
.legal-links a:hover,
.payment-legal-note a:hover {
  text-decoration: underline;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.auth-legal-links {
  max-width: 420px;
  margin-top: 14px;
}

.sidebar-legal-links {
  justify-content: center;
  padding: 2px 0 4px;
}

.payment-legal-note {
  max-width: 720px;
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: rgba(255, 253, 249, 0.9);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  margin-bottom: 22px;
}

.main-nav {
  display: grid;
  gap: 8px;
}

.main-nav button {
  justify-content: flex-start;
  padding: 0 13px;
  text-align: left;
}

.sidebar-bottom {
  display: grid;
  gap: 10px;
  margin-top: auto;
}

.balance-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.balance-box span,
.balance-box small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.balance-box strong {
  display: block;
  margin-top: 2px;
  color: var(--teal);
  font-size: 34px;
  line-height: 1;
}

.workspace {
  min-width: 0;
  padding: 22px clamp(16px, 3vw, 34px) 34px;
}

.topbar {
  min-height: 72px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 16px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
}

.quick-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

#queueStatus {
  min-width: 92px;
  padding: 8px 10px;
  color: var(--muted);
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  font-size: 13px;
  font-weight: 760;
}

#queueStatus.busy {
  color: white;
  background: var(--teal);
  border-color: var(--teal);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.chat-layout,
.split-view,
.call-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 18px;
  align-items: start;
}

.conversation-panel,
.work-panel,
.history-block,
.center-panel,
.call-stage {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 46px rgba(70, 48, 38, 0.07);
}

.conversation-panel,
.work-panel {
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 132px);
}

.messages {
  flex: 1;
  min-height: 360px;
  max-height: calc(100vh - 218px);
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 16px;
}

.messages.compact {
  min-height: 420px;
}

#assessmentMessages .message.zinaida {
  width: min(100%, 720px);
  max-width: 100%;
}

#assessmentMessages .message.user {
  max-width: 92%;
}

.message {
  max-width: 82%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.message.user {
  justify-self: end;
  background: #fff7f1;
  border-color: #efd7cc;
}

.message.zinaida {
  justify-self: start;
  background: var(--teal-soft);
  border-color: #cfe8df;
}

.message strong {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.message p {
  margin: 0;
  line-height: 1.48;
  white-space: pre-wrap;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.composer button {
  padding: 0 16px;
}

.action-rail {
  display: grid;
  gap: 12px;
}

.action-tile,
.tool-card,
.test-card {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 92px;
  padding: 15px;
  text-align: left;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.action-tile:hover,
.tool-card:hover,
.test-card:hover {
  border-color: var(--teal);
  box-shadow: 0 12px 32px rgba(33, 120, 102, 0.1);
}

.action-tile strong,
.tool-card strong,
.test-card strong {
  font-size: 16px;
}

.action-tile span,
.tool-card span,
.test-card span {
  color: var(--muted);
  line-height: 1.35;
  font-size: 13px;
}

.test-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.42;
}

.test-card .test-card-action {
  color: var(--teal);
  font-weight: 750;
}

.test-filters {
  display: inline-flex;
  max-width: 100%;
  margin: 0 0 12px;
  padding: 3px;
  overflow-x: auto;
  background: var(--wash);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.test-filters button {
  min-height: 34px;
  padding: 7px 11px;
  white-space: nowrap;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.test-filters button[aria-pressed="true"] {
  color: var(--text);
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(59, 42, 36, 0.08);
}

.mini-history,
.history-block {
  padding: 15px;
}

.mini-history h3,
.history-block h3,
.section-head h3,
.center-panel h3,
.billing-layout h3 {
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.15;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.tool-grid,
.test-list,
.price-grid {
  display: grid;
  gap: 10px;
}

.history-block {
  margin-top: 16px;
}

.history-block.full {
  grid-column: 1 / -1;
}

.history-row,
.payment-row {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.action-row {
  display: grid;
  gap: 8px;
}

.action-row .row-actions {
  justify-content: flex-start;
}

.history-row:first-child,
.payment-row:first-child {
  border-top: 0;
}

.history-row p,
.payment-row p {
    margin: 0;
    color: var(--muted);
    line-height: 1.42;
}

.assessment-history-intro {
    color: var(--muted);
    line-height: 1.45;
}

.assessment-history-card {
    display: grid;
    gap: 6px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.assessment-history-card strong {
    color: var(--ink);
    font-size: 15px;
}

.assessment-history-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.42;
}

.assessment-history-date {
    color: var(--muted);
    font-size: 12px;
}

.assessment-history-compare {
    color: var(--muted);
}

.assessment-history-compare summary {
    cursor: pointer;
    color: var(--teal);
    font-weight: 700;
}

.assessment-repeat-button {
    justify-self: start;
}

.achievement-summary {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.achievement-summary p {
  margin: 0;
  color: var(--ink);
  line-height: 1.42;
}

.achievement-row {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  opacity: 0.62;
}

.achievement-row:first-of-type {
  border-top: 0;
}

.achievement-summary + .achievement-row {
  border-top: 0;
}

.achievement-row.unlocked {
  opacity: 1;
}

.achievement-row strong {
  color: var(--ink);
  font-size: 15px;
}

.achievement-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}

.achievement-progress {
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #efe8df;
}

.achievement-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.inline-actions,
.prompt-row,
.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-actions {
  padding: 0 12px 12px;
}

.map-actions {
  padding: 12px 0 0;
}

.inline-actions button,
.prompt-row button,
.row-actions button {
  min-height: 38px;
  padding: 0 11px;
  font-size: 13px;
}

.billing-layout,
.memory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.memory-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.next-step-box {
  margin: 0;
  background: var(--teal-soft);
  border-color: #cfe8df;
  color: var(--ink);
  line-height: 1.45;
}

.price-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.price-card {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.price-card h4 {
  margin: 0;
  font-size: 19px;
}

.price-card p {
  margin: 0;
  line-height: 1.4;
}

.price {
  color: var(--plum);
  font-size: 26px;
}

.price-features {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.45;
}

.price-features li + li {
  margin-top: 6px;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.center-panel {
  max-width: 680px;
  padding: 18px;
}

.promo-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.referral-form + #resendVerificationButton {
  margin-top: 10px;
}

.referral-form input[readonly] {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
}

.result-box {
  min-height: 110px;
  margin-top: 14px;
  padding: 14px;
  color: var(--muted);
  line-height: 1.5;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.call-layout {
  grid-template-columns: minmax(260px, 0.46fr) minmax(0, 1fr);
}

.call-stage {
  min-height: 520px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  padding: 22px;
  background:
    linear-gradient(145deg, #fff6ed, #e8f4ef 58%, #f1edf5);
}

.call-stage p {
  margin: 0;
  color: var(--plum);
  font-size: 24px;
  font-weight: 800;
}

.call-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
}

.prompt-row {
  padding: 0 12px 12px;
}

audio {
  width: calc(100% - 24px);
  margin: 0 12px 12px;
}

.debug {
  margin: 0 12px 12px;
  color: var(--muted);
}

.debug pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 12px;
  background: #f5f0ea;
  border-radius: 8px;
}

.referral-lines {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.referral-lines p,
.referral-own-status,
.referral-empty {
  margin: 0;
}

.result-box h4 {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 15px;
}

.referral-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.referral-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.56);
}

.referral-table th,
.referral-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.referral-table th {
  color: var(--muted);
  background: rgba(231, 242, 238, 0.72);
  font-weight: 760;
}

.referral-table tr:last-child td {
  border-bottom: 0;
}

/* Visual refresh */
.auth-panel,
.sidebar,
.topbar,
.conversation-panel,
.work-panel,
.history-block,
.center-panel,
.call-stage,
.price-card,
.action-tile,
.tool-card,
.test-card {
  box-shadow: var(--soft-shadow);
}

.sidebar {
  color: #f8fbf8;
  background:
    linear-gradient(180deg, rgba(25, 115, 102, 0.25), transparent 42%),
    #211d24;
  border-right: 0;
}

.sidebar .brand-row span,
.sidebar .balance-box span,
.sidebar .balance-box small {
  color: rgba(248, 251, 248, 0.68);
}

.sidebar .brand-row strong {
  color: #ffffff;
}

.sidebar .brand-mark {
  background: linear-gradient(145deg, var(--coral), #e16f57);
}

.main-nav button {
  color: rgba(248, 251, 248, 0.82);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.09);
}

.main-nav button.active {
  color: #211d24;
  background: #f8fbf8;
  border-color: #f8fbf8;
}

.main-nav button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

.sidebar .balance-box {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.11);
}

.sidebar .balance-box strong {
  color: #78dbc8;
}

.sidebar .ghost {
  color: #f8fbf8;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.18);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: -22px calc(clamp(16px, 3vw, 34px) * -1) 18px;
  padding: 22px clamp(16px, 3vw, 34px) 16px;
  background: rgba(251, 251, 247, 0.86);
  border-bottom: 1px solid rgba(223, 228, 223, 0.8);
  backdrop-filter: blur(18px);
}

.conversation-panel,
.work-panel,
.history-block,
.center-panel,
.call-stage,
.price-card {
  background: rgba(255, 255, 255, 0.94);
}

.action-tile,
.tool-card,
.test-card,
.price-card,
.history-block {
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.action-tile:hover,
.tool-card:hover,
.test-card:hover,
.price-card:hover {
  transform: translateY(-1px);
}

.primary,
.secondary,
.ghost,
.auth-tabs button,
.main-nav button {
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, color 160ms ease;
}

.primary:hover,
.secondary:hover,
.ghost:hover {
  transform: translateY(-1px);
}

.call-layout {
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
}

.call-stage {
  align-content: stretch;
  justify-items: stretch;
  gap: 14px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(25, 115, 102, 0.18), rgba(199, 71, 75, 0.10)),
    #fbfbf7;
}

.call-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.call-mode-switch button {
  min-height: 40px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.9);
}

.call-mode-switch button.active {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.video-frame {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(32, 27, 34, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(160deg, rgba(80, 55, 90, 0.18), transparent 42%),
    linear-gradient(20deg, rgba(25, 115, 102, 0.24), rgba(255, 255, 255, 0.52)),
    #e9f1ee;
}

.video-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.26;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.28) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22) 1px, transparent 1px);
  background-size: 26px 26px;
}

.video-frame.voice-only .avatar-scene {
  opacity: 0.44;
  filter: saturate(0.65);
}

.call-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  min-height: 28px;
  padding: 6px 10px;
  color: white;
  background: rgba(32, 27, 34, 0.8);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.avatar-scene {
  position: relative;
  z-index: 1;
  width: min(310px, 76vw);
  height: 320px;
  display: grid;
  place-items: center;
  transition: transform 220ms ease, filter 220ms ease;
}

.avatar-backlight {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.92), rgba(120, 219, 200, 0.28) 52%, transparent 70%);
}

.avatar-hair {
  position: absolute;
  top: 48px;
  width: 172px;
  height: 178px;
  border-radius: 46% 46% 44% 44%;
  background: linear-gradient(155deg, #2a2027, #583641);
  box-shadow: 0 18px 48px rgba(32, 27, 34, 0.25);
}

.avatar-face {
  position: absolute;
  top: 82px;
  width: 132px;
  height: 148px;
  border-radius: 42% 42% 46% 46%;
  background: linear-gradient(180deg, #f1c9b6, #e4a990);
  box-shadow: inset 0 -14px 24px rgba(150, 50, 56, 0.08);
}

.avatar-eye {
  position: absolute;
  top: 58px;
  width: 13px;
  height: 8px;
  border-radius: 999px;
  background: #2b2027;
}

.avatar-eye.left {
  left: 34px;
}

.avatar-eye.right {
  right: 34px;
}

.avatar-nose {
  position: absolute;
  top: 70px;
  left: 61px;
  width: 10px;
  height: 22px;
  border-radius: 999px;
  border-right: 2px solid rgba(80, 55, 90, 0.22);
}

.avatar-mouth {
  position: absolute;
  left: 50%;
  bottom: 34px;
  width: 38px;
  height: 9px;
  border-radius: 999px;
  background: #9d3f46;
  transform: translateX(-50%);
  transition: height 120ms ease, border-radius 120ms ease;
}

.avatar-shoulders {
  position: absolute;
  bottom: 8px;
  width: 232px;
  height: 86px;
  border-radius: 70px 70px 18px 18px;
  background: linear-gradient(135deg, var(--plum), var(--blue));
}

.voice-rings {
  position: absolute;
  right: 18px;
  bottom: 58px;
  display: flex;
  align-items: end;
  gap: 5px;
}

.voice-rings span {
  width: 8px;
  height: 24px;
  border-radius: 999px;
  background: rgba(199, 71, 75, 0.65);
  transform-origin: bottom;
}

.voice-rings span:nth-child(2) {
  height: 42px;
  background: rgba(25, 115, 102, 0.7);
}

.voice-rings span:nth-child(3) {
  height: 31px;
  background: rgba(183, 134, 44, 0.72);
}

.avatar-scene.listening {
  transform: scale(1.015);
}

.avatar-scene.thinking {
  filter: saturate(0.84);
}

.avatar-scene.speaking .avatar-mouth {
  height: 22px;
  border-radius: 45% 45% 52% 52%;
  animation: mouthTalk 520ms infinite;
}

.avatar-scene.speaking .voice-rings span,
.avatar-scene.listening .voice-rings span {
  animation: voiceBars 720ms infinite ease-in-out;
}

.avatar-scene.speaking .voice-rings span:nth-child(2),
.avatar-scene.listening .voice-rings span:nth-child(2) {
  animation-delay: 110ms;
}

.avatar-scene.speaking .voice-rings span:nth-child(3),
.avatar-scene.listening .voice-rings span:nth-child(3) {
  animation-delay: 220ms;
}

.avatar-scene.error {
  filter: grayscale(0.45) saturate(0.75);
}

.call-caption {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 12px 13px;
  color: #fff;
  background: rgba(32, 27, 34, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  line-height: 1.35;
}

.call-status-board {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.call-status-board #status {
  color: var(--plum);
  font-size: 22px;
  font-weight: 840;
}

.call-status-board strong {
  color: var(--muted);
  font-size: 13px;
}

.call-panel {
  gap: 0;
}

.call-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.call-metrics div {
  min-width: 0;
  padding: 11px;
  background: #f7faf6;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.call-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.call-metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.call-history,
.video-note-teaser {
  margin: 0 12px 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf7;
}

.call-history .section-head {
  margin-bottom: 8px;
}

.call-history-row {
  display: grid;
  gap: 4px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.call-history-row:first-child {
  border-top: 0;
}

.call-history-row p {
  margin: 0;
  color: var(--ink);
  line-height: 1.35;
}

.call-history-row span {
  color: var(--muted);
  font-size: 12px;
}

.video-note-teaser {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: linear-gradient(135deg, rgba(80, 55, 90, 0.08), rgba(25, 115, 102, 0.08));
}

.video-note-teaser h3,
.video-note-teaser p {
  margin: 0;
}

.video-note-teaser p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.42;
}

@keyframes voiceBars {
  0%, 100% {
    transform: scaleY(0.62);
  }
  50% {
    transform: scaleY(1.16);
  }
}

@keyframes mouthTalk {
  0%, 100% {
    height: 9px;
  }
  50% {
    height: 23px;
  }
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  color: white;
  background: var(--ink);
  border-radius: 8px;
  box-shadow: var(--shadow);
  line-height: 1.4;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .chat-layout,
  .split-view,
  .call-layout,
  .billing-layout,
  .memory-grid {
    grid-template-columns: 1fr;
  }

  .conversation-panel,
  .work-panel {
    min-height: 520px;
  }

  .messages {
    max-height: 560px;
  }
}

@media (max-width: 760px) {
  .auth-screen {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-visual {
    min-height: 240px;
  }

  .portrait {
    width: min(270px, 76vw);
  }

  .portrait-face {
    width: 104px;
    font-size: 36px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    gap: 12px;
  }

  .main-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-nav button {
    min-height: 42px;
  }

  .sidebar-bottom {
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
  }

  .topbar {
    flex-direction: column;
  }

  .quick-status {
    width: 100%;
    justify-content: space-between;
  }

  .composer,
  .promo-form,
  .call-buttons {
    grid-template-columns: 1fr;
  }

  .call-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-note-teaser {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 94%;
  }
}

@media (max-width: 460px) {
  .workspace,
  .sidebar,
  .auth-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .main-nav {
    grid-template-columns: 1fr;
  }

  .sidebar-bottom {
    grid-template-columns: 1fr;
  }

  .section-head,
  .payment-row {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions button {
    flex: 1 1 140px;
  }
}

/* 2026 cozy premium redesign */
:root {
  --ink: #251f22;
  --muted: #756b6e;
  --paper: #fffaf4;
  --wash: #f4eee7;
  --panel: rgba(255, 252, 246, 0.92);
  --line: rgba(68, 51, 48, 0.13);
  --line-strong: rgba(68, 51, 48, 0.2);
  --rose: #bd5d63;
  --rose-dark: #914249;
  --teal: #2d766c;
  --teal-soft: #e6f2ee;
  --plum: #5c455e;
  --blue: #456f92;
  --gold: #b0813d;
  --sage: #788d76;
  --charcoal: #2c2528;
  --cream: #fff7ed;
  --shadow: 0 26px 80px rgba(59, 42, 36, 0.16);
  --soft-shadow: 0 16px 44px rgba(59, 42, 36, 0.1);
}

body {
  background:
    linear-gradient(90deg, rgba(45, 118, 108, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(189, 93, 99, 0.04) 1px, transparent 1px),
    linear-gradient(135deg, #fffaf4 0%, #f4eee7 34%, #eaf3ee 72%, #f7e9ed 100%);
  background-size: 34px 34px, 34px 34px, auto;
}

body.booting .auth-screen,
body.booting .app-shell {
  display: none;
}

.auth-screen {
  grid-template-columns: minmax(360px, 1.02fr) minmax(390px, 0.78fr);
  min-height: 100vh;
  background: linear-gradient(135deg, rgba(255, 250, 244, 0.62), rgba(234, 243, 238, 0.6));
}

.auth-visual {
  padding: clamp(26px, 5.8vw, 76px);
  background:
    linear-gradient(135deg, rgba(45, 118, 108, 0.12) 0%, rgba(255, 250, 244, 0.36) 42%, rgba(189, 93, 99, 0.13) 100%),
    linear-gradient(180deg, rgba(44, 37, 40, 0.03), rgba(44, 37, 40, 0));
}

.portrait-card {
  width: min(520px, 88vw);
  display: grid;
  gap: 14px;
  padding: 14px;
  background: rgba(255, 252, 246, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.portrait-window {
  position: relative;
  overflow: hidden;
  min-height: 548px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    #eee5db;
}

.portrait-window img {
  width: 100%;
  height: 100%;
  min-height: 548px;
  display: block;
  object-fit: cover;
}

.portrait-status {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: white;
  background: rgba(37, 31, 34, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  backdrop-filter: blur(14px);
  font-size: 13px;
  font-weight: 760;
}

.portrait-status span {
  width: 8px;
  height: 8px;
  background: #9be0ba;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(155, 224, 186, 0.18);
}

.portrait-copy {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 4px 2px 0;
}

.portrait-copy strong {
  font-size: 24px;
  line-height: 1;
}

.portrait-copy span {
  max-width: 270px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.signal-lines {
  position: static;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.signal-lines div {
  min-height: 74px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.signal-lines strong,
.signal-lines span {
  display: block;
}

.signal-lines strong {
  color: var(--rose);
  font-size: 25px;
  line-height: 1;
}

.signal-lines span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.24;
}

.auth-panel {
  background: rgba(255, 252, 246, 0.86);
  border-left: 1px solid rgba(68, 51, 48, 0.12);
  backdrop-filter: blur(22px);
}

.auth-panel h1 {
  max-width: 640px;
  font-size: clamp(38px, 5.2vw, 68px);
  letter-spacing: 0;
}

.auth-highlights {
  counter-reset: auth-step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 640px;
  margin: 0 0 22px;
}

.auth-highlights span {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 94px;
  padding: 12px 12px 13px;
  color: var(--charcoal);
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.82), rgba(245, 233, 229, 0.74)),
    #f5e9e5;
  border: 1px solid rgba(189, 93, 99, 0.2);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.24;
  box-shadow: 0 12px 28px rgba(92, 72, 66, 0.08);
}

.auth-highlights span::before {
  counter-increment: auth-step;
  content: counter(auth-step);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fffaf6;
  background: var(--rose);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(189, 93, 99, 0.2);
}

.brand-mark {
  background: linear-gradient(135deg, var(--rose), var(--plum));
  box-shadow: 0 10px 24px rgba(145, 66, 73, 0.18);
}

input,
button,
.auth-tabs button,
.main-nav button,
.ghost,
.secondary,
.primary {
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

input {
  background: rgba(255, 255, 255, 0.82);
  border-color: var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

input:focus {
  outline: none;
  border-color: rgba(45, 118, 108, 0.55);
  box-shadow: 0 0 0 4px rgba(45, 118, 108, 0.12);
}

.primary {
  background: linear-gradient(135deg, var(--rose), var(--rose-dark));
  border-color: rgba(145, 66, 73, 0.1);
  box-shadow: 0 16px 34px rgba(145, 66, 73, 0.18);
}

.primary:hover {
  background: linear-gradient(135deg, #c7676d, #873d44);
  border-color: rgba(145, 66, 73, 0.1);
  box-shadow: 0 18px 38px rgba(145, 66, 73, 0.22);
}

.secondary,
.ghost,
.auth-tabs button,
.main-nav button {
  background: rgba(255, 252, 246, 0.78);
  border-color: var(--line);
}

.secondary:hover,
.ghost:hover,
.auth-tabs button:hover,
.main-nav button:hover {
  background: rgba(255, 245, 236, 0.96);
  border-color: rgba(189, 93, 99, 0.2);
}

.app-shell {
  grid-template-columns: 304px minmax(0, 1fr);
}

.sidebar {
  padding: 18px;
  color: #fdf6ee;
  background:
    linear-gradient(180deg, rgba(44, 37, 40, 0.96), rgba(55, 43, 43, 0.96)),
    #2c2528;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 12px 0 36px rgba(44, 37, 40, 0.12);
}

.sidebar .brand-row span,
.sidebar .balance-box span,
.sidebar .balance-box small {
  color: rgba(255, 247, 237, 0.68);
}

.sidebar .brand-row strong {
  color: #fffaf4;
}

.persona-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  margin: 0 0 18px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.persona-card img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  object-position: 50% 24%;
  border-radius: 8px;
}

.persona-card strong,
.persona-card span {
  display: block;
}

.persona-card strong {
  color: #fffaf4;
}

.persona-card span {
  margin-top: 4px;
  color: rgba(255, 247, 237, 0.68);
  font-size: 12px;
  line-height: 1.32;
}

.main-nav {
  gap: 7px;
}

.main-nav button {
  position: relative;
  min-height: 44px;
  color: rgba(255, 247, 237, 0.76);
  background: transparent;
  border-color: transparent;
}

.main-nav button::before {
  content: "";
  width: 6px;
  height: 6px;
  margin-right: 9px;
  display: inline-block;
  background: rgba(255, 247, 237, 0.34);
  border-radius: 50%;
  vertical-align: middle;
}

.main-nav button.active {
  color: #fffaf4;
  background: rgba(255, 255, 255, 0.11);
  border-color: rgba(255, 255, 255, 0.13);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.main-nav button.active::before {
  background: #efb4a4;
  box-shadow: 0 0 0 5px rgba(239, 180, 164, 0.1);
}

.sidebar .balance-box {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.sidebar .balance-box strong {
  color: #f2c58b;
}

.sidebar .ghost {
  color: #fffaf4;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.12);
}

.workspace {
  padding: 18px clamp(14px, 2.4vw, 30px) 30px;
}

.topbar {
  min-height: 74px;
  align-items: center;
  padding: 2px 0 18px;
}

.eyebrow {
  color: var(--rose);
  text-transform: none;
  font-size: 13px;
  letter-spacing: 0;
}

.topbar h2 {
  font-size: clamp(30px, 3.8vw, 50px);
  letter-spacing: 0;
}

#queueStatus {
  background: rgba(255, 252, 246, 0.78);
  border-color: var(--line);
}

.chat-layout,
.split-view,
.call-layout {
  gap: 16px;
}

.conversation-panel,
.work-panel,
.history-block,
.center-panel,
.call-stage,
.action-tile,
.tool-card,
.test-card,
.price-card,
.result-box,
.mini-history {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.conversation-panel,
.work-panel {
  min-height: calc(100vh - 132px);
}

.lab-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.62fr);
  gap: 14px;
  margin-bottom: 16px;
}

.lab-hero-copy,
.lab-hero-side {
  min-height: 224px;
  padding: clamp(18px, 2.7vw, 30px);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.lab-hero-copy {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.96) 0%, rgba(240, 229, 224, 0.92) 46%, rgba(229, 241, 237, 0.92) 100%);
}

.lab-hero-copy::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 7px;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--teal), var(--blue));
}

.soft-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  color: var(--rose-dark);
  background: rgba(189, 93, 99, 0.12);
  border: 1px solid rgba(189, 93, 99, 0.16);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 820;
}

.lab-hero h3 {
  max-width: 660px;
  margin: 14px 0 10px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 0.98;
  letter-spacing: 0;
}

.lab-hero p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hero-actions button {
  padding: 0 18px;
}

.lab-hero-side {
  display: grid;
  align-content: stretch;
  gap: 12px;
  background:
    linear-gradient(145deg, rgba(44, 37, 40, 0.95), rgba(72, 57, 58, 0.95)),
    var(--charcoal);
  color: #fffaf4;
}

.mini-story-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
}

.mini-story-card span {
  color: rgba(255, 247, 237, 0.72);
  line-height: 1.45;
}

.lab-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lab-metrics div {
  min-height: 76px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.lab-metrics strong,
.lab-metrics span {
  display: block;
}

.lab-metrics strong {
  color: #f2c58b;
  font-size: 28px;
  line-height: 1;
}

.lab-metrics span {
  margin-top: 6px;
  color: rgba(255, 247, 237, 0.7);
  font-size: 12px;
  line-height: 1.2;
}

.tool-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tool-card {
  position: relative;
  min-height: 132px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
  gap: 7px 12px;
  padding: 15px;
  overflow: hidden;
}

.tool-card .tool-icon {
  grid-row: 1 / span 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: white;
  background: var(--charcoal);
  border-radius: 8px;
  font-size: 19px;
  font-weight: 860;
}

.tool-card em {
  justify-self: start;
  padding: 4px 7px;
  color: var(--muted);
  background: rgba(37, 31, 34, 0.04);
  border-radius: 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 820;
}

.tool-card strong {
  font-size: 18px;
  line-height: 1.15;
}

.tool-card span:not(.tool-icon) {
  grid-column: 2;
  font-size: 13px;
  line-height: 1.42;
}

.tool-card.featured {
  grid-column: 1 / -1;
  min-height: 148px;
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.98), rgba(255, 239, 232, 0.92)),
    var(--panel);
  border-color: rgba(189, 93, 99, 0.24);
}

.tool-card-rose .tool-icon { background: linear-gradient(135deg, var(--rose), var(--rose-dark)); }
.tool-card-ink .tool-icon { background: linear-gradient(135deg, var(--charcoal), #5a4c50); }
.tool-card-blue .tool-icon { background: linear-gradient(135deg, var(--blue), #274f6f); }
.tool-card-sage .tool-icon { background: linear-gradient(135deg, var(--sage), #566c55); }
.tool-card-gold .tool-icon { background: linear-gradient(135deg, var(--gold), #8c632e); }
.tool-card-plum .tool-icon { background: linear-gradient(135deg, var(--plum), #3f3043); }

.action-tile:hover,
.tool-card:hover,
.test-card:hover,
.price-card:hover {
  border-color: rgba(45, 118, 108, 0.34);
  box-shadow: 0 18px 48px rgba(59, 42, 36, 0.13);
}

.messages {
  gap: 11px;
  padding: 14px;
}

.message {
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(59, 42, 36, 0.06);
}

.message.user {
  background: #fff1e8;
  border-color: rgba(189, 93, 99, 0.16);
}

.message.zinaida {
  background: #eaf4ef;
  border-color: rgba(45, 118, 108, 0.16);
}

.message strong {
  color: rgba(37, 31, 34, 0.56);
  text-transform: none;
  font-size: 12px;
}

.composer {
  background: rgba(255, 250, 244, 0.72);
}

.history-row,
.achievement-row,
.price-card {
  background: rgba(255, 255, 255, 0.64);
  border-color: var(--line);
  border-radius: 8px;
}

.prompt-row button {
  background: rgba(255, 252, 246, 0.8);
  border-color: var(--line);
}

.call-layout {
  grid-template-columns: minmax(340px, 0.86fr) minmax(0, 1fr);
}

.call-stage {
  min-height: calc(100vh - 132px);
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(44, 37, 40, 0.94), rgba(69, 56, 58, 0.94)),
    var(--charcoal);
  color: #fffaf4;
}

.video-frame {
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.12), rgba(45, 118, 108, 0.12)),
    linear-gradient(180deg, #423538, #2c2528);
  border-color: rgba(255, 255, 255, 0.12);
}

.call-caption {
  background: rgba(37, 31, 34, 0.66);
  border-color: rgba(255, 255, 255, 0.12);
}

.call-mode-switch {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.call-mode-switch button {
  color: rgba(255, 247, 237, 0.72);
  background: transparent;
}

.call-mode-switch button.active {
  color: #251f22;
  background: #fffaf4;
}

.call-status-board,
.call-metrics div,
.video-note-teaser {
  border-radius: 8px;
}

.call-status-board {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
}

.call-status-board span {
  color: rgba(255, 247, 237, 0.68);
}

.call-status-board strong {
  color: #f2c58b;
}

.avatar-scene {
  filter: drop-shadow(0 24px 42px rgba(0, 0, 0, 0.22));
}

.avatar-face {
  background: linear-gradient(145deg, #f0c1a4, #d09172);
}

.avatar-hair {
  background: linear-gradient(100deg, #b89676 0%, #efd8bb 34%, #8f6e5a 68%, #e8caa6 100%);
}

.avatar-shoulders {
  background: linear-gradient(145deg, #707274, #4f5357);
  border-radius: 8px 8px 0 0;
}

.memory-grid {
  gap: 14px;
}

.dashboard-focus {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  max-width: 920px;
  margin: 0 auto 18px;
}

.quick-start-strip {
  display: grid;
  gap: 14px;
  max-width: 920px;
  margin: 0 auto 18px;
  padding: 18px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(231, 242, 238, 0.86), rgba(255, 255, 255, 0.9)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.quick-start-strip h3 {
  margin: 7px 0 0;
  font-size: 22px;
  line-height: 1.12;
}

.quick-start-grid {
  counter-reset: quick-step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.quick-start-grid div {
  position: relative;
  display: grid;
  gap: 5px;
  min-height: 124px;
  padding: 14px 13px 13px 52px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(245, 250, 247, 0.76)),
    rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(70, 119, 98, 0.16);
  border-radius: 8px;
}

.quick-start-grid div::before {
  counter-increment: quick-step;
  content: counter(quick-step);
  position: absolute;
  left: 13px;
  top: 14px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fafffb;
  background: var(--teal);
  border-radius: 999px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(25, 115, 102, 0.16);
}

.quick-start-grid strong {
  font-size: 14px;
}

.quick-start-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.quick-start-strip > button {
  justify-self: start;
  box-shadow: 0 14px 28px rgba(189, 93, 99, 0.18);
}

.dashboard-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 920px;
  margin: 0 auto 18px;
}

.dashboard-actions button {
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 18px 18px 16px;
  text-align: left;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(255, 250, 244, 0.7)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.dashboard-actions button:hover {
  transform: translateY(-1px);
  border-color: rgba(189, 93, 99, 0.26);
  box-shadow: 0 16px 34px rgba(92, 72, 66, 0.12);
}

.dashboard-actions button:first-child {
  background:
    linear-gradient(135deg, rgba(189, 93, 99, 0.12), rgba(255, 250, 244, 0.92)),
    var(--panel);
  border-color: rgba(189, 93, 99, 0.2);
}

.dashboard-actions strong {
  font-size: 19px;
  line-height: 1.15;
}

.dashboard-actions span {
  color: var(--muted);
  line-height: 1.36;
}

.retention-nudge {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  max-width: 920px;
  min-height: 116px;
  margin: -2px auto 2px;
  padding: 20px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(238, 247, 243, 0.82)),
    var(--panel);
  border: 1px solid rgba(45, 118, 108, 0.16);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.retention-nudge h3 {
  margin: 10px 0 6px;
  font-size: clamp(21px, 2.1vw, 30px);
  line-height: 1.05;
}

.retention-nudge p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.retention-nudge button {
  min-width: 168px;
  padding: 0 18px;
}

.command-center {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.72fr) minmax(280px, 0.58fr);
  gap: 14px;
  margin-bottom: 16px;
}

.command-card,
.memory-hero,
.billing-value-card,
.call-room-intro,
.lab-result-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(14px);
}

.command-card {
  min-height: 224px;
  padding: 18px;
  animation: cardIn 220ms ease both;
}

.now-card {
  min-height: 260px;
  padding: clamp(24px, 4vw, 44px);
}

.state-command-card {
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.96), rgba(231, 242, 238, 0.92)),
    var(--panel);
}

.now-card h3 {
  display: grid;
  gap: 6px;
}

.now-card h3 span {
  color: var(--muted);
  font-size: clamp(18px, 2vw, 25px);
  font-weight: 650;
}

.now-card h3 em {
  max-width: 760px;
  font-style: normal;
}

.now-card p {
  max-width: 720px;
  font-size: clamp(17px, 1.6vw, 21px);
}

.dashboard-secondary {
  max-width: 920px;
  margin: 0 auto;
}

.dashboard-secondary summary {
  cursor: pointer;
  width: max-content;
  max-width: 100%;
  margin: 0 0 10px;
  padding: 9px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.command-card h3 {
  margin: 12px 0 8px;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.03;
}

.command-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.48;
}

.command-actions {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.command-actions button {
  display: grid;
  gap: 5px;
  min-height: 58px;
  padding: 10px 12px;
  text-align: left;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.command-actions button:first-child {
  background: rgba(189, 93, 99, 0.11);
  border-color: rgba(189, 93, 99, 0.18);
}

.command-actions strong,
.command-actions span {
  display: block;
}

.command-actions span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.28;
}

.memory-preview-card {
  background:
    linear-gradient(145deg, rgba(44, 37, 40, 0.95), rgba(79, 67, 66, 0.95)),
    var(--charcoal);
  color: #fffaf4;
}

.memory-preview-card p {
  color: rgba(255, 247, 237, 0.72);
}

.memory-preview-card .soft-label {
  color: #f2c58b;
  background: rgba(242, 197, 139, 0.1);
  border-color: rgba(242, 197, 139, 0.18);
}

.memory-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.memory-mini-stats div {
  min-height: 64px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
}

.memory-mini-stats strong,
.memory-mini-stats span {
  display: block;
}

.memory-mini-stats strong {
  color: #f2c58b;
  font-size: 24px;
  line-height: 1;
}

.memory-mini-stats span {
  margin-top: 6px;
  color: rgba(255, 247, 237, 0.68);
  font-size: 12px;
}

.memory-preview-card .ghost {
  color: #fffaf4;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.lab-mode-banner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.96), rgba(232, 244, 239, 0.88)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.active-lab-notice {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.98), rgba(231, 242, 238, 0.9)),
    var(--panel);
  border: 1px solid rgba(189, 93, 99, 0.18);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.active-lab-notice p {
  margin: 5px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.active-lab-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-media-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 12px 0;
}

.chat-media-actions button.recording {
  color: #fffaf4;
  background: var(--coral);
  border-color: var(--coral);
  animation: softPulse 900ms ease-in-out infinite;
}

.chat-media-actions span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 240px;
  min-height: 34px;
  padding: 7px 10px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(70, 62, 58, 0.08);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.25;
}

.chat-media-actions span.busy::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: var(--sage);
  border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(45, 118, 108, 0.22);
  animation: statusPulse 1100ms ease-in-out infinite;
}

.chat-media-actions span[data-tone="voice"] {
  color: #49605a;
  background: rgba(232, 244, 239, 0.72);
  border-color: rgba(45, 118, 108, 0.14);
}

.chat-media-actions span[data-tone="video"] {
  color: #76524d;
  background: rgba(255, 239, 231, 0.78);
  border-color: rgba(189, 93, 99, 0.14);
}

.chat-media-actions span[data-tone="error"] {
  color: #8d3f45;
  background: rgba(255, 238, 239, 0.8);
  border-color: rgba(189, 93, 99, 0.22);
}

.chat-audio {
  display: block;
  width: min(360px, 100%);
  margin-top: 9px;
}

.chat-video-note {
  display: block;
  width: min(260px, 72vw);
  aspect-ratio: 1 / 1;
  margin-top: 10px;
  object-fit: cover;
  border-radius: 999px;
  background: #1f1b1d;
  border: 3px solid rgba(255, 250, 244, 0.92);
  box-shadow: 0 18px 36px rgba(44, 37, 40, 0.22);
}

.media-replay-button {
  width: max-content;
  max-width: 100%;
  min-height: 36px;
  margin-top: 10px;
  padding: 0 13px;
}

.media-replay-button:disabled {
  opacity: 0.72;
  cursor: wait;
}

.bottom-nav {
  display: none;
}

.lab-mode-banner h3 {
  margin: 10px 0 6px;
  font-size: clamp(24px, 2.8vw, 38px);
  line-height: 1.05;
}

.lab-mode-banner p {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

body[data-lab-tool="telepath"] .lab-mode-banner {
  background: linear-gradient(135deg, rgba(69, 111, 146, 0.12), rgba(255, 250, 244, 0.94));
}

body[data-lab-tool="radar"] .lab-mode-banner {
  background: linear-gradient(135deg, rgba(176, 129, 61, 0.12), rgba(255, 250, 244, 0.94));
}

body[data-lab-tool="detective"] .lab-mode-banner {
  background: linear-gradient(135deg, rgba(44, 37, 40, 0.12), rgba(255, 250, 244, 0.94));
}

body[data-lab-tool="conflict"] .lab-mode-banner {
  background: linear-gradient(135deg, rgba(120, 141, 118, 0.14), rgba(255, 250, 244, 0.94));
}

body[data-lab-tool="artifacts"] .lab-mode-banner {
  background: linear-gradient(135deg, rgba(92, 69, 94, 0.13), rgba(255, 250, 244, 0.94));
}

.lab-result-cards {
  padding: 0 12px 12px;
}

.lab-result-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.96), rgba(232, 244, 239, 0.92)),
    var(--panel);
  animation: cardIn 260ms ease both;
}

.lab-result-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.lab-result-header h3 {
  margin: 10px 0 6px;
  font-size: 24px;
  line-height: 1.1;
}

.lab-result-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.result-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.result-badges span,
.price-kind {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 9px;
  color: var(--plum);
  background: rgba(92, 69, 94, 0.09);
  border: 1px solid rgba(92, 69, 94, 0.13);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 820;
}

.lab-result-section {
  padding: 12px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.lab-result-section h4 {
  margin: 0 0 8px;
  font-size: 15px;
}

.lab-result-list {
  display: grid;
  gap: 7px;
}

.lab-result-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.38;
}

.lab-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lab-result-actions button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.memory-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: clamp(18px, 2.8vw, 28px);
  background:
    linear-gradient(135deg, rgba(255, 250, 244, 0.96), rgba(239, 231, 224, 0.92)),
    var(--panel);
}

.memory-hero h3 {
  margin: 12px 0 8px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.02;
}

.memory-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.memory-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.memory-hero-actions button {
  padding: 0 16px;
}

.billing-value-card,
.call-room-intro {
  padding: 14px;
  margin-bottom: 12px;
}

.status-box {
  padding: 12px 14px;
  color: #fffaf4;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.status-box span,
.status-box strong {
  display: block;
}

.status-box span {
  color: rgba(255, 247, 237, 0.66);
  font-size: 12px;
}

.status-box #queueStatus {
  min-width: 0;
  margin-top: 4px;
  padding: 0;
  color: #f2c58b;
  text-align: left;
  background: transparent;
  border: 0;
  font-size: 16px;
}

.status-box #queueStatus.busy {
  color: #9be0ba;
  background: transparent;
  border: 0;
}

.topbar-pay-button {
  padding: 0 16px;
}

.skeleton-line {
  position: relative;
  overflow: hidden;
  min-height: 84px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.skeleton-line::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.72), transparent);
  animation: skeletonSweep 1.15s infinite;
}

.message.zinaida {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 9px;
}

.message-avatar {
  width: 34px;
  height: 34px;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(59, 42, 36, 0.14);
}

.message-body {
  min-width: 0;
}

.video-note-progress-message,
.video-note-result-message {
  width: min(82%, 620px);
}

.video-note-reply {
  display: grid;
  gap: 2px;
  margin: 2px 0 10px;
  padding: 7px 10px;
  overflow: hidden;
  color: rgba(37, 31, 34, 0.68);
  background: rgba(255, 255, 255, 0.54);
  border-left: 3px solid var(--teal);
  border-radius: 0 5px 5px 0;
}

.video-note-reply-label {
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 760;
}

.video-note-reply-text {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-note-progress {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.video-note-progress-track {
  height: 5px;
  overflow: hidden;
  background: rgba(45, 118, 108, 0.14);
  border-radius: 3px;
}

.video-note-progress-bar {
  display: block;
  width: 4%;
  height: 100%;
  background: var(--teal);
  border-radius: inherit;
  transition: width 420ms ease;
}

.video-note-progress-meta,
.video-note-progress-stages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.video-note-progress-estimate {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.video-note-progress-stages {
  justify-content: flex-start;
  gap: 5px;
}

.video-note-progress-stages span {
  padding: 3px 7px;
  color: rgba(37, 31, 34, 0.45);
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid transparent;
  border-radius: 4px;
}

.video-note-progress-stages span.active {
  color: var(--teal-dark);
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(45, 118, 108, 0.2);
}

.video-note-progress-stages span.done {
  color: rgba(45, 118, 108, 0.7);
}

.video-note-progress-failed .video-note-progress-bar {
  background: var(--coral-dark);
}

.video-note-progress-failed .video-note-progress-track {
  background: rgba(189, 93, 99, 0.14);
}

.message {
  animation: messageIn 180ms ease both;
}

.call-avatar-photo {
  position: relative;
  z-index: 1;
  width: min(290px, 70vw);
  height: 320px;
  object-fit: cover;
  object-position: 50% 20%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.24);
}

.avatar-scene.speaking .call-avatar-photo {
  animation: softPulse 900ms infinite ease-in-out;
}

.avatar-scene.listening .call-avatar-photo {
  filter: saturate(1.08) brightness(1.03);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes skeletonSweep {
  to {
    transform: translateX(100%);
  }
}

@keyframes softPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.012);
  }
}

@keyframes statusPulse {
  0%, 100% {
    transform: scale(0.92);
    box-shadow: 0 0 0 0 rgba(45, 118, 108, 0.22);
  }
  50% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(45, 118, 108, 0);
  }
}

.billing-value-card strong,
.billing-value-card span,
.call-room-intro span,
.call-room-intro h3,
.call-room-intro p {
  display: block;
}

.billing-value-card strong {
  font-size: 18px;
}

.billing-value-card span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.42;
}

.subscription-value-card {
  background: linear-gradient(135deg, rgba(45, 118, 108, 0.1), rgba(255, 250, 244, 0.92));
}

.topup-value-card {
  background: linear-gradient(135deg, rgba(189, 93, 99, 0.1), rgba(255, 250, 244, 0.92));
}

.price-card.subscription-card {
  border-color: rgba(45, 118, 108, 0.18);
}

.price-card.topup-card {
  border-color: rgba(189, 93, 99, 0.16);
}

.call-room-intro {
  margin: 12px 12px 0;
  background:
    linear-gradient(135deg, rgba(92, 69, 94, 0.08), rgba(45, 118, 108, 0.08)),
    #fffaf4;
}

.call-room-intro h3 {
  margin: 10px 0 6px;
  font-size: 24px;
  line-height: 1.1;
}

.call-room-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.42;
}

.billing-layout {
  gap: 16px;
}

.toast {
  border-radius: 8px;
  background: rgba(44, 37, 40, 0.92);
  box-shadow: var(--shadow);
}

@media (max-width: 1180px) {
  .dashboard-focus,
  .dashboard-actions,
  .quick-start-grid {
    grid-template-columns: 1fr;
  }

  .command-center {
    grid-template-columns: 1fr;
  }

  .lab-hero,
  .chat-layout,
  .split-view,
  .call-layout {
    grid-template-columns: 1fr;
  }

  .conversation-panel,
  .work-panel,
  .call-stage {
    min-height: auto;
  }
}

@media (max-width: 880px) {
  .auth-screen {
    grid-template-columns: 1fr;
  }

  .auth-visual {
    min-height: 44vh;
  }

  .portrait-card {
    width: min(520px, 100%);
  }

  .portrait-window,
  .portrait-window img {
    min-height: 400px;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding-bottom: 92px;
  }

  .topbar {
    margin-left: -14px;
    margin-right: -14px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .toast {
    left: 18px;
    right: 18px;
    bottom: 84px;
    max-width: none;
  }

  .sidebar {
    position: relative;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .persona-card {
    display: none;
  }

  .main-nav {
    display: none;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .main-nav button {
    flex: 0 0 auto;
  }

  .sidebar-bottom {
    grid-template-columns: 1fr auto;
    align-items: stretch;
  }

  .sidebar .ghost {
    width: auto;
    min-width: 112px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar-pay-button {
    width: 100%;
  }

  .bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    background: rgba(255, 250, 244, 0.92);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
  }

  .bottom-nav button {
    min-height: 48px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-weight: 800;
  }

  .bottom-nav button.active {
    color: var(--ink);
    background: rgba(189, 93, 99, 0.12);
  }

  .active-lab-notice {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .auth-panel {
    padding: 24px 16px 30px;
  }

  .auth-screen {
    grid-template-columns: minmax(0, 1fr);
  }

  .auth-visual,
  .auth-panel,
  .auth-panel > *,
  .auth-tabs,
  .auth-form,
  .auth-highlights {
    max-width: 100%;
    min-width: 0;
  }

  .auth-panel h1,
  .lab-hero h3 {
    font-size: 36px;
    line-height: 1.02;
  }

  .signal-lines,
  .auth-highlights,
  .lab-metrics,
  .tool-grid,
  .price-grid {
    grid-template-columns: 1fr;
  }

  .tool-card.featured {
    grid-column: auto;
  }

  .lab-hero-copy,
  .lab-hero-side,
  .history-block,
  .work-panel,
  .conversation-panel,
  .call-stage {
    padding: 14px;
  }

  .dashboard-focus,
  .dashboard-actions,
  .quick-start-strip,
  .retention-nudge,
  .dashboard-secondary {
    max-width: 100%;
  }

  .dashboard-focus {
    gap: 12px;
    margin-bottom: 12px;
  }

  .dashboard-actions {
    gap: 10px;
    margin-bottom: 12px;
  }

  .dashboard-actions button {
    min-height: 94px;
    padding: 14px;
  }

  .now-card {
    min-height: 0;
    padding: 20px 16px;
  }

  .retention-nudge {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    padding: 16px;
  }

  .retention-nudge button {
    width: 100%;
  }

  .hero-actions,
  .quick-status,
  .section-head,
  .inline-actions,
  .memory-hero,
  .lab-result-header,
  .lab-mode-banner {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions button,
  .quick-status button,
  .inline-actions button,
  .memory-hero-actions button,
  .lab-result-actions button {
    width: 100%;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .message {
    max-width: 96%;
  }

  .topbar {
    display: grid;
  }
}

.topbar > div {
  min-width: 0;
}

.topbar h2 {
  max-width: min(760px, 100%);
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.04;
}

.active-assessment-notice {
  background:
    linear-gradient(135deg, rgba(245, 233, 229, 0.98), rgba(255, 250, 244, 0.94)),
    var(--panel);
  border-color: rgba(92, 69, 94, 0.2);
}

#view-lab .work-panel {
  position: sticky;
  top: 18px;
  border: 2px solid rgba(189, 93, 99, 0.22);
  box-shadow: 0 22px 70px rgba(145, 66, 73, 0.15);
}

#view-lab .work-panel::before {
  content: "Рабочий чат Лаборатории";
  display: block;
  margin: 12px 12px 0;
  padding: 10px 12px;
  color: var(--rose-dark);
  background: rgba(189, 93, 99, 0.11);
  border: 1px solid rgba(189, 93, 99, 0.16);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 840;
}

#labMessages {
  background:
    linear-gradient(180deg, rgba(255, 250, 244, 0.72), rgba(232, 244, 239, 0.42));
}

.achievements-hero {
  margin-bottom: 16px;
}

.achievements-panel {
  max-width: 980px;
}

#view-achievements .achievement-row {
  grid-template-columns: minmax(0, 1fr);
  padding: 14px 0;
}

#view-achievements .achievement-row strong {
  font-size: 16px;
}

#view-achievements .achievement-progress {
  height: 9px;
}

@media (max-width: 880px) {
  #view-lab .work-panel {
    position: static;
  }
}

.auth-value-list {
  display: grid;
  gap: 10px;
  margin: 18px 0 4px;
}

.auth-value-list > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.auth-value-list svg {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--teal);
}

.auth-value-list span,
.auth-value-list small {
  display: block;
}

.auth-value-list strong {
  color: var(--ink);
  font-size: 14px;
}

.auth-value-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.studio-panel-switch,
.studio-format-switch,
.studio-duration-switch {
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 3px;
  padding: 3px;
  overflow-x: auto;
  background: #e8eeea;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.studio-panel-switch {
  margin-bottom: 14px;
}

.studio-panel-switch button,
.studio-format-switch button,
.studio-duration-switch button,
.studio-option-switch button,
.studio-theme-switch button {
  min-height: 38px;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 13px;
  color: var(--muted);
  font-weight: 730;
  white-space: nowrap;
  background: transparent;
  border: 0;
  border-radius: 6px;
}

.studio-panel-switch button.active,
.studio-format-switch button.active,
.studio-duration-switch button.active,
.studio-option-switch button.active,
.studio-theme-switch button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 1px 3px rgb(32 27 34 / 10%);
}

.studio-panel-switch svg {
  width: 17px;
  height: 17px;
}

.studio-publication-panel {
  min-width: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.studio-publication-head {
  margin-bottom: 12px;
}

.studio-publication-head h3 {
  margin-top: 4px;
}

.studio-status[data-tone="recording"] {
  color: var(--coral-dark);
}

.studio-status[data-tone="ready"] {
  color: var(--teal);
}

.studio-status[data-tone="error"] {
  color: #a43b42;
}

.studio-format-switch {
  width: 100%;
  margin-bottom: 16px;
}

.studio-format-switch button {
  flex: 1 0 auto;
}

.studio-publication-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
  gap: 22px;
  align-items: start;
}

.studio-publication-editor,
.studio-publication-preview {
  min-width: 0;
}

.studio-publication-editor {
  display: grid;
  gap: 15px;
}

.studio-field-label {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.studio-message-picker {
  max-height: 330px;
  display: grid;
  gap: 1px;
  overflow: auto;
  border-block: 1px solid var(--line);
}

.studio-source-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 11px 4px;
  cursor: pointer;
  border-bottom: 1px solid rgb(32 27 34 / 7%);
}

.studio-source-row:last-child {
  border-bottom: 0;
}

.studio-source-row input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--teal);
}

.studio-source-row span,
.studio-source-row strong,
.studio-source-row small {
  min-width: 0;
  display: block;
}

.studio-source-row strong {
  color: var(--ink);
  font-size: 13px;
}

.studio-source-row small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.studio-source-empty {
  margin: 0;
  padding: 18px 4px;
  color: var(--muted);
  font-size: 13px;
}

.studio-format-fields {
  display: grid;
  gap: 12px;
}

.studio-editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.studio-story-field select {
  width: 100%;
  min-height: 44px;
  padding: 10px 36px 10px 12px;
  color: var(--ink);
  background: #fbfbf7;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.studio-duration-switch {
  width: 100%;
}

.studio-duration-switch button {
  flex: 1 1 0;
}

.studio-customization-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding-block: 14px;
  border-block: 1px solid var(--line);
}

.studio-control-block {
  min-width: 0;
}

.studio-control-block:first-child {
  grid-column: 1 / -1;
}

.studio-theme-switch {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.studio-theme-switch button {
  min-width: 0;
  padding-inline: 8px;
  border: 1px solid transparent;
}

.studio-theme-switch button.active {
  border-color: rgba(45, 118, 108, 0.2);
}

.studio-theme-swatch {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border: 1px solid rgba(32, 27, 34, 0.18);
  border-radius: 50%;
}

.studio-theme-swatch.theme-calm {
  background: linear-gradient(90deg, #197366 0 50%, #eef3ef 50%);
}

.studio-theme-swatch.theme-night {
  background: linear-gradient(90deg, #202624 0 50%, #f0a06d 50%);
}

.studio-theme-swatch.theme-editorial {
  background: linear-gradient(90deg, #111 0 50%, #b3262d 50%);
}

.studio-theme-swatch.theme-fresh {
  background: linear-gradient(90deg, #167d77 0 50%, #e85757 50%);
}

.studio-option-switch {
  display: flex;
  min-width: 0;
}

.studio-option-switch button {
  min-width: 0;
  flex: 1 1 0;
  padding-inline: 8px;
}

.studio-anonymous-toggle {
  margin: 0;
}

.studio-privacy-review {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  padding: 13px 0;
  color: var(--ink);
  border-block: 1px solid var(--line);
}

.studio-privacy-review > svg {
  width: 20px;
  height: 20px;
  color: var(--teal);
}

.studio-privacy-review strong,
.studio-privacy-review p {
  display: block;
}

.studio-privacy-review p {
  margin: 3px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.studio-privacy-review p[data-tone="warning"] {
  color: #934045;
}

.studio-privacy-review label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  font-size: 12px;
  font-weight: 680;
  line-height: 1.35;
}

.studio-privacy-review input {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
}

.studio-publication-preview {
  position: sticky;
  top: 82px;
  display: grid;
  justify-items: stretch;
  gap: 11px;
}

.studio-video-stage {
  width: min(100%, 360px);
  display: grid;
  place-items: center;
  justify-self: center;
  overflow: hidden;
  background: #202326;
  border: 1px solid var(--line);
  border-radius: 8px;
  aspect-ratio: 9 / 16;
}

.studio-video-stage canvas,
.studio-video-stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #eef3ef;
}

.studio-publication-preview progress {
  width: min(100%, 360px);
  height: 7px;
  justify-self: center;
  overflow: hidden;
  accent-color: var(--teal);
  border: 0;
  border-radius: 4px;
}

.studio-publication-actions {
  justify-content: center;
}

.studio-export-band {
  display: grid;
  gap: 8px;
  margin-top: 3px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.studio-export-band .studio-toggle {
  margin: 0;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.4;
}

.studio-export-band > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.studio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 18px;
  align-items: start;
}

.studio-capture,
.studio-story {
  min-width: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.studio-status {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.studio-status.recording {
  color: var(--coral-dark);
}

.studio-preview {
  position: relative;
  min-height: 360px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--muted);
  background: #202326;
  border-radius: 8px;
  aspect-ratio: 16 / 9;
}

.studio-countdown {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(17, 20, 19, 0.54);
  font-size: clamp(58px, 12vw, 118px);
  font-weight: 780;
  line-height: 1;
  pointer-events: none;
}

.studio-countdown.hidden {
  display: none;
}

.studio-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #111;
}

#studioPreviewEmpty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 16px;
  color: #e4ece8;
  text-align: center;
}

#studioPreviewEmpty svg {
  width: 38px;
  height: 38px;
}

#studioPreviewEmpty strong {
  color: #e4ece8;
}

.studio-toggle {
  display: flex;
  gap: 9px;
  align-items: center;
  margin: 14px 0;
  color: var(--ink);
  font-weight: 680;
}

.studio-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.studio-capture-settings {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr);
  gap: 12px;
  align-items: end;
  margin: 14px 0;
}

.studio-capture-toggles {
  display: grid;
  gap: 9px;
  align-self: center;
}

.studio-capture-toggles .studio-toggle {
  margin: 0;
}

.studio-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.studio-actions button,
.call-buttons button,
.call-share-button {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.studio-actions svg,
.call-buttons svg,
.call-share-button svg {
  width: 18px;
  height: 18px;
}

.studio-privacy {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.studio-privacy svg {
  width: 16px;
  min-width: 16px;
}

.studio-story {
  display: grid;
  gap: 13px;
}

.studio-story-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.studio-story-field textarea,
.studio-story-field input,
.studio-story-field select {
  width: 100%;
  color: var(--ink);
  background: #fbfbf7;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  resize: vertical;
}

#studioStoryCanvas {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  aspect-ratio: 9 / 16;
  background: #eef3ef;
}

.call-avatar-photo {
  transform: scale(var(--voice-scale, 1));
  transition: transform 80ms linear, filter 220ms ease;
}

.avatar-scene.speaking .call-avatar-photo {
  animation: none;
}

.voice-rings span {
  transform: scaleY(var(--voice-bar-1, 0.45));
}

.voice-rings span:nth-child(2) {
  transform: scaleY(var(--voice-bar-2, 0.72));
}

.voice-rings span:nth-child(3) {
  transform: scaleY(var(--voice-bar-3, 0.56));
}

.avatar-scene.speaking .voice-rings span,
.avatar-scene.listening .voice-rings span {
  animation: none;
}

.call-share-button {
  margin: 0 12px 12px;
}

@media (max-width: 1060px) {
  .studio-publication-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 330px);
  }

  .studio-layout {
    grid-template-columns: 1fr;
  }

  .studio-story {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .studio-panel-switch {
    width: 100%;
  }

  .studio-panel-switch button {
    flex: 1 1 0;
    padding-inline: 9px;
  }

  .studio-publication-panel,
  .studio-capture,
  .studio-story {
    padding: 13px;
  }

  .studio-publication-workspace {
    grid-template-columns: 1fr;
  }

  .studio-publication-preview {
    position: static;
  }

  .studio-format-switch button {
    flex: 0 0 auto;
  }

  .studio-editor-grid {
    grid-template-columns: 1fr;
  }

  .studio-customization-grid {
    grid-template-columns: 1fr;
  }

  .studio-control-block:first-child {
    grid-column: auto;
  }

  .studio-theme-switch {
    grid-template-columns: 1fr 1fr;
  }

  .studio-capture-settings {
    grid-template-columns: 1fr;
  }

  .studio-video-stage {
    width: min(100%, 315px);
  }

  .studio-preview {
    width: 100%;
    min-height: 0;
  }

  .studio-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .studio-actions button,
  .call-buttons button,
  .call-share-button {
    width: 100%;
  }

  .video-note-progress-message,
  .video-note-result-message {
    width: 94%;
    max-width: 94%;
  }

  .video-note-progress-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .video-note-progress-estimate {
    max-width: 100%;
    text-align: left;
  }
}
