:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --panel: #fffdfa;
  --line: #d8d2c7;
  --ink: #252422;
  --muted: #706c64;
  --accent: #86604a;
  --accent-strong: #5f3d2f;
  --gold: #e2b735;
  --blue: #2f5f8f;
  --green: #34715f;
  --danger: #9f3d33;
  --shadow: 0 16px 34px rgba(37, 36, 34, 0.08);
}

.feedback-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  width: min(420px, calc(100vw - 32px));
}

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

.feedback-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border, #ddd4cc);
  border-radius: 8px;
  background: var(--surface, #fffaf5);
  box-shadow: 0 18px 48px rgba(31, 23, 18, 0.2);
}

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

.feedback-heading h2 {
  margin: 0;
  font-size: 1.05rem;
}

.feedback-card label {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

.feedback-card select,
.feedback-card textarea,
.admin-feedback-note input,
.admin-feedback-status {
  width: 100%;
  border: 1px solid var(--border, #ddd4cc);
  border-radius: 8px;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
}

.feedback-card select,
.admin-feedback-status,
.admin-feedback-note input {
  min-height: 40px;
  padding: 8px 10px;
}

.feedback-card textarea {
  resize: vertical;
  padding: 10px;
}

.feedback-check {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  font-weight: 600 !important;
}

.feedback-check input {
  width: 18px;
  height: 18px;
}

.feedback-status {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted, #746963);
}

.feedback-status[data-kind="error"] {
  color: #a33a2a;
}

.feedback-actions,
.admin-feedback-note {
  display: flex;
  gap: 8px;
}

.feedback-actions {
  justify-content: flex-end;
}

.admin-feedback-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-feedback-summary article {
  border: 1px solid var(--border, #ddd4cc);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-muted, #f7f1eb);
}

.admin-feedback-summary span {
  display: block;
  color: var(--muted, #746963);
  font-size: 0.85rem;
}

.admin-feedback-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 1.3rem;
}

.admin-character-layout {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(360px, 1.25fr);
  gap: 16px;
}

.admin-character-list,
.admin-character-form {
  border: 1px solid var(--border, #ddd4cc);
  border-radius: 8px;
  background: var(--surface, #fff);
  padding: 12px;
}

.admin-character-list > div,
.admin-character-form {
  display: grid;
  gap: 10px;
}

.admin-character-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 1px solid var(--border, #ddd4cc);
  border-radius: 7px;
  background: var(--surface-muted, #f7f1eb);
  color: inherit;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.admin-character-row strong,
.admin-character-row small {
  display: block;
}

.admin-character-row small {
  margin-top: 2px;
  color: var(--muted, #746963);
  font-size: 0.8rem;
}

.admin-character-row em {
  color: var(--accent-strong, #5f3d2f);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-character-form label {
  display: grid;
  gap: 6px;
  color: var(--muted, #746963);
  font-size: 0.8rem;
  font-weight: 850;
}

.admin-character-form input,
.admin-character-form textarea,
.admin-character-form select {
  width: 100%;
  border: 1px solid var(--border, #ddd4cc);
  border-radius: 7px;
  background: var(--surface, #fff);
  color: inherit;
  font: inherit;
  font-size: 0.92rem;
  padding: 9px 10px;
}

.admin-character-form textarea {
  min-height: 112px;
  resize: vertical;
}

.admin-character-flags {
  display: grid;
  grid-template-columns: auto auto minmax(110px, 1fr);
  align-items: center;
  gap: 12px;
}

.admin-character-flags label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-character-flags input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
}

.admin-character-flags select {
  min-width: 130px;
}

.admin-character-save-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.admin-character-save-status {
  min-height: 1.2em;
  margin: 0 auto 0 0;
  color: var(--muted, #746963);
  font-size: 13px;
  font-weight: 850;
}

.admin-character-save-status[data-kind="success"] {
  color: #34715f;
}

.admin-character-save-status[data-kind="error"] {
  color: #9f3d33;
}

.admin-character-save-status[data-kind="dirty"] {
  color: #86604a;
}

.admin-character-form button[type="submit"] {
  justify-self: end;
  border: 0;
  border-radius: 7px;
  background: var(--accent-strong, #5f3d2f);
  color: #fff;
  font: inherit;
  font-weight: 850;
  padding: 10px 14px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .feedback-panel {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .admin-feedback-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-feedback-note {
    flex-direction: column;
  }

  .admin-character-layout,
  .admin-character-flags {
    grid-template-columns: 1fr;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171615;
  --panel: #23201d;
  --line: #403a33;
  --ink: #eee8dc;
  --muted: #b9b0a4;
  --accent: #c59a77;
  --accent-strong: #d6b18e;
  --gold: #e1bd4a;
  --blue: #8fb9df;
  --green: #8bc4ad;
  --danger: #f08b7f;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.admin-page {
  background: #f7f7f4;
}

.developer-page {
  min-height: 100vh;
  background: #f7f7f4;
}

.developer-shell {
  width: min(1320px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.developer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.developer-header h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.developer-header p {
  margin: 8px 0 0;
  color: #66706c;
}

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

.developer-console {
  display: grid;
  gap: 16px;
}

.developer-summary {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.developer-summary article,
.developer-card {
  border: 1px solid #d9ddd8;
  border-radius: 8px;
  background: #fff;
}

.developer-summary article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
}

.developer-summary span {
  color: #66706c;
  font-size: 12px;
  font-weight: 850;
}

.developer-summary strong {
  overflow-wrap: anywhere;
  color: #202322;
  font-size: 24px;
  line-height: 1.15;
}

.developer-summary small {
  min-height: 16px;
  color: #66706c;
  font-size: 12px;
  line-height: 1.35;
}

.developer-card {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.developer-card h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.developer-card p {
  margin: 5px 0 0;
  color: #68726e;
  line-height: 1.65;
}

.developer-section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.developer-auth-card {
  width: min(560px, 100%);
  margin: 80px auto 0;
}

.developer-login-form,
.developer-key-form {
  display: grid;
  gap: 12px;
}

.developer-login-form {
  grid-template-columns: 1fr;
}

.developer-key-form {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
}

.developer-login-form label,
.developer-key-form label {
  display: grid;
  gap: 6px;
  color: #4f5955;
  font-size: 12px;
  font-weight: 850;
}

.developer-login-form input,
.developer-key-form input,
.developer-secret-panel textarea {
  width: 100%;
  border: 1px solid #cfd6d2;
  border-radius: 8px;
  background: #fff;
  color: #202322;
  font: inherit;
  font-size: 14px;
}

.developer-login-form input,
.developer-key-form input {
  height: 44px;
  padding: 0 12px;
}

.developer-google-button {
  width: 100%;
}

.developer-secret-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(32, 35, 34, 0.48);
}

.developer-secret-modal[hidden] {
  display: none;
}

.developer-secret-panel {
  display: grid;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  gap: 14px;
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(52, 113, 95, 0.26);
  border-radius: 8px;
  background: #f4fbf7;
  box-shadow: 0 24px 80px rgba(32, 35, 34, 0.28);
}

.developer-secret-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
}

.developer-secret-heading h2 {
  margin: 0;
  color: #202322;
  font-size: 24px;
  line-height: 1.2;
}

.developer-secret-heading p {
  margin: 6px 0 0;
  color: #68726e;
  line-height: 1.55;
}

.developer-secret-panel label {
  display: grid;
  gap: 6px;
  color: #4f5955;
  font-size: 12px;
  font-weight: 850;
}

.developer-secret-panel strong {
  color: #1f5d4c;
}

.developer-secret-panel span {
  color: #68726e;
  font-size: 13px;
}

.developer-secret-panel textarea {
  min-height: 88px;
  padding: 10px;
  resize: vertical;
}

.developer-secret-actions {
  display: grid;
  grid-template-columns: minmax(0, 220px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.developer-secret-status {
  align-self: center;
  margin: 0;
  color: #1f5d4c;
  font-size: 13px;
  font-weight: 800;
}

.developer-key-list {
  display: grid;
  gap: 8px;
}

.developer-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid #d9ddd8;
  border-radius: 8px;
  background: #fff;
}

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

.developer-key-row strong {
  color: #202322;
}

.developer-key-row span,
.developer-empty {
  color: #68726e;
  font-size: 13px;
  line-height: 1.55;
}

.developer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}

.developer-code {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  border: 1px solid #d9ddd8;
  border-radius: 8px;
  background: #111815;
  color: #eef7f2;
  font-size: 13px;
  line-height: 1.55;
}

.developer-definition-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.developer-definition-list div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e4e7e2;
}

.developer-definition-list dt {
  color: #66706c;
  font-size: 12px;
  font-weight: 900;
}

.developer-definition-list dd {
  margin: 0;
  color: #202322;
  line-height: 1.6;
}

.developer-usage-bars {
  display: grid;
  gap: 12px;
}

.developer-usage-bars.compact {
  gap: 10px;
}

.developer-usage-subsection {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid #e4e7e2;
}

.developer-usage-subsection h3 {
  margin: 0;
  color: #3f4944;
  font-size: 15px;
  line-height: 1.2;
}

.developer-usage-bar-row {
  display: grid;
  gap: 9px;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #d9ddd8;
  border-radius: 8px;
  background: #fff;
}

.developer-usage-bar-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
}

.developer-usage-bar-head strong,
.developer-usage-bar-head span,
.developer-usage-bar-metrics strong,
.developer-usage-bar-metrics span {
  display: block;
}

.developer-usage-bar-head strong {
  color: #202322;
  font-size: 15px;
  line-height: 1.35;
}

.developer-usage-bar-head span {
  color: #68726e;
  font-size: 12px;
  line-height: 1.45;
}

.developer-usage-bar-metrics {
  min-width: 118px;
  text-align: right;
}

.developer-usage-bar-metrics strong {
  font-size: 17px;
  line-height: 1.2;
}

.developer-usage-bar-metrics span {
  color: #68726e;
  font-size: 12px;
  line-height: 1.45;
}

.developer-usage-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf0ec;
}

.developer-usage-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34715f, #d0a13d);
}

.developer-table-wrap {
  overflow-x: auto;
  border: 1px solid #d9ddd8;
  border-radius: 8px;
}

.developer-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.developer-table th,
.developer-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e4e7e2;
  text-align: left;
  vertical-align: top;
}

.developer-table th {
  color: #66706c;
  font-size: 12px;
  font-weight: 900;
  background: #f4f7f5;
}

.developer-table td {
  color: #202322;
  font-size: 13px;
  line-height: 1.55;
}

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

.developer-table td span {
  display: block;
  color: #68726e;
}

.developer-table .num {
  text-align: right;
  white-space: nowrap;
}

.developer-status {
  display: inline-flex !important;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.developer-status.success {
  color: #1f766b;
  background: #e4f5ef;
}

.developer-status.error {
  color: #9f3d33;
  background: #fff0ed;
}

.developer-message {
  min-height: 22px;
  margin: 0;
  color: #66706c;
  font-size: 13px;
}

.developer-message[data-kind="success"] {
  color: #1f766b;
}

.developer-message[data-kind="error"] {
  color: #9f3d33;
}

.admin-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-header h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.admin-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-summary article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d9ddd8;
  border-radius: 8px;
  background: #fff;
}

.admin-summary span {
  color: #66706c;
  font-size: 12px;
  font-weight: 800;
}

.admin-summary strong {
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.15;
}

.admin-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  border: 1px solid #d9ddd8;
  border-radius: 8px;
  background: #fff;
}

.admin-view-tab {
  min-width: 104px;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  background: transparent;
  color: #59635f;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.admin-view-tab.is-active {
  background: #1f342d;
  color: #fff;
}

.admin-panel {
  margin-bottom: 18px;
}

.admin-panel-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.admin-panel-heading h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.admin-panel-meta {
  margin: 4px 0 0;
  color: #68726e;
  font-size: 12px;
  font-weight: 700;
}

.admin-grant-form {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) minmax(120px, 0.5fr) minmax(220px, 1.6fr) auto;
  align-items: end;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d9ddd8;
  border-radius: 8px;
  background: #fff;
}

.admin-grant-form label {
  display: grid;
  gap: 6px;
  color: #4f5955;
  font-size: 12px;
  font-weight: 850;
}

.admin-grant-form input {
  width: 100%;
  height: 40px;
  border: 1px solid #cfd6d2;
  border-radius: 6px;
  background: #fff;
  color: #202322;
  font: inherit;
  font-size: 14px;
  padding: 0 10px;
}

.admin-api-key-form {
  grid-template-columns: minmax(220px, 1.4fr) minmax(220px, 1.2fr) auto auto;
}

.admin-api-key-secret {
  display: block;
  width: 100%;
  margin-top: 10px;
  border: 1px solid #cfd6d2;
  border-radius: 8px;
  background: #fff;
  color: #202322;
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  padding: 10px;
  resize: vertical;
}

.admin-api-key-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.admin-api-key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #d9ddd8;
  border-radius: 8px;
  background: #fff;
}

.admin-api-key-row strong,
.admin-api-key-row span {
  display: block;
}

.admin-api-key-row strong {
  color: #202322;
  font-size: 13px;
}

.admin-api-key-row span,
.admin-api-key-empty {
  color: #68726e;
  font-size: 12px;
}

.admin-actions-cell {
  min-width: 150px;
  white-space: nowrap;
}

.admin-actions-cell button + button {
  margin-left: 6px;
}

.admin-dialog {
  width: min(920px, calc(100vw - 32px));
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: transparent;
  color: #202322;
}

.admin-dialog::backdrop {
  background: rgba(32, 35, 34, 0.5);
}

.admin-dialog-shell {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid #d9ddd8;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(32, 35, 34, 0.22);
}

.admin-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.admin-dialog-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
}

.admin-dialog-header span {
  display: block;
  margin-top: 4px;
  color: #68726e;
  font-size: 13px;
}

.admin-dialog-message {
  min-height: 22px;
  margin: -4px 0 0;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #66706c;
  font-size: 13px;
  font-weight: 750;
}

.admin-dialog-message:empty {
  display: none;
}

.admin-dialog-message[data-kind="success"] {
  border-color: #b8e1cb;
  background: #eaf7f0;
  color: #16633a;
}

.admin-dialog-message[data-kind="error"] {
  border-color: #f0c2ba;
  background: #fff0ed;
  color: #9f3d33;
}

.admin-dialog-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.admin-action-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #d9ddd8;
  border-radius: 8px;
  background: #fffdfa;
}

.admin-action-panel h3 {
  margin: 0 0 2px;
  font-size: 16px;
}

.admin-action-note {
  margin: 0;
  color: #68726e;
  font-size: 13px;
  line-height: 1.55;
}

.admin-action-panel label {
  display: grid;
  gap: 6px;
  color: #4f5955;
  font-size: 12px;
  font-weight: 850;
}

.admin-action-panel input {
  width: 100%;
  height: 40px;
  border: 1px solid #cfd6d2;
  border-radius: 6px;
  background: #fff;
  color: #202322;
  font: inherit;
  font-size: 14px;
  padding: 0 10px;
}

.admin-balance {
  color: #16633a;
  font-weight: 850;
}

.admin-table-wrap {
  overflow: auto;
  border: 1px solid #d9ddd8;
  border-radius: 8px;
  background: #fff;
}

[data-admin-view-panel="balance"] .admin-table-wrap,
[data-admin-view-panel="usage"] .admin-table-wrap {
  max-height: calc(100vh - 285px);
}

.admin-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #ecefed;
  color: #202322;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f4f2;
  color: #4f5955;
  font-size: 12px;
  font-weight: 850;
}

.admin-table td span {
  display: block;
  color: #68726e;
  font-size: 12px;
}

.admin-table .num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.admin-table code {
  font-size: 12px;
}

.admin-select {
  min-width: 190px;
  height: 34px;
  padding: 6px 9px;
  border: 1px solid #cfd8d3;
  border-radius: 6px;
  background: #fff;
  color: #202322;
  font: inherit;
  font-size: 12px;
}

.prompt-preview {
  max-width: 360px;
  color: #505956;
}

.admin-empty-row {
  padding: 22px !important;
  color: #68726e !important;
  text-align: center !important;
}

.component-breakdown {
  min-width: 220px;
}

.component-details {
  min-width: 180px;
}

.component-details summary {
  color: #29443b;
  font-weight: 800;
  cursor: pointer;
}

.component-details[open] summary {
  margin-bottom: 8px;
}

.component-line {
  display: grid;
  gap: 3px;
  padding: 8px 0;
  border-top: 1px solid #ecefed;
}

.component-line:last-child {
  border-bottom: 0;
}

.component-line > span:not(.admin-status) {
  color: #68726e;
  font-size: 12px;
}

.component-line > strong {
  color: #202322;
  font-size: 12px;
}

.admin-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-weight: 800;
}

.admin-status.ok {
  background: #e4f5ec;
  color: #16633a;
}

.admin-status.warn {
  background: #fff3cf;
  color: #8a5b00;
}

.admin-status.bad {
  background: #fde8e4;
  color: #8f2d20;
}

.admin-message {
  min-height: 22px;
  margin: 12px 0 0;
  color: #66706c;
  font-size: 13px;
}

.admin-message[data-kind="error"] {
  color: #9f3d33;
}

@media (max-width: 980px) {
  .admin-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .admin-grant-form {
    grid-template-columns: 1fr;
  }

  .admin-api-key-row {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-dialog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-shell {
    width: min(100% - 20px, 1480px);
    padding-top: 18px;
  }

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

  .admin-view-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .admin-view-tab {
    min-width: 0;
    padding-inline: 8px;
  }
}

.marketing-page {
  min-height: 100vh;
  background: #f7f5ef;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1220px;
  margin: 0 auto;
  padding: 20px 22px 8px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}

.site-brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.site-brand-title {
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.08;
}

.site-brand-mode {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-switcher {
  position: relative;
  flex: 0 0 auto;
}

.language-switcher-button,
.language-switcher-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
  white-space: nowrap;
}

.language-switcher-button {
  height: 44px;
  min-width: 108px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  cursor: pointer;
}

.language-switcher-button:hover,
.language-switcher-button:focus-visible {
  border-color: rgba(84, 50, 34, 0.35);
  background: #fff6e6;
}

.language-flag {
  width: 18px;
  height: 12px;
  flex: 0 0 auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(31, 29, 26, 0.12);
  object-fit: cover;
}

.language-caret {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
}

.language-switcher-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 136px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf2;
  box-shadow: 0 18px 40px rgba(31, 29, 26, 0.14);
}

.language-switcher-option {
  width: 100%;
  min-height: 34px;
  padding: 7px 8px;
  border-radius: 6px;
}

.language-switcher-option:hover,
.language-switcher-option[aria-selected="true"] {
  background: rgba(183, 85, 45, 0.1);
}

.nav-link,
.nav-cta,
.primary-action,
.secondary-action,
.google-button,
.ghost-button,
.text-button {
  height: 44px;
  border-radius: 8px;
}

.nav-link,
.ghost-button,
.text-button {
  min-width: auto;
  border-color: transparent;
  background: transparent;
  color: var(--ink);
}

.nav-cta,
.primary-action {
  min-width: 128px;
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
}

.secondary-action {
  min-width: 112px;
  border-color: var(--line);
  background: #f4f0e8;
  color: var(--ink);
}

.hero,
.proof-section,
.product-section,
.cta-section {
  max-width: 1220px;
  margin: 0 auto;
  padding: 58px 22px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.55fr);
  align-items: center;
  gap: 44px;
  min-height: 0;
  padding-top: 76px;
  padding-bottom: 84px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 840px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 76px;
  line-height: 0.98;
}

.hero-lead {
  max-width: 790px;
  margin: 24px 0 0;
  color: #4f4b46;
  font-size: 20px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero-score {
  display: grid;
  gap: 18px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-score img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: 8px;
}

.score-label,
.score-rank {
  display: block;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.hero-score strong {
  display: block;
  margin: 6px 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 82px;
  line-height: 1;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 24px;
}

.section-heading h2,
.cta-section h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  line-height: 1.1;
}

.section-heading p:not(.eyebrow),
.cta-section p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

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

.benchmark-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.benchmark-panel h3 {
  margin: 0;
  font-size: 22px;
}

.benchmark-panel p {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.benchmark-open {
  display: block;
  width: 100%;
  height: auto;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.benchmark-open img {
  display: block;
  width: 100%;
  max-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: contain;
  background: #f8f6f1;
}

.benchmark-open:hover img {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(254, 199, 78, 0.28);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.feature-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.feature-grid h3 {
  margin: 0 0 10px;
  font-size: 20px;
}

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

.cta-section {
  margin-bottom: 38px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.auth-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 22px;
  background: #f7f5ef;
}

.auth-card {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0 22px;
  padding: 14px;
  border: 1px solid #e6dccd;
  border-radius: 8px;
  background: #fff8ea;
}

.auth-home-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 760;
  text-decoration: none;
}

.auth-home-link:hover,
.auth-home-link:focus-visible {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-brand-mark {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}

.auth-brand h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.22;
}

.auth-brand p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

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

.auth-form input {
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

.google-button {
  width: 100%;
  margin-top: 12px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.auth-message {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.auth-message[data-tone="error"] {
  color: var(--danger);
}

.auth-message[data-tone="success"] {
  color: #047857;
}

.text-button {
  margin-top: 8px;
  padding: 0;
  color: var(--accent-strong);
}

.account-box {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.character-settings-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
}

.character-settings-button:hover,
.character-settings-button:focus-visible {
  border-color: #cbb8a9;
  background: #fbf8f3;
}

.character-settings-badge {
  max-width: 86px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-settings-badge::before {
  content: "• ";
  color: var(--muted);
}

.character-modal {
  position: fixed;
  inset: 0;
  z-index: 65;
}

.character-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(34, 28, 24, 0.46);
}

.character-modal-dialog {
  position: relative;
  width: min(720px, calc(100% - 32px));
  max-height: calc(100vh - 44px);
  margin: 22px auto;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 80px rgba(31, 24, 20, 0.22);
}

.character-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
}

.character-modal-header h2 {
  margin: 0;
  font-size: 26px;
}

.character-modal-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.character-modal-close {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4eee6;
  color: var(--ink);
  font-size: 28px;
  line-height: 1;
}

.character-modal-body {
  display: grid;
  gap: 12px;
  padding: 20px 28px 18px;
}

.character-card {
  display: grid;
  gap: 7px;
  width: 100%;
  height: auto;
  min-height: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  line-height: 1.35;
  white-space: normal;
}

.character-card:hover,
.character-card:focus-visible {
  border-color: #b99f8c;
  background: #fbf8f3;
}

.character-card.active {
  border-color: #5d3d2f;
  box-shadow: inset 4px 0 0 #5d3d2f;
}

.character-card strong {
  display: block;
  font-size: 18px;
  line-height: 1.3;
}

.character-card-description {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.character-card-selected {
  justify-self: start;
  border-radius: 999px;
  background: rgba(93, 61, 47, 0.1);
  color: #5d3d2f;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  padding: 4px 9px;
}

.character-modal-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  padding: 14px 28px 22px;
  border-top: 1px solid var(--line);
}

.character-selection-message {
  margin: 0 auto 0 0;
  color: #5d3d2f;
  font-size: 13px;
  font-weight: 850;
}

.rag-references {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(93, 61, 47, 0.18);
  color: var(--muted);
  font-size: 13px;
}

.rag-references summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 850;
}

.rag-references ol {
  display: grid;
  gap: 10px;
  margin: 10px 0 0;
  padding-left: 20px;
}

.rag-references li {
  padding-left: 4px;
}

.rag-references strong,
.rag-source-uri {
  display: block;
}

.rag-source-uri {
  margin-top: 2px;
  word-break: break-all;
  color: var(--muted);
  font-size: 12px;
}

.rag-references p {
  margin: 5px 0 0;
}

.account-profile {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.account-avatar,
.settings-avatar-preview {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(95, 61, 47, 0.22);
  border-radius: 50%;
  background: #efe7db;
  background-position: center;
  background-size: cover;
  color: var(--accent-strong);
  font-weight: 800;
}

.account-avatar {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.account-avatar.has-image,
.settings-avatar-preview.has-image {
  color: transparent;
}

.icon-button {
  display: grid;
  place-items: center;
  min-width: 38px;
  width: 38px;
  height: 38px;
  padding: 0;
  border-color: var(--line);
  background: #f4f0e8;
  color: var(--ink);
}

.icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 23, 21, 0.72);
}

.lightbox-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(94vw, 1500px);
  height: min(92vh, 980px);
  margin: 4vh auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.lightbox-header h2 {
  margin: 0;
  font-size: 18px;
}

.lightbox-close {
  min-width: 38px;
  width: 38px;
  height: 38px;
  border-color: var(--line);
  background: #f4f0e8;
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.lightbox-body {
  overflow: auto;
  padding: 16px;
  background: #f8f6f1;
}

.lightbox-body img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: calc(92vh - 94px);
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.github-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
}

.github-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 23, 21, 0.58);
}

.github-modal-dialog {
  position: relative;
  width: min(92vw, 560px);
  margin: 12vh auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.github-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.github-modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.github-modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.github-modal-close {
  min-width: 36px;
  width: 36px;
  height: 36px;
  border-color: var(--line);
  background: #f4f0e8;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.github-modal-body {
  display: grid;
  gap: 12px;
  padding: 16px 20px;
}

.github-modal-url-reader {
  display: grid;
  gap: 8px;
  padding: 0 20px 16px;
}

.github-modal-url-reader label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.github-modal-url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.github-modal-url-row input {
  min-width: 0;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.github-modal-url-row input:focus {
  border-color: var(--accent-strong);
  outline: none;
}

.github-modal-url-row button {
  height: 44px;
  min-width: 104px;
}

.github-modal-url-reader .github-import-message {
  grid-column: 1 / -1;
  margin: 0;
}

.github-wizard-step {
  border-left: 3px solid var(--gold);
  padding-left: 12px;
}

.github-wizard-step strong {
  display: block;
  font-size: 14px;
}

.github-wizard-step p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.github-wizard-notice {
  padding: 10px 12px;
  border: 1px solid rgba(159, 61, 51, 0.28);
  border-radius: 8px;
  background: rgba(159, 61, 51, 0.07);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
}

.github-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
}

.members-modal {
  position: fixed;
  inset: 0;
  z-index: 65;
}

.members-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 23, 21, 0.58);
}

.members-modal-dialog {
  position: relative;
  width: min(92vw, 680px);
  max-height: 86vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin: 8vh auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.members-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.members-modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.members-modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.members-modal-close {
  min-width: 36px;
  width: 36px;
  height: 36px;
  border-color: var(--line);
  background: #f4f0e8;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.members-modal-body {
  overflow: auto;
  padding: 16px 20px 20px;
}

.member-invite-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.member-invite-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.member-invite-form input,
.member-invite-form select {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.member-invite-form button {
  height: 38px;
}

.members-message {
  min-height: 18px;
  margin: 10px 2px 14px;
  color: var(--muted);
  font-size: 12px;
}

.members-message[data-tone="error"] {
  color: var(--danger);
}

.members-message[data-tone="success"] {
  color: var(--green);
}

.members-modal-body section {
  margin-top: 16px;
}

.members-modal-body h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

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

.member-row,
.member-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.member-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-identity {
  display: grid;
  gap: 2px;
}

.member-display-name,
.member-email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-display-name {
  color: var(--ink);
  font-weight: 700;
}

.member-email {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.member-row strong {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ef;
  color: var(--muted);
  font-size: 11px;
}

.member-row.pending strong {
  background: #f4edcf;
  color: var(--accent-strong);
}

.member-empty {
  justify-content: flex-start;
  color: var(--muted);
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.settings-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 23, 21, 0.58);
}

.settings-modal-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(92vw, 760px);
  max-height: 88vh;
  margin: 6vh auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.settings-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.settings-modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.settings-modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.settings-modal-close {
  min-width: 36px;
  width: 36px;
  height: 36px;
  border-color: var(--line);
  background: #f4f0e8;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.settings-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  overflow-y: auto;
  padding: 16px 20px;
}

.settings-section {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(216, 210, 199, 0.75);
}

.settings-section:first-child {
  grid-row: span 2;
}

.settings-section h3 {
  margin: 0;
  font-size: 16px;
}

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

.settings-language-hint {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.label-with-help {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
}

.help-tip {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f0e8;
  color: var(--muted);
  cursor: help;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.help-bubble {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  display: none;
  width: min(340px, 78vw);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.label-with-help:hover .help-bubble,
.help-tip:focus + .help-bubble {
  display: block;
}

.settings-section input,
.settings-section select,
.settings-section textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
}

.settings-section input,
.settings-section select {
  height: 42px;
  padding: 0 11px;
}

.settings-section textarea {
  grid-column: auto;
  min-height: 88px;
  padding: 10px 11px;
  resize: vertical;
}

.settings-api-section {
  grid-column: 1 / -1;
}

.settings-api-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.settings-api-create {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.api-key-secret {
  min-height: 58px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.api-key-list {
  display: grid;
  gap: 8px;
}

.api-key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.api-key-row strong,
.api-key-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-key-row strong {
  color: var(--ink);
  font-size: 14px;
}

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

.api-key-empty {
  color: var(--muted);
  font-size: 13px;
}

.settings-section input:focus,
.settings-section select:focus,
.settings-section textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(226, 183, 53, 0.24);
}

.settings-section input:disabled {
  background: #f4f0e8;
  color: var(--muted);
}

.profile-editor {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-avatar-preview {
  width: 72px;
  height: 72px;
  font-size: 24px;
}

.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--line);
}

.plan-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.plan-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 23, 21, 0.58);
}

.plan-modal-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(92vw, 760px);
  max-height: 88vh;
  margin: 6vh auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.plan-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.plan-modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.plan-modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.plan-modal-close {
  min-width: 36px;
  width: 36px;
  height: 36px;
  border-color: var(--line);
  background: #f4f0e8;
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
}

.plan-modal-body {
  display: grid;
  align-content: start;
  gap: 16px;
  overflow-y: auto;
  padding: 16px 20px 20px;
}

.plan-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.plan-status-grid article {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdfa;
}

.plan-status-grid span,
.plan-status-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.plan-status-grid strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.plan-purchase-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.plan-purchase-actions button {
  min-height: 42px;
  padding-inline: 10px;
}

.plan-purchase-notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.plan-purchase-notes article {
  display: grid;
  align-content: start;
  gap: 5px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(216, 210, 199, 0.8);
  border-radius: 8px;
  background: #fffdfa;
}

.plan-purchase-notes strong {
  color: var(--ink);
  font-size: 13px;
}

.plan-purchase-notes p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.plan-pricing-link {
  grid-column: 1 / -1;
  justify-self: end;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 850;
}

.plan-subscription-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.plan-subscription-actions button {
  min-height: 40px;
}

.plan-subscription-actions .danger {
  border-color: #e4b8b0;
  color: #9f3027;
}

.plan-cancel-confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e4b8b0;
  border-radius: 8px;
  background: #fff7f5;
}

.plan-cancel-confirm[hidden] {
  display: none;
}

.plan-cancel-confirm strong {
  display: block;
  color: #7d241d;
  font-size: 14px;
}

.plan-cancel-confirm p {
  margin: 5px 0 0;
  color: #6f4a44;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
}

.plan-cancel-confirm-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.plan-cancel-confirm-actions button {
  min-height: 38px;
  white-space: nowrap;
}

.plan-cancel-confirm-actions .danger {
  border-color: #9f3027;
  background: #9f3027;
  color: #fff;
}

.plan-modal-message {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.plan-modal-message[data-tone="error"] {
  color: #a33a2f;
}

.plan-modal-message[data-tone="success"] {
  color: #2f7a4f;
}

.plan-modal-message[data-tone="loading"] {
  color: var(--muted);
}

.avatar-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
}

.avatar-crop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 23, 21, 0.72);
}

.avatar-crop-dialog {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(94vw, 520px);
  max-height: 92vh;
  margin: 4vh auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.avatar-crop-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.avatar-crop-header h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
}

.avatar-crop-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.avatar-crop-close {
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border-color: var(--line);
  background: #f4f0e8;
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.avatar-crop-body {
  display: grid;
  justify-items: center;
  gap: 14px;
  min-height: 0;
  padding: 18px;
}

#avatarCropCanvas {
  width: min(360px, calc(100vw - 56px));
  height: min(360px, calc(100vw - 56px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #efe7db;
  cursor: grab;
  touch-action: none;
}

#avatarCropCanvas:active {
  cursor: grabbing;
}

.avatar-crop-control {
  display: grid;
  width: min(360px, 100%);
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.avatar-crop-control input {
  width: 100%;
}

.avatar-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
}

.settings-message {
  min-height: 20px;
  margin: 0;
  color: var(--green);
  font-size: 13px;
}

.small-button {
  min-width: 88px;
  height: 38px;
}

button,
textarea,
input {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  height: 100vh;
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px;
  gap: 14px;
}

.workspace-sidebar {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef2ef;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.workspace-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 58px;
  padding: 12px;
  border-bottom: 1px solid rgba(95, 61, 47, 0.12);
}

.workspace-sidebar-title {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-icon-button {
  display: grid;
  place-items: center;
  min-width: 34px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(95, 61, 47, 0.16);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 18px;
  font-weight: 650;
  line-height: 1;
}

.sidebar-icon-button.compact {
  min-width: 26px;
  width: 26px;
  height: 26px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-icon-button.compact.danger {
  font-size: 16px;
}

.sidebar-icon-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-icon-button.compact.members svg {
  width: 15px;
  height: 15px;
}

.sidebar-icon-button:hover,
.project-section.active .project-row .sidebar-icon-button:hover,
.chat-row.active .sidebar-icon-button:hover {
  border-color: rgba(95, 61, 47, 0.22);
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.project-list {
  min-height: 0;
  overflow-y: auto;
  padding: 10px 8px 14px;
}

.sidebar-empty,
.chat-empty {
  padding: 10px 8px;
  color: var(--muted);
  font-size: 12px;
}

.project-section {
  margin-bottom: 8px;
}

.project-row,
.chat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  border-radius: 8px;
}

.project-row {
  min-height: 34px;
}

.chat-row {
  min-height: 30px;
  margin: 1px 0;
}

.project-section.active > .project-row {
  background: rgba(255, 255, 255, 0.72);
}

.chat-row.active {
  background: rgba(226, 183, 53, 0.22);
}

.project-name,
.chat-name {
  display: block;
  min-width: 0;
  width: 100%;
  height: auto;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-name {
  padding: 7px 6px 7px 20px;
  color: #4f5753;
  font-size: 12px;
  font-weight: 500;
}

.project-actions,
.chat-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 4px;
  opacity: 0;
}

.project-row:hover .project-actions,
.chat-row:hover .chat-actions,
.project-row:focus-within .project-actions,
.chat-row:focus-within .chat-actions,
.project-section.active > .project-row .project-actions,
.chat-row.active .chat-actions {
  opacity: 1;
}

.chat-list {
  margin: 2px 0 8px;
}

.workspace-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  gap: 14px;
}

.invite-inbox {
  display: grid;
  gap: 8px;
}

.invite-inbox[hidden] {
  display: none !important;
}

.invite-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(52, 113, 95, 0.24);
  border-radius: 8px;
  background: #f4fbf7;
}

.invite-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.invite-copy strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.invite-actions {
  display: flex;
  gap: 7px;
}

.invite-actions button {
  min-width: 64px;
  height: 34px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 84px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.brand-mark {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

h1 {
  margin: 0;
  letter-spacing: 0;
}

.brand-status {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.brand-status::before {
  content: "";
  flex: 0 0 auto;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--muted);
}

.brand-status[data-tone="error"] {
  color: var(--danger);
}

.brand-status[data-tone="error"]::before {
  background: var(--danger);
}

.chat-region {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.messages {
  height: 100%;
  overflow-y: auto;
  padding: 22px;
}

:root[data-text-size="small"] .messages,
:root[data-text-size="small"] textarea {
  font-size: 14px;
}

:root[data-text-size="medium"] .messages,
:root[data-text-size="medium"] textarea {
  font-size: 15px;
}

:root[data-text-size="large"] .messages,
:root[data-text-size="large"] textarea {
  font-size: 17px;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 100%;
  color: var(--muted);
  font-size: 15px;
}

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

.message.user {
  margin-left: auto;
}

.message.assistant {
  margin-right: auto;
}

.message.error .bubble {
  border-color: rgba(159, 61, 51, 0.45);
  color: var(--danger);
}

.speaker {
  padding-top: 9px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
  text-transform: uppercase;
}

.message.user .speaker,
.message.assistant .speaker {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  text-transform: none;
}

.speaker-avatar,
.speaker-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
}

.speaker-avatar {
  display: grid;
  place-items: center;
  border: 1px solid rgba(95, 61, 47, 0.2);
  border-radius: 50%;
  background: #efe7db;
  background-position: center;
  background-size: cover;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
}

.speaker-avatar.has-image {
  color: transparent;
}

.speaker-mark {
  object-fit: contain;
}

.bubble {
  position: relative;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
  line-height: 1.62;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.bubble a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.bubble.markdown-body {
  white-space: normal;
}

.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 1.02em;
  line-height: 1.45;
  font-weight: 750;
}

.markdown-body p {
  min-width: 0;
  margin: 0 0 13px;
  overflow-wrap: anywhere;
}

.markdown-body p:last-child,
.markdown-body ul:last-child,
.markdown-body ol:last-child,
.markdown-body blockquote:last-child,
.markdown-body pre:last-child,
.markdown-body .markdown-table-wrap:last-child {
  margin-bottom: 0;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 13px;
  padding-left: 1.35em;
}

.markdown-body li {
  min-width: 0;
  margin: 3px 0;
  overflow-wrap: anywhere;
}

.markdown-body strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.markdown-body blockquote {
  margin: 0 0 13px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid rgba(52, 113, 95, 0.28);
  color: var(--muted);
}

.markdown-body code {
  padding: 1px 5px;
  border: 1px solid rgba(32, 31, 29, 0.12);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.74);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.markdown-body pre {
  margin: 0 0 13px;
  padding: 10px 12px;
  overflow-x: auto;
  border: 1px solid rgba(32, 31, 29, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.78);
  white-space: pre;
}

.markdown-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 0.9em;
}

.inline-svg-chart-wrap {
  background: #ffffff;
  border: 1px solid #dfe8e4;
  border-radius: 12px;
  margin: 14px 0;
  overflow: auto;
  padding: 14px;
}

.inline-svg-chart {
  display: block;
  height: auto;
  max-width: 100%;
}

.inline-svg-chart-download {
  display: inline-flex;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 700;
}

.markdown-inline-image-wrap {
  display: block;
  margin: 12px 0;
}

.markdown-inline-image {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid #dfe8e4;
  border-radius: 10px;
  background: #ffffff;
  cursor: zoom-in;
}

.markdown-inline-image-wrap.is-missing-image {
  padding: 10px 12px;
  border: 1px solid #f0c7c2;
  border-radius: 8px;
  background: #fff6f4;
}

.markdown-table-wrap {
  margin: 0 0 13px;
  overflow-x: auto;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94em;
}

.markdown-body th,
.markdown-body td {
  padding: 7px 9px;
  border: 1px solid rgba(52, 113, 95, 0.2);
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  background: rgba(52, 113, 95, 0.08);
  font-weight: 700;
}

.message.user .bubble {
  border-color: rgba(47, 95, 143, 0.34);
  background: #edf4fb;
}

.message.user.queued .bubble {
  border-color: rgba(47, 95, 143, 0.3);
  background: #f3f7fb;
}

.message-queue-label {
  margin-top: 8px;
  color: #6f665c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.message.assistant .bubble {
  border-color: rgba(52, 113, 95, 0.28);
  background: #f6fbf8;
}

.message.assistant .bubble.has-copy-action {
  padding-right: 54px;
}

.message-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-color: rgba(52, 113, 95, 0.24);
  background: #ecf5ef;
  color: var(--green);
}

.message-copy-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.message-copy-button[data-state="success"] {
  border-color: rgba(52, 113, 95, 0.36);
  background: #dfeee5;
}

.message-copy-button:hover:not(:disabled),
.message-copy-button:focus-visible {
  border-color: rgba(52, 113, 95, 0.46);
  background: #e1efe6;
}

.message-copy-button:disabled {
  opacity: 1;
}

.message.pending .bubble {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}

.thinking {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 40px;
}

.thinking span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-strong);
  opacity: 0.3;
  animation: thinkingPulse 1.1s infinite ease-in-out;
}

.thinking span:nth-child(2) {
  animation-delay: 0.16s;
}

.thinking span:nth-child(3) {
  animation-delay: 0.32s;
}

.thinking-text {
  font-size: 14px;
}

@keyframes thinkingPulse {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.3;
  }
  40% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

.meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: start;
  padding: 14px 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.composer.drag-over {
  border-radius: 10px;
  background: #fff9df;
  outline: 3px solid rgba(226, 183, 53, 0.22);
}

.github-import {
  display: grid;
  order: 4;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.github-import input {
  min-width: 0;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
}

.github-import input:focus {
  border-color: transparent;
  box-shadow: none;
}

.github-import button {
  height: 46px;
  font-size: 13px;
}

.github-import button.is-loading {
  position: relative;
  padding-left: 34px;
}

.github-import button.is-loading::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  border: 2px solid rgba(37, 36, 34, 0.22);
  border-top-color: var(--accent-strong);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.github-import-message {
  display: flex;
  grid-area: message;
  align-items: center;
  gap: 7px;
  order: 5;
  grid-column: auto;
  min-height: 18px;
  margin: 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.github-import-message:empty {
  display: none;
}

.github-import-message:not(:empty) {
  margin-top: 8px;
}

.github-import-message[data-tone="error"] {
  color: var(--danger);
}

.github-import-message[data-tone="success"] {
  color: var(--green);
}

.github-import-message[data-tone="loading"] {
  color: var(--muted);
}

.mini-spinner {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(112, 108, 100, 0.24);
  border-top-color: var(--accent-strong);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.github-import-message .inline-action {
  min-width: auto;
  height: 28px;
  margin-left: 8px;
  padding: 0 10px;
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #fff;
  font-size: 12px;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

#prompt {
  order: 1;
  grid-column: 1;
  width: 100%;
  min-height: 36px;
  padding: 7px 12px;
  overflow: visible;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: break-word;
  white-space: break-spaces;
  cursor: text;
}

.prompt-input.is-empty::before {
  content: attr(data-placeholder);
  color: #81776d;
  pointer-events: none;
}

.prompt-fallback {
  display: none !important;
}

.attachment-tray {
  display: flex;
  flex-wrap: wrap;
  order: 3;
  grid-column: 1 / -1;
  gap: 8px;
  min-height: 0;
}

.attachment-tray:empty {
  display: none;
}

.attachment-chip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  max-width: min(420px, 100%);
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
}

.attachment-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  background: #eee7dc;
}

.attachment-file-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: #eee7dc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.attachment-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.attachment-remove {
  min-width: 30px;
  width: 30px;
  height: 30px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.message-attachment {
  max-width: 240px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.message-attachment img {
  display: block;
  max-width: 220px;
  max-height: 160px;
  border-radius: 6px;
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.message-attachment img:hover,
.message-attachment img:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(28, 24, 20, 0.16);
  outline: 2px solid rgba(197, 90, 53, 0.35);
  outline-offset: 2px;
}

.message-attachment-name {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-attachment-name a {
  color: inherit;
}

#prompt:focus {
  border-color: transparent;
  box-shadow: none;
}

.composer-actions {
  display: flex;
  align-items: stretch;
  order: 2;
  grid-column: 2;
  gap: 8px;
}

.composer-actions button {
  height: 46px;
  min-width: 86px;
  padding: 0 16px;
  font-size: 13px;
}

button {
  min-width: 86px;
  height: 48px;
  border: 1px solid var(--accent-strong);
  border-radius: 8px;
  background: var(--accent-strong);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.character-modal .character-card {
  min-width: 0;
  height: auto;
  min-height: 0;
  align-items: start;
}

button.secondary {
  border-color: var(--line);
  background: #f4f0e8;
  color: var(--ink);
}

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

:root[data-theme="dark"] .marketing-page,
:root[data-theme="dark"] .auth-page {
  background: var(--bg);
}

:root[data-theme="dark"] .hero-lead {
  color: #d4cabc;
}

:root[data-theme="dark"] .auth-brand {
  border-color: var(--line);
  background: #2a241e;
}

:root[data-theme="dark"] .auth-brand-mark {
  background: #181716;
}

:root[data-theme="dark"] button,
:root[data-theme="dark"] .nav-cta,
:root[data-theme="dark"] .primary-action {
  color: #171615;
}

:root[data-theme="dark"] .nav-link,
:root[data-theme="dark"] .ghost-button,
:root[data-theme="dark"] .text-button,
:root[data-theme="dark"] .benchmark-open,
:root[data-theme="dark"] .attachment-remove {
  color: var(--ink);
}

:root[data-theme="dark"] button.secondary,
:root[data-theme="dark"] .secondary-action,
:root[data-theme="dark"] .google-button,
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .top-link-button,
:root[data-theme="dark"] .lightbox-close,
:root[data-theme="dark"] .github-modal-close,
:root[data-theme="dark"] .settings-modal-close,
:root[data-theme="dark"] .avatar-crop-close {
  border-color: var(--line);
  background: #302b25;
  color: var(--ink);
}

:root[data-theme="dark"] .auth-form input,
:root[data-theme="dark"] .settings-section input,
:root[data-theme="dark"] .settings-section select,
:root[data-theme="dark"] .settings-section textarea,
:root[data-theme="dark"] .github-modal-url-row input,
:root[data-theme="dark"] .github-import input,
:root[data-theme="dark"] textarea {
  border-color: var(--line);
  background: #181716;
  color: var(--ink);
}

:root[data-theme="dark"] .settings-section input:disabled {
  background: #2b2722;
  color: var(--muted);
}

:root[data-theme="dark"] .help-tip {
  background: #302b25;
  color: var(--ink);
}

:root[data-theme="dark"] .help-bubble {
  border-color: var(--line);
  background: #23201d;
  color: var(--ink);
}

:root[data-theme="dark"] .account-avatar,
:root[data-theme="dark"] .settings-avatar-preview,
:root[data-theme="dark"] .speaker-avatar {
  border-color: rgba(214, 177, 142, 0.24);
  background-color: #342d25;
  color: var(--accent-strong);
}

:root[data-theme="dark"] .benchmark-open img,
:root[data-theme="dark"] .lightbox-body {
  background: #181716;
}

:root[data-theme="dark"] .bubble,
:root[data-theme="dark"] .attachment-chip {
  background: #2a2621;
}

:root[data-theme="dark"] .message.user .bubble {
  border-color: rgba(143, 185, 223, 0.38);
  background: #202a35;
}

:root[data-theme="dark"] .message.user.queued .bubble {
  border-color: rgba(143, 185, 223, 0.32);
  background: #242b33;
}

:root[data-theme="dark"] .message-queue-label {
  color: #c8bdb0;
}

:root[data-theme="dark"] .message.assistant .bubble {
  border-color: rgba(139, 196, 173, 0.34);
  background: #1d2b25;
}

:root[data-theme="dark"] .message-copy-button {
  border-color: rgba(139, 196, 173, 0.28);
  background: #243830;
  color: var(--green);
}

:root[data-theme="dark"] .message-copy-button:hover:not(:disabled),
:root[data-theme="dark"] .message-copy-button:focus-visible,
:root[data-theme="dark"] .message-copy-button[data-state="success"] {
  border-color: rgba(139, 196, 173, 0.5);
  background: #2a473c;
}

:root[data-theme="dark"] .composer.drag-over {
  background: #302715;
}

:root[data-theme="dark"] .attachment-thumb,
:root[data-theme="dark"] .attachment-file-icon {
  background: #38322c;
}

:root[data-theme="dark"] .message-attachment {
  background: rgba(24, 23, 22, 0.72);
}

:root[data-theme="dark"] #avatarCropCanvas {
  background: #342d25;
}

:root[data-theme="dark"] .workspace-sidebar {
  background: #202723;
}

:root[data-theme="dark"] .workspace-sidebar-head {
  border-bottom-color: rgba(214, 177, 142, 0.18);
}

:root[data-theme="dark"] .sidebar-icon-button,
:root[data-theme="dark"] .project-section.active > .project-row {
  border-color: rgba(214, 177, 142, 0.18);
  background: #2a312d;
  color: var(--ink);
}

:root[data-theme="dark"] .sidebar-icon-button.compact {
  background: transparent;
  color: var(--muted);
}

:root[data-theme="dark"] .chat-row.active {
  background: rgba(139, 196, 173, 0.18);
}

:root[data-theme="dark"] .chat-name {
  color: #c4cdc7;
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 34px;
  }

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

  .hero-lead {
    font-size: 17px;
  }

  .benchmark-grid,
  .feature-grid {
    grid-template-columns: 1fr;
  }

  .hero,
  .proof-section,
  .product-section,
  .cta-section {
    padding: 38px 14px;
  }

  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    padding: 10px;
    gap: 10px;
  }

  .workspace-sidebar {
    max-height: 34vh;
  }

  .workspace-main {
    min-height: 0;
  }

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

  .topbar {
    display: grid;
  }

  .messages {
    padding: 14px;
  }

  .message {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .speaker {
    text-align: left;
  }

  .message.user .speaker,
  .message.assistant .speaker {
    justify-content: flex-start;
  }

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

  #prompt,
  .github-import,
  .attachment-tray,
  .composer-actions {
    grid-column: 1;
  }

  .github-import {
    grid-template-columns: 1fr;
  }

  .composer-actions {
    grid-row: auto;
  }

  .composer-actions {
    justify-content: flex-end;
  }

  .github-modal-dialog {
    width: calc(100vw - 22px);
    margin: 7vh auto;
  }

  .github-modal-url-row {
    grid-template-columns: 1fr;
  }

  .github-modal-url-row button {
    width: 100%;
  }

  .github-modal-actions {
    flex-direction: column-reverse;
  }

  .github-modal-actions button {
    width: 100%;
  }

  .settings-modal-dialog {
    width: calc(100vw - 22px);
    margin: 5vh auto;
  }

  .plan-modal-dialog {
    width: calc(100vw - 22px);
    margin: 5vh auto;
  }

  .avatar-crop-dialog {
    width: calc(100vw - 22px);
    margin: 4vh auto;
  }

  .settings-modal-body {
    grid-template-columns: 1fr;
  }

  .plan-status-grid,
  .plan-purchase-actions,
  .plan-purchase-notes {
    grid-template-columns: 1fr;
  }

  .plan-pricing-link {
    justify-self: stretch;
  }

  .plan-cancel-confirm {
    grid-template-columns: 1fr;
  }

  .plan-cancel-confirm-actions {
    justify-content: stretch;
  }

  .plan-cancel-confirm-actions button {
    width: 100%;
  }

  .settings-section:first-child {
    grid-row: auto;
  }

  .settings-modal-actions {
    grid-template-columns: 1fr;
  }

  .settings-modal-actions button {
    width: 100%;
  }

  .avatar-crop-actions {
    flex-direction: column-reverse;
  }

  .avatar-crop-actions button {
    width: 100%;
  }
}

/* Playground refresh */
body:has(#playgroundApp:not([hidden])) {
  overflow: hidden;
}

.shell {
  grid-template-columns: var(--sidebar-width, 280px) minmax(0, 1fr);
  height: 100dvh;
  max-width: none;
  padding: 0;
  gap: 0;
  background:
    linear-gradient(
      90deg,
      var(--sidebar-bg, #f7f7f5) 0,
      var(--sidebar-bg, #f7f7f5) var(--sidebar-width, 280px),
      transparent var(--sidebar-width, 280px)
    ),
    #f7f5ef;
}

.workspace-sidebar {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  min-width: 0;
  border: 0;
  border-right: 1px solid #d8d5cf;
  border-radius: 0;
  background: var(--sidebar-bg, #f7f7f5);
  box-shadow: none;
  overflow: visible;
}

.workspace-sidebar-head {
  min-height: 58px;
  padding: 10px 14px 7px;
  border-bottom: 0;
}

.workspace-sidebar-title {
  font-size: 15px;
  letter-spacing: 0;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: #1e1f1d;
  text-decoration: none;
}

.sidebar-brand:hover {
  color: #1e1f1d;
}

.sidebar-brand-mark {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  object-fit: contain;
}

.sidebar-brand-name {
  min-width: 0;
  overflow: hidden;
  font-size: 18px;
  font-weight: 780;
  letter-spacing: 0;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-tools {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.sidebar-tool-button {
  display: grid;
  place-items: center;
  min-width: 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #555955;
}

.sidebar-tool-button:hover,
.sidebar-tool-button:focus-visible {
  background: #ebe9e4;
  color: #1f201e;
}

.sidebar-tool-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-new-chat {
  display: flex;
  align-items: center;
  min-width: 0;
  width: auto;
  gap: 12px;
  height: 44px;
  margin: 6px 10px 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #242522;
  font-size: 14px;
  font-weight: 560;
  text-align: left;
}

.sidebar-new-chat:hover,
.sidebar-new-chat:focus-visible {
  background: #ebe9e4;
}

.sidebar-new-chat-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #e7e4dd;
  color: #1e1f1d;
  font-size: 21px;
  font-weight: 420;
  line-height: 1;
}

.sidebar-projects-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  margin: 4px 12px 2px;
  color: #8b877f;
  font-size: 12px;
  font-weight: 650;
}

.project-list {
  padding: 4px 8px 12px;
}

.project-section {
  margin-bottom: 10px;
}

.project-row,
.chat-row {
  border-radius: 6px;
}

.project-section.active > .project-row {
  background: #fffdfa;
}

.chat-row.active {
  background: #f1e8c6;
}

.project-name {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 8px;
  color: #252422;
  font-size: 13px;
}

.project-name-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-star-badge {
  flex: 0 0 auto;
  color: #b88721;
  font-size: 12px;
  line-height: 1;
}

.chat-name {
  padding: 7px 8px 7px 18px;
  color: #4f5753;
  font-size: 12px;
}

#playgroundApp.shell {
  --sidebar-width: 280px;
  --sidebar-bg: #f7f7f5;
  --composer-height: 191px;
  --composer-bottom-offset: 28px;
  --composer-text-clearance: 18px;
  --composer-bottom-mask-extra: 74px;
  --scrollbar-visual-gutter: 16px;
  --messages-bottom-clearance: calc(
    var(--composer-height) + var(--composer-bottom-offset) + var(--composer-text-clearance)
  );
}

#playgroundApp.shell.sidebar-collapsed {
  --sidebar-width: 64px;
}

.workspace-main {
  position: relative;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0;
  background: #fbfaf6;
  overflow: hidden;
}

.workspace-main::after {
  content: "";
  position: absolute;
  z-index: 8;
  right: var(--scrollbar-visual-gutter);
  bottom: 0;
  left: 0;
  height: calc(var(--messages-bottom-clearance) + var(--composer-bottom-mask-extra));
  pointer-events: none;
  background:
    linear-gradient(
      180deg,
      rgba(251, 250, 246, 0) 0%,
      rgba(251, 250, 246, 0.82) 28%,
      rgba(251, 250, 246, 0.98) 58%,
      #fbfaf6 100%
    );
}

.topbar {
  min-height: 66px;
  padding: 10px 18px;
  border: 0;
  border-bottom: 1px solid #dfd9cf;
  border-radius: 0;
  background: rgba(255, 253, 250, 0.96);
  box-shadow: none;
}

.brand-link {
  color: inherit;
  text-decoration: none;
  border-radius: 8px;
}

.brand-link:hover {
  background: rgba(95, 61, 47, 0.06);
}

.brand-status {
  font-size: 12px;
}

.account-box {
  gap: 8px;
  font-size: 12px;
  flex-wrap: nowrap;
}

.account-profile {
  max-width: 230px;
  padding: 5px 8px;
  border: 1px solid #e1dbd1;
  border-radius: 999px;
  background: #f6f2ea;
  cursor: pointer;
  list-style: none;
}

.account-profile span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-avatar {
  width: 28px;
  height: 28px;
}

.account-profile::-webkit-details-marker {
  display: none;
}

.account-menu {
  position: relative;
  z-index: 20;
}

.account-menu[open] .account-chevron {
  transform: rotate(180deg);
}

.account-chevron {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform 140ms ease;
}

.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 210px;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(28, 24, 20, 0.16);
}

.account-plan-status {
  min-height: 30px;
  display: flex;
  align-items: center;
  padding: 0 10px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.account-menu-item {
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
}

.account-menu-item-stacked {
  height: auto;
  min-height: 50px;
  display: grid;
  align-content: center;
  gap: 2px;
}

.account-menu-item-stacked span {
  font-weight: 850;
}

.account-menu-item-stacked small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.account-menu-item:hover {
  background: #f4f0e8;
}

.sidebar-account {
  position: relative;
  z-index: 24;
  margin: 8px 10px 12px;
}

.sidebar-account .account-profile {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  max-width: none;
  min-height: 50px;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.sidebar-account .account-profile:hover,
.sidebar-account .account-profile:focus-visible {
  background: #ebe9e4;
}

.sidebar-account .account-avatar {
  width: 34px;
  height: 34px;
  font-size: 13px;
}

.sidebar-account .account-profile > span {
  min-width: 0;
  overflow: hidden;
  color: #1f201e;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-account .account-menu-panel {
  right: 0;
  bottom: calc(100% + 8px);
  left: 0;
  top: auto;
  width: auto;
  padding: 8px;
  border-color: #d8d2c8;
  border-radius: 14px;
  background: #fffefa;
  box-shadow: 0 20px 56px rgba(28, 24, 20, 0.18);
}

.topbar-project-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: min(520px, 60vw);
  height: 40px;
  gap: 8px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #161716;
  font-size: 15px;
  font-weight: 760;
  letter-spacing: 0;
}

.topbar-project-title:hover,
.topbar-project-title:focus-visible {
  background: #f2eee7;
}

.topbar-project-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-project-title svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar-project-title[aria-expanded="true"] {
  background: #f2eee7;
}

.topbar-project-title.starred::before {
  content: "★";
  flex: 0 0 auto;
  color: #b88721;
  font-size: 13px;
  line-height: 1;
}

.topbar-project-menu-wrap {
  position: relative;
  min-width: 0;
}

.project-title-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 40;
  display: grid;
  width: 264px;
  padding: 10px;
  border: 1px solid #d8d2c8;
  border-radius: 14px;
  background: #fffefa;
  box-shadow: 0 18px 50px rgba(28, 24, 20, 0.18);
}

.project-title-menu[hidden] {
  display: none !important;
}

.project-title-menu-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 44px;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #242321;
  font-size: 15px;
  font-weight: 520;
  text-align: left;
}

.project-title-menu-item:hover,
.project-title-menu-item:focus-visible {
  background: #f2f0eb;
}

.project-title-menu-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.project-title-menu-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.project-title-menu-item.active svg {
  fill: currentColor;
}

.project-title-menu-item.danger {
  color: #b42318;
}

.project-title-menu-separator {
  height: 1px;
  margin: 6px 8px;
  background: #e5ded4;
}

.workspace-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  align-items: start;
  justify-content: center;
  padding: 94px 24px 24px;
  background: rgba(25, 24, 22, 0.18);
}

.workspace-search-overlay[hidden] {
  display: none !important;
}

.workspace-search-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(760px, calc(100vw - 48px));
  max-height: min(650px, calc(100vh - 140px));
  overflow: hidden;
  border: 1px solid #d8d2c8;
  border-radius: 12px;
  background: #fffefa;
  box-shadow: 0 28px 90px rgba(25, 24, 22, 0.24);
}

