:root {
  color-scheme: light;
  --page-bg: #f4f7fb;
  --shell-bg: rgba(255, 255, 255, 0.76);
  --shell-border: rgba(31, 49, 86, 0.12);
  --panel-bg: rgba(255, 255, 255, 0.68);
  --panel-border: rgba(31, 49, 86, 0.14);
  --text: #1f2740;
  --muted: #5f6780;
  --heading: #11203d;
  --teal: #2aaeb0;
  --cyan: #2ec5e9;
  --blue: #2746df;
  --violet: #8d34ff;
  --magenta: #f12bb2;
  --coral: #ff5b55;
  --gold: #f4bb45;
  --shadow: 0 24px 60px rgba(23, 37, 84, 0.16);
  --user-bg: linear-gradient(135deg, rgba(42, 174, 176, 0.16), rgba(46, 197, 233, 0.24));
  --assistant-bg: rgba(255, 255, 255, 0.88);
  --system-bg: rgba(255, 91, 85, 0.08);
  --button-text: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  padding: 14px;
  font-family: Inter, Arial, Helvetica, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(46, 197, 233, 0.32), transparent 28%),
    radial-gradient(circle at top right, rgba(241, 43, 178, 0.18), transparent 28%),
    radial-gradient(circle at bottom right, rgba(244, 187, 69, 0.22), transparent 30%),
    linear-gradient(145deg, #edf6fb 0%, #f4f6fd 48%, #fff2f7 100%);
}

.app-shell {
  width: min(1240px, 100%);
  height: calc(100dvh - 28px);
  margin: 0 auto;
  background: var(--shell-bg);
  border: 1px solid var(--shell-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.hero-panel {
  position: relative;
  padding: 24px 28px 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06)),
    linear-gradient(115deg, #2db6d7 0%, #2746df 34%, #ef2ea9 68%, #ff8c4c 100%);
  color: #ffffff;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -80px -110px auto;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  filter: blur(6px);
}

.hero-brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.hero-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  padding: 3px;
}

.hero-brand-copy {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero-main {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 136px 1fr;
  align-items: center;
  gap: 22px;
}

.hero-avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 40px rgba(16, 24, 40, 0.24);
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.95;
}

.hero-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(2.1rem, 3vw, 3.35rem);
  line-height: 1.04;
}

.hero-copy p:last-child {
  margin: 0;
  max-width: 760px;
  line-height: 1.65;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.95);
}

.content-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  overflow: hidden;
}

.panel {
  background: transparent;
}

.sidebar {
  min-width: 0;
  min-height: 0;
  padding: 22px;
  border-right: 1px solid var(--panel-border);
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08));
}

.sidebar-card {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 10px 28px rgba(31, 39, 64, 0.07);
}

.status-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.status-pill {
  padding: 8px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--magenta), var(--coral));
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 10px 20px rgba(241, 43, 178, 0.22);
}

.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--heading);
  font-weight: 700;
}

.toggle-row input {
  accent-color: var(--teal);
}

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

.voice-picker-row label,
.value-card h2 {
  color: var(--heading);
}

.voice-picker-row label {
  font-size: 0.92rem;
  font-weight: 700;
}

.voice-picker-row select,
textarea {
  width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(39, 70, 223, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 14px 15px;
  font: inherit;
}

.voice-picker-row select {
  appearance: none;
  font-weight: 600;
}

.value-card h2 {
  margin: 0 0 8px;
  font-size: 1rem;
}

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

.brand-mark {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(45, 182, 215, 0.12), rgba(241, 43, 178, 0.1), rgba(244, 187, 69, 0.14));
  border: 1px solid rgba(39, 70, 223, 0.1);
}

.brand-mark img {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: block;
  background: rgba(255, 255, 255, 0.92);
  padding: 2px;
}

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

.brand-mark strong {
  color: var(--heading);
  margin-bottom: 4px;
}

.brand-mark span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.chat-panel {
  min-width: 0;
  min-height: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 2px 6px;
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
}

