:root {
  --primary-color: #000000;
  --secondary-color: #C93C35;
  --third-color: #ffffff;
  --footer-background: #000000;
  --muted-color: rgba(0, 0, 0, 0.62);
  --line-color: #000000;
  --soft-line: rgba(0, 0, 0, 0.14);
  --status-info: #C93C35;
  --status-danger: #000000;
  --heading-font-family: "Cassannet Plus", "Cassannet", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --main-font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --body-font-size: 16px;
  --body-line-height: 1.55;
  --button-font-size: 16px;
  --button-padding-x: 28px;
  --desktop-content-width: 1040px;
  --wide-content-width: 1123px;
  --desktop-text-width: 960px;
  --header-padding: 30px 40px;
  --header-height: 110px;
  --hero-height: 520px;
  --mobile-breakpoint: 640px;
  --menu-breakpoint: 1024px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--third-color);
  color: var(--primary-color);
  font-family: var(--main-font-family);
  font-size: var(--body-font-size);
  line-height: var(--body-line-height);
}

h1,
h2,
h3,
.page-title,
.chat-title,
.brand-name,
.site-nav a,
.btn,
.btn-danger,
.primary-button,
.chat-tab,
.tool-card,
.action-card,
.feature h3 {
  font-family: var(--heading-font-family);
  letter-spacing: 0;
}

.ui-icon {
  width: 32px;
  height: 32px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

a {
  color: var(--secondary-color);
  font-weight: 700;
  text-decoration: underline;
}

a:hover,
a:focus {
  font-weight: 700;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: fixed;
  z-index: 90;
  top: 0;
  left: 0;
  width: 100%;
  min-height: var(--header-height);
  padding: var(--header-padding);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--secondary-color);
  color: var(--third-color);
  box-shadow: none;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--third-color);
  text-decoration: none;
  min-width: max-content;
}

.brand-link::before {
  content: "";
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  display: block;
  background: url("/assets/logo-mark.png") center / contain no-repeat;
}

.brand-link:hover,
.brand-link:focus {
  color: var(--third-color);
  opacity: 0.85;
}

.brand-logo {
  display: none;
}

.brand-name {
  display: block;
  max-width: 360px;
  color: var(--third-color);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.15;
  text-transform: uppercase;
}

.brand-name::after {
  content: "SPEAKSMART";
  display: block;
  margin-top: 3px;
  width: max-content;
  height: auto;
  background: none;
  color: var(--third-color);
  font-family: var(--main-font-family);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
  word-spacing: 0;
  opacity: 0.92;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  margin-left: auto;
}

.site-nav a {
  color: var(--third-color);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
  opacity: 0.7;
}

.site-nav a:hover,
.site-nav a:focus {
  opacity: 1;
}

.site-nav a.active {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 10px;
  text-decoration-thickness: 2px;
  opacity: 1;
}

.site-main {
  flex: 1;
  width: min(var(--wide-content-width), calc(100% - 80px));
  margin: 0 auto;
  padding: calc(var(--header-height) + 68px) 0 72px;
}

.entry-main {
  width: 100%;
  padding: 0;
}

.entry-hero {
  min-height: calc(var(--header-height) + var(--hero-height));
  padding: calc(var(--header-height) + 74px) 40px 76px;
  display: grid;
  align-items: center;
  background: var(--secondary-color);
  color: var(--third-color);
}

.entry-hero-inner {
  width: 100%;
  max-width: var(--desktop-content-width);
  margin: 0 auto;
  text-align: center;
}

.page-title {
  margin: 0;
  color: var(--primary-color);
  font-size: 60px;
  font-weight: 700;
  line-height: 1.08;
  text-align: center;
}

.page-title.left {
  text-align: left;
}

.entry-page .page-title {
  color: var(--third-color);
}

.red-rule {
  width: 82px;
  height: 4px;
  margin: 24px auto 28px;
  background: var(--secondary-color);
}

.entry-hero .red-rule {
  background: var(--third-color);
}

.red-rule.left {
  margin-left: 0;
}

.lead {
  max-width: 760px;
  margin: 0 auto;
  color: var(--primary-color);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.entry-page .lead {
  color: var(--third-color);
}

.entry-access {
  width: min(var(--wide-content-width), calc(100% - 80px));
  margin: 0 auto;
  padding: 70px 0 0;
}

.entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 640px);
  justify-content: center;
  gap: 34px;
}

.outline-card {
  min-height: 360px;
  border: 1px solid var(--line-color);
  border-radius: 0;
  background: var(--third-color);
  padding: 46px 36px 38px;
}

.outline-card h2,
.feature h3,
.chat-title,
.action-card,
.admin-section h2 {
  font-weight: 700;
}

.outline-card h2 {
  margin: 0 0 46px;
  text-align: center;
  font-size: 18px;
  line-height: 1.25;
  text-transform: uppercase;
}