.workspace-search-head {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 14px;
  border-bottom: 1px solid #e8e2d8;
}

.workspace-search-head > svg,
.workspace-search-head button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.workspace-search-head > svg {
  color: #8d877f;
}

.workspace-search-head input {
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #242321;
  font-size: 14px;
}

.workspace-search-head input::placeholder {
  color: #9b958d;
}

.workspace-search-head button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #8d877f;
}

.workspace-search-head button:hover,
.workspace-search-head button:focus-visible {
  background: #f2eee7;
  color: #242321;
}

.workspace-search-results {
  min-height: 0;
  max-height: 560px;
  overflow-y: auto;
  padding: 8px;
}

.workspace-search-result {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 44px;
  gap: 10px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #242321;
  text-align: left;
}

.workspace-search-result:hover,
.workspace-search-result:focus-visible {
  background: #f2f0eb;
}

.workspace-search-result-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid #dad4cb;
  border-radius: 50%;
  color: #69645e;
  font-size: 11px;
  font-weight: 760;
}

.workspace-search-result-title {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 560;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-search-result-meta {
  color: #8d877f;
  font-size: 12px;
  white-space: nowrap;
}

.workspace-search-empty {
  padding: 20px 12px;
  color: #8d877f;
  font-size: 13px;
}

#playgroundApp.sidebar-collapsed .workspace-sidebar {
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
}