.message {
  max-width: min(86%, 760px);
  border-radius: 22px;
  padding: 18px 18px;
  line-height: 1.65;
  white-space: pre-wrap;
  border: 1px solid var(--panel-border);
  font-size: 1rem;
  box-shadow: 0 12px 26px rgba(31, 39, 64, 0.06);
}

.message.user {
  background: var(--user-bg);
  align-self: flex-end;
  border-color: rgba(42, 174, 176, 0.12);
}

.message.assistant {
  background: var(--assistant-bg);
  align-self: flex-start;
}

.message.system {
  background: var(--system-bg);
  align-self: flex-start;
}

.chat-form {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 16px;
  box-shadow: 0 12px 26px rgba(31, 39, 64, 0.07);
}

textarea {
  resize: vertical;
  min-height: 82px;
  max-height: 32dvh;
}

textarea::placeholder {
  color: #7d869e;
}

textarea:focus,
select:focus,
button:focus,
input:focus {
  outline: 3px solid rgba(46, 197, 233, 0.22);
  outline-offset: 2px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

button {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--blue), var(--magenta));
  color: var(--button-text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(39, 70, 223, 0.22);
}

button.secondary {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 251, 0.96));
  color: var(--heading);
  border: 1px solid rgba(39, 70, 223, 0.1);
  box-shadow: none;
}

.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;
}


.hidden {
  display: none !important;
  pointer-events: none !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 32, 61, 0.42);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 1000;
}

.modal-card {
  width: min(100%, 460px);
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--panel-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(31, 39, 64, 0.22);
}

.modal-card h2 {
  margin: 0 0 12px;
  color: var(--heading);
}

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

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

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

  .sidebar {
    display: none;
  }
}

@media (max-width: 980px) {
  body {
    padding: 8px;
  }

  .app-shell {
    height: calc(100dvh - 16px);
    border-radius: 22px;
  }

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

  .chat-panel {
    padding: 16px;
  }
}

@media (max-height: 820px) and (min-width: 981px) {
  body {
    padding: 8px;
  }

  .app-shell {
    height: calc(100dvh - 16px);
  }

  .hero-panel,
  .sidebar,
  .chat-panel {
    padding: 16px;
  }

  .hero-main {
    grid-template-columns: 104px 1fr;
    gap: 16px;
  }

  .hero-avatar {
    width: 100px;
    height: 100px;
  }

  .chat-form {
    padding: 12px;
  }

  textarea {
    min-height: 64px;
  }
}