.entry-form {
  display: grid;
  gap: 31px;
}

.code-input {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--line-color);
  border-radius: 0;
  background: var(--third-color);
  color: var(--primary-color);
  text-align: center;
  font-size: 20px;
  font-weight: 700;
}

.btn,
.btn-danger,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border: 1px solid var(--secondary-color);
  border-radius: 0;
  padding: 10px var(--button-padding-x) 11px;
  background: var(--secondary-color);
  color: var(--third-color);
  text-decoration: none;
  font-size: var(--button-font-size);
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.btn:hover,
.btn:focus,
.btn-danger:hover,
.btn-danger:focus,
.primary-button:hover,
.primary-button:focus {
  background: transparent;
  color: var(--secondary-color);
}

.btn.ghost {
  border-color: var(--primary-color);
  background: transparent;
  color: var(--secondary-color);
}

.btn.ghost:hover,
.btn.ghost:focus {
  border-color: var(--secondary-color);
  background: var(--secondary-color);
  color: var(--third-color);
}

.btn-danger {
  border-color: var(--primary-color);
  background: var(--primary-color);
}

.qr-demo {
  display: grid;
  place-items: center;
  gap: 30px;
}

.qr-illustration {
  width: 190px;
  height: 190px;
  display: grid;
  place-items: center;
}

.qr-illustration svg {
  width: 100%;
  height: 100%;
}

.camera-status {
  min-height: 20px;
  margin: -14px 0 0;
  color: var(--secondary-color);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.qr-video {
  width: min(100%, 320px);
  border: 1px solid var(--line-color);
}

.features {
  padding: 70px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--third-color);
  text-align: center;
}

.feature {
  min-height: 248px;
  padding: 0 30px;
  border-right: 1px solid var(--primary-color);
}

.feature:last-child {
  border-right: 0;
}

.feature-icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 25px;
  color: var(--secondary-color);
  display: grid;
  place-items: center;
}

.feature-icon .ui-icon {
  width: 70px;
  height: 70px;
  stroke-width: 1.7;
}

.feature h3 {
  margin: 0 0 22px;
  font-size: 18px;
  line-height: 1.25;
  text-transform: uppercase;
}

.feature p {
  max-width: 314px;
  margin: 0 auto;
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.site-footer {
  min-height: 120px;
  padding: 40px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  background: var(--footer-background);
  color: var(--third-color);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
}

.lang-switch {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
  line-height: 1;
  text-transform: uppercase;
}

.lang-switch a {
  color: var(--third-color);
  font-weight: 400;
  text-decoration: none;
  opacity: 0.7;
}

.lang-switch a.active {
  font-weight: 700;
  opacity: 1;
}

.error,
.admin-error {
  margin-bottom: 22px;
  border: 1px solid var(--secondary-color);
  background: var(--third-color);
  color: var(--secondary-color);
  padding: 14px 18px;
  font-weight: 700;
}

.chat-main-shell {
  width: min(var(--wide-content-width), calc(100% - 80px));
}

.chat-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.chat-sidebar {
  border: 1px solid var(--line-color);
  background: var(--third-color);
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-tabs {
  margin-top: 0;
  border-top: 0;
  padding: 24px;
  display: grid;
  gap: 16px;
}

.chat-tab {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--primary-color);
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  text-transform: uppercase;
}

.chat-tab span {
  display: grid;
  place-items: center;
  color: currentColor;
}

.chat-tab .ui-icon {
  width: 27px;
  height: 27px;
  stroke-width: 2.1;
}

.chat-tab.active {
  color: var(--secondary-color);
}

.chat-actions {
  border-top: 1px solid var(--soft-line);
  padding-top: 0;
}

.chat-tab-link {
  text-decoration: none;
}

.chat-tab-link:hover,
.chat-tab-link:focus {
  color: var(--secondary-color);
  outline: none;
}

.chat-pane {
  min-width: 0;
  padding: 16px 0 0;
}

.chat-panel[hidden] {
  display: none;
}

.chat-panel.active {
  display: block;
}

.chat-title {
  margin: 0;
  color: var(--primary-color);
  font-size: 54px;
  line-height: 1.08;
}

.chat-subtitle {
  max-width: 780px;
  margin: 0 0 36px;
  color: var(--primary-color);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.messages {
  display: grid;
  gap: 18px;
}

.starter-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 28px 0 4px 68px;
}

.starter-choice {
  min-height: 132px;
  border: 1px solid var(--primary-color);
  border-radius: 8px;
  background: var(--primary-color);
  color: var(--third-color);
  padding: 24px 26px;
  text-align: left;
  font-size: 22px;
  font-weight: 400;
  line-height: 1.45;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.starter-choice:hover,
.starter-choice:focus {
  border-color: var(--secondary-color);
  background: var(--secondary-color);
  color: var(--third-color);
  outline: none;
}

.starter-large-grid {
  display: grid;
  gap: 28px;
  margin: 56px 0 0;
}

.starter-large {
  min-height: 190px;
  border: 1px solid var(--line-color);
  border-radius: 0;
  background: var(--third-color);
  color: var(--primary-color);
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 30px;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
}

.starter-large:hover,
.starter-large:focus {
  border-color: var(--secondary-color);
  color: var(--secondary-color);
  outline: none;
}

.starter-large-icon {
  color: var(--secondary-color);
  font-size: 58px;
  line-height: 1;
}

.message-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--secondary-color);
  color: var(--third-color);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
}