#playgroundApp.sidebar-collapsed .workspace-sidebar-head {
  flex-direction: column;
  justify-content: center;
  padding: 10px 8px 6px;
}

#playgroundApp.sidebar-collapsed .sidebar-brand {
  justify-content: center;
}

#playgroundApp.sidebar-collapsed .sidebar-brand-name,
#playgroundApp.sidebar-collapsed .sidebar-new-chat span:not(.sidebar-new-chat-icon),
#playgroundApp.sidebar-collapsed .sidebar-projects-label span,
#playgroundApp.sidebar-collapsed .sidebar-account .account-profile > span,
#playgroundApp.sidebar-collapsed .sidebar-account .account-chevron {
  display: none;
}

#playgroundApp.sidebar-collapsed .project-list {
  visibility: hidden;
  overflow: hidden;
  padding: 0;
}

#playgroundApp.sidebar-collapsed .sidebar-tools {
  flex-direction: column;
  margin-left: 0;
}

#playgroundApp.sidebar-collapsed .sidebar-new-chat {
  justify-content: center;
  width: auto;
  min-width: 0;
  margin: 8px;
  padding: 0;
}

#playgroundApp.sidebar-collapsed .sidebar-projects-label {
  justify-content: center;
  margin: 0 8px;
}

#playgroundApp.sidebar-collapsed .sidebar-account .account-profile {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  min-height: 50px;
  padding: 8px 0;
}

