:root {
  --ink: #132238;
  --muted: #647184;
  --line: #dde6ee;
  --surface: #ffffff;
  --surface-soft: #f6f9fb;
  --teal: #0ea6a6;
  --teal-dark: #087b82;
  --blue: #173b6d;
  --coral: #f06c64;
  --gold: #f2ba4c;
  --green: #2d9c68;
  --shadow: 0 18px 48px rgba(19, 34, 56, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(135deg, rgba(14, 166, 166, 0.12), rgba(240, 108, 100, 0.1) 48%, rgba(242, 186, 76, 0.14)),
    #f8fbfd;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.access-gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(14, 166, 166, 0.18), rgba(240, 108, 100, 0.1) 48%, rgba(242, 186, 76, 0.22)),
    #f8fbfd;
}

.access-gate.is-hidden {
  display: none;
}

.access-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(340px, 0.78fr);
  gap: 28px;
  align-items: center;
  width: min(100%, 1080px);
}

.access-intro {
  max-width: 650px;
}

.access-kicker {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.access-intro h1 {
  max-width: 720px;
  margin-bottom: 16px;
  color: var(--ink);
  font-size: clamp(2.3rem, 5vw, 4.4rem);
  line-height: 0.98;
}

.access-lead {
  max-width: 620px;
  color: #405166;
  font-size: 1.02rem;
}

.access-warning {
  display: grid;
  gap: 4px;
  max-width: 620px;
  margin: 22px 0 16px;
  border: 1px solid rgba(242, 186, 76, 0.42);
  border-radius: var(--radius);
  padding: 13px 16px;
  color: #6e4b00;
  background: rgba(242, 186, 76, 0.2);
}

.access-warning span,
.access-small {
  color: #5f6f83;
}

.access-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.access-points div {
  min-height: 92px;
  border: 1px solid rgba(221, 230, 238, 0.92);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.access-points strong,
.access-points span {
  display: block;
}

.access-points strong {
  margin-bottom: 5px;
  color: var(--blue);
  font-size: 0.86rem;
}

.access-points span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.access-small {
  margin: 18px 0 10px;
  font-size: 0.8rem;
}

.access-manual {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--blue);
  background: rgba(23, 59, 109, 0.08);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 850;
}

.access-card {
  display: grid;
  gap: 14px;
  width: min(100%, 460px);
  border: 1px solid rgba(221, 230, 238, 0.94);
  border-radius: calc(var(--radius) * 2);
  padding: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(19, 34, 56, 0.14);
  backdrop-filter: blur(18px);
}

.access-card-head {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 12px;
  align-items: center;
}

.access-card-head h2 {
  color: var(--ink);
}

.access-card-head p:not(.eyebrow) {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.account-dialog {
  width: min(100% - 32px, 520px);
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  background: transparent;
}

.account-dialog::backdrop {
  background: rgba(12, 26, 43, 0.46);
  backdrop-filter: blur(6px);
}

.account-card {
  display: grid;
  gap: 14px;
  border: 1px solid rgba(221, 230, 238, 0.9);
  border-radius: var(--radius);
  padding: 20px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 30px 80px rgba(12, 26, 43, 0.26);
}

.access-logo {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  background: #000;
  box-shadow: 0 12px 28px rgba(23, 59, 109, 0.18);
}

.access-card label,
.account-card label {
  display: grid;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 850;
}

.access-card label {
  color: var(--ink);
}

.access-card input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

.access-card input::placeholder {
  color: #9aa7b8;
}

.access-card input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(14, 166, 166, 0.12);
}

.password-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.password-field:focus-within {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(14, 166, 166, 0.12);
}

.password-field input {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.password-field button {
  min-height: 34px;
  margin-right: 6px;
  border: 0;
  border-radius: 6px;
  padding: 0 10px;
  color: var(--blue);
  background: rgba(23, 59, 109, 0.08);
  font-size: 0.78rem;
  font-weight: 850;
}

.access-copy,
.access-note,
.access-message {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.access-message {
  min-height: 22px;
  color: var(--coral);
  font-weight: 800;
}

.access-message.is-success {
  color: var(--green);
}

.account-email {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.remember-row {
  display: flex !important;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 750 !important;
}

.remember-row input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--teal);
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.app-shell.is-locked {
  display: none;
}

.mode-dental {
  --mode-accent: var(--teal);
  --mode-accent-dark: var(--teal-dark);
  --mode-soft: rgba(14, 166, 166, 0.1);
}

.mode-general {
  --mode-accent: var(--coral);
  --mode-accent-dark: #bd4f49;
  --mode-soft: rgba(240, 108, 100, 0.11);
}

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

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  object-fit: cover;
  background: #000;
  box-shadow: 0 12px 28px rgba(23, 59, 109, 0.22);
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.compact-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  white-space: nowrap;
}

.header-link {
  text-decoration: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.6rem, 4vw, 2.55rem);
  line-height: 1.02;
}

h2 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 1rem;
  line-height: 1.25;
}

