:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #eef3f8;
  --ink: #152033;
  --muted: #657184;
  --line: #d9e0ea;
  --nav: #111827;
  --blue: #2458d3;
  --blue-strong: #1743a6;
  --gold: #c98219;
  --green: #15803d;
  --red: #b42318;
  --shadow: 0 18px 50px rgba(18, 32, 52, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

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

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: #fff;
  color: var(--ink);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

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

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

h1 {
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.02;
  margin-bottom: 18px;
}

h2 {
  font-size: 28px;
  line-height: 1.15;
  margin-bottom: 10px;
}

h3 {
  font-size: 18px;
  margin-bottom: 8px;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #0f172a;
  color: #ecf4ff;
  border-radius: var(--radius);
  padding: 16px;
  overflow: auto;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  padding: 11px 15px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  min-height: 42px;
  text-align: center;
}

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

.button.primary:hover,
button.primary:hover {
  background: var(--blue-strong);
}

.button.secondary,
button.secondary {
  background: #fff;
  border: 1px solid var(--line);
}

.button.small {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.button.full,
button.full {
  width: 100%;
}

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  font-weight: 900;
  letter-spacing: 0;
}

.brand-with-logo {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brand-with-logo img {
  display: block;
  width: min(260px, 42vw);
  height: auto;
}

.top-nav,
.hero-actions,
.editor-actions,
.improve-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.top-nav {
  font-size: 14px;
  color: var(--muted);
}

.landing-page {
  background: #071225;
}

.landing-header {
  background: rgba(7, 18, 37, 0.94);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(16px);
}

.landing-header .top-nav {
  color: #d7e3f8;
}

.landing-header .login-link {
  color: #fff;
  font-weight: 900;
}

.button.light {
  background: #fff;
  color: var(--nav);
}

.button.google {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  color: #1f2937;
}

.button.google::before {
  content: "G";
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f4f7fb;
  color: #1a73e8;
  font-weight: 900;
}

.auth-logo {
  width: min(320px, 84vw);
  height: auto;
  margin-bottom: 8px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--line);
  flex: 1;
}

.landing-hero {
  min-height: calc(92vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: 48px;
  align-items: center;
  padding: 54px max(28px, calc((100vw - 1180px) / 2)) 64px;
  background:
    radial-gradient(circle at 85% 18%, rgba(18, 113, 255, 0.22), transparent 30%),
    linear-gradient(135deg, #071225 0%, #0b1f42 56%, #071225 100%);
  color: #fff;
}

.landing-hero-copy h1 {
  color: #fff;
  font-size: clamp(44px, 7vw, 88px);
  margin-bottom: 16px;
}

.landing-hero-copy p {
  color: #d7e3f8;
}

.hero-logo {
  width: min(520px, 86vw);
  height: auto;
  margin-bottom: 24px;
}

.hero-cta {
  min-height: 52px;
  padding-inline: 22px;
  font-size: 16px;
}

.button.secondary.dark {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.hero-note {
  margin-top: 18px;
  font-size: 14px;
  max-width: 640px;
}

.landing-product {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
  padding: 18px;
  display: grid;
  gap: 14px;
}

.product-topline,
.product-flow,
.product-metrics {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.product-topline {
  color: #d7e3f8;
  font-size: 14px;
}

.product-topline strong {
  color: #fff;
}

.product-flow span {
  flex: 1;
  min-width: 90px;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  color: #eaf2ff;
  font-weight: 900;
  font-size: 13px;
}

.product-panel {
  min-height: 280px;
  padding: 20px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}

.product-panel h2 {
  color: var(--ink);
}

.product-panel p {
  color: var(--muted);
}

.product-lines {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.product-lines span {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(36, 88, 211, 0.22), rgba(255, 111, 0, 0.24));
}

.product-lines span:nth-child(2) {
  width: 86%;
}

.product-lines span:nth-child(3) {
  width: 72%;
}

.product-lines span:nth-child(4) {
  width: 58%;
}

.product-metrics article {
  flex: 1;
  min-width: 110px;
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
}

.product-metrics span {
  display: block;
  color: #c6d7f4;
  font-size: 12px;
  font-weight: 800;
}

.product-metrics strong {
  display: block;
  color: #fff;
  font-size: 22px;
}

.landing-band {
  background: #f7f9fd;
}

.value-grid,
.trial-rules {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.value-grid article,
.trial-rules article {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 8px 26px rgba(17, 24, 39, 0.06);
}

.trial-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 28px;
  align-items: start;
  background: #fff;
}

.trial-copy p,
.trial-rules span {
  color: var(--muted);
}

.trial-rules strong {
  display: block;
  font-size: 34px;
  line-height: 1;
  margin-bottom: 8px;
  color: var(--blue);
}

.hero {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 48px;
  align-items: center;
  padding: 56px max(28px, calc((100vw - 1180px) / 2));
  background:
    linear-gradient(115deg, rgba(36, 88, 211, 0.08), transparent 46%),
    #fff;
}

.hero-copy p {
  max-width: 660px;
  color: var(--muted);
  font-size: 20px;
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--nav);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.flow-step {
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  color: #e9eef8;
  font-weight: 800;
}

.flow-step.is-active {
  background: #fff;
  color: var(--nav);
}

.section {
  padding: 72px max(24px, calc((100vw - 1180px) / 2));
}

.band {
  background: #fff;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading p {
  color: var(--muted);
}

.section-heading.compact {
  margin-bottom: 16px;
}

.module-strip,
.pricing-grid,
.metrics-grid,
.split-grid {
  display: grid;
  gap: 16px;
}

.module-strip {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.module-card,
.price-card,
.panel,
.metrics-grid article,
.install-card,
.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 26px rgba(17, 24, 39, 0.06);
}

.module-card,
.price-card,
.metrics-grid article,
.panel {
  padding: 18px;
}

.module-card p,
.price-card p,
.panel p {
  color: var(--muted);
}

.pricing-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.price-card strong {
  display: block;
  margin-bottom: 12px;
  font-size: 24px;
}

.install-page,
.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f6f8fb, #e9eef6);
}

.install-shell,
.auth-shell {
  width: min(100%, 980px);
}

.install-card,
.auth-card {
  padding: 28px;
}

.auth-shell {
  width: min(100%, 440px);
  min-width: 0;
}

.auth-card, .auth-card label, .auth-card input, .auth-card select { min-width: 0; }

.install-form,
.auth-card,
.profile-form {
  display: grid;
  gap: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.form-grid.wide {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.requirements {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0;
}

.status-pill,
.progress-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
}

.status-pill.is-ok {
  background: rgba(21, 128, 61, 0.1);
  color: var(--green);
}

.status-pill.is-bad {
  background: rgba(180, 35, 24, 0.1);
  color: var(--red);
}

.status-pill.is-muted {
  background: rgba(101, 113, 132, 0.12);
  color: var(--muted);
}

.button.danger {
  color: var(--red);
}

.is-hidden {
  display: none !important;
}

.progress-badge {
  background: rgba(201, 130, 25, 0.14);
  color: #8a530e;
}

.notice,
.form-error,
.privacy-note {
  border-radius: var(--radius);
  padding: 12px;
}

.notice.success {
  background: rgba(21, 128, 61, 0.1);
  color: var(--green);
}

.notice.error,
.form-error:not(:empty) {
  background: rgba(180, 35, 24, 0.1);
  color: var(--red);
}

.privacy-note {
  background: rgba(36, 88, 211, 0.08);
  color: #26447b;
}

.app-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--nav);
  color: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.app-brand {
  color: #fff;
}

.app-brand img {
  width: 214px;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.side-nav button {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: transparent;
  color: #cbd5e1;
}

.side-nav button.is-active,
.side-nav button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.workspace {
  padding: 24px;
  min-width: 0;
}

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

.workspace-header h1 {
  font-size: 34px;
  margin-bottom: 4px;
}

.workspace-header p {
  color: var(--muted);
  margin-bottom: 0;
}

.workspace-section {
  display: none;
}

.workspace-section.is-active {
  display: block;
}

.metrics-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 16px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.metrics-grid span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.analytics-grid span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 6px;
}

.metrics-grid strong {
  font-size: 24px;
}

.trial-notice {
  margin-bottom: 16px;
  background: rgba(36, 88, 211, 0.08);
  color: #26447b;
}

.trial-notice p {
  margin: 6px 0 0;
}

.training-video {
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 8px 26px rgba(17, 24, 39, 0.06);
}

.training-video-label {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.training-video iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  background: #0f172a;
}

.instruction-panel {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.instruction-panel ol {
  margin: 10px 0 0;
  padding-inline-start: 22px;
  color: var(--muted);
}

.instruction-panel li + li {
  margin-top: 8px;
}

.analytics-grid strong {
  font-size: 22px;
}

.expert-core-shell {
  display: grid;
  gap: 16px;
}

.expert-core-import-panel {
  margin-bottom: 16px;
}

.expert-core-import-panel form {
  display: grid;
  gap: 12px;
}

.expert-core-import-result {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.expert-core-import-summary article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.expert-core-import-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.expert-core-import-summary strong {
  font-size: 24px;
}

.expert-core-status {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.expert-core-status span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.expert-core-status strong {
  display: block;
  margin: 2px 0 8px;
  font-size: 30px;
}

.expert-core-status p {
  margin-bottom: 0;
  max-width: 780px;
}

.readiness-meter {
  height: 9px;
  margin: 8px 0 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce4ef;
}

.readiness-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

.expert-core-stepper,
.expert-core-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.expert-core-stepper button {
  min-height: 36px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px;
}

.expert-core-stepper button.is-active {
  border-color: var(--blue);
  background: rgba(36, 88, 211, 0.1);
  color: var(--blue);
}

.expert-core-step {
  display: none;
}

.expert-core-step.is-active {
  display: grid;
  gap: 12px;
}

.expert-core-step-head {
  color: var(--muted);
  font-weight: 900;
}

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

.expert-core-field {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.expert-core-field.is-filled {
  border-color: rgba(21, 128, 61, 0.45);
  background: rgba(21, 128, 61, 0.035);
}

.field-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink);
  font-size: 15px;
}

.field-title em {
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(36, 88, 211, 0.1);
  color: var(--blue);
  font-size: 11px;
  font-style: normal;
}

.field-title small {
  margin-inline-start: auto;
  border-radius: 999px;
  padding: 3px 7px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
}

.expert-core-field.is-filled .field-title small {
  background: rgba(21, 128, 61, 0.11);
  color: var(--green);
}

.field-help {
  display: block;
  min-height: 84px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.model-field-hint {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.expert-core-conflict {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.expert-core-conflict.is-resolved {
  border-color: rgba(21, 128, 61, 0.45);
}

.expert-core-conflict h5,
.expert-core-conflict p {
  margin: 0;
}

.expert-core-conflict-options {
  display: grid;
  gap: 8px;
}

.expert-core-conflict-options button {
  display: grid;
  gap: 5px;
  text-align: start;
  white-space: normal;
}

.expert-core-conflict-options span,
.expert-core-conflict-options em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.split-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.panel-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-heading-row p {
  margin-bottom: 0;
}

.analytics-block {
  margin: 16px 0;
}

.projects-layout {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.project-create-form,
.project-card form,
.integration-form {
  display: grid;
  gap: 14px;
}

.project-list-panel h3 {
  margin-bottom: 14px;
}

.project-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

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

.project-card-head,
.project-actions,
.copy-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.project-actions form {
  display: inline-flex;
}

.empty-state {
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: rgba(255, 255, 255, 0.62);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-client-actions {
  min-width: 360px;
}

.client-action-form {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(120px, 1fr) auto;
  gap: 6px;
  align-items: start;
  margin-bottom: 8px;
}

.delete-client-form {
  grid-template-columns: minmax(150px, 1fr) minmax(90px, 0.7fr) auto;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.data-table th {
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 900;
}

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

.compact-table {
  min-width: 520px;
}

.guide-panel,
.settings-panel {
  max-width: 980px;
}

.guide-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 22px;
}

.guide-toc a {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  background: var(--surface-soft);
  font-weight: 800;
  font-size: 14px;
}

.guide-toc.mini {
  margin: 12px 0;
}

.guide-sections {
  display: grid;
  gap: 14px;
}

.guide-sections section {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.guide-sections section p {
  max-width: 880px;
}

.onboarding-path {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.62);
}

.onboarding-overlay.is-hidden {
  display: none;
}

.onboarding-dialog {
  width: min(100%, 720px);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.onboarding-language-form {
  display: grid;
  gap: 14px;
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="rtl"] .side-nav button,
html[dir="rtl"] .module-list button,
html[dir="rtl"] .doc-list button,
html[dir="rtl"] .module-choice,
html[dir="rtl"] .document-link,
html[dir="rtl"] .document-rendered th,
html[dir="rtl"] .document-rendered td,
html[dir="rtl"] .data-table th,
html[dir="rtl"] .data-table td {
  text-align: right;
}

html[dir="rtl"] .module-list button.is-active {
  box-shadow: inset -3px 0 0 var(--blue);
}

.module-workbench {
  display: grid;
  grid-template-columns: 280px minmax(320px, 480px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.module-catalog {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.module-choice {
  min-height: 190px;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 26px rgba(17, 24, 39, 0.06);
  position: relative;
  overflow: hidden;
}

.module-choice::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: var(--module-accent, var(--blue));
}

.module-choice strong {
  font-size: 18px;
}

.module-choice span:not(.module-index) {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.module-includes {
  margin: 0;
  padding-inline-start: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-align: start;
}

.module-includes li + li {
  margin-top: 4px;
}

.selected-module-includes {
  margin-top: 10px;
}

.module-choice em {
  color: var(--module-accent, var(--blue));
  font-style: normal;
  font-size: 13px;
  font-weight: 900;
  margin-top: auto;
}

.module-choice.is-active {
  border-color: var(--module-accent, var(--blue));
  box-shadow: 0 14px 34px rgba(17, 24, 39, 0.12);
}

.module-index {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--module-accent, var(--blue)) 14%, #fff);
  color: var(--module-accent, var(--blue));
  font-weight: 900;
  font-size: 13px;
}

.module-accent-0 { --module-accent: #2458d3; }
.module-accent-1 { --module-accent: #0f766e; }
.module-accent-2 { --module-accent: #b45309; }
.module-accent-3 { --module-accent: #7c3aed; }
.module-accent-4 { --module-accent: #be123c; }
.module-accent-5 { --module-accent: #15803d; }

.module-list,
.doc-list {
  display: grid;
  gap: 8px;
}

.module-list button,
.doc-list button {
  justify-content: flex-start;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
}

.module-list button.is-active {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.module-list span,
.doc-list span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.module-form {
  display: grid;
  gap: 14px;
}

.module-setup {
  max-width: 920px;
}

.generation-status:not(:empty),
.ai-action-status:not(:empty) {
  background: rgba(21, 128, 61, 0.1);
  color: var(--green);
  border-radius: var(--radius);
  padding: 12px;
  font-weight: 800;
}

.ai-loading-state {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-spinner {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 3px solid rgba(36, 88, 211, 0.18);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: ai-spin 0.85s linear infinite;
}

button:disabled,
.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

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

@media (prefers-reduced-motion: reduce) {
  .ai-spinner {
    animation-duration: 1.8s;
  }
}

.result-panel pre {
  min-height: 520px;
}

.document-library {
  gap: 14px;
}

.document-group {
  display: grid;
  gap: 10px;
}

.document-link-list {
  display: grid;
  gap: 8px;
}

.document-link {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.document-link strong {
  display: block;
  width: 100%;
}

.document-link span {
  display: block;
  width: 100%;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.document-link.is-active {
  border-color: var(--blue);
}

.editor-panel form {
  display: grid;
  gap: 14px;
}

.document-editor-surface {
  display: grid;
  gap: 12px;
}

.editor-view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  width: fit-content;
}

.editor-view-tabs button {
  min-height: 34px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
}

.editor-view-tabs button.is-active {
  background: #fff;
  border-color: var(--line);
  color: var(--blue);
  box-shadow: 0 5px 16px rgba(18, 32, 52, 0.08);
}

.document-rendered {
  min-height: 520px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  overflow-wrap: anywhere;
}

.document-rendered.is-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.document-rendered h1,
.document-rendered h2,
.document-rendered h3,
.document-rendered h4 {
  color: #111827;
  line-height: 1.2;
  margin: 1.4em 0 0.55em;
}

.document-rendered h1:first-child,
.document-rendered h2:first-child,
.document-rendered h3:first-child {
  margin-top: 0;
}

.document-rendered h1 {
  font-size: 30px;
}

.document-rendered h2 {
  font-size: 24px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.document-rendered h3 {
  font-size: 19px;
}

.document-rendered p {
  color: var(--ink);
  margin: 0.75em 0;
}

.document-rendered ul,
.document-rendered ol {
  margin: 0.75em 0 1em;
  padding-inline-start: 24px;
}

.document-rendered li + li {
  margin-top: 0.35em;
}

.document-rendered blockquote {
  margin: 18px 0;
  padding: 11px 16px;
  border-inline-start: 4px solid var(--blue);
  border-radius: var(--radius);
  background: #eef4ff;
  color: #334155;
}

.document-rendered code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-soft);
  font-size: 0.92em;
}

.document-rendered pre {
  margin: 18px 0;
}

.document-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.document-rendered table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  background: #fff;
}

.document-rendered th,
.document-rendered td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.document-rendered th {
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 900;
}

.document-rendered tr:last-child td {
  border-bottom: 0;
}

.document-source textarea {
  min-height: 520px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.55;
}

.referral-layout {
  display: grid;
  gap: 16px;
}

.copy-row input {
  flex: 1 1 320px;
}

.referral-table-panel {
  min-width: 0;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.admin-tabs button {
  border: 1px solid var(--line);
  background: #fff;
}

.admin-tabs button.is-active {
  border-color: var(--blue);
  background: rgba(36, 88, 211, 0.1);
  color: var(--blue);
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.is-active {
  display: block;
}

.admin-data-grid {
  margin-top: 14px;
}

.secret-status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  margin: 12px 0 18px;
}

.secret-status-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.secret-status-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.secret-status-grid strong {
  display: block;
  margin-top: 4px;
}

.is-ok-text {
  color: var(--green);
}

.is-bad-text {
  color: var(--red);
}

.improve-actions {
  margin-top: 14px;
}

.dashboard-pricing input {
  margin-bottom: 10px;
}

.plan-description {
  margin: 12px 0;
  color: var(--muted);
  white-space: pre-line;
}

.plan-limits {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.plan-limits h4 {
  margin: 0 0 8px;
}

.plan-limits ul {
  margin: 0;
  padding-inline-start: 18px;
  color: var(--muted);
}

.plan-admin-form,
.training-video-admin-form {
  display: grid;
  gap: 16px;
}

.plan-admin-grid,
.training-video-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.plan-admin-card,
.training-video-language {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

@media (max-width: 980px) {
  .hero,
  .landing-hero,
  .trial-section,
  .app-body,
  .module-workbench,
  .documents-layout,
  .projects-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .side-nav {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .workspace-header {
    display: grid;
  }

  .expert-core-field-grid {
    grid-template-columns: 1fr;
  }

  .expert-core-import-summary,
  .client-action-form,
  .delete-client-form {
    grid-template-columns: 1fr;
  }

  .document-rendered,
  .document-source textarea {
    min-height: 380px;
  }

  .document-rendered {
    padding: 18px;
  }

  .editor-view-tabs {
    width: 100%;
  }

  .editor-view-tabs button {
    flex: 1;
  }
}

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

  .hero,
  .landing-hero,
  .section,
  .workspace {
    padding: 22px 16px;
  }

  .hero,
  .landing-hero {
    min-height: auto;
  }

  .brand-with-logo img,
  .hero-logo {
    width: min(320px, 86vw);
  }

  .sticky-action {
    position: sticky;
    bottom: 10px;
    z-index: 5;
  }
}
.auth-legal { font-size: 12px; line-height: 1.5; color: #667085; }
.sidebar-legal { display: grid; gap: 7px; margin-top: 14px; font-size: 11px; line-height: 1.35; }
.sidebar-legal a { color: #aab6ca; text-decoration: none; }
.sidebar-legal a:hover { color: #fff; }
.legal-page { margin: 0; min-height: 100vh; background: #f5f7fb; color: #172033; font-family: Inter, system-ui, sans-serif; }
.legal-header { min-height: 72px; display: flex; align-items: center; padding: 0 24px; background: #070f21; }
.legal-header img { display: block; width: 190px; max-height: 48px; object-fit: contain; }
.legal-shell { width: min(900px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 64px; }
.legal-back { display: inline-block; margin-bottom: 20px; color: #2563eb; font-weight: 700; text-decoration: none; }
.legal-document { background: #fff; border: 1px solid #e3e8f1; border-radius: 8px; padding: clamp(24px, 5vw, 56px); box-shadow: 0 14px 38px rgba(21, 33, 56, .07); }
.legal-document h1 { margin: 0 0 8px; font-size: clamp(30px, 5vw, 46px); line-height: 1.12; letter-spacing: 0; }
.legal-date { margin-bottom: 34px; color: #667085; }
.legal-document section { padding: 22px 0; border-top: 1px solid #e8ecf3; }
.legal-document h2 { margin: 0 0 10px; font-size: 21px; letter-spacing: 0; }
.legal-document p { margin: 0; line-height: 1.75; color: #344054; }