#playgroundApp.sidebar-collapsed .sidebar-account .account-menu-panel {
  left: calc(100% + 8px);
  right: auto;
  bottom: 0;
  width: 180px;
}

.icon-button {
  min-width: 36px;
  width: 36px;
  height: 36px;
  border-radius: 6px;
}

.small-button,
.account-box .secondary {
  min-width: 0;
  height: 36px;
  padding: 0 13px;
  border-radius: 6px;
  font-size: 12px;
}

.top-link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f0e8;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.top-link-button:hover {
  border-color: rgba(95, 61, 47, 0.32);
  background: #eee7dc;
}

.chat-region {
  grid-row: 2 / -1;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(251, 250, 246, 0.94), rgba(251, 250, 246, 0.98)),
    radial-gradient(circle at 12% 0%, rgba(226, 183, 53, 0.08), transparent 34%),
    #fbfaf6;
  box-shadow: none;
}

.invite-inbox {
  grid-row: 2;
  padding: 10px 18px 0;
  background: #fbfaf6;
}

.invite-inbox:not([hidden]) + .chat-region {
  grid-row: 3 / -1;
}

.invite-card {
  max-width: 1020px;
  margin: 0 auto;
  border-color: #cfe2d8;
  background: #f3faf6;
}

.messages {
  height: 100%;
  min-height: 0;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 24px var(--messages-bottom-clearance);
  scroll-padding-bottom: var(--messages-bottom-clearance);
}

.empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  min-height: 100%;
  color: #81776d;
  font-size: 16px;
  text-align: center;
}