.language-switch,
.tabs {
  display: flex;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 24px rgba(19, 34, 56, 0.06);
}

.lang-button,
.tab-button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 750;
}

.lang-button {
  width: 44px;
}

.lang-button.is-active,
.tab-button.is-active {
  color: #fff;
  background: var(--mode-accent-dark, var(--blue));
}

.command-center {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 14px;
  border: 1px solid rgba(221, 230, 238, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.tabs {
  width: 100%;
}

.tab-button {
  flex: 1;
  padding: 0 14px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  margin-top: 12px;
}

.search-box,
.builder-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
}

.search-box span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
  padding: 12px 13px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(14, 166, 166, 0.12);
}

.workspace-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}

.category-panel,
.prompt-area,
.library-sidebar,
.builder-form,
.builder-result {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 34px rgba(19, 34, 56, 0.08);
}

.category-panel {
  align-self: start;
  position: sticky;
  top: 116px;
  padding: 14px;
}

.panel-heading,
.section-heading,
.result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading p {
  margin-bottom: 0;
  font-weight: 850;
}

.panel-heading span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 750;
}

.category-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.category-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-weight: 750;
}

.category-button:hover,
.category-button.is-active {
  border-color: rgba(14, 166, 166, 0.24);
  color: var(--teal-dark);
  background: rgba(14, 166, 166, 0.09);
}

.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(23, 59, 109, 0.09);
  font-size: 0.75rem;
  font-weight: 850;
}

.library-sidebar {
  position: sticky;
  top: 98px;
  max-height: calc(100vh - 118px);
  overflow: auto;
  padding: 14px;
}

.prompt-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.prompt-card {
  display: grid;
  gap: 9px;
  min-height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
}

.prompt-card:hover {
  border-color: rgba(14, 166, 166, 0.35);
  box-shadow: 0 16px 38px rgba(19, 34, 56, 0.1);
  transform: translateY(-1px);
}

.prompt-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  color: #fff;
  background: var(--coral);
  font-size: 0.74rem;
  font-weight: 850;
}

.prompt-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.45;
}

.prompt-text {
  overflow: auto;
  max-height: 88px;
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 11px;
  color: #24344c;
  background: var(--surface-soft);
  font-size: 0.79rem;
  line-height: 1.42;
  white-space: pre-wrap;
}

.card-actions,
.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-self: end;
}

.primary-button,
.secondary-button,
.ghost-button,
.copy-button,
.favorite-button {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 13px;
  font-weight: 850;
}

.primary-button,
.copy-button {
  color: #fff;
  background: var(--teal);
}

.access-card .primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--teal), var(--teal-dark));
}

.access-card .primary-button:hover {
  background: var(--teal-dark);
}

.access-card .secondary-button {
  color: var(--blue);
  border-color: rgba(23, 59, 109, 0.16);
  background: rgba(23, 59, 109, 0.07);
}

.primary-button:hover,
.copy-button:hover {
  background: var(--teal-dark);
}

.secondary-button {
  color: var(--blue);
  border-color: rgba(23, 59, 109, 0.2);
  background: rgba(23, 59, 109, 0.07);
}

.ghost-button,
.favorite-button {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface);
}

.favorite-button.is-active {
  color: #835700;
  border-color: rgba(242, 186, 76, 0.45);
  background: rgba(242, 186, 76, 0.18);
}