@media (max-width: 700px) {
  .hero-panel {
    padding: 18px 18px 20px;
  }

  .hero-main {
    grid-template-columns: 88px 1fr;
    gap: 14px;
    align-items: center;
  }

  .hero-avatar {
    width: 84px;
    height: 84px;
    border-width: 4px;
  }

  .eyebrow {
    margin-bottom: 6px;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
  }

  .hero-copy h1 {
    margin-bottom: 8px;
    font-size: clamp(1.6rem, 6vw, 2.2rem);
    line-height: 1.05;
  }

  .hero-copy p:last-child {
    font-size: 0.96rem;
    line-height: 1.45;
  }

  .message {
    max-width: 100%;
  }

  .button-row,
  .modal-actions {
    flex-direction: column;
  }

  .button-row > *,
  .modal-actions > * {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .hero-panel {
    padding: 14px 14px 16px;
  }

  .hero-main {
    grid-template-columns: 66px 1fr;
    gap: 10px;
  }

  .hero-avatar {
    width: 62px;
    height: 62px;
    border-width: 3px;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 0.68rem;
    letter-spacing: 0.08em;
  }

  .hero-copy h1 {
    margin-bottom: 6px;
    font-size: clamp(1.2rem, 5.8vw, 1.7rem);
  }

  .hero-copy p:last-child {
    font-size: 0.84rem;
    line-height: 1.35;
  }

  .chat-panel {
    padding: 12px;
  }

  .chat-form {
    padding: 12px;
    border-radius: 18px;
  }

  textarea {
    min-height: 64px;
  }
}

@media (max-width: 380px) {
  .hero-panel {
    padding: 10px 10px 12px;
  }

  .hero-main {
    grid-template-columns: 52px 1fr;
    gap: 8px;
  }

  .hero-avatar {
    width: 48px;
    height: 48px;
    border-width: 2px;
  }

  .eyebrow {
    font-size: 0.58rem;
    margin-bottom: 2px;
  }

  .hero-copy h1 {
    margin-bottom: 3px;
    font-size: clamp(1rem, 5vw, 1.3rem);
  }

  .hero-copy p:last-child {
    font-size: 0.74rem;
    line-height: 1.25;
  }
}



/* --- 2026-04-01 follow-up fix: prioritize chat/input and hard-hide sidebar on constrained screens --- */
.hero-panel {
  flex: 0 0 auto;
}

.hero-copy {
  min-width: 0;
}

.hero-copy h1,
.hero-copy p,
.eyebrow {
  overflow-wrap: anywhere;
}

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

  .content-shell > .sidebar {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
  }

  .content-shell > .chat-panel {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 820px) {
  body {
    padding: 0;
  }

  .app-shell {
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .hero-panel {
    padding: 14px 14px 12px;
  }

  .hero-main {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: end;
  }

  .hero-avatar {
    width: 68px;
    height: 68px;
    border-width: 3px;
  }

  .eyebrow {
    margin: 0 0 4px;
    font-size: 0.66rem;
    line-height: 1.15;
    letter-spacing: 0.08em;
  }

  .hero-copy h1 {
    margin: 0 0 4px;
    font-size: clamp(1.2rem, 5.2vw, 1.85rem);
    line-height: 1.02;
  }

  .hero-copy p:last-child {
    font-size: 0.84rem;
    line-height: 1.3;
    max-width: none;
  }

  .chat-panel {
    padding: 10px;
    gap: 10px;
  }

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

  .chat-form {
    padding: 12px;
    border-radius: 18px;
  }

  textarea {
    min-height: 60px;
    max-height: 24dvh;
  }
}

@media (max-width: 560px) {
  .hero-panel {
    padding: 10px 10px 9px;
  }

  .hero-main {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 8px;
  }

  .hero-avatar {
    width: 52px;
    height: 52px;
    border-width: 2px;
  }

  .eyebrow {
    font-size: 0.56rem;
    margin-bottom: 2px;
    letter-spacing: 0.07em;
  }

  .hero-copy h1 {
    font-size: clamp(1rem, 5vw, 1.45rem);
    margin-bottom: 2px;
  }

  .hero-copy p:last-child {
    font-size: 0.72rem;
    line-height: 1.2;
  }

  .chat-panel {
    padding: 8px;
  }

  .chat-form {
    padding: 10px;
    border-radius: 16px;
  }

  .button-row {
    gap: 8px;
    margin-top: 10px;
  }

  button {
    padding: 11px 14px;
  }
}

@media (max-width: 360px), (max-height: 760px) and (max-width: 900px) {
  .hero-panel {
    padding: 8px 8px 7px;
  }

  .hero-main {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 7px;
  }

  .hero-avatar {
    width: 40px;
    height: 40px;
    border-width: 2px;
  }

  .eyebrow {
    font-size: 0.5rem;
    line-height: 1.1;
    margin-bottom: 1px;
  }

  .hero-copy h1 {
    font-size: clamp(0.92rem, 4.8vw, 1.2rem);
    line-height: 1;
    margin-bottom: 1px;
  }

  .hero-copy p:last-child {
    font-size: 0.64rem;
    line-height: 1.12;
  }

  .chat-panel {
    padding: 6px;
  }

  .chat-form {
    padding: 8px;
    border-radius: 14px;
  }

  textarea {
    min-height: 52px;
  }
}