.empty-illustration {
  width: clamp(136px, 20vw, 208px);
  aspect-ratio: 1;
  object-fit: contain;
  opacity: 0.96;
}

.empty-label {
  line-height: 1.5;
}

.message {
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  max-width: 930px;
  margin: 0 0 14px;
}

.message.user {
  grid-template-columns: minmax(0, 1fr) 34px;
  max-width: 760px;
  margin-left: auto;
}

.message.user .speaker {
  grid-column: 2;
  grid-row: 1;
}

.message.user .bubble {
  grid-column: 1;
  grid-row: 1;
}

.message.assistant {
  margin-right: auto;
}

.speaker {
  justify-content: center;
  padding-top: 4px;
  text-align: center;
}

.message.user .speaker,
.message.assistant .speaker {
  justify-content: center;
}

.speaker span {
  display: none;
}

.speaker-avatar,
.speaker-mark {
  width: 26px;
  height: 26px;
}

.bubble {
  padding: 14px 16px;
  border-radius: 8px;
  line-height: 1.72;
}

.message.user .bubble {
  border-color: #cbdced;
  background: #edf5ff;
}

.message.user.queued .bubble {
  border-color: #d8e1ea;
  background: #f5f8fb;
}

.message-queue-label {
  margin-top: 9px;
  color: #7b7167;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.message.assistant .bubble {
  border-color: #d7e6df;
  background: #fbfffc;
}

.message.error .bubble {
  background: #fff8f6;
}

.meta {
  margin-top: 9px;
  font-size: 11px;
}

.message-copy-button {
  top: 9px;
  right: 9px;
  width: 30px;
  height: 30px;
  border-radius: 7px;
}

.composer {
  position: absolute;
  z-index: 10;
  grid-area: 1 / 1 / -1 / -1;
  left: 50%;
  bottom: 28px;
  width: min(880px, calc(100% - 56px));
  margin: 0;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "prompt"
    "tray"
    "message"
    "actions";
  row-gap: 0;
  column-gap: 8px;
  align-items: center;
  padding: 14px 18px 13px;
  border: 1px solid #ded7cd;
  border-radius: 28px;
  background: #fffdfa;
  box-shadow: 0 18px 54px rgba(37, 36, 34, 0.16);
  transform: translateX(-50%);
}

.composer-disclaimer {
  position: absolute;
  z-index: 12;
  left: 50%;
  bottom: 6px;
  width: min(880px, calc(100% - 56px));
  margin: 0;
  color: #8a8277;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.scroll-bottom-button {
  position: absolute;
  z-index: 11;
  grid-area: 1 / 1 / -1 / -1;
  left: 50%;
  bottom: calc(42px + var(--composer-height));
  display: grid;
  place-items: center;
  min-width: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #ddd6cc;
  border-radius: 999px;
  background: #fffefa;
  color: #161716;
  box-shadow: 0 8px 24px rgba(37, 36, 34, 0.16);
  transform: translateX(-50%);
}

.scroll-bottom-button:hover,
.scroll-bottom-button:focus-visible {
  border-color: #cfc6ba;
  background: #fff;
}

.scroll-bottom-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#prompt {
  grid-area: prompt;
  min-height: 36px;
  padding: 5px 14px;
  overflow: visible;
  border-color: transparent;
  border-radius: 12px;
  background: transparent;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: break-word;
  white-space: break-spaces;
}

#playgroundApp #prompt {
  max-height: none !important;
  overflow: visible !important;
  overflow-x: visible !important;
  overflow-y: visible !important;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#playgroundApp #prompt::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.composer-actions {
  grid-area: actions;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.composer-actions button {
  height: 42px;
  min-width: 0;
  padding: 0;
  border-radius: 999px;
  font-size: 13px;
}

.composer-menu-wrap {
  position: relative;
  flex: 0 0 auto;
}

.composer-model-wrap {
  position: relative;
  flex: 0 0 auto;
  margin-left: auto;
}

.composer-icon-button,
.composer-send-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
}

.composer-icon-button {
  border-color: transparent;
  background: transparent;
  color: #171817;
}

.composer-icon-button:hover,
.composer-icon-button:focus-visible {
  background: #f2eee7;
}

.composer-icon-button svg,
.composer-send-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.composer-icon-button svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.8;
}

.composer-send-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.composer-model-label {
  display: inline-flex;
  width: auto;
  height: 34px;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #5f5a53;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.composer-model-label:hover,
.composer-model-label:focus-visible,
.composer-model-label[aria-expanded="true"] {
  background: transparent;
  color: #171817;
}

.composer-model-label svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.composer-model-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 24;
  box-sizing: border-box;
  width: min(360px, calc(100vw - 42px));
  padding: 10px;
  border: 1px solid #ded7cd;
  border-radius: 14px;
  background: #fffefa;
  box-shadow: 0 14px 38px rgba(37, 36, 34, 0.18);
}

.composer-model-menu-section + .composer-model-menu-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ebe4da;
}

.composer-model-menu-heading {
  padding: 3px 8px 7px;
  color: #3f3a34;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.composer-model-menu .composer-model-menu-item {
  position: relative;
  display: grid;
  width: 100%;
  height: auto;
  min-height: 52px;
  justify-items: start;
  align-content: center;
  gap: 4px;
  box-sizing: border-box;
  padding: 9px 38px 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #171817;
  font-size: 13px;
  line-height: 1.25;
  text-align: left;
}

.composer-model-menu .composer-model-menu-item:hover:not(:disabled),
.composer-model-menu .composer-model-menu-item:focus-visible:not(:disabled) {
  background: #f8f4ed;
}

.composer-model-menu .composer-model-menu-item.active {
  background: #f1ebe2;
  box-shadow: inset 3px 0 0 #c55a35;
}

.composer-model-menu .composer-model-menu-item.active::after {
  position: absolute;
  top: 50%;
  right: 10px;
  color: #6f3f2d;
  font-size: 15px;
  line-height: 1;
  content: "✓";
  transform: translateY(-50%);
}

.composer-model-menu-title {
  color: inherit;
  font-size: 14px;
  font-weight: 800;
}

.composer-model-menu-meta {
  color: #6f665c;
  font-size: 12px;
  font-weight: 600;
}

.composer-send-button {
  border-color: #c55a35;
  border-radius: 999px;
  background: #c55a35;
  color: #fff;
}

.composer-send-button:hover,
.composer-send-button:focus-visible {
  border-color: #ad4828;
  background: #ad4828;
}

.composer-send-button:disabled {
  border-color: #d9d2c8;
  background: #d9d2c8;
  color: #867d72;
}

.composer-send-button.is-loading {
  border-color: #fff;
  background: #fff;
  color: #252422;
  box-shadow: 0 0 0 1px rgba(37, 36, 34, 0.08);
}

.composer-send-button.is-loading:hover,
.composer-send-button.is-loading:focus-visible {
  border-color: #f2eee7;
  background: #f2eee7;
  color: #252422;
}

.composer-send-button.is-loading svg {
  opacity: 1;
}

.composer-send-button .stop-icon {
  fill: currentColor;
  stroke: none;
}

.composer-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  width: min(360px, calc(100vw - 42px));
  min-width: 260px;
  padding: 7px;
  border: 1px solid #ded7cd;
  border-radius: 12px;
  background: #fffefa;
  box-shadow: 0 14px 38px rgba(37, 36, 34, 0.16);
}

.composer-menu button {
  width: 100%;
  height: 38px;
  min-width: 0;
  justify-content: flex-start;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #171817;
  font-size: 13px;
  text-align: left;
}

.composer-menu button:hover,
.composer-menu button:focus-visible {
  background: #f2eee7;
}

.composer-menu-divider {
  height: 1px;
  margin: 7px 4px;
  background: #ebe4da;
}

.composer-menu-label {
  margin: 4px 8px 6px;
  color: #706a61;
  font-size: 12px;
  font-weight: 700;
}

.composer-github-repos {
  display: grid;
  gap: 4px;
  max-height: 212px;
  overflow-y: auto;
  padding-right: 2px;
}

.composer-github-note {
  padding: 7px 8px 9px;
  color: #706a61;
  font-size: 12px;
  line-height: 1.4;
}

.composer-github-note.error {
  color: var(--danger);
}

.composer-github-note.loading {
  color: #5f5a53;
}

.composer-menu .composer-github-repo {
  display: grid;
  height: auto;
  min-height: 48px;
  align-items: center;
  gap: 2px;
  padding: 7px 10px;
}

.composer-github-repo-name {
  overflow: hidden;
  color: #171817;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-github-repo-meta {
  color: #706a61;
  font-size: 11px;
  font-weight: 600;
}

.github-import {
  grid-area: github;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 6px;
  border: 1px solid #ebe4da;
  border-radius: 12px;
  background: #fbf8f2;
  margin-bottom: 0;
  margin-top: 8px;
}

.github-import[hidden] {
  display: none !important;
}

.github-import input {
  height: 34px;
  padding: 0 8px;
  border-color: transparent;
  border-radius: 8px;
  background: transparent;
}

.github-import button {
  height: 34px;
  min-width: 112px;
  border-radius: 10px;
}

.attachment-tray {
  grid-area: tray;
  gap: 7px;
  margin-top: 8px;
}

.attachment-chip {
  border-radius: 7px;
  background: #fffefa;
}

:root[data-theme="dark"] .shell {
  background:
    linear-gradient(
      90deg,
      var(--sidebar-bg, #202723) 0,
      var(--sidebar-bg, #202723) var(--sidebar-width, 280px),
      transparent var(--sidebar-width, 280px)
    ),
    var(--bg);
}

:root[data-theme="dark"] #playgroundApp.shell {
  --sidebar-bg: #202723;
}

:root[data-theme="dark"] .workspace-sidebar {
  border-color: #30372f;
}

:root[data-theme="dark"] .sidebar-brand,
:root[data-theme="dark"] .sidebar-brand:hover,
:root[data-theme="dark"] .topbar-project-title,
:root[data-theme="dark"] .workspace-search-result,
:root[data-theme="dark"] .sidebar-account .account-profile > span {
  color: #eee8dc;
}

:root[data-theme="dark"] .sidebar-tool-button,
:root[data-theme="dark"] .workspace-search-head > svg,
:root[data-theme="dark"] .workspace-search-head button,
:root[data-theme="dark"] .workspace-search-result-meta,
:root[data-theme="dark"] .workspace-search-empty {
  color: #a9a198;
}

:root[data-theme="dark"] .sidebar-tool-button:hover,
:root[data-theme="dark"] .sidebar-tool-button:focus-visible,
:root[data-theme="dark"] .sidebar-new-chat:hover,
:root[data-theme="dark"] .sidebar-new-chat:focus-visible,
:root[data-theme="dark"] .sidebar-account .account-profile:hover,
:root[data-theme="dark"] .sidebar-account .account-profile:focus-visible,
:root[data-theme="dark"] .topbar-project-title:hover,
:root[data-theme="dark"] .topbar-project-title:focus-visible,
:root[data-theme="dark"] .workspace-search-head button:hover,
:root[data-theme="dark"] .workspace-search-head button:focus-visible,
:root[data-theme="dark"] .workspace-search-result:hover,
:root[data-theme="dark"] .workspace-search-result:focus-visible {
  background: #302b25;
  color: #eee8dc;
}

:root[data-theme="dark"] .sidebar-new-chat,
:root[data-theme="dark"] .sidebar-projects-label {
  color: #a9a198;
}

:root[data-theme="dark"] .sidebar-new-chat-icon {
  background: #2f3631;
  color: #eee8dc;
}

:root[data-theme="dark"] .workspace-search-dialog,
:root[data-theme="dark"] .sidebar-account .account-menu-panel,
:root[data-theme="dark"] .project-title-menu {
  border-color: #403a33;
  background: #211f1d;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .project-title-menu-item {
  color: #eee8dc;
}

:root[data-theme="dark"] .project-title-menu-item:hover,
:root[data-theme="dark"] .project-title-menu-item:focus-visible,
:root[data-theme="dark"] .topbar-project-title[aria-expanded="true"] {
  background: #302b25;
}

:root[data-theme="dark"] .project-title-menu-item.danger {
  color: #f97066;
}

:root[data-theme="dark"] .project-title-menu-separator {
  background: #403a33;
}

:root[data-theme="dark"] .workspace-search-head {
  border-color: #403a33;
}

:root[data-theme="dark"] .workspace-search-head input {
  color: #eee8dc;
}

:root[data-theme="dark"] .workspace-search-result-icon {
  border-color: #4b443d;
  color: #b9b0a4;
}

:root[data-theme="dark"] .workspace-main,
:root[data-theme="dark"] .chat-region {
  background: #171615;
}

:root[data-theme="dark"] .workspace-main::after {
  background:
    linear-gradient(
      180deg,
      rgba(23, 22, 21, 0) 0%,
      rgba(23, 22, 21, 0.82) 28%,
      rgba(23, 22, 21, 0.98) 58%,
      #171615 100%
    );
}

:root[data-theme="dark"] .topbar {
  border-color: var(--line);
  background: #23201d;
}

:root[data-theme="dark"] .composer {
  border-color: var(--line);
  background: #211f1d;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .github-import {
  border-color: #37322d;
  background: #181716;
}

:root[data-theme="dark"] .composer-icon-button {
  color: #eee8dc;
}

:root[data-theme="dark"] .composer-icon-button:hover,
:root[data-theme="dark"] .composer-icon-button:focus-visible {
  background: #302b25;
}

:root[data-theme="dark"] .composer-model-label {
  color: #b9b0a4;
}

:root[data-theme="dark"] .composer-model-label:hover,
:root[data-theme="dark"] .composer-model-label:focus-visible,
:root[data-theme="dark"] .composer-model-label[aria-expanded="true"] {
  background: transparent;
  color: #eee8dc;
}

:root[data-theme="dark"] .composer-disclaimer {
  color: #9f9588;
}

:root[data-theme="dark"] .composer-menu {
  border-color: #403a33;
  background: #23201d;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .composer-model-menu {
  border-color: #403a33;
  background: #23201d;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .composer-model-menu-section + .composer-model-menu-section {
  border-color: #403a33;
}

:root[data-theme="dark"] .composer-menu button {
  color: #eee8dc;
}

:root[data-theme="dark"] .composer-model-menu .composer-model-menu-item {
  color: #eee8dc;
}

:root[data-theme="dark"] .composer-menu button:hover,
:root[data-theme="dark"] .composer-menu button:focus-visible {
  background: #302b25;
}

:root[data-theme="dark"] .composer-model-menu .composer-model-menu-item:hover:not(:disabled),
:root[data-theme="dark"] .composer-model-menu .composer-model-menu-item:focus-visible:not(:disabled) {
  background: #302b25;
}

:root[data-theme="dark"] .composer-model-menu .composer-model-menu-item.active {
  background: #32463d;
  box-shadow: inset 3px 0 0 #f2c06b;
}

:root[data-theme="dark"] .composer-model-menu .composer-model-menu-item.active::after {
  color: #f2c06b;
}

:root[data-theme="dark"] .composer-menu-divider {
  background: #403a33;
}

:root[data-theme="dark"] .composer-menu-label,
:root[data-theme="dark"] .composer-github-note,
:root[data-theme="dark"] .composer-github-repo-meta,
:root[data-theme="dark"] .composer-model-menu-meta {
  color: #b9b0a4;
}

:root[data-theme="dark"] .composer-model-menu-heading {
  color: #eee8dc;
}

:root[data-theme="dark"] .composer-github-repo-name {
  color: #eee8dc;
}

:root[data-theme="dark"] .scroll-bottom-button {
  border-color: #403a33;
  background: #23201d;
  color: #eee8dc;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .account-profile,
:root[data-theme="dark"] .project-section.active > .project-row {
  background: #2a312d;
}

:root[data-theme="dark"] .brand-link:hover,
:root[data-theme="dark"] .account-menu-item:hover {
  background: #302b25;
}

:root[data-theme="dark"] .account-menu-panel {
  background: #211f1d;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] #playgroundApp .project-name,
:root[data-theme="dark"] #playgroundApp .chat-name,
:root[data-theme="dark"] #playgroundApp .account-menu-item,
:root[data-theme="dark"] #playgroundApp .sidebar-account .account-profile > span {
  color: #eee8dc;
}

:root[data-theme="dark"] #playgroundApp .chat-empty,
:root[data-theme="dark"] #playgroundApp .sidebar-empty,
:root[data-theme="dark"] #playgroundApp .sidebar-projects-label {
  color: #b9b0a4;
}

:root[data-theme="dark"] #playgroundApp .sidebar-icon-button.compact {
  color: #d8d0c4;
}