.empty-state {
  margin-top: 18px;
  border: 1px dashed rgba(100, 113, 132, 0.4);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
  font-weight: 750;
}

.builder-view {
  margin-top: 0;
}

.manual-view {
  margin-top: 18px;
}

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

.playground-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  border: 1px solid rgba(242, 186, 76, 0.45);
  border-radius: var(--radius);
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(19, 34, 56, 0.96), rgba(23, 59, 109, 0.9)),
    var(--ink);
  color: #fff;
  box-shadow: var(--shadow);
}

.mode-general .playground-hero {
  border-color: rgba(240, 108, 100, 0.44);
  background:
    linear-gradient(135deg, rgba(19, 34, 56, 0.96), rgba(106, 57, 71, 0.9)),
    var(--ink);
}

.playground-hero .eyebrow {
  color: var(--gold);
}

.playground-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.55;
}

.mode-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 4px 10px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.8rem;
  font-weight: 850;
}

.checklist-card {
  display: grid;
  gap: 8px;
  flex: 0 0 112px;
  width: 190px;
  border: 1px solid rgba(242, 186, 76, 0.46);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.checklist-card p {
  margin-bottom: 2px;
  color: var(--gold);
  font-weight: 850;
}

.checklist-card span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  line-height: 1.25;
}

.checklist-card span::before {
  content: "";
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
}

.checklist-card span.is-done {
  color: #fff;
  font-weight: 800;
}

.checklist-card span.is-done::before {
  border-color: var(--gold);
  background: var(--gold);
}

.builder-form,
.builder-result {
  padding: 18px;
}

.builder-form {
  display: grid;
  gap: 16px;
}

.playground-form {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 249, 251, 0.94)),
    var(--surface);
}

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

.compact-grid {
  align-items: end;
}

.play-section {
  display: grid;
  gap: 10px;
}

.starter-panel {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: var(--mode-soft, var(--surface-soft));
}

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

.starter-button {
  min-height: 42px;
  border: 1px solid rgba(23, 59, 109, 0.14);
  border-radius: var(--radius);
  padding: 8px 10px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.86);
  font-weight: 850;
  text-align: left;
}

.starter-button:hover {
  border-color: var(--mode-accent, var(--teal));
  color: var(--mode-accent-dark, var(--teal-dark));
}

.play-label {
  margin-bottom: 0;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

.choice-card,
.token-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
}

.choice-card {
  display: grid;
  gap: 6px;
  min-height: 104px;
  padding: 13px;
}

.choice-card span {
  color: var(--ink);
  font-weight: 850;
}

.choice-card small {
  color: var(--muted);
  line-height: 1.35;
}

.choice-card:hover,
.choice-card.is-active,
.token-button:hover,
.token-button.is-active {
  border-color: var(--mode-accent, var(--teal));
  background: var(--mode-soft, rgba(242, 186, 76, 0.14));
  box-shadow: 0 10px 24px rgba(19, 34, 56, 0.08);
}

.token-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.token-button {
  min-height: 40px;
  padding: 0 13px;
  color: var(--blue);
  font-weight: 850;
}

.builder-result {
  align-self: start;
}

.builder-result pre {
  overflow: auto;
  min-height: 260px;
  margin: 16px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  color: #24344c;
  background: var(--surface-soft);
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.94rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

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

.ai-improve-note {
  margin-top: 12px;
  border: 1px solid rgba(14, 166, 166, 0.24);
  border-radius: var(--radius);
  padding: 12px;
  color: #375066;
  background: rgba(14, 166, 166, 0.08);
  font-size: 0.88rem;
  line-height: 1.48;
}

.ai-improve-note strong {
  color: var(--teal-dark);
}

.compact-search {
  grid-template-columns: 1fr;
}

.compact-search .ghost-button {
  width: 100%;
}

.library-count {
  margin-top: 14px;
}

.legal-footer {
  margin-top: 16px;
  border-top: 1px solid rgba(221, 230, 238, 0.9);
  padding-top: 10px;
  color: var(--muted);
}

.legal-footer details {
  max-width: 980px;
}

.legal-footer summary {
  cursor: pointer;
  width: fit-content;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.legal-footer summary:hover {
  color: var(--ink);
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin-top: 10px;
  padding-bottom: 8px;
}

.legal-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.42;
}

.manual-dialog {
  width: min(100% - 32px, 1040px);
  max-height: min(86vh, 820px);
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  color: var(--ink);
  background: transparent;
}

.manual-dialog::backdrop {
  background: rgba(12, 26, 43, 0.46);
  backdrop-filter: blur(6px);
}

.manual-dialog-shell {
  max-height: min(86vh, 820px);
  overflow: auto;
  border: 1px solid rgba(221, 230, 238, 0.9);
  border-radius: var(--radius);
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(14, 166, 166, 0.09), rgba(242, 186, 76, 0.1) 48%, rgba(240, 108, 100, 0.08)),
    #fff;
  box-shadow: 0 30px 80px rgba(12, 26, 43, 0.26);
}