.coach-avatar {
  overflow: hidden;
  background: var(--secondary-color) url("/assets/logo-mark.png") center / 38px 38px no-repeat;
}

.message-row.user .avatar,
.user-avatar {
  border-radius: 0;
  background: var(--primary-color);
}

.message-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.message-meta time {
  color: var(--muted-color);
  font-weight: 400;
  text-transform: none;
}

.bubble {
  border: 1px solid var(--line-color);
  background: var(--third-color);
  padding: 14px 18px;
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  white-space: pre-wrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.composer {
  margin-top: 28px;
  border: 1px solid var(--line-color);
  background: var(--third-color);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px;
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.composer textarea {
  width: 100%;
  min-height: 58px;
  border: 1px solid var(--line-color);
  border-radius: 0;
  resize: vertical;
  padding: 15px 18px;
  color: var(--primary-color);
  outline: none;
}

.composer textarea:focus {
  border-color: var(--secondary-color);
}

.send-icon-btn {
  width: 58px;
  height: 58px;
  min-height: 58px;
  border: 1px solid var(--secondary-color);
  border-radius: 50%;
  background: var(--secondary-color);
  color: var(--third-color);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 0;
  font-weight: 700;
  line-height: 1;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.send-icon-btn svg {
  width: 29px;
  height: 29px;
}

.send-icon-btn:hover,
.send-icon-btn:focus {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: var(--third-color);
  outline: none;
  transform: translateX(1px);
}

.send-icon-btn:disabled {
  cursor: wait;
  opacity: 0.55;
  transform: none;
}

.fineprint {
  margin: 28px 0 0;
  color: var(--muted-color);
  font-size: 14px;
  font-weight: 400;
}

.notes-input {
  width: 100%;
  min-height: 360px;
  border: 1px solid var(--line-color);
  border-radius: 0;
  background: var(--third-color);
  padding: 18px 20px;
  color: var(--primary-color);
  font-size: 16px;
  line-height: 1.7;
  resize: vertical;
  outline: none;
}

.notes-input:focus {
  border-color: var(--secondary-color);
}

.tool-grid,
.settings-actions {
  display: grid;
  gap: 22px;
}

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

.tool-card {
  min-height: 170px;
  border: 1px solid var(--line-color);
  border-radius: 0;
  background: var(--third-color);
  color: var(--secondary-color);
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: uppercase;
}

.tool-card span {
  display: grid;
  place-items: center;
  color: var(--secondary-color);
}

.tool-card .ui-icon {
  width: 52px;
  height: 52px;
  stroke-width: 1.8;
}

.tool-card:hover,
.tool-card:focus {
  border-color: var(--secondary-color);
  color: var(--primary-color);
  outline: none;
}

.settings-actions {
  max-width: 420px;
}

.settings-actions .btn {
  width: 100%;
}

.settings-actions .btn.active {
  border-color: var(--secondary-color);
  background: var(--secondary-color);
  color: var(--third-color);
}

.empty-state {
  border: 1px solid var(--line-color);
  background: var(--third-color);
  padding: 26px;
  color: var(--primary-color);
  font-weight: 400;
}

.quick-actions {
  margin: 48px 0 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.action-card {
  min-height: 150px;
  border: 1px solid var(--line-color);
  background: var(--third-color);
  color: var(--secondary-color);
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  font-size: 18px;
  line-height: 1.25;
  text-transform: uppercase;
}

.action-card span {
  display: block;
  margin-bottom: 10px;
  font-size: 38px;
  line-height: 1;
}

@media (max-width: 1024px) {
  :root {
    --header-height: 108px;
  }

  .site-header {
    min-height: var(--header-height);
    padding: 28px 40px;
  }

  .site-nav {
    gap: 14px;
  }

  .site-nav a {
    font-size: 14px;
  }

  .entry-grid,
  .features,
  .chat-layout,
  .tool-grid,
  .quick-actions {
    grid-template-columns: 1fr;
  }

  .features {
    padding-bottom: 40px;
  }

  .feature {
    min-height: 0;
    padding: 0 0 40px;
    border-right: 0;
    border-bottom: 1px solid var(--soft-line);
  }

  .feature + .feature {
    padding-top: 40px;
  }

  .feature:last-child {
    border-bottom: 0;
  }

  .chat-sidebar {
    min-height: 0;
  }

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

  .starter-choice-grid {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 88px;
  }

  body {
    font-size: 16px;
  }

  .site-header {
    min-height: var(--header-height);
    padding: 20px 20px 14px;
    gap: 14px;
  }

  .brand-logo {
    display: none;
  }

  .brand-name {
    display: block;
    max-width: 210px;
    font-size: 15px;
  }

  .brand-name::after {
    width: 128px;
    height: 20px;
    margin-top: 2px;
  }

  .brand-link::before {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .site-nav {
    display: none;
  }

  .site-main,
  .chat-main-shell,
  .entry-access {
    width: min(var(--wide-content-width), calc(100% - 40px));
  }

  .entry-hero {
    min-height: calc(var(--header-height) + 400px);
    padding: calc(var(--header-height) + 49px) 20px 51px;
  }

  .page-title {
    font-size: 42px;
    line-height: 1.25;
  }

  .chat-title {
    font-size: 36px;
    line-height: 1.25;
  }

  .lead,
  .chat-subtitle {
    font-size: 16px;
  }

  .outline-card {
    min-height: 0;
    padding: 28px 18px;
  }

  .features {
    padding-top: 40px;
  }

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

  .starter-choice-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 22px 0 0;
  }

  .starter-choice {
    min-height: 112px;
    padding: 20px;
    font-size: 18px;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 10px;
  }

  .site-footer {
    min-height: 0;
    padding: 28px 20px;
    align-items: flex-start;
    flex-direction: column;
  }

  .starter-large {
    min-height: 150px;
    font-size: 22px;
  }

  .send-icon-btn {
    width: 52px;
    height: 52px;
    min-height: 52px;
    justify-self: end;
  }

  .send-icon-btn svg {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 82px;
  }

  html,
  body {
    overflow-x: hidden;
  }

  .site-header {
    min-height: 82px;
    padding: 15px 16px;
  }

  .brand-link {
    min-width: 0;
    gap: 10px;
  }

  .brand-link::before {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .brand-name {
    max-width: 220px;
    font-size: 14px;
    line-height: 1.12;
  }

  .brand-name::after {
    width: auto;
    height: auto;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1.1;
    letter-spacing: 0;
    word-spacing: 0;
  }

  .site-nav {
    display: none;
  }

  .site-main,
  .chat-main-shell,
  .entry-access {
    width: calc(100% - 28px);
  }

  .site-main,
  .chat-main-shell {
    padding-top: calc(var(--header-height) + 32px);
    padding-bottom: 46px;
  }

  .entry-hero {
    min-height: auto;
    padding: calc(var(--header-height) + 48px) 18px 52px;
  }

  .entry-access {
    padding-top: 38px;
  }

  .page-title {
    font-size: 38px;
    line-height: 1.13;
  }

  .lead {
    max-width: 100%;
    font-size: 16px;
  }

  .red-rule {
    width: 62px;
    height: 3px;
    margin: 18px auto 22px;
  }

  .red-rule.left {
    margin-left: 0;
  }

  .outline-card {
    padding: 26px 18px;
  }

  .outline-card h2 {
    margin-bottom: 24px;
    font-size: 16px;
  }

  .entry-form {
    gap: 18px;
  }

  .code-input {
    min-height: 52px;
    font-size: 17px;
  }

  .features {
    padding: 38px 0 28px;
  }

  .feature {
    padding-bottom: 30px;
  }

  .feature + .feature {
    padding-top: 30px;
  }

  .feature-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 16px;
  }

  .feature-icon .ui-icon {
    width: 54px;
    height: 54px;
  }

  .chat-layout {
    gap: 24px;
  }

  .chat-sidebar {
    position: sticky;
    top: 82px;
    z-index: 20;
    margin: -4px -14px 8px;
    border-right: 0;
    border-left: 0;
    background: var(--third-color);
  }

  .chat-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .chat-tabs::-webkit-scrollbar {
    display: none;
  }

  .chat-actions {
    border-top: 1px solid var(--soft-line);
  }

  .chat-tab {
    width: max-content;
    min-width: max-content;
    min-height: 42px;
    grid-template-columns: 24px max-content;
    gap: 8px;
    padding: 0 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  .chat-tab .ui-icon {
    width: 22px;
    height: 22px;
  }

  .chat-pane {
    padding-top: 14px;
  }

  .chat-title {
    font-size: 34px;
    line-height: 1.14;
  }

  .chat-subtitle {
    margin-bottom: 24px;
    font-size: 16px;
  }

  .messages {
    gap: 16px;
  }

  .message-row {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
  }

  .avatar {
    width: 36px;
    height: 36px;
    font-size: 17px;
  }

  .coach-avatar {
    background-size: 32px 32px;
  }

  .message-meta {
    gap: 10px;
    margin-bottom: 6px;
    font-size: 13px;
  }

  .bubble {
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.48;
    overflow-wrap: anywhere;
  }

  .starter-choice-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0 0 50px;
  }

  .starter-choice {
    min-height: 96px;
    padding: 18px;
    font-size: 18px;
  }

  .composer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    grid-template-columns: minmax(0, 1fr) 50px;
    gap: 9px;
    margin-top: 22px;
    padding: 10px;
    background: var(--third-color);
  }

  .composer textarea {
    min-height: 50px;
    max-height: 160px;
    padding: 12px 13px;
    font-size: 15px;
  }

  .send-icon-btn {
    width: 50px;
    height: 50px;
    min-height: 50px;
  }

  .send-icon-btn svg {
    width: 25px;
    height: 25px;
  }

  .notes-input {
    min-height: 300px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .tool-card {
    min-height: 120px;
    padding: 20px;
    font-size: 16px;
  }

  .fineprint {
    margin-top: 18px;
    font-size: 13px;
  }

  .site-footer {
    padding: 24px 16px;
  }
}

@media (max-width: 430px) {
  :root {
    --header-height: 78px;
  }

  .site-header {
    min-height: var(--header-height);
    padding: 13px 14px;
  }

  .brand-link::before {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .brand-name {
    max-width: 178px;
    font-size: 12px;
  }

  .brand-name::after {
    font-size: 10px;
  }

  .page-title {
    font-size: 34px;
  }

  .chat-title {
    font-size: 30px;
  }

  .starter-choice-grid {
    margin-left: 0;
  }

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

  .avatar {
    width: 32px;
    height: 32px;
    font-size: 15px;
  }

  .coach-avatar {
    background-size: 29px 29px;
  }

  .message-meta {
    flex-wrap: wrap;
    gap: 4px 8px;
    font-size: 12px;
  }

  .bubble {
    padding: 11px 12px;
    font-size: 14px;
  }

  .chat-sidebar {
    top: var(--header-height);
  }
}

@media (max-width: 760px) {
  :root {
    --header-height: 76px;
  }

  .site-header {
    position: sticky;
    min-height: var(--header-height);
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.24);
  }

  .brand-link::before {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

  .brand-name {
    max-width: 230px;
    font-size: 13px;
  }

  .brand-name::after {
    font-size: 10px;
    opacity: 0.95;
  }

  .site-main,
  .chat-main-shell {
    width: calc(100% - 24px);
    padding-top: 24px;
    padding-bottom: 34px;
  }

  .entry-main {
    width: 100%;
    padding: 0;
  }

  .entry-hero {
    min-height: auto;
    padding: 48px 16px 46px;
  }

  .entry-hero-inner {
    text-align: left;
  }

  .entry-page .page-title,
  .entry-page .lead {
    text-align: left;
  }

  .entry-hero .red-rule {
    margin-left: 0;
  }

  .entry-access {
    width: calc(100% - 24px);
    padding-top: 24px;
  }

  .page-title {
    font-size: 34px;
    line-height: 1.12;
  }

  .outline-card {
    border-color: var(--soft-line);
    padding: 22px 16px;
  }

  .outline-card h2 {
    margin-bottom: 18px;
    text-align: left;
  }

  .code-input {
    text-align: left;
    padding-left: 16px;
    padding-right: 16px;
  }

  .entry-form .btn {
    width: 100%;
  }

  .features {
    gap: 0;
    padding-top: 30px;
  }

  .feature {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    column-gap: 14px;
    text-align: left;
  }

  .feature-icon {
    grid-row: span 2;
    margin: 0;
  }

  .feature h3,
  .feature p {
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  .feature h3 {
    margin-bottom: 8px;
    font-size: 15px;
  }

  .chat-layout {
    display: flex;
    flex-direction: column;
    gap: 18px;
  }

  .chat-sidebar {
    position: static;
    margin: 0;
    border: 1px solid var(--soft-line);
  }

  .chat-tabs {
    padding: 8px;
  }

  .chat-actions {
    border-top: 1px solid var(--soft-line);
    padding-top: 8px;
  }

  .chat-tab {
    min-height: 38px;
    padding: 0 9px;
    font-size: 12px;
  }

  .chat-tab.active {
    background: var(--secondary-color);
    color: var(--third-color);
  }

  .chat-tab-link {
    border: 1px solid var(--soft-line);
  }

  .chat-pane {
    padding-top: 0;
  }

  .chat-title {
    font-size: 31px;
    line-height: 1.12;
  }

  .chat-subtitle {
    margin-bottom: 22px;
    font-size: 15px;
    line-height: 1.48;
  }

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

  .avatar {
    width: 32px;
    height: 32px;
  }

  .coach-avatar {
    background-size: 29px 29px;
  }

  .bubble {
    border-color: var(--soft-line);
  }

  .starter-choice-grid {
    margin: 18px 0 0 43px;
  }

  .starter-choice {
    min-height: 86px;
    border-color: var(--primary-color);
    padding: 16px;
    font-size: 16px;
  }

  .composer {
    border-color: var(--soft-line);
    box-shadow: 0 -10px 24px rgba(255, 255, 255, 0.88);
  }

  .composer textarea {
    border-color: var(--soft-line);
  }
}

@media (max-width: 430px) {
  :root {
    --header-height: 72px;
  }

  .site-header {
    padding: 12px;
  }

  .brand-link {
    gap: 8px;
  }

  .brand-link::before {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .brand-name {
    max-width: 170px;
    font-size: 11px;
  }

  .brand-name::after {
    font-size: 9px;
  }

  .entry-hero {
    padding-top: 38px;
    padding-bottom: 38px;
  }

  .page-title {
    font-size: 30px;
  }

  .chat-title {
    font-size: 28px;
  }

  .chat-subtitle,
  .lead {
    font-size: 14px;
  }

  .chat-tab {
    min-height: 36px;
    font-size: 11px;
  }

  .chat-tab .ui-icon {
    width: 19px;
    height: 19px;
  }

  .starter-choice-grid {
    margin-left: 0;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 46px;
  }

  .send-icon-btn {
    width: 46px;
    height: 46px;
    min-height: 46px;
  }
}

/* Final responsive guard: keep every public view inside the viewport. */
html,
body,
.site-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

@supports not (overflow-x: clip) {
  html,
  body,
  .site-shell {
    overflow-x: hidden;
  }
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

.site-header,
.site-main,
.entry-main,
.entry-hero,
.entry-grid,
.entry-form,
.entry-access,
.features,
.feature,
.chat-main-shell,
.chat-layout,
.chat-pane,
.chat-panel,
.messages,
.composer,
.bubble,
.brand-name,
.notes-input,
.tool-card,
.starter-choice {
  max-width: 100%;
}

.chat-pane,
.chat-panel,
.message-row > div,
.bubble,
.composer textarea,
.notes-input,
.brand-name,
.tool-card,
.starter-choice,
.code-input {
  min-width: 0;
}

.bubble,
.notes-input,
.composer textarea,
.brand-name,
.tool-card,
.starter-choice,
.code-input {
  overflow-wrap: anywhere;
}

button,
form,
input,
textarea {
  max-width: 100%;
}

@media (min-width: 1025px) {
  .chat-layout {
    grid-template-columns: minmax(220px, 250px) minmax(0, 1fr);
  }
}

@media (max-width: 1024px) {
  .site-main,
  .chat-main-shell,
  .entry-access {
    width: min(100% - 48px, var(--wide-content-width));
  }

  .chat-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .chat-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  :root {
    --header-height: 70px;
  }

  body {
    min-width: 0;
    font-size: 15px;
  }

  .site-header {
    position: sticky;
    top: 0;
    min-height: var(--header-height);
    padding: 12px 14px;
    gap: 10px;
  }

  .brand-link {
    min-width: 0;
    max-width: 100%;
    gap: 9px;
  }

  .brand-link::before {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  .brand-name {
    max-width: calc(100vw - 84px);
    font-size: 13px;
    line-height: 1.12;
  }

  .brand-name::after {
    margin-top: 2px;
    max-width: 100%;
    font-size: 10px;
  }

  .site-nav {
    display: none;
  }

  .site-main,
  .chat-main-shell,
  .entry-access {
    width: calc(100% - 24px);
    padding-right: 0;
    padding-left: 0;
  }

  .site-main,
  .chat-main-shell {
    padding-top: 22px;
    padding-bottom: 30px;
  }

  .entry-main {
    width: 100%;
    padding: 0;
  }

  .entry-hero {
    min-height: auto;
    padding: 40px 14px 38px;
    align-items: start;
  }

  .entry-hero-inner,
  .entry-page .page-title,
  .entry-page .lead {
    text-align: left;
  }

  .entry-hero .red-rule,
  .red-rule.left {
    margin-left: 0;
  }

  .entry-access {
    padding-top: 20px;
  }

  .page-title,
  .chat-title {
    font-size: 32px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .lead,
  .chat-subtitle {
    font-size: 15px;
    line-height: 1.48;
  }

  .red-rule {
    width: 54px;
    height: 3px;
    margin: 16px 0 20px;
  }

  .outline-card {
    min-height: 0;
    border-color: var(--soft-line);
    padding: 20px 14px;
  }

  .outline-card h2 {
    margin-bottom: 16px;
    text-align: left;
    font-size: 15px;
  }

  .entry-form {
    gap: 14px;
  }

  .code-input {
    min-height: 50px;
    padding: 12px 14px;
    text-align: left;
    font-size: 16px;
  }

  .entry-form .btn {
    width: 100%;
  }

  .features {
    padding: 28px 0 18px;
  }

  .feature {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    column-gap: 13px;
    min-height: 0;
    padding: 0 0 24px;
    text-align: left;
  }

  .feature + .feature {
    padding-top: 24px;
  }

  .feature-icon {
    grid-row: span 2;
    width: 44px;
    height: 44px;
    margin: 0;
  }

  .feature-icon .ui-icon {
    width: 42px;
    height: 42px;
  }

  .feature h3 {
    margin: 0 0 7px;
    font-size: 14px;
  }

  .feature p {
    max-width: none;
    margin: 0;
    font-size: 14px;
  }

  .chat-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .chat-sidebar {
    position: static;
    width: 100%;
    margin: 0;
    border: 1px solid var(--soft-line);
    background: var(--third-color);
  }

  .chat-tabs,
  .chat-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    overflow: visible;
  }

  .chat-actions {
    border-top: 1px solid var(--soft-line);
    padding-top: 8px;
  }

  .chat-tab {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 7px;
    padding: 7px 8px;
    border: 1px solid transparent;
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
  }

  .chat-tab.active {
    border-color: var(--secondary-color);
    background: var(--secondary-color);
    color: var(--third-color);
  }

  .chat-tab-link {
    border-color: var(--soft-line);
  }

  .chat-tab .ui-icon {
    width: 20px;
    height: 20px;
  }

  .chat-pane {
    padding-top: 0;
  }

  .chat-subtitle {
    margin-bottom: 20px;
  }

  .messages {
    gap: 14px;
  }

  .message-row {
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 8px;
  }

  .avatar {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .coach-avatar {
    background-size: 27px 27px;
  }

  .message-meta {
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-bottom: 5px;
    font-size: 12px;
  }

  .bubble {
    border-color: var(--soft-line);
    padding: 10px 11px;
    font-size: 14px;
    line-height: 1.48;
  }

  .starter-choice-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin: 16px 0 0;
  }

  .starter-choice {
    min-height: 74px;
    border-radius: 6px;
    padding: 14px;
    font-size: 16px;
    line-height: 1.35;
  }

  .composer {
    position: sticky;
    bottom: 0;
    z-index: 30;
    grid-template-columns: minmax(0, 1fr) 46px;
    gap: 8px;
    margin: 18px -1px 0;
    border-color: var(--soft-line);
    padding: 8px;
    box-shadow: 0 -12px 24px rgba(255, 255, 255, 0.92);
  }

  .composer textarea {
    min-height: 46px;
    max-height: 130px;
    padding: 11px 12px;
    resize: none;
    font-size: 14px;
  }

  .send-icon-btn {
    width: 46px;
    height: 46px;
    min-height: 46px;
  }

  .send-icon-btn svg {
    width: 23px;
    height: 23px;
  }

  .notes-input {
    min-height: 260px;
    padding: 13px;
    font-size: 14px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .tool-card {
    min-height: 96px;
    padding: 15px;
    font-size: 14px;
  }

  .tool-card .ui-icon {
    width: 38px;
    height: 38px;
  }

  .settings-actions {
    max-width: none;
  }

  .fineprint {
    margin-top: 14px;
    font-size: 12px;
  }

  .site-footer {
    min-height: 0;
    padding: 22px 14px;
    flex-direction: column;
  }
}

@media (max-width: 360px) {
  .brand-name {
    max-width: calc(100vw - 74px);
    font-size: 10px;
  }

  .brand-name::after {
    font-size: 8px;
  }

  .page-title,
  .chat-title {
    font-size: 26px;
  }

  .chat-tab {
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 5px;
    padding: 7px 6px;
    font-size: 10px;
  }

  .chat-tab .ui-icon {
    width: 17px;
    height: 17px;
  }

  .composer {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .send-icon-btn {
    width: 42px;
    height: 42px;
    min-height: 42px;
  }
}

/* SpeakSmart CVI refinement: calmer proportions with official brand assets. */
@media (min-width: 761px) {
  :root {
    --header-height: 82px;
    --header-padding: 12px 28px;
    --hero-height: 310px;
  }

  .brand-link {
    gap: 11px;
  }

  .brand-link::before {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .brand-name {
    font-size: 15px;
  }

  .brand-name::after {
    margin-top: 2px;
    font-size: 11px;
  }

  .site-nav a {
    font-size: 14px;
  }

  .entry-hero {
    min-height: calc(var(--header-height) + var(--hero-height));
    padding: calc(var(--header-height) + 38px) 32px 50px;
  }

  .chat-main-shell {
    padding-top: calc(var(--header-height) + 44px);
  }
}

.site-nav .contact-link {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  padding: 8px 14px;
  background: transparent;
  color: var(--third-color);
  text-decoration: none;
  opacity: 1;
  white-space: nowrap;
}

.site-nav .contact-link .ui-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  stroke-width: 2;
}

.site-nav .contact-link:hover,
.site-nav .contact-link:focus {
  background: var(--third-color);
  color: var(--secondary-color);
  text-decoration: none;
}

.feature-icon img {
  display: block;
  width: 112px;
  height: 74px;
  object-fit: contain;
}

.feature-icon.official-icon {
  width: 112px;
}

@media (max-width: 760px) {
  :root {
    --header-height: 62px;
  }

  .site-header {
    min-height: var(--header-height);
    padding: 8px 12px;
  }

  .brand-link {
    gap: 8px;
  }

  .brand-link::before {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .brand-name {
    max-width: none;
    font-size: 8px;
    overflow-wrap: normal;
    white-space: nowrap;
  }

  .brand-name::after {
    margin-top: 1px;
    font-size: 8px;
  }

  .site-nav {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
  }

  .site-nav a.active {
    display: none;
  }

  .site-nav .contact-link {
    min-height: 36px;
    gap: 6px;
    padding: 7px 9px;
    font-size: 9px;
  }

  .site-nav .contact-link .ui-icon {
    width: 15px;
    height: 15px;
    flex-basis: 15px;
  }

  .entry-hero {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .feature-icon img {
    width: 66px;
    height: 44px;
  }

  .feature {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .feature-icon.official-icon {
    width: 58px;
  }
}

/* Contact page */
.contact-main {
  width: min(var(--desktop-content-width), calc(100% - 80px));
  margin: 0 auto;
  padding: calc(var(--header-height) + 64px) 0 80px;
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 72px;
  align-items: start;
}

.contact-kicker {
  margin: 0 0 14px;
  color: var(--secondary-color);
  font-family: var(--heading-font-family);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.contact-lead {
  max-width: 430px;
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
}

.contact-direct {
  margin-top: 38px;
  border-top: 1px solid var(--soft-line);
  padding-top: 22px;
  display: grid;
  justify-items: start;
  gap: 8px;
}

.contact-direct > span:first-child {
  color: var(--muted-color);
  font-size: 14px;
}

.contact-direct a {
  color: var(--primary-color);
  font-size: 20px;
  overflow-wrap: anywhere;
}

.copy-email-button {
  margin-top: 8px;
  border: 0;
  border-bottom: 1px solid var(--secondary-color);
  padding: 4px 0;
  background: transparent;
  color: var(--secondary-color);
  font-family: var(--heading-font-family);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.copy-email-status {
  min-height: 20px;
  color: var(--muted-color);
  font-size: 13px;
}

.contact-form-panel {
  border: 1px solid var(--line-color);
  padding: 30px;
  background: var(--third-color);
}

.contact-form {
  display: grid;
  gap: 22px;
}

.contact-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--primary-color);
  font-family: var(--heading-font-family);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-color);
  border-radius: 0;
  padding: 12px 13px;
  background: var(--third-color);
  color: var(--primary-color);
  font-family: var(--main-font-family);
  font-size: 16px;
  font-weight: 400;
  text-transform: none;
}

.contact-form input,
.contact-form select {
  min-height: 48px;
}

.contact-form textarea {
  min-height: 190px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--secondary-color);
  outline: 2px solid rgba(201, 60, 53, 0.15);
  outline-offset: 1px;
}

.contact-submit {
  justify-self: start;
}

.contact-success {
  margin-bottom: 22px;
  border: 1px solid var(--secondary-color);
  padding: 14px 18px;
  color: var(--primary-color);
  font-weight: 700;
}

.contact-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 760px) {
  .contact-page .contact-home-link {
    display: none;
  }

  .contact-main {
    width: calc(100% - 24px);
    padding: 30px 0 42px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .contact-main .page-title {
    font-size: 32px;
  }

  .contact-lead {
    font-size: 15px;
  }

  .contact-direct {
    margin-top: 24px;
    padding-top: 18px;
  }

  .contact-direct a {
    font-size: 18px;
  }

  .contact-form-panel {
    padding: 20px 14px;
  }

  .contact-field-row {
    grid-template-columns: 1fr;
  }

  .contact-form textarea {
    min-height: 160px;
  }

  .contact-submit {
    width: 100%;
  }
}

/* Keep the chat tools available while the conversation itself scrolls. */
@media (min-width: 761px) {
  .chat-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 20px);
    z-index: 40;
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
    background: var(--third-color);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  }
}

@media (max-width: 760px) {
  .chat-sidebar {
    position: sticky;
    top: var(--header-height);
    z-index: 70;
    align-self: start;
    max-height: calc(100vh - var(--header-height) - 12px);
    overflow-y: auto;
    scrollbar-width: thin;
    background: var(--third-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  }

  .chat-sidebar .chat-tabs,
  .chat-sidebar .chat-actions {
    flex-shrink: 0;
  }
}