:root[data-theme="dark"] #playgroundApp .sidebar-icon-button.compact:hover,
:root[data-theme="dark"] #playgroundApp .sidebar-icon-button.compact:focus-visible {
  border-color: rgba(238, 232, 220, 0.24);
  background: #302b25;
  color: #ffffff;
}

:root[data-theme="dark"] #playgroundApp .project-section.active > .project-row {
  background: #32463d;
}

:root[data-theme="dark"] #playgroundApp .chat-row.active {
  background: #355448;
}

:root[data-theme="dark"] #playgroundApp .project-star-badge,
:root[data-theme="dark"] #playgroundApp .topbar-project-title.starred::before {
  color: #f7c96b;
}

:root[data-theme="dark"] #playgroundApp .sidebar-account .account-menu-panel {
  border-color: #564d44;
  background: #211f1d;
}

:root[data-theme="dark"] #playgroundApp .account-menu-item:hover,
:root[data-theme="dark"] #playgroundApp .account-menu-item:focus-visible {
  background: #302b25;
  color: #ffffff;
}

:root[data-theme="dark"] .message.user .bubble {
  border-color: rgba(143, 185, 223, 0.34);
  background: #202a34;
}

:root[data-theme="dark"] .message.assistant .bubble {
  border-color: rgba(139, 196, 173, 0.28);
  background: #1c231f;
}

:root[data-theme="dark"] #prompt,
:root[data-theme="dark"] .github-import input {
  background: #181716;
}

@media (max-width: 900px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    background: #fbfaf6;
  }

  .workspace-sidebar {
    max-height: 30vh;
    border-right: 0;
    border-bottom: 1px solid #d9ded9;
  }

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 11px 14px;
  }

  .account-box {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .account-profile {
    max-width: 100%;
  }

  .messages {
    padding: 18px 12px 34px;
  }

  .message,
  .message.user {
    grid-template-columns: 30px minmax(0, 1fr);
    max-width: 100%;
    margin-left: 0;
  }

  .message.user .speaker,
  .message.user .bubble {
    grid-column: auto;
    grid-row: auto;
  }

  .composer {
    width: calc(100% - 20px);
    margin-bottom: 10px;
    grid-template-columns: 1fr;
  }

  .composer-actions {
    grid-column: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    justify-content: stretch;
  }

  .composer-actions button {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
  }

  .github-import {
    grid-template-columns: 1fr;
  }
}

/* TanakaSun Pro public landing refresh. */
.marketing-page {
  --lp-bg: #f5f7f4;
  --lp-surface: #ffffff;
  --lp-ink: #171817;
  --lp-muted: #606862;
  --lp-line: #d8ded8;
  --lp-copper: #b4552c;
  --lp-copper-dark: #7a321d;
  --lp-teal: #1f766b;
  --lp-blue: #244f8f;
  --lp-charcoal: #151715;
  --lp-soft: #edf2ee;
  min-height: 100vh;
  background: var(--lp-bg);
  color: var(--lp-ink);
}

.marketing-page a {
  color: inherit;
  text-decoration: none;
}

.marketing-page .site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: none;
  padding: 16px max(18px, calc((100vw - 1220px) / 2));
  border-bottom: 1px solid rgba(216, 222, 216, 0.9);
  background: rgba(245, 247, 244, 0.94);
  backdrop-filter: blur(14px);
}

.marketing-page .site-brand {
  text-decoration: none;
}

.marketing-page .site-header .brand-mark {
  width: 48px;
  height: 48px;
}

.marketing-page .site-brand-title {
  color: var(--lp-ink);
  font-size: 22px;
  font-weight: 700;
}

.marketing-page .site-brand-mode {
  color: var(--lp-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.marketing-page .site-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.marketing-page .nav-link,
.marketing-page .nav-cta,
.marketing-page .primary-action,
.marketing-page .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.marketing-page .nav-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--lp-muted);
}

.marketing-page .nav-link:hover,
.marketing-page .nav-link:focus-visible {
  border-color: var(--lp-line);
  background: var(--lp-surface);
  color: var(--lp-ink);
}

.marketing-page .nav-link-active,
.marketing-page .nav-link-active:hover,
.marketing-page .nav-link-active:focus-visible {
  border-color: rgba(180, 85, 44, 0.28);
  background: #fff9f4;
  color: var(--lp-ink);
  box-shadow: inset 0 0 0 1px rgba(180, 85, 44, 0.08);
}

.marketing-page .nav-cta,
.marketing-page .primary-action {
  border: 1px solid var(--lp-copper);
  background: var(--lp-copper);
  color: #fff;
}

.marketing-page .secondary-action {
  border: 1px solid var(--lp-line);
  background: var(--lp-surface);
  color: var(--lp-ink);
}

.marketing-page .hero,
.marketing-page .crucible-section,
.marketing-page .proof-section,
.marketing-page .repro-section,
.marketing-page .product-section,
.marketing-page .model-section,
.marketing-page .cta-section {
  max-width: none;
  margin: 0;
  padding-right: max(18px, calc((100vw - 1220px) / 2));
  padding-left: max(18px, calc((100vw - 1220px) / 2));
}

.marketing-page .hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 48px;
  align-items: center;
  min-height: 690px;
  padding-top: 74px;
  padding-bottom: 82px;
  background: var(--lp-charcoal);
  color: #f8faf7;
}

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

.marketing-page .eyebrow {
  margin: 0 0 14px;
  color: var(--lp-copper);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: none;
}

.marketing-page .hero .eyebrow {
  color: #f0b071;
}

.marketing-page .hero h1 {
  max-width: 860px;
  margin: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 70px;
  line-height: 1.02;
  letter-spacing: 0;
}

html[lang="en"] .marketing-page .hero h1 {
  max-width: 920px;
  font-size: 64px;
  line-height: 1.14;
}

.marketing-page .hero-title-line {
  display: block;
}

.marketing-page .hero-title-mobile {
  display: none;
}

.marketing-page .hero-lead {
  max-width: 800px;
  margin: 24px 0 0;
  color: #d8ded8;
  font-size: 20px;
  line-height: 1.82;
}

.marketing-page .hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  margin-top: 32px;
}

.marketing-page .hero-score {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(240, 176, 113, 0.42);
  border-radius: 8px;
  background: #20231f;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.marketing-page .score-kicker,
.marketing-page .score-claim {
  color: #cbd5cc;
  font-size: 14px;
  font-weight: 820;
}

.marketing-page .score-main {
  display: grid;
  gap: 0;
}

.marketing-page .score-main span {
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 58px;
  line-height: 0.98;
}

.marketing-page .score-main small {
  color: #f0b071;
  font-size: 15px;
  font-weight: 850;
}

.marketing-page .score-bars {
  position: relative;
  height: 18px;
  border-radius: 8px;
  background: #343a35;
  overflow: hidden;
}

.marketing-page .score-bars-fill {
  position: absolute;
  left: 0;
  height: 9px;
  border-radius: 8px;
}

.marketing-page .score-bars-fill-primary {
  top: 0;
  background: #f0b071;
}

.marketing-page .score-bars-fill-reference {
  bottom: 0;
  background: #5fb0a8;
}

.marketing-page .hero-score p {
  margin: 0;
  color: #d8ded8;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.6;
}

.marketing-page .hero-compare {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.marketing-page .hero-compare .comparison-row {
  grid-template-columns: minmax(150px, 0.72fr) minmax(180px, 1.12fr) 52px;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
}

.marketing-page .hero-compare .comparison-row-primary {
  background: transparent;
}

.marketing-page .hero-compare .comparison-row-primary div:first-child strong {
  color: #f0b071;
}

.marketing-page .hero-compare .comparison-row div:first-child {
  gap: 1px;
}

.marketing-page .hero-compare .comparison-row strong {
  color: #f5f8f4;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.marketing-page .hero-compare .comparison-row > strong {
  color: #fff;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 12px;
  font-weight: 850;
  overflow: visible;
}

.marketing-page .hero-compare .comparison-row span {
  color: #9fa99f;
  font-size: 10px;
}

.marketing-page .hero-compare .comparison-track {
  height: 7px;
  background: #343a35;
}

.marketing-page .hero-compare .comparison-track span {
  background: #5fb0a8;
}

.marketing-page .hero-compare .comparison-row-primary .comparison-track span {
  background: #f0b071;
}

.marketing-page .crucible-section,
.marketing-page .proof-section,
.marketing-page .repro-section,
.marketing-page .product-section,
.marketing-page .model-section,
.marketing-page .cta-section {
  padding-top: 74px;
  padding-bottom: 76px;
}

.marketing-page .proof-section,
.marketing-page .model-section {
  background: #fff;
}

.marketing-page .repro-section {
  background: #edf2ee;
}

.marketing-page .section-heading {
  max-width: 820px;
  margin: 0 0 28px;
}

.marketing-page .section-heading h2,
.marketing-page .cta-section h2 {
  margin: 0;
  color: var(--lp-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  line-height: 1.12;
  letter-spacing: 0;
}

.marketing-page .section-heading p:not(.eyebrow),
.marketing-page .cta-section p {
  margin: 14px 0 0;
  color: var(--lp-muted);
  font-size: 17px;
  line-height: 1.74;
}

.marketing-page .section-text-link {
  display: inline-flex;
  width: fit-content;
  margin-top: 12px;
  color: var(--lp-blue);
  font-size: 15px;
  font-weight: 850;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.marketing-page .section-text-link:hover,
.marketing-page .section-text-link:focus-visible {
  color: var(--lp-copper);
}

.marketing-page .process-grid,
.marketing-page .feature-grid,
.marketing-page .model-grid {
  display: grid;
  gap: 14px;
}

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

.marketing-page .feature-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.marketing-page .service-surface-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.marketing-page .service-surface-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: var(--lp-surface);
}

.marketing-page .service-surface-card-primary {
  border-color: rgba(180, 85, 44, 0.42);
  background: #fff9f4;
}

.marketing-page .service-surface-card span {
  color: var(--lp-copper);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.marketing-page .service-surface-card h3 {
  margin: 0;
  color: var(--lp-ink);
  font-size: 23px;
  line-height: 1.22;
}

.marketing-page .service-surface-card p {
  margin: 0;
  color: var(--lp-muted);
  font-size: 15px;
  line-height: 1.72;
}

.marketing-page .service-surface-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.1em;
}

.marketing-page .service-surface-card li {
  color: var(--lp-ink);
  font-size: 14px;
  line-height: 1.58;
}

.marketing-page .service-card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 44px;
  margin-top: 4px;
  padding: 0 16px;
  border: 1px solid var(--lp-copper);
  border-radius: 8px;
  background: var(--lp-copper);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  text-decoration: none;
}

.marketing-page .service-card-link:hover,
.marketing-page .service-card-link:focus-visible {
  border-color: var(--lp-copper-dark);
  background: var(--lp-copper-dark);
  color: #fff;
}

.marketing-page .model-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.8fr);
}

.marketing-page .process-grid article,
.marketing-page .feature-grid article,
.marketing-page .model-card,
.marketing-page .repro-panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: var(--lp-surface);
}

.marketing-page .process-grid article span,
.marketing-page .model-label,
.marketing-page .status-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 8px;
  background: #e7f2ef;
  color: var(--lp-teal);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.marketing-page .process-grid h3,
.marketing-page .feature-grid h3,
.marketing-page .model-card h3 {
  margin: 16px 0 8px;
  color: var(--lp-ink);
  font-size: 21px;
  line-height: 1.25;
}

.marketing-page .process-grid p,
.marketing-page .feature-grid p,
.marketing-page .model-card p,
.marketing-page .repro-panel p {
  margin: 0;
  color: var(--lp-muted);
  font-size: 15px;
  line-height: 1.72;
}

.marketing-page .comparison-board {
  display: grid;
  gap: 12px;
  max-width: 980px;
}

.marketing-page .comparison-row {
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #f8faf8;
}

.marketing-page .comparison-row-primary {
  border-color: rgba(180, 85, 44, 0.38);
  background: #fff9f4;
}

.marketing-page .comparison-row-primary div:first-child strong {
  color: var(--lp-copper);
}

.marketing-page .comparison-row div:first-child {
  display: grid;
  gap: 4px;
}

.marketing-page .comparison-row strong {
  color: var(--lp-ink);
  font-size: 18px;
  line-height: 1.25;
}

.marketing-page .comparison-row > strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  text-align: right;
}

.marketing-page .comparison-row span {
  color: var(--lp-muted);
  font-size: 13px;
  font-weight: 760;
}

.marketing-page .comparison-track {
  height: 18px;
  border-radius: 8px;
  background: #e2e8e3;
  overflow: hidden;
}

.marketing-page .comparison-track span {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: var(--lp-teal);
}

.marketing-page .comparison-row-primary .comparison-track span {
  background: var(--lp-copper);
}

.marketing-page .proof-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 980px;
}

.marketing-page .proof-summary-card {
  display: grid;
  gap: 8px;
  min-height: 148px;
  padding: 20px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #f8faf8;
}

.marketing-page .proof-summary-card-primary {
  border-color: rgba(180, 85, 44, 0.38);
  background: #fff9f4;
}

