:root {
  --app-height: 100dvh;
  --keyboard-offset: 0px;
  --bg: #f4f6f9;
  --bg-soft: #edf2f7;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: #ffffff;
  --line: rgba(15, 23, 42, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --accent: #14b8d4;
  --accent-strong: #0891b2;
  --accent-soft: rgba(20, 184, 212, 0.1);
  --warn: #b45309;
  --error: #b91c1c;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  background:
    radial-gradient(circle at top left, rgba(20, 184, 212, 0.08), transparent 18%),
    linear-gradient(180deg, #f9fbfd 0%, var(--bg) 100%);
}

body.app-active {
  overflow: hidden;
  overscroll-behavior: none;
}

.hidden {
  display: none !important;
}

body.sheet-open {
  overflow: hidden;
}

button,
input,
textarea {
  font: inherit;
}

.auth-screen {
  min-height: var(--app-height);
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 460px);
  padding: 30px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.12);
}

.auth-logo {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin: 10px 0 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: clamp(28px, 4vw, 36px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.auth-copy {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.auth-copy code {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.google-signin {
  margin-top: 24px;
}

.google-signin > div {
  margin: 0 auto;
}

.auth-message,
.auth-pending {
  margin-top: 16px;
  border-radius: 18px;
  padding: 14px 16px;
}

.auth-message {
  background: rgba(20, 184, 212, 0.1);
  border: 1px solid rgba(20, 184, 212, 0.16);
}

.auth-message.warn {
  color: var(--warn);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(180, 83, 9, 0.14);
}

.auth-message.error {
  color: var(--error);
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(185, 28, 28, 0.14);
}

.auth-pending {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
}

.auth-pending strong,
.auth-pending p {
  display: block;
}

.auth-pending p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.sidebar {
  background: rgba(246, 249, 252, 0.92);
  border-right: 1px solid var(--line);
  padding: 22px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
  overflow: auto;
}

.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.sidebar-head h1,
.hero h2,
.conversation-meta h3 {
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.sidebar-head h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.plan-trigger {
  display: inline-grid;
  gap: 2px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  text-align: left;
}

.plan-trigger strong {
  font-size: 13px;
}

.plan-trigger span {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow,
.section-label,
.model-trigger-note,
.chat-item span,
.message-meta,
.sheet-head p {
  color: var(--muted);
}

.eyebrow,
.section-label {
  margin: 0 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 11px;
}

.new-chat-button,
.ghost-button,
.icon-button,
.model-trigger,
.suggestion-chip,
.file-button,
.send-button,
.chat-item,
.model-option {
  border: 0;
  cursor: pointer;
}

.new-chat-button,
.ghost-button,
.icon-button,
.model-trigger,
.suggestion-chip,
.file-button {
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.new-chat-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  font-weight: 700;
}

.sidebar-section.grow {
  flex: 1;
  min-height: 0;
}

.chat-list {
  display: grid;
  gap: 6px;
  overflow: auto;
  margin-top: 12px;
}

.chat-item {
  width: 100%;
  display: grid;
  gap: 4px;
  text-align: left;
  padding: 12px;
  border-radius: 14px;
  background: transparent;
}

.chat-item strong {
  font-size: 14px;
  line-height: 1.4;
}

.chat-item span {
  font-size: 12px;
}

.chat-item.active {
  background: rgba(255, 255, 255, 0.88);
}

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: start;
  padding: 18px 28px 14px;
  background: rgba(244, 246, 249, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.header-slot {
  display: flex;
  align-items: flex-start;
}

.header-left {
  justify-content: flex-start;
}

.header-center {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.header-right {
  justify-content: flex-end;
}

.header-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  padding: 8px 12px 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 700;
}

.user-avatar {
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: 999px;
}

.user-pill span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ghost-button.subtle {
  background: rgba(255, 255, 255, 0.72);
}

.icon-button,
.ghost-button,
.file-button,
.send-button,
.model-trigger {
  border-radius: 999px;
}

.chat-control-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.icon-button,
.ghost-button,
.file-button {
  padding: 11px 14px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}

#open-sidebar {
  display: none;
}

.model-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 232px;
  padding: 10px 14px 10px 12px;
  box-shadow: var(--shadow);
}

.model-trigger img {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
}

.model-trigger.locked {
  cursor: default;
}

.model-trigger-note {
  margin: 8px 0 0;
  font-size: 12px;
}

.chat-mode-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.chat-mode-switch button {
  padding: 10px 14px;
  border-radius: 999px;
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}

.chat-mode-switch button.active {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
}

.chat-mode-switch.locked button {
  cursor: default;
}

.chat-mode-switch.locked button:not(.active) {
  opacity: 0.55;
}

.chat-mode-note,
.hero-subtitle {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.chat-mode-note {
  max-width: 620px;
  font-size: 12px;
}

.hero-subtitle {
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.workspace-body {
  flex: 1;
  overflow: auto;
  min-height: 0;
  padding: 28px 28px 8px;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: 160px;
  touch-action: pan-y;
}

.hero,
.conversation-meta,
.notice,
.message-bubble,
.composer-box,
.model-sheet-card,
.settings-card {
  box-shadow: var(--shadow);
}

.hero {
  width: min(100%, 900px);
  margin: 40px auto 0;
  text-align: center;
}

.hero-logo {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.hero h2 {
  margin: 18px 0 0;
  font-size: clamp(38px, 6vw, 62px);
  line-height: 1.04;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.hero-suggestions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.suggestion-chip {
  padding: 12px 16px;
  border-radius: 999px;
}

.conversation-meta {
  width: min(100%, 900px);
  margin: 0 auto 18px;
  padding: 18px 20px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
}

.conversation-meta h3 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.notice {
  width: min(100%, 900px);
  margin: 0 auto 18px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--accent-soft);
  border: 1px solid transparent;
}

.notice.warn {
  color: var(--warn);
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(180, 83, 9, 0.14);
}

.notice.error {
  color: var(--error);
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(185, 28, 28, 0.14);
}

.messages {
  width: min(100%, 900px);
  margin: 0 auto;
  display: grid;
  gap: 22px;
  padding-bottom: 24px;
}

.message {
  display: grid;
  gap: 12px;
}

.message:not(.user) {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start;
}

.message.user {
  grid-template-columns: minmax(0, 1fr);
  justify-items: end;
}

.message.user .message-avatar-wrap {
  display: none;
}

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

.message-avatar-wrap {
  width: 42px;
  height: 42px;
}

.message-avatar {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

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

.message-bubble {
  max-width: min(100%, 760px);
  padding: 16px 18px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--panel);
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message.user .message-bubble {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: white;
  border-color: transparent;
}

.message-bubble p {
  margin: 0;
  overflow-wrap: anywhere;
}

.message-bubble p + p,
.message-bubble p + ul,
.message-bubble p + ol,
.message-bubble ul + p,
.message-bubble ol + p,
.message-bubble pre + p,
.message-bubble p + pre {
  margin-top: 14px;
}

.message-bubble h1,
.message-bubble h2,
.message-bubble h3 {
  margin: 0 0 12px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.message-bubble h1 {
  font-size: 24px;
}

.message-bubble h2 {
  font-size: 21px;
}

.message-bubble h3 {
  font-size: 18px;
}

.message-bubble ul,
.message-bubble ol {
  margin: 0;
  padding-left: 22px;
}

.message-bubble li + li {
  margin-top: 6px;
}

.message-bubble li,
.message-bubble h1,
.message-bubble h2,
.message-bubble h3,
.message-bubble code,
.message-bubble a {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.message-bubble a {
  text-decoration-thickness: 0.08em;
}

.message-bubble code {
  font-family: 'SFMono-Regular', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.92em;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.08);
}

.message.user .message-bubble code {
  background: rgba(255, 255, 255, 0.16);
}

.code-block {
  margin: 14px 0 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #0f172a;
  color: #e2e8f0;
}

.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.code-copy-button {
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.code-copy-button.is-copied {
  background: rgba(20, 184, 212, 0.18);
  border-color: rgba(20, 184, 212, 0.28);
}

.code-block pre {
  margin: 0;
  overflow-x: auto;
}

.code-block code {
  display: block;
  padding: 14px 16px 16px;
  background: transparent;
  color: inherit;
  border-radius: 0;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
}

.typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

.typing-dots {
  display: inline-flex;
  gap: 6px;
}

.typing-dots i {
  width: 7px;
  height: 7px;
  display: block;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.24;
  animation: typing-bounce 1s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing-dots i:nth-child(3) {
  animation-delay: 0.3s;
}

.typing-caret {
  width: 10px;
  height: 18px;
  display: inline-block;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(8, 145, 178, 0.5);
  animation: caret-blink 1s infinite;
}

.message-bubble.is-pending,
.message-bubble.is-typing {
  min-width: 190px;
}

@keyframes typing-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.24;
  }

  40% {
    transform: translateY(-3px);
    opacity: 0.8;
  }
}

@keyframes caret-blink {
  0%,
  49% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0;
  }
}

.attachment-tags,
.attachment-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.attachment-tags {
  margin-top: 14px;
}

.attachment-tags span,
.attachment-chip {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  font-size: 12px;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}

.attachment-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: min(36vw, 320px);
}

.attachment-remove {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.composer {
  position: sticky;
  bottom: 0;
  padding: 0 24px calc(24px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(244, 246, 249, 0) 0%, rgba(244, 246, 249, 0.82) 16%, rgba(244, 246, 249, 0.97) 100%);
}

.composer.is-disabled {
  opacity: 0.82;
}

.attachment-strip {
  width: min(100%, 900px);
  margin: 0 auto 10px;
}

.attachment-strip:not(.visible) {
  display: none;
}

.composer-box {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: 8px 10px 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid var(--line);
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
}

.composer-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.composer textarea {
  flex: 1;
  min-height: 28px;
  max-height: 180px;
  resize: none;
  border: 0;
  background: transparent;
  outline: none;
  padding: 12px 0;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
}

.file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  padding: 0;
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-button-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font-size: 34px;
  line-height: 1;
  font-weight: 400;
}

.send-button {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent) 100%);
  color: white;
  border: 0;
  font-size: 24px;
  line-height: 1;
  box-shadow: var(--shadow);
}

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

.send-button:disabled {
  opacity: 0.38;
  cursor: default;
  box-shadow: none;
}

.sidebar-backdrop {
  display: none;
}

.mobile-only {
  display: none;
}

.model-sheet,
.settings-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
}

.model-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
}

.model-sheet-card,
.settings-card {
  position: relative;
  z-index: 1;
  width: min(100%, 680px);
  border-radius: 28px;
  background: #fbfdff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 18px;
}

.settings-card {
  width: min(100%, 560px);
}

.sheet-handle {
  display: none;
}

.sheet-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
}

.sheet-head h4 {
  margin: 0;
  font-size: 24px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.sheet-head p {
  margin: 4px 0 0;
  line-height: 1.5;
}

.model-options {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.settings-section {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
}

.settings-usage-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}

.settings-usage-percent {
  min-width: 108px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.05em;
}

.settings-usage-copy strong,
.settings-section-head strong,
.settings-weight-item strong {
  display: block;
}

.settings-usage-copy p,
.settings-weight-item p,
.settings-muted {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.usage-bar {
  height: 12px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
}

.usage-bar span {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent) 100%);
}

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

.settings-weight-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.settings-weight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
}

.settings-weight-item span {
  flex-shrink: 0;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
}

.plan-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.plan-pill.is-pro {
  background: rgba(20, 184, 212, 0.12);
  color: #0f172a;
}

.plan-cta {
  margin-top: 16px;
  padding: 14px 16px;
  width: 100%;
  border-radius: 16px;
  border: 0;
  background: linear-gradient(135deg, var(--accent-strong) 0%, var(--accent) 100%);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.plan-card-list {
  display: grid;
  gap: 12px;
}

.plan-card {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
}

.plan-card.active {
  border-color: rgba(20, 184, 212, 0.26);
  background: rgba(255, 255, 255, 0.98);
}

.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.plan-card-head strong {
  font-size: 18px;
}

.plan-card-head span,
.plan-card-body p {
  color: var(--muted);
}

.plan-card-body {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.plan-card-body p {
  margin: 0;
  line-height: 1.6;
}

.model-option {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  text-align: left;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
}

.model-option img {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  object-fit: cover;
}

.model-option-copy {
  display: grid;
  gap: 4px;
}

.model-option-copy strong {
  font-size: 17px;
}

.model-option-copy span {
  color: var(--muted);
  line-height: 1.55;
}

.model-option-bestfor {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
}

.model-capability-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.model-capability-tags span {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #0f172a;
  font-size: 11px;
  font-weight: 700;
}

.model-option em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

.model-option b {
  font-size: 20px;
  color: var(--accent-strong);
}

.model-option.active {
  border-color: rgba(20, 184, 212, 0.24);
  background: rgba(255, 255, 255, 0.98);
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-backdrop.visible {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.18);
    z-index: 20;
  }

  .mobile-only,
  #open-sidebar {
    display: inline-flex;
  }

  .workspace-header {
    padding-left: 18px;
    padding-right: 18px;
  }

  .workspace-body,
  .composer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .model-trigger {
    min-width: 0;
    width: auto;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .user-pill {
    max-width: 48vw;
  }

  .model-sheet,
  .settings-sheet {
    align-items: end;
  }

  .model-sheet-card,
  .settings-card {
    width: 100%;
    max-height: min(86vh, 760px);
    overflow: auto;
    border-radius: 24px 24px 0 0;
    padding-top: 12px;
  }

  .sheet-handle {
    display: block;
    width: 42px;
    height: 5px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.12);
    margin: 0 auto 12px;
  }

  .auth-card {
    padding: 24px;
    border-radius: 26px;
  }
}

@media (max-width: 720px) {
  .workspace-header {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }

  .chat-control-row,
  .chat-mode-switch {
    width: 100%;
  }

  .chat-control-row {
    display: grid;
  }

  .model-trigger,
  .chat-mode-switch {
    width: 100%;
  }

  .chat-mode-switch button {
    flex: 1;
  }

  .model-trigger-note,
  .chat-mode-note {
    max-width: 320px;
  }

  .hero h2 {
    font-size: 48px;
  }

  .suggestion-chip {
    width: 100%;
  }

  .file-button,
  .send-button {
    width: 48px;
  }

  .composer-box {
    border-radius: 28px;
    padding: 10px 12px;
  }

  .workspace-body {
    padding-top: 20px;
    padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: 140px;
  }

  .composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    padding: 0 18px calc(12px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(180deg, rgba(244, 246, 249, 0) 0%, rgba(244, 246, 249, 0.82) 12%, rgba(244, 246, 249, 0.98) 100%);
  }

  body.keyboard-open .workspace {
    padding-bottom: 0;
  }

  body.keyboard-open .workspace-body {
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: 168px;
  }

  body.keyboard-open .composer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 25;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .model-option {
    grid-template-columns: 56px minmax(0, 1fr) auto;
  }

  .model-option em {
    display: none;
  }

  .auth-screen {
    padding: 16px;
  }

  .auth-card {
    width: 100%;
    padding: 22px;
  }

  .workspace-header {
    grid-template-columns: auto 1fr auto;
    row-gap: 10px;
  }

  .header-center {
    grid-column: 1 / -1;
    order: 3;
  }

  .header-right {
    justify-content: flex-end;
  }

  .user-pill {
    max-width: 100%;
  }

  .user-pill span {
    max-width: 32vw;
  }

  .settings-usage-hero {
    grid-template-columns: 1fr;
  }

  .settings-usage-percent {
    min-width: 0;
    font-size: 34px;
  }

  .settings-section-head,
  .settings-weight-item {
    display: grid;
  }
}