.manual-hero,
.manual-panel,
.manual-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 34px rgba(19, 34, 56, 0.08);
}

.manual-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
}

.manual-hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.manual-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.manual-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.manual-grid,
.manual-layout,
.tips-grid {
  display: grid;
  gap: 14px;
}

.manual-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.manual-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 18px;
}

.manual-card,
.manual-panel {
  padding: 18px;
}

.manual-card {
  position: relative;
  overflow: hidden;
}

.manual-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--teal);
}

.manual-card.accent-gold::before {
  background: var(--gold);
}

.manual-card.accent-coral::before {
  background: var(--coral);
}

.manual-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #fff;
  background: var(--blue);
  font-weight: 850;
  margin-bottom: 12px;
}

.manual-card p,
.tip-item p,
.example-box p,
.formula-list span {
  color: var(--muted);
  line-height: 1.5;
}

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

.formula-list div {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.example-box {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}

.example-box.is-better {
  border-color: rgba(14, 166, 166, 0.28);
  background: rgba(14, 166, 166, 0.08);
}

.tips-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.tip-item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface-soft);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10;
  transform: translateY(20px);
  opacity: 0;
  border-radius: var(--radius);
  padding: 12px 14px;
  color: #fff;
  background: var(--ink);
  font-weight: 850;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 920px) {
  .access-layout,
  .workspace-layout,
  .builder-layout,
  .choice-grid,
  .starter-grid,
  .legal-grid,
  .manual-grid,
  .manual-layout,
  .tips-grid {
    grid-template-columns: 1fr;
  }

  .access-layout {
    gap: 20px;
  }

  .access-points {
    grid-template-columns: 1fr;
  }

  .category-panel,
  .library-sidebar,
  .builder-result {
    position: static;
    max-height: none;
  }

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

}

@media (max-width: 640px) {
  .access-gate {
    padding: 16px;
  }

  .access-card {
    padding: 18px;
  }

  .access-intro h1 {
    font-size: 2.25rem;
  }

  .app-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .topbar,
  .playground-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-logo {
    width: 56px;
    height: 56px;
  }

  .topbar-actions,
  .language-switch {
    width: 100%;
  }

  .topbar-actions {
    align-items: stretch;
  }

  .compact-action {
    flex: 1;
  }

  .topbar-actions .language-switch {
    flex: 2 1 160px;
    width: auto;
  }

  .lang-button {
    flex: 1;
    width: auto;
  }

  .command-center {
    padding: 10px;
  }

  .tabs,
  .search-row,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    display: grid;
  }

  .search-row {
    display: grid;
  }

  .category-list {
    grid-template-columns: 1fr;
  }

  .library-sidebar,
  .prompt-area,
  .builder-form,
  .builder-result {
    padding: 14px;
  }

  .prompt-card {
    min-height: auto;
  }

  .section-heading,
  .panel-heading,
  .result-top,
  .manual-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading .secondary-button,
  .result-top .secondary-button,
  .manual-hero .primary-button,
  .manual-hero .ghost-button,
  .playground-hero .primary-button {
    width: 100%;
  }

  .result-actions {
    width: 100%;
  }

  .result-actions .secondary-button {
    flex: 1 1 100%;
  }

  .checklist-card {
    width: 100%;
    height: auto;
    min-height: 78px;
    border-radius: var(--radius);
  }

  .formula-list div {
    grid-template-columns: 1fr;
  }
}