.marketing-page .proof-summary-card span {
  color: var(--lp-muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.marketing-page .proof-summary-card strong {
  color: var(--lp-ink);
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 24px;
  line-height: 1.18;
}

.marketing-page .proof-summary-card-primary strong {
  color: var(--lp-copper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  line-height: 1;
}

.marketing-page .proof-summary-card p {
  margin: 0;
  color: var(--lp-muted);
  font-size: 14px;
  line-height: 1.55;
}

.marketing-page .source-note {
  max-width: 980px;
  margin: 16px 0 0;
  color: var(--lp-muted);
  font-size: 13px;
  line-height: 1.65;
}

.marketing-page .source-note a {
  color: var(--lp-blue);
  font-weight: 820;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.marketing-page .repro-panel {
  display: grid;
  gap: 10px;
  max-width: 760px;
  border-color: rgba(31, 118, 107, 0.35);
}

.marketing-page .repro-panel strong {
  color: var(--lp-ink);
  font-size: 24px;
  line-height: 1.2;
}

.marketing-page .model-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.marketing-page .model-card-primary {
  border-color: rgba(180, 85, 44, 0.42);
  background: #fff9f4;
}

.marketing-page .model-card-muted {
  background: #f8faf8;
}

.marketing-page .model-card h3 {
  margin: 0;
}

.marketing-page .model-card strong {
  color: var(--lp-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  line-height: 1.12;
}

.marketing-page .model-card .primary-action,
.marketing-page .model-card .secondary-action {
  width: fit-content;
  margin-top: 4px;
}

.marketing-page .model-versions {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.marketing-page .model-versions span {
  color: var(--lp-muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.marketing-page .model-versions ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--lp-ink);
  font-size: 14px;
  font-weight: 760;
  line-height: 1.45;
}

.marketing-page .model-waiting {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 40px;
  margin-top: 4px;
  padding: 0 14px;
  border: 1px solid var(--lp-line);
  border-radius: 8px;
  background: #edf2ee;
  color: var(--lp-muted);
  font-size: 14px;
  font-weight: 850;
}

.marketing-page .cta-section {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(420px, 1fr);
  align-items: center;
  gap: 48px;
  border-top: 1px solid var(--lp-line);
  background: var(--lp-charcoal);
  text-align: left;
  overflow: hidden;
}

.marketing-page .cta-copy {
  display: grid;
  justify-items: start;
  gap: 18px;
}

.marketing-page .cta-section .eyebrow {
  margin: 0;
  color: #f0b071;
}

.marketing-page .cta-section h2 {
  margin: 0;
  color: #fff;
  font-size: 62px;
  line-height: 1.04;
}

.marketing-page .cta-section p {
  max-width: 680px;
  margin: 0;
  color: #d8ded8;
  font-size: 18px;
  line-height: 1.85;
}

.marketing-page .cta-section .hero-actions {
  justify-content: flex-start;
  margin-top: 10px;
}

.marketing-page .cta-art {
  margin: 0;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 430px;
}

.marketing-page .cta-art img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .marketing-page {
  --lp-bg: #111312;
  --lp-surface: #1c211f;
  --lp-ink: #f2f5f2;
  --lp-muted: #b9c2ba;
  --lp-line: #343c37;
  --lp-soft: #161b18;
  background: var(--lp-bg);
}

:root[data-theme="dark"] .marketing-page .site-header,
:root[data-theme="dark"] .marketing-page .proof-section,
:root[data-theme="dark"] .marketing-page .model-section,
:root[data-theme="dark"] .marketing-page .comparison-row {
  background: #111312;
}

:root[data-theme="dark"] .marketing-page .comparison-row-primary,
:root[data-theme="dark"] .marketing-page .model-card-primary {
  background: #201812;
}

:root[data-theme="dark"] .marketing-page .repro-section {
  background: #161b18;
}

:root[data-theme="dark"] .marketing-page .secondary-action {
  background: #1c211f;
  color: var(--lp-ink);
}

@media (max-width: 900px) {
  .marketing-page .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .marketing-page .site-nav {
    justify-content: flex-start;
  }

  .marketing-page .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 46px;
    padding-bottom: 52px;
  }

  .marketing-page .hero h1 {
    font-size: 50px;
  }

  html[lang="en"] .marketing-page .hero h1 {
    font-size: 48px;
    line-height: 1.14;
  }

  .marketing-page .hero-lead {
    font-size: 17px;
  }

  .marketing-page .hero-score {
    padding: 22px;
  }

  .marketing-page .score-main span {
    font-size: 68px;
  }

  .marketing-page .process-grid,
  .marketing-page .feature-grid,
  .marketing-page .service-surface-grid,
  .marketing-page .model-grid {
    grid-template-columns: 1fr;
  }

  .marketing-page .comparison-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .marketing-page .cta-section {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .marketing-page .cta-art {
    min-height: 0;
  }

  .marketing-page .proof-summary-grid {
    grid-template-columns: 1fr;
  }

  .marketing-page .hero-compare .comparison-row {
    grid-template-columns: minmax(0, 1fr) minmax(78px, 1fr) 48px;
    gap: 8px;
  }

  .marketing-page .comparison-row > strong {
    text-align: left;
  }

  .marketing-page .hero-compare .comparison-row > strong {
    text-align: right;
  }

  .marketing-page .section-heading h2,
  .marketing-page .cta-section h2 {
    font-size: 36px;
  }
}

@media (max-width: 560px) {
  .marketing-page .site-nav {
    width: 100%;
  }

  .marketing-page .nav-link,
  .marketing-page .nav-cta,
  .marketing-page .language-switcher-button {
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .marketing-page .language-switcher-button {
    min-width: 100px;
    padding: 0 10px;
  }

  .marketing-page .language-flag {
    width: 16px;
    height: 11px;
  }

  .marketing-page .hero h1 {
    font-size: 43px;
  }

  html[lang="en"] .marketing-page .hero h1 {
    font-size: 36px;
  }

  .marketing-page .hero-title-desktop {
    display: none;
  }

  .marketing-page .hero-title-mobile {
    display: block;
  }

  .marketing-page .hero-actions {
    width: 100%;
  }

  .marketing-page .hero-actions .primary-action,
  .marketing-page .hero-actions .secondary-action {
    width: 100%;
  }

  .marketing-page .crucible-section,
  .marketing-page .proof-section,
  .marketing-page .repro-section,
  .marketing-page .product-section,
  .marketing-page .model-section,
  .marketing-page .cta-section {
    padding-top: 48px;
    padding-bottom: 50px;
  }

  .marketing-page .comparison-row > strong,
  .marketing-page .model-card strong {
    font-size: 28px;
  }
}

@media (max-width: 420px) {
  .marketing-page .hero h1 {
    font-size: 37px;
  }

  html[lang="en"] .marketing-page .hero h1 {
    font-size: 30px;
  }
}

.site-footer {
  padding: 0;
  border-top: 1px solid rgba(240, 176, 113, 0.22);
  background:
    linear-gradient(135deg, rgba(31, 118, 107, 0.12), transparent 38%),
    #0f1110;
  color: #d8ded8;
}

.site-footer .footer-inner {
  display: grid;
  grid-template-columns: minmax(300px, 1.35fr) repeat(3, minmax(150px, 0.72fr));
  gap: 34px;
  padding: 42px max(18px, calc((100vw - 1220px) / 2)) 34px;
}

.site-footer .footer-brand,
.site-footer .footer-group {
  display: grid;
  align-content: start;
  gap: 12px;
}

.site-footer .footer-brand-head {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.site-footer .footer-brand-head img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 1px solid rgba(240, 176, 113, 0.32);
  border-radius: 10px;
  object-fit: contain;
  background: #fff8ea;
}

.site-footer strong {
  color: #fff;
  font-size: 20px;
  line-height: 1.1;
}

.site-footer span {
  color: #aeb8af;
  font-size: 13px;
}

.site-footer .footer-brand-head > div {
  display: grid;
  gap: 2px;
}

.site-footer .footer-brand-sub {
  color: #aeb8af;
  font-size: 12px;
  font-weight: 760;
}

.site-footer .footer-brand p {
  max-width: 360px;
  margin: 4px 0 0;
  color: #c8d2ca;
  font-size: 14px;
  line-height: 1.72;
}

.site-footer .footer-operator {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(240, 176, 113, 0.22);
  border-radius: 999px;
  background: rgba(255, 249, 244, 0.05);
  color: #eef4ef;
  font-size: 12px;
  font-weight: 760;
}

.site-footer .footer-group > span {
  color: #f0b071;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer a,
.legal-page .site-footer a {
  display: inline-flex;
  width: fit-content;
  color: #dce5de;
  font-size: 14px;
  font-weight: 760;
  line-height: 1.45;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible,
.legal-page .site-footer a:hover,
.legal-page .site-footer a:focus-visible {
  color: #f0b071;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer .footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px max(18px, calc((100vw - 1220px) / 2)) 18px;
  border-top: 1px solid rgba(216, 222, 216, 0.12);
  color: #8f9a91;
}

.site-footer .footer-bottom span {
  color: #8f9a91;
  font-size: 12px;
  line-height: 1.5;
}

.legal-page {
  min-height: 100vh;
  background: #f5f7f4;
  color: #171817;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.legal-page a {
  color: #244f8f;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.marketing-subpage {
  --lp-bg: #f5f7f4;
  --lp-surface: #ffffff;
  --lp-ink: #171817;
  --lp-muted: #606862;
  --lp-line: #d8ded8;
  --lp-copper: #b4552c;
  --lp-copper-dark: #7a321d;
}

.marketing-subpage .site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: none;
  padding: 16px max(18px, calc((100vw - 1220px) / 2));
  border-bottom: 1px solid rgba(216, 222, 216, 0.9);
  background: rgba(245, 247, 244, 0.94);
  backdrop-filter: blur(14px);
}

.marketing-subpage .site-brand {
  color: var(--lp-ink);
  text-decoration: none;
}

.marketing-subpage .site-header .brand-mark {
  width: 48px;
  height: 48px;
}

.marketing-subpage .site-brand-title {
  color: var(--lp-ink);
  font-size: 22px;
  font-weight: 700;
}

.marketing-subpage .site-brand-mode {
  color: var(--lp-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.marketing-subpage .site-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.marketing-subpage .nav-link,
.marketing-subpage .nav-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.marketing-subpage .nav-link {
  border: 1px solid transparent;
  background: transparent;
  color: var(--lp-muted);
}

.marketing-subpage .nav-link:hover,
.marketing-subpage .nav-link:focus-visible {
  border-color: var(--lp-line);
  background: var(--lp-surface);
  color: var(--lp-ink);
  text-decoration: none;
}

.marketing-subpage .nav-link-active,
.marketing-subpage .nav-link-active:hover,
.marketing-subpage .nav-link-active:focus-visible {
  border-color: rgba(180, 85, 44, 0.28);
  background: #fff9f4;
  color: var(--lp-ink);
  box-shadow: inset 0 0 0 1px rgba(180, 85, 44, 0.08);
  text-decoration: none;
}

.marketing-subpage .nav-cta {
  border: 1px solid var(--lp-copper);
  background: var(--lp-copper);
  color: #fff;
}

.marketing-subpage .nav-cta:hover,
.marketing-subpage .nav-cta:focus-visible {
  border-color: var(--lp-copper-dark);
  background: var(--lp-copper-dark);
  color: #fff;
  text-decoration: none;
}

.marketing-subpage .primary-action,
.marketing-subpage .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}

.marketing-subpage .primary-action {
  border: 1px solid var(--lp-copper);
  background: var(--lp-copper);
  color: #fff;
}

.marketing-subpage .primary-action:hover,
.marketing-subpage .primary-action:focus-visible {
  border-color: var(--lp-copper-dark);
  background: var(--lp-copper-dark);
  color: #fff;
  text-decoration: none;
}

.marketing-subpage .secondary-action {
  border: 1px solid var(--lp-line);
  background: var(--lp-surface);
  color: var(--lp-ink);
}

.marketing-subpage .secondary-action:hover,
.marketing-subpage .secondary-action:focus-visible {
  border-color: rgba(180, 85, 44, 0.42);
  color: var(--lp-copper);
  text-decoration: none;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px max(18px, calc((100vw - 1040px) / 2));
  border-bottom: 1px solid #d8ded8;
  background: rgba(245, 247, 244, 0.96);
}

.legal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #171817;
  font-weight: 850;
  text-decoration: none;
}

.legal-brand img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.legal-header nav,
.legal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.legal-header nav a,
.legal-footer a {
  color: #606862;
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
}

.legal-header nav a:hover,
.legal-header nav a:focus-visible,
.legal-footer a:hover,
.legal-footer a:focus-visible {
  color: #b4552c;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-shell {
  width: min(1040px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.legal-shell h1 {
  max-width: 920px;
  margin: 0;
  color: #171817;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 52px;
  line-height: 1.08;
}

.legal-updated,
.legal-shell > p {
  max-width: 900px;
}

.legal-updated {
  margin: 10px 0 22px;
  color: #606862;
  font-size: 13px;
  font-weight: 760;
}

.legal-shell p,
.legal-shell li,
.legal-table td,
.legal-table th {
  color: #3e4741;
  font-size: 16px;
  line-height: 1.78;
}

.legal-shell section {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid #d8ded8;
}

.legal-shell h2 {
  margin: 0 0 12px;
  color: #171817;
  font-size: 24px;
  line-height: 1.25;
}

.legal-shell h3 {
  margin: 8px 0;
  color: #171817;
  font-size: 20px;
  line-height: 1.25;
}

.legal-shell ul {
  margin: 0;
  padding-left: 1.2em;
}

.legal-notice {
  padding: 14px 16px;
  border: 1px solid rgba(180, 85, 44, 0.34);
  border-radius: 8px;
  background: #fff9f4;
}

.legal-table {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
  border: 1px solid #d8ded8;
  background: #fff;
}

.legal-table th,
.legal-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #d8ded8;
  text-align: left;
  vertical-align: top;
}

.legal-table th {
  width: 230px;
  background: #edf2ee;
  color: #171817;
  font-weight: 850;
}

.legal-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.legal-card-grid article,
.contact-panel,
.faq-list article {
  padding: 18px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.pricing-shell {
  width: min(1120px, calc(100vw - 36px));
}

.pricing-lead {
  margin: 18px 0 0;
  color: #3e4741;
  font-size: 18px;
  line-height: 1.85;
}

.pricing-flow,
.pricing-plan-grid,
.pricing-rule-grid {
  display: grid;
  gap: 14px;
}

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

.pricing-flow article,
.pricing-rule-grid article {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.pricing-flow span,
.pricing-rule-grid span,
.pricing-kicker {
  color: #b4552c;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.pricing-flow strong {
  color: #171817;
  font-size: 18px;
  line-height: 1.3;
}

.pricing-flow p,
.pricing-rule-grid p,
.pricing-card p,
.pricing-card li {
  margin: 0;
}

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

.pricing-card {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  padding: 22px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.pricing-card-primary {
  border-color: rgba(180, 85, 44, 0.42);
  background: #fff9f4;
  box-shadow: 0 20px 44px rgba(59, 42, 29, 0.08);
}

.pricing-shell .pricing-price {
  display: grid;
  gap: 3px;
  color: #171817;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 760;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.pricing-shell .pricing-price span {
  color: #606862;
  font-family: Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 13px;
  font-weight: 800;
}

.pricing-rule-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.pricing-footnote {
  margin-top: 16px;
  color: #606862;
  font-size: 14px;
}

.pricing-rule-list {
  display: grid;
  gap: 9px;
}

.pricing-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.pricing-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
  color: #171817;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.pricing-links a:hover,
.pricing-links a:focus-visible {
  border-color: rgba(180, 85, 44, 0.42);
  color: #b4552c;
  text-decoration: none;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.contact-panel-primary {
  width: min(920px, 100%);
  padding: 22px;
}

.contact-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

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

.contact-form label {
  display: grid;
  gap: 7px;
  color: #303833;
  font-size: 13px;
  font-weight: 850;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  background: #fffdfa;
  color: #171817;
  font: inherit;
  font-size: 15px;
}

.contact-form input,
.contact-form select {
  height: 46px;
  padding: 0 12px;
}

.contact-form textarea {
  min-height: 180px;
  padding: 12px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: 3px solid rgba(180, 85, 44, 0.16);
  border-color: #b4552c;
}

.contact-submit-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 180px;
  height: 46px;
  padding: 0 18px;
  border: 1px solid #b4552c;
  border-radius: 8px;
  background: #b4552c;
  color: #fff;
  font-size: 15px;
  font-weight: 850;
}

.contact-submit-button:hover,
.contact-submit-button:focus-visible {
  border-color: #7a321d;
  background: #7a321d;
}

.contact-submit-button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.contact-form-message {
  min-height: 24px;
  margin: 0;
  color: #1f766b;
  font-size: 13px;
  font-weight: 780;
}

.legal-card-grid span {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 8px;
  background: #e7f2ef;
  color: #1f766b;
  font-size: 12px;
  font-weight: 850;
}

.legal-mail-link {
  font-size: 22px;
  font-weight: 850;
}

.faq-list {
  display: grid;
  gap: 14px;
}

.legal-footer {
  justify-content: center;
  padding: 24px 18px 36px;
  border-top: 1px solid #d8ded8;
  background: #fff;
}

.benchmark-page {
  background: #f2f4f1;
}

.benchmark-shell h1 {
  max-width: 980px;
}

.benchmark-lead {
  max-width: 980px;
}

.benchmark-overview {
  margin-top: 34px;
  padding-top: 0;
  border-top: 0;
}

.benchmark-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.benchmark-overview-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 20px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.benchmark-overview-card-primary {
  border-color: rgba(180, 85, 44, 0.4);
  background: #fff8f2;
}

.benchmark-overview-card span,
.benchmark-registry-table td span {
  color: #606862;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.benchmark-overview-card strong {
  color: #171817;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 1;
}

.benchmark-overview-card-primary strong {
  color: #b4552c;
}

.benchmark-overview-card p {
  margin: 0;
  color: #606862;
  font-size: 14px;
  line-height: 1.55;
}

.benchmark-table-wrap {
  overflow-x: auto;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.benchmark-registry-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.benchmark-registry-table th:nth-child(5),
.benchmark-registry-table td:nth-child(5) {
  min-width: 190px;
  text-align: center;
}

.benchmark-registry-table th,
.benchmark-registry-table td {
  padding: 16px;
  border-bottom: 1px solid #e3e7e2;
  text-align: left;
  vertical-align: middle;
}

.benchmark-registry-table th {
  color: #606862;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: center;
  background: #f8faf8;
}

.benchmark-registry-table th:nth-child(3),
.benchmark-registry-table td:nth-child(3) {
  min-width: 138px;
  text-align: center;
}

.benchmark-registry-table th:nth-child(4),
.benchmark-registry-table td:nth-child(4) {
  min-width: 156px;
  text-align: center;
  white-space: nowrap;
}

.benchmark-registry-table td {
  color: #3e4741;
  font-size: 14px;
  line-height: 1.55;
}

.benchmark-registry-table td strong {
  display: block;
  color: #171817;
  font-size: 16px;
  line-height: 1.35;
}

.benchmark-registry-table td:nth-child(4) strong {
  display: inline;
  color: #3e4741;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.benchmark-registry-table tr:first-child td:nth-child(4) strong {
  color: #171817;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.benchmark-name-link {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.benchmark-name-link:hover,
.benchmark-name-link:focus-visible {
  color: #244f8f;
}

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

.benchmark-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.benchmark-status-reported {
  color: #164623;
  background: #dff2e3;
}

.benchmark-status-planned {
  color: #5b5248;
  background: #eee8df;
}

.benchmark-status-progress {
  color: #70410b;
  background: #f7e4c4;
}

.benchmark-status-internal {
  color: #244463;
  background: #dfeefa;
}

.benchmark-evidence-note {
  display: block;
  margin-top: 4px;
  color: #707872;
  font-size: 12px;
  line-height: 1.45;
}

.benchmark-detail-grid {
  display: grid;
  gap: 16px;
}

.benchmark-detail-card {
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.benchmark-detail-card h3 {
  margin: 0;
  color: #171817;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1.15;
}

.benchmark-detail-card dl,
.benchmark-method-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.benchmark-method-note {
  padding: 14px 16px;
  border: 1px solid rgba(36, 79, 143, 0.22);
  border-radius: 8px;
  color: #244f8f;
  background: #f4f7fb;
  font-weight: 760;
}

.benchmark-detail-card dl div,
.benchmark-method-list div {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  padding-top: 10px;
  border-top: 1px solid #e3e7e2;
}

.benchmark-detail-card dt,
.benchmark-method-list dt {
  color: #606862;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.benchmark-detail-card dd,
.benchmark-method-list dd {
  margin: 0;
  color: #3e4741;
  font-size: 15px;
  line-height: 1.7;
}

.benchmark-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.benchmark-source-links a {
  font-size: 13px;
  font-weight: 850;
}

.benchmark-row-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(180, 85, 44, 0.34);
  border-radius: 999px;
  color: #8d3f1f;
  background: #fff8f2;
  font-size: 13px;
  font-weight: 880;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.benchmark-registry-table .benchmark-row-link {
  justify-content: center;
  min-width: 154px;
}

.benchmark-detail-card .benchmark-row-link {
  margin-top: 10px;
}

.benchmark-row-link:hover,
.benchmark-row-link:focus-visible {
  border-color: #b4552c;
  color: #6f3e2d;
  background: #fff2e7;
}

.benchmark-queue {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.benchmark-queue-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d8ded8;
  border-radius: 999px;
  color: #3e4741;
  background: #fff;
  font-size: 13px;
  font-weight: 850;
}

.gpqa-score-page {
  background: #f2f4f1;
}

.gpqa-shell {
  width: min(1360px, calc(100vw - 36px));
}

.gpqa-shell h1 {
  max-width: 1040px;
}

.gpqa-lead {
  max-width: 1040px;
}

.gpqa-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.gpqa-summary article {
  display: grid;
  gap: 8px;
  min-height: 136px;
  padding: 20px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.gpqa-summary article:first-child {
  border-color: rgba(180, 85, 44, 0.4);
  background: #fff8f2;
}

.gpqa-summary span,
.gpqa-source,
.gpqa-rank {
  color: #606862;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gpqa-summary strong {
  color: #171817;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 1;
}

.gpqa-summary article:first-child strong {
  color: #b4552c;
}

.gpqa-summary p {
  margin: 0;
  color: #606862;
  font-size: 14px;
  line-height: 1.55;
}

.gpqa-note {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(180, 85, 44, 0.24);
  border-radius: 8px;
  background: #fffaf5;
}

.gpqa-note p {
  margin: 0;
}

.gpqa-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.gpqa-source-links a {
  font-size: 13px;
  font-weight: 850;
}

.gpqa-section-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.gpqa-section-head h2 {
  margin-bottom: 0;
}

.gpqa-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  color: #3e4741;
  background: #fff;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.gpqa-axis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 8px min(390px, 32vw);
  color: #606862;
  font-size: 12px;
  font-weight: 850;
}

.gpqa-axis span:nth-child(2) {
  text-align: center;
}

.gpqa-axis span:last-child {
  text-align: right;
}

.gpqa-chart {
  display: grid;
  gap: 8px;
}

.gpqa-row {
  display: grid;
  grid-template-columns: 46px minmax(220px, 320px) minmax(220px, 1fr) 86px minmax(160px, 240px);
  gap: 14px;
  align-items: center;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.gpqa-row-primary {
  border-color: rgba(180, 85, 44, 0.58);
  background: #fff8f2;
}

.gpqa-row-primary .gpqa-rank,
.gpqa-row-primary .gpqa-model strong,
.gpqa-row-primary .gpqa-score {
  color: #b4552c;
}

.gpqa-model {
  display: grid;
  gap: 3px;
}

.gpqa-model strong {
  color: #171817;
  font-size: 15px;
  line-height: 1.35;
}

.gpqa-model span {
  color: #606862;
  font-size: 12px;
  line-height: 1.35;
}

.gpqa-bar-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #dbe1da;
  overflow: hidden;
}

.gpqa-bar-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: #69bcb5;
}

.gpqa-row-primary .gpqa-bar-fill {
  background: #f2b06f;
}

.gpqa-score {
  color: #171817;
  font-size: 15px;
  font-weight: 900;
  text-align: right;
}

.gpqa-source {
  letter-spacing: 0.02em;
  text-transform: none;
}

.gpqa-table-wrap {
  overflow-x: auto;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.gpqa-score-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
}

.gpqa-score-table th,
.gpqa-score-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #e3e7e2;
  text-align: left;
  vertical-align: top;
}

.gpqa-score-table th {
  color: #606862;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #f8faf8;
}

.gpqa-score-table td {
  color: #3e4741;
  font-size: 14px;
  line-height: 1.55;
}

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

.gpqa-score-table td strong {
  display: block;
  color: #171817;
}

.gpqa-score-table td span {
  display: block;
  margin-top: 2px;
  color: #606862;
  font-size: 12px;
}

.hle-disclaimer {
  margin: 18px 0 4px;
  padding: 14px 18px;
  border: 1px solid rgba(180, 130, 44, 0.42);
  border-left: 4px solid #d29922;
  border-radius: 8px;
  background: #fdf8ee;
  color: #5a4a26;
  font-size: 13px;
  line-height: 1.7;
}

.hle-disclaimer strong {
  color: #8a6516;
}

.hle-row-panel {
  border-color: rgba(105, 188, 181, 0.55);
  background: #f3fbfa;
}

.hle-row-panel .gpqa-model span {
  color: #2f8079;
  font-weight: 700;
}

.hle-partial {
  color: #b06f16;
  font-weight: 700;
}

.hle-table-primary td {
  background: #fff8f2;
}

.hle-table-primary td strong {
  color: #b4552c;
}

.crucible-page {
  background: #f2f4f1;
}

.crucible-shell {
  width: min(1180px, calc(100vw - 36px));
}

.crucible-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  align-items: center;
  gap: 34px;
  padding: 28px 0 34px;
  border-top: 0;
}

.crucible-hero-copy {
  display: grid;
  gap: 18px;
}

.crucible-hero-copy h1 {
  max-width: 680px;
}

.crucible-hero-copy p {
  margin: 0;
  max-width: 680px;
  color: #3e4741;
  font-size: 18px;
  line-height: 1.85;
}

.crucible-hero-note {
  padding: 14px 16px;
  border-left: 4px solid #b4552c;
  background: #fff9f4;
  font-size: 15px !important;
  line-height: 1.72 !important;
}

.crucible-hero-media {
  margin: 0;
}

.crucible-hero-media img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(180, 85, 44, 0.28);
  border-radius: 8px;
  box-shadow: 0 28px 60px rgba(31, 39, 34, 0.18);
}

.crucible-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.crucible-card-grid,
.crucible-secret-grid,
.crucible-principle-grid {
  display: grid;
  gap: 14px;
}

.crucible-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
}

.crucible-card-grid article,
.crucible-secret-grid article,
.crucible-principle-grid article {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  padding: 20px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.crucible-card-grid article:first-child {
  border-color: rgba(180, 85, 44, 0.38);
  background: #fff9f4;
}

.crucible-card-grid span,
.crucible-principle-grid span {
  color: #b4552c;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.crucible-card-grid h3,
.crucible-secret-grid h3,
.crucible-principle-grid h3 {
  margin: 0;
}

.crucible-card-grid p,
.crucible-secret-grid p,
.crucible-principle-grid p {
  margin: 0;
  font-size: 15px;
  line-height: 1.72;
}

.crucible-pipeline {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: crucible-step;
}

.crucible-pipeline li {
  counter-increment: crucible-step;
  display: grid;
  grid-template-columns: 74px minmax(180px, 0.45fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.crucible-pipeline li::before {
  content: counter(crucible-step, decimal-leading-zero);
  color: #b4552c;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1;
}

.crucible-pipeline strong {
  color: #171817;
  font-size: 16px;
  line-height: 1.25;
}

.crucible-pipeline span {
  color: #3e4741;
  font-size: 15px;
  line-height: 1.65;
}

.crucible-secret-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px;
}

.crucible-secret-grid article {
  background: #101713;
  border-color: rgba(242, 177, 106, 0.26);
}

.crucible-secret-grid h3 {
  color: #fffdfa;
}

.crucible-secret-grid p {
  color: #d6ded8;
}

.crucible-compare-table-wrap {
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid #d8ded8;
  border-radius: 8px;
  background: #fff;
}

.crucible-compare-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

.crucible-compare-table th,
.crucible-compare-table td {
  padding: 16px;
  border-bottom: 1px solid #e3e7e2;
  text-align: left;
  vertical-align: top;
}

.crucible-compare-table thead th {
  color: #606862;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #f8faf8;
}

.crucible-compare-table tbody th {
  width: 160px;
  color: #171817;
  font-size: 15px;
  font-weight: 850;
}

.crucible-compare-table td {
  color: #3e4741;
  font-size: 15px;
  line-height: 1.7;
}

.crucible-compare-table tr:last-child th,
.crucible-compare-table tr:last-child td {
  border-bottom: 0;
}

.crucible-principle-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.crucible-bottom-cta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 28px;
  border: 1px solid rgba(180, 85, 44, 0.34);
  border-radius: 8px;
  background: #fff9f4;
}

.crucible-bottom-cta h2 {
  margin-bottom: 10px;
}

.crucible-bottom-cta p {
  margin: 0;
}

@media (max-width: 760px) {
  .developer-shell {
    width: min(100% - 24px, 1320px);
    padding-top: 20px;
  }

  .developer-header,
  .developer-section-head {
    display: grid;
  }

  .developer-header-actions {
    justify-content: flex-start;
  }

  .developer-summary,
  .developer-grid,
  .developer-key-form {
    grid-template-columns: 1fr;
  }

  .developer-summary strong {
    font-size: 22px;
  }

  .developer-auth-card {
    margin-top: 32px;
  }

  .developer-secret-panel {
    grid-template-columns: 1fr;
  }

  .developer-key-row {
    display: grid;
  }

  .developer-secret-modal {
    align-items: start;
    padding: 12px;
  }

  .developer-secret-panel {
    max-height: calc(100vh - 24px);
    padding: 18px;
  }

  .developer-secret-heading {
    display: grid;
  }

  .developer-secret-actions {
    grid-template-columns: 1fr;
  }

  .developer-usage-bar-head {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .developer-usage-bar-metrics {
    min-width: 0;
    text-align: left;
  }

  .developer-definition-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .legal-header,
  .marketing-subpage .site-header {
    grid-template-columns: 1fr;
    align-items: flex-start;
    flex-direction: column;
  }

  .legal-header nav,
  .marketing-subpage .site-nav {
    justify-content: flex-start;
  }

  .site-footer .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 32px;
    padding-bottom: 28px;
  }

  .site-footer .footer-bottom {
    flex-direction: column;
    gap: 6px;
  }

  .marketing-subpage .site-nav {
    width: 100%;
  }

  .marketing-subpage .nav-link,
  .marketing-subpage .nav-cta,
  .marketing-subpage .language-switcher-button {
    height: 40px;
    padding: 0 12px;
    font-size: 13px;
  }

  .marketing-subpage .language-switcher-button {
    min-width: 100px;
    padding: 0 10px;
  }

  .marketing-subpage .language-flag {
    width: 16px;
    height: 11px;
  }

  .legal-shell {
    padding-top: 38px;
  }

  .legal-shell h1 {
    font-size: 38px;
  }

  .legal-card-grid {
    grid-template-columns: 1fr;
  }

  .pricing-flow,
  .pricing-plan-grid,
  .pricing-rule-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card {
    padding: 18px;
  }

  .pricing-shell .pricing-price {
    font-size: 29px;
  }

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

  .benchmark-overview-grid {
    grid-template-columns: 1fr;
  }

  .gpqa-summary {
    grid-template-columns: 1fr;
  }

  .gpqa-section-head {
    display: grid;
    align-items: start;
  }

  .gpqa-axis {
    margin-left: 0;
  }

  .gpqa-row {
    grid-template-columns: 42px 1fr 76px;
    gap: 8px 12px;
  }

  .gpqa-bar-track {
    grid-column: 2 / -1;
  }

  .gpqa-source {
    grid-column: 2 / -1;
  }

  .crucible-hero,
  .crucible-bottom-cta {
    grid-template-columns: 1fr;
  }

  .crucible-hero {
    gap: 22px;
    padding-top: 10px;
  }

  .crucible-hero-media {
    order: -1;
  }

  .crucible-hero-copy p {
    font-size: 16px;
  }

  .crucible-card-grid,
  .crucible-secret-grid,
  .crucible-principle-grid {
    grid-template-columns: 1fr;
  }

  .crucible-pipeline li {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .benchmark-detail-card dl div,
  .benchmark-method-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .legal-table,
  .legal-table tbody,
  .legal-table tr,
  .legal-table th,
  .legal-table td {
    display: block;
    width: 100%;
  }

  .legal-table th {
    border-bottom: 0;
  }
}

@media (max-width: 900px) {
  body:has(#playgroundApp:not([hidden])) {
    overflow-x: hidden;
  }

  #playgroundApp.shell {
    --scrollbar-visual-gutter: 0px;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  #playgroundApp .composer {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 14px 10px 18px;
  }

  #playgroundApp .composer-disclaimer {
    width: calc(100% - 20px);
    bottom: 5px;
    font-size: 11px;
  }

  #playgroundApp .scroll-bottom-button {
    bottom: calc(28px + var(--composer-height));
    width: 40px;
    height: 40px;
  }

  #playgroundApp #prompt,
  #playgroundApp .github-import,
  #playgroundApp .attachment-tray,
  #playgroundApp .composer-actions,
  #playgroundApp .github-import input,
  #playgroundApp .github-import button {
    width: 100%;
    min-width: 0;
  }

  #playgroundApp .composer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }

  #playgroundApp .composer-actions button {
    width: 100%;
    min-width: 0;
    padding-right: 6px;
    padding-left: 6px;
  }

  #playgroundApp .composer-model-menu .composer-model-menu-item {
    width: 100%;
    height: auto;
    min-height: 52px;
    padding: 9px 38px 9px 12px;
    border-radius: 8px;
  }

  #playgroundApp .composer-model-wrap,
  #playgroundApp .composer-model-label {
    width: 100%;
    min-width: 0;
  }

  #playgroundApp .composer-model-label {
    justify-content: center;
  }

  #playgroundApp .composer-model-menu {
    right: 0;
    width: min(360px, calc(100vw - 36px));
  }

  #playgroundApp #sendButton {
    grid-column: 1 / -1;
  }
}
