@font-face {
  font-family: "Noto Sans Arabic";
  src: url("/assets/fonts/NotoSansArabic-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Noto Kufi Arabic";
  src: url("/assets/fonts/NotoKufiArabic-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --canvas: #f7f8fc;
  --canvas-deep: #eef0f7;
  --surface: #ffffff;
  --surface-soft: #fbfbfe;
  --surface-brand: #f5f0fa;
  --ink: #29243b;
  --ink-soft: #514b64;
  --muted: #77728a;
  --soft: #9a96a9;
  --line: #e7e4ef;
  --line-strong: #d8d3e2;
  --brand-purple: #7a3e89;
  --brand-deep: #682c84;
  --brand-cyan: #59c9cd;
  --brand-teal: #00a98f;
  --success: #087d65;
  --warning: #a46716;
  --danger: #b33e55;
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 11px;
  --shadow-soft: 0 18px 55px rgba(49, 38, 79, .08);
  --shadow-card: 0 10px 28px rgba(49, 38, 79, .06);
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-in-out: cubic-bezier(.77, 0, .175, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: hidden; background: var(--canvas); scroll-behavior: smooth; }
body { min-height: 100vh; margin: 0; overflow-x: hidden; color: var(--ink); background: radial-gradient(circle at 12% -8%, rgba(89, 201, 205, .16), transparent 28rem), radial-gradient(circle at 94% 18%, rgba(122, 62, 137, .1), transparent 25rem), var(--canvas); font-family: "Noto Sans Arabic", Tahoma, sans-serif; line-height: 1.65; direction: rtl; }
body, button, input, textarea, select { font-synthesis: none; }
button, textarea, input, select { font: inherit; }
button, select, input[type="range"] { touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3, .brand-context strong, .primary-button, .secondary-button { font-family: "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, sans-serif; }

.skip-link { position: fixed; z-index: 100; right: 16px; top: -64px; padding: 10px 16px; color: #fff; border-radius: 10px; background: var(--brand-deep); box-shadow: var(--shadow-card); transition: top 180ms var(--ease-out); }
.skip-link:focus { top: 16px; outline: 3px solid rgba(89, 201, 205, .55); outline-offset: 3px; }

.topbar { position: sticky; z-index: 50; top: 0; border-bottom: 1px solid rgba(216, 211, 226, .75); background: rgba(247, 248, 252, .84); backdrop-filter: blur(18px); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: min(1240px, calc(100% - 40px)); min-height: 78px; margin: 0 auto; }
.brand { display: flex; align-items: center; min-width: 0; max-width: 100%; gap: 14px; text-decoration: none; }
.brand-logo { display: block; width: clamp(132px, 15vw, 176px); max-width: 100%; height: auto; }
.brand-divider { width: 1px; height: 34px; background: var(--line-strong); }
.brand-context { min-width: 0; }
.brand-context strong, .brand-context small { display: block; }
.brand-context strong { color: var(--ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.brand-context small { margin-top: 2px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.mode-badge { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 11px; color: var(--brand-deep); border: 1px solid rgba(122, 62, 137, .16); border-radius: 999px; background: rgba(122, 62, 137, .06); font-size: 10px; white-space: nowrap; }
.pulse-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-teal); box-shadow: 0 0 0 4px rgba(0, 169, 143, .12); }
.icon-button, .text-button { color: var(--muted); border: 0; background: transparent; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .64); transition: color 160ms ease-out, border-color 160ms ease-out, transform 160ms ease-out, background 160ms ease-out; }
.icon-button svg, .primary-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:hover, .icon-button:focus-visible, .text-button:hover, .text-button:focus-visible { color: var(--brand-deep); border-color: rgba(122, 62, 137, .45); background: #fff; outline: none; }
.icon-button:active, .primary-button:active, .secondary-button:active, .preview-tool-button:active, .preview-mini-button:active { transform: scale(.97); }

.shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 84px; }
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(330px, .95fr); min-width: 0; gap: 30px; align-items: center; padding: 4px 0 42px; }
.hero-copy-block { min-width: 0; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; color: var(--brand-purple); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.eyebrow::before { display: none; }
h1 { max-width: 100%; margin-bottom: 17px; color: var(--ink); font-size: clamp(34px, 5vw, 64px); font-weight: 800; line-height: 1.25; letter-spacing: -.055em; overflow-wrap: anywhere; }
h1 em { color: var(--brand-purple); font-style: normal; }
.hero-copy { max-width: 590px; margin-bottom: 23px; color: var(--ink-soft); font-size: 16px; line-height: 2; overflow-wrap: anywhere; }
.hero-points { display: flex; flex-wrap: wrap; gap: 9px; }
.hero-points span { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 10px 6px 12px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .72); font-size: 11px; }
.hero-points i { display: grid; place-items: center; width: 22px; height: 22px; color: #fff; border-radius: 50%; background: var(--brand-deep); font: 700 8px/1 ui-monospace, SFMono-Regular, Menlo, monospace; font-style: normal; direction: ltr; }

.hero-art { position: relative; min-height: 315px; overflow: hidden; border: 1px solid rgba(122, 62, 137, .16); border-radius: 32px; background: linear-gradient(145deg, #fff 0%, #f5f1fa 57%, #edf8f8 100%); box-shadow: var(--shadow-soft); isolation: isolate; }
.hero-art::after { position: absolute; inset: 0; z-index: -1; content: ""; background: linear-gradient(135deg, transparent 35%, rgba(255, 255, 255, .75) 35.2%, transparent 35.5%), linear-gradient(315deg, transparent 53%, rgba(255, 255, 255, .6) 53.2%, transparent 53.5%); opacity: .8; }
.art-grid { position: absolute; inset: auto -22% -42% 7%; height: 75%; background-image: linear-gradient(rgba(122, 62, 137, .11) 1px, transparent 1px), linear-gradient(90deg, rgba(122, 62, 137, .11) 1px, transparent 1px); background-size: 24px 24px; transform: perspective(480px) rotateX(62deg) rotateZ(-7deg); transform-origin: center bottom; opacity: .45; }
.art-orbit { position: absolute; border: 1px solid rgba(122, 62, 137, .22); border-radius: 50%; transform: rotate(-24deg); }
.art-orbit-one { width: 255px; height: 128px; right: 23%; top: 24%; }
.art-orbit-two { width: 325px; height: 164px; right: 12%; top: 18%; border-color: rgba(89, 201, 205, .25); transform: rotate(21deg); }
.art-glow { position: absolute; width: 190px; height: 190px; right: 33%; top: 21%; border-radius: 50%; background: radial-gradient(circle, rgba(89, 201, 205, .29), rgba(122, 62, 137, .12) 46%, transparent 72%); filter: blur(3px); }
.hero-art-logo { position: absolute; z-index: 1; width: 112px; height: 122px; right: 38%; top: 25%; object-fit: contain; filter: drop-shadow(0 16px 14px rgba(104, 44, 132, .16)); }
.art-caption { position: absolute; z-index: 2; right: 24px; bottom: 22px; color: var(--muted); font-size: 11px; line-height: 1.8; }
.art-caption b { color: var(--brand-deep); font-weight: 800; }
.art-corner { position: absolute; color: var(--soft); font: 700 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; direction: ltr; }
.art-corner-top { left: 20px; top: 20px; }
.art-corner-bottom { left: 20px; bottom: 20px; color: var(--brand-purple); }

.engine-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; gap: 13px; margin-bottom: 18px; }
.engine-grid > .section-heading-wide { grid-column: 1 / -1; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-heading .eyebrow { margin-bottom: 5px; }
h2 { margin-bottom: 0; color: var(--ink); font-size: 21px; font-weight: 800; line-height: 1.45; letter-spacing: -.025em; }
h3 { margin-bottom: 0; color: var(--ink); font-size: 14px; font-weight: 800; line-height: 1.5; }
.muted, .step-label { color: var(--muted); font-size: 11px; }
.engine-card, .panel { border: 1px solid var(--line); border-radius: var(--radius-lg); background: rgba(255, 255, 255, .88); box-shadow: var(--shadow-card); }
.engine-card { display: flex; gap: 14px; min-height: 112px; padding: 19px; }
.engine-icon { display: grid; flex: 0 0 42px; place-items: center; width: 42px; height: 42px; border-radius: 13px; font: 800 16px/1 "Noto Kufi Arabic", sans-serif; direction: ltr; }
.agy-icon { color: #fff; background: linear-gradient(145deg, #b77a1f, #e3b55f); box-shadow: 0 8px 16px rgba(180, 118, 26, .18); }
.trellis-icon { color: #fff; background: linear-gradient(145deg, #166d70, #2fa5a1); box-shadow: 0 8px 16px rgba(22, 109, 112, .18); }
.engine-main { min-width: 0; flex: 1; }
.engine-title-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.engine-main p { margin: 5px 0 3px; color: var(--ink-soft); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.engine-main small { display: block; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 800; white-space: nowrap; }
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-chip.connected { color: var(--success); background: rgba(0, 169, 143, .09); }
.status-chip.offline { color: var(--danger); background: rgba(179, 62, 85, .08); }
.status-chip.checking { color: var(--warning); background: rgba(164, 103, 22, .09); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(300px, .82fr); min-width: 0; gap: 18px; margin-bottom: 18px; }
.panel { min-width: 0; max-width: 100%; padding: 28px; }
.create-panel { min-height: 500px; }
.create-panel .section-heading, .workflow-panel .section-heading, .jobs-panel .section-heading { margin-bottom: 25px; }
form { margin-top: 25px; }
label, .field-label { display: block; margin-bottom: 8px; color: var(--ink); font-size: 12px; font-weight: 800; }
.required { color: var(--brand-purple); }
.optional { color: var(--muted); font-weight: 500; }
textarea, input[type="number"], select { width: 100%; color: var(--ink); border: 1px solid var(--line-strong); outline: none; background: var(--surface-soft); }
textarea { min-height: 172px; resize: vertical; padding: 15px 16px; border-radius: var(--radius-md); line-height: 1.9; }
textarea::placeholder { color: #aaa5b8; }
input[type="number"], select { min-height: 48px; padding: 0 13px; border-radius: var(--radius-sm); }
input[type="number"] { direction: ltr; text-align: right; }
select { appearance: auto; }
textarea:focus, input[type="number"]:focus, select:focus { border-color: var(--brand-purple); box-shadow: 0 0 0 4px rgba(122, 62, 137, .11); }
.prompt-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 11px; }
.prompt-tool-help { color: var(--muted); font-size: 11px; }
.secondary-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 13px; color: var(--brand-deep); border: 1px solid rgba(122, 62, 137, .23); border-radius: 10px; background: rgba(122, 62, 137, .06); font-size: 11px; font-weight: 800; transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out, transform 160ms ease-out; }
.secondary-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.secondary-button:hover, .secondary-button:focus-visible { color: #fff; border-color: var(--brand-purple); background: var(--brand-purple); outline: none; }
.secondary-button:focus-visible { outline: 3px solid rgba(122, 62, 137, .2); outline-offset: 2px; }
.secondary-button[disabled] { cursor: wait; opacity: .58; }
.secondary-button .button-spinner { border-color: rgba(122, 62, 137, .25); border-top-color: var(--brand-purple); }
.secondary-button.loading .button-spinner { display: inline-block; }
.secondary-button.loading svg { display: none; }
.field-help { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; color: var(--muted); font-size: 10px; }
.field-help span:last-child { direction: rtl; white-space: nowrap; }
.reference-field { margin-top: 23px; }
.reference-upload { position: relative; }
.reference-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.reference-picker { display: flex; align-items: center; gap: 13px; min-height: 82px; margin: 0; padding: 14px 16px; color: var(--ink-soft); border: 1px dashed rgba(122, 62, 137, .34); border-radius: var(--radius-md); background: linear-gradient(120deg, rgba(122, 62, 137, .035), rgba(89, 201, 205, .06)); cursor: pointer; transition: border-color 160ms ease-out, background 160ms ease-out, transform 160ms ease-out; }
.reference-picker:hover { border-color: var(--brand-cyan); background: rgba(89, 201, 205, .1); }
.reference-picker:active { transform: scale(.995); }
.reference-picker svg { flex: 0 0 auto; width: 24px; height: 24px; fill: none; stroke: var(--brand-purple); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.reference-picker strong, .reference-picker small { display: block; }
.reference-picker strong { color: var(--ink); font-size: 12px; font-weight: 800; }
.reference-picker small { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 500; direction: ltr; text-align: right; }
.reference-input:focus-visible + .reference-picker { outline: 3px solid rgba(89, 201, 205, .35); outline-offset: 3px; border-color: var(--brand-cyan); }
.reference-upload.has-file .reference-picker { display: none; }
.reference-upload.is-preparing .reference-picker { opacity: .62; }
.reference-preview { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 82px; padding: 8px; border: 1px solid rgba(0, 169, 143, .28); border-radius: var(--radius-md); background: rgba(0, 169, 143, .055); }
.reference-preview[hidden] { display: none; }
.reference-preview-main { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; }
.reference-preview-grid { display: grid; grid-template-columns: repeat(4, minmax(48px, 72px)); gap: 6px; min-width: 0; }
.reference-preview-grid img { width: 72px; height: 60px; object-fit: cover; border: 1px solid rgba(122, 62, 137, .14); border-radius: 9px; background: var(--canvas-deep); }
.reference-preview-copy { min-width: 0; }
.reference-preview-copy strong, .reference-preview-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reference-preview-copy strong { color: var(--ink); font-size: 12px; }
.reference-preview-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; direction: ltr; text-align: right; }
.reference-remove { min-height: 42px; padding: 7px 10px; color: var(--danger); border: 1px solid rgba(179, 62, 85, .25); border-radius: 9px; background: transparent; font-size: 10px; font-weight: 800; transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out; }
.reference-remove:hover, .reference-remove:focus-visible { color: #fff; border-color: var(--danger); background: var(--danger); outline: none; }
.reference-remove:focus-visible { outline: 3px solid rgba(179, 62, 85, .2); outline-offset: 2px; }
.reference-options { display: grid; grid-template-columns: 1.1fr .75fr 1fr; gap: 12px; margin-top: 17px; }
.reference-options label { margin-bottom: 7px; }
.reference-calibration-help { margin: 8px 0 0; color: var(--muted); font-size: 10px; }
.form-row { display: flex; align-items: flex-start; gap: 16px; margin-top: 23px; }
.field-group { flex: 1; min-width: 0; }
.output-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; min-height: 48px; }
.output-pills span, .skill-tags span { padding: 6px 8px; color: var(--brand-deep); border: 1px solid rgba(122, 62, 137, .18); border-radius: 7px; background: rgba(122, 62, 137, .055); font: 800 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 54px; margin-top: 26px; padding: 0 18px; color: #fff; border: 1px solid var(--brand-deep); border-radius: 14px; background: var(--brand-deep); box-shadow: 0 13px 24px rgba(104, 44, 132, .18); font-size: 13px; font-weight: 800; transition: transform 160ms ease-out, background 160ms ease-out, box-shadow 160ms ease-out; }
.primary-button:hover { background: #572372; box-shadow: 0 16px 30px rgba(104, 44, 132, .22); }
.primary-button:focus-visible { outline: 3px solid rgba(89, 201, 205, .45); outline-offset: 3px; }
.primary-button[disabled] { cursor: wait; opacity: .68; }
.button-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .36); border-top-color: #fff; border-radius: 50%; animation: spin 700ms linear infinite; }
.primary-button.loading .button-spinner { display: inline-block; }
.primary-button.loading svg { display: none; }
.form-message { min-height: 20px; margin: 12px 0 0; color: var(--muted); font-size: 11px; }
.form-message.error { color: var(--danger); }
.form-message.success { color: var(--success); }

.workflow-panel { background: linear-gradient(155deg, #fff, #fbf8fd); }
.workflow-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.workflow-list li { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.workflow-list li:first-child { padding-top: 0; }
.workflow-list li:last-child { border-bottom: 0; }
.workflow-list li > span { flex: 0 0 auto; color: var(--brand-purple); font: 800 11px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.workflow-list strong { color: var(--ink); font-size: 14px; font-weight: 800; }
.workflow-list p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.8; }
.workflow-note { display: flex; align-items: center; gap: 10px; margin-top: 20px; padding: 12px; color: var(--brand-deep); border: 1px solid rgba(89, 201, 205, .22); border-radius: 13px; background: rgba(89, 201, 205, .08); font-size: 10px; line-height: 1.8; }
.workflow-note-icon { display: grid; flex: 0 0 auto; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .72); }
.workflow-note-icon svg { width: 17px; height: 17px; fill: none; stroke: var(--brand-purple); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.skill-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); }
.skill-label { color: var(--muted); font-size: 10px; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.skill-tags span { color: var(--brand-teal); border-color: rgba(0, 169, 143, .2); background: rgba(0, 169, 143, .06); font-size: 9px; }

.jobs-panel { min-height: 190px; }
.text-button { min-height: 40px; padding: 7px 0; color: var(--brand-purple); font-size: 11px; font-weight: 800; transition: color 160ms ease-out; }
.text-button:hover, .text-button:focus-visible { color: var(--brand-deep); outline: none; }
.jobs-list { display: grid; min-width: 0; gap: 10px; }
.empty-state { padding: 30px 10px 24px; color: var(--soft); text-align: center; }
.empty-icon { display: block; margin-bottom: 7px; color: var(--brand-purple); font-size: 24px; line-height: 1; }
.empty-state p { margin-bottom: 3px; color: var(--ink-soft); font-size: 13px; font-weight: 700; }
.empty-state small { font-size: 10px; }
.job-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; gap: 16px; align-items: center; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius-md); background: rgba(255, 255, 255, .74); transition: border-color 160ms ease-out, box-shadow 160ms ease-out; }
.job-row:hover { border-color: rgba(122, 62, 137, .25); box-shadow: var(--shadow-card); }
.job-row > div { min-width: 0; }
.job-title-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.job-title { overflow: hidden; color: var(--ink); font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.reference-chip { flex: 0 0 auto; padding: 4px 7px; color: var(--brand-teal); border: 1px solid rgba(0, 169, 143, .2); border-radius: 999px; background: rgba(0, 169, 143, .06); font: 800 9px/1 "Noto Sans Arabic", sans-serif; white-space: nowrap; }
.job-meta { margin: 5px 0 0; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.job-progress-wrap { max-width: 240px; margin-top: 11px; }
.job-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.job-progress-state { display: inline-flex; align-items: center; gap: 7px; color: var(--brand-deep); }
.job-progress-loader { width: 11px; height: 11px; flex: 0 0 auto; border: 2px solid rgba(89, 201, 205, .28); border-top-color: var(--brand-cyan); border-radius: 50%; animation: spin 800ms linear infinite; }
.job-progress-value { color: var(--brand-deep); font: 800 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.job-progress { width: 100%; height: 6px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: #ebe9f0; }
.job-progress span { display: block; height: 100%; border-radius: inherit; background: var(--brand-cyan); transition: width 220ms var(--ease-out); }
.jobs-pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 19px; direction: rtl; }
.jobs-pagination[hidden] { display: none; }
.pagination-pages { display: flex; align-items: center; gap: 6px; }
.pagination-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 7px 10px; color: var(--brand-purple); border: 1px solid rgba(122, 62, 137, .2); border-radius: 9px; background: #fff; font-size: 10px; font-weight: 800; transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out, transform 160ms ease-out; }
.pagination-button:hover, .pagination-button:focus-visible, .pagination-button[aria-current="page"] { color: #fff; border-color: var(--brand-deep); background: var(--brand-deep); outline: none; }
.pagination-button:active { transform: scale(.97); }
.pagination-button:disabled { cursor: not-allowed; opacity: .4; }
.pagination-summary { min-width: 88px; color: var(--muted); font-size: 10px; text-align: center; }
.job-actions { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 6px; margin-top: 9px; }
.job-downloads { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 6px; }
.job-actions a, .format-link, .delete-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 11px; color: var(--brand-purple); border: 1px solid rgba(122, 62, 137, .2); border-radius: 9px; background: #fff; font-size: 10px; font-weight: 800; text-decoration: none; transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out, transform 160ms ease-out; }
.job-actions a:hover, .job-actions a:focus-visible, .format-link:hover, .format-link:focus-visible { color: #fff; border-color: var(--brand-purple); background: var(--brand-purple); outline: none; }
.job-thumbnail { position: relative; display: block; width: 140px; min-height: 92px; padding: 0; overflow: hidden; color: #fff; border: 1px solid rgba(89, 201, 205, .55); border-radius: 11px; background: #2b2542; cursor: pointer; transition: transform 160ms ease-out, box-shadow 160ms ease-out; }
.job-thumbnail img { display: block; width: 100%; height: 92px; object-fit: cover; }
.job-thumbnail span { position: absolute; right: 5px; bottom: 5px; left: 5px; padding: 5px 6px; border-radius: 6px; background: rgba(41, 36, 59, .84); font-size: 9px; font-weight: 800; }
.job-thumbnail:hover, .job-thumbnail:focus-visible { border-color: var(--brand-cyan); outline: none; box-shadow: 0 0 0 4px rgba(89, 201, 205, .16); transform: translateY(-2px); }
.job-thumbnail:active { transform: scale(.98); }
.delete-button { color: var(--danger); border-color: rgba(179, 62, 85, .22); }
.delete-button:hover, .delete-button:focus-visible { color: #fff; border-color: var(--danger); background: var(--danger); outline: none; }
.delete-button:disabled { cursor: wait; opacity: .5; }
.job-actions a:focus-visible, .format-link:focus-visible, .delete-button:focus-visible { outline: 3px solid rgba(122, 62, 137, .22); outline-offset: 2px; }

.preview-dialog { width: min(1020px, calc(100% - 28px)); max-width: none; max-height: calc(100dvh - 28px); margin: auto; padding: 0; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 26px; background: #fff; box-shadow: 0 32px 100px rgba(49, 38, 79, .28); overflow: auto; }
.preview-dialog::backdrop { background: rgba(41, 36, 59, .52); backdrop-filter: blur(7px); }
.preview-shell { display: grid; gap: 17px; padding: clamp(18px, 3vw, 30px); }
.preview-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.preview-header h2 { margin-bottom: 4px; }
.preview-meta-row { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.preview-meta { margin: 0; color: var(--muted); font-size: 11px; }
.preview-prompt-info { position: relative; display: inline-flex; padding-bottom: 8px; margin-bottom: -8px; }
.preview-prompt-button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; color: var(--brand-purple); border: 1px solid rgba(122, 62, 137, .22); border-radius: 50%; background: rgba(122, 62, 137, .06); cursor: help; transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out; }
.preview-prompt-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.preview-prompt-button:hover, .preview-prompt-button:focus-visible { color: #fff; border-color: var(--brand-purple); background: var(--brand-purple); outline: none; }
.preview-prompt-button:focus-visible { box-shadow: 0 0 0 3px rgba(122, 62, 137, .2); }
.preview-prompt-tooltip { position: absolute; z-index: 4; top: 100%; right: 0; width: min(340px, calc(100vw - 72px)); max-height: 220px; padding: 10px 12px; overflow: auto; color: #fff; border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px; background: rgba(41, 36, 59, .96); box-shadow: 0 12px 28px rgba(49, 38, 79, .26); font-size: 11px; font-weight: 600; line-height: 1.8; opacity: 0; pointer-events: auto; transform: translateY(-4px); transition: opacity 160ms ease-out, transform 160ms ease-out; visibility: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-prompt-info:hover .preview-prompt-tooltip, .preview-prompt-button:focus-visible + .preview-prompt-tooltip { opacity: 1; transform: translateY(0); visibility: visible; }
.preview-stage { position: relative; min-height: 360px; height: min(60dvh, 590px); overflow: hidden; border: 1px solid #38bdf8; border-radius: 18px; background: radial-gradient(circle at 50% 14%, rgba(186, 230, 253, .92) 0, rgba(56, 189, 248, .46) 22%, transparent 46%), radial-gradient(circle at 88% 86%, rgba(14, 116, 144, .54), transparent 52%), linear-gradient(145deg, #075985 0%, #0e7490 48%, #0369a1 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 12px 30px rgba(14, 116, 144, .24); direction: ltr; }
.preview-canvas { display: block; width: 100%; height: 100%; outline: none; cursor: grab; touch-action: none; }
.preview-canvas:active { cursor: grabbing; }
.preview-hover-label { position: absolute; z-index: 2; max-width: calc(100% - 16px); margin: 0; padding: 7px 10px; overflow: hidden; color: #fff; border: 1px solid rgba(89, 201, 205, .55); border-radius: 8px; background: rgba(41, 36, 59, .9); box-shadow: 0 8px 24px rgba(49, 38, 79, .25); font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; pointer-events: none; direction: rtl; }
.preview-hover-label[hidden] { display: none; }
.preview-transform-hint { position: absolute; z-index: 2; right: 12px; bottom: 12px; max-width: min(430px, calc(100% - 24px)); margin: 0; padding: 8px 10px; color: var(--ink-soft); border: 1px solid rgba(122, 62, 137, .2); border-radius: 9px; background: rgba(255, 255, 255, .9); box-shadow: 0 7px 18px rgba(49, 38, 79, .12); font-size: 10px; font-weight: 800; pointer-events: none; direction: rtl; }
.preview-transform-hint[hidden] { display: none; }
.preview-state { position: absolute; top: 50%; left: 50%; margin: 0; padding: 10px 13px; color: #fff; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; background: rgba(41, 36, 59, .82); font-size: 11px; transform: translate(-50%, -50%); pointer-events: none; direction: rtl; }
.preview-state-error { color: #ffdce3; border-color: rgba(255, 220, 227, .34); }
.preview-graphics-quality { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 13px; border: 1px solid rgba(16, 185, 129, .38); border-radius: 12px; background: linear-gradient(135deg, rgba(236, 253, 245, .94), rgba(240, 253, 250, .82)); }
.preview-graphics-quality[hidden] { display: none; }
.preview-graphics-badge { padding: 5px 8px; color: #065f46; border-radius: 999px; background: #a7f3d0; font-size: 10px; font-weight: 850; }
.preview-graphics-quality p { margin: 0; color: #166534; font-size: 10px; font-weight: 750; direction: ltr; }
.preview-stage[data-preview-mode="print"] { border-color: #94a3b8; background: radial-gradient(circle at 50% 16%, rgba(255, 255, 255, .96) 0, rgba(226, 232, 240, .9) 30%, rgba(148, 163, 184, .78) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76), 0 12px 30px rgba(71, 85, 105, .2); }
.preview-mode-panel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 20px; align-items: center; padding: 14px 16px; border: 1px solid rgba(89, 201, 205, .32); border-radius: var(--radius-md); background: linear-gradient(135deg, rgba(236, 254, 255, .88), rgba(248, 250, 252, .94)); }
.preview-mode-panel h3 { margin: 2px 0 0; color: var(--ink); font-size: 14px; }
.preview-mode-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.preview-mode-button { min-height: 44px; padding: 8px 12px; color: var(--ink-soft); border: 1px solid rgba(89, 201, 205, .38); border-radius: 9px; background: #fff; font-size: 11px; font-weight: 800; cursor: pointer; transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out; }
.preview-mode-button[aria-pressed="true"] { color: #fff; border-color: var(--brand-deep); background: var(--brand-deep); }
.preview-mode-button:hover, .preview-mode-button:focus-visible { border-color: var(--brand-deep); outline: none; }
.preview-mode-button:focus-visible { box-shadow: 0 0 0 3px rgba(89, 201, 205, .34); }
.preview-mode-button:disabled { cursor: not-allowed; opacity: .48; }
.preview-mode-status { grid-column: 1 / -1; margin: 0; color: var(--ink-soft); font-size: 11px; font-weight: 700; line-height: 1.7; }
.preview-controls { display: grid; grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr); gap: 12px; }
.preview-control-card { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.preview-control-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.preview-control-heading h3 { color: var(--ink); }
.preview-control-heading output { color: var(--brand-purple); font: 800 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.range-label { margin-top: 14px; color: var(--ink-soft); font-size: 10px; font-weight: 600; }
.preview-control-card input[type="range"] { display: block; width: 100%; min-height: 44px; margin: 10px 0 0; accent-color: var(--brand-purple); cursor: ew-resize; touch-action: manipulation; direction: ltr; }
.print-prep-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; margin-top: 10px; }
.print-prep-row input { min-width: 0; min-height: 44px; padding: 0 10px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 9px; outline: none; background: #fff; font-size: 12px; direction: ltr; }
.print-prep-row input:focus { border-color: var(--brand-purple); box-shadow: 0 0 0 3px rgba(122, 62, 137, .1); }
.print-quality-list { display: grid; gap: 7px; padding: 0; margin: 12px 0; list-style: none; }
.print-quality-list li { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 8px; padding: 8px 9px; color: var(--ink-soft); border: 1px solid rgba(148, 163, 184, .42); border-radius: 8px; background: rgba(255, 255, 255, .72); font-size: 10px; font-weight: 650; line-height: 1.55; }
.print-quality-list strong { color: var(--ink); font-weight: 800; }
#previewPrintDownload { width: 100%; margin-top: 9px; }
#previewPreparePrint { width: 100%; margin-top: 9px; }
.preview-selection-name { margin: 12px 0 2px; color: var(--brand-deep); font-size: 12px; font-weight: 800; }
.preview-control-note { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.preview-dimensions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 13px 0 10px; }
.preview-dimension-control { min-width: 0; }
.preview-dimension-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.preview-dimension-label output { color: var(--brand-purple); font: 800 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; direction: ltr; }
.preview-dimensions input { width: 100%; min-height: 42px; margin-top: 5px; padding: 0 8px; color: var(--ink); border: 1px solid var(--line-strong); border-radius: 8px; outline: none; background: #fff; font-size: 12px; }
.preview-dimensions input:focus { border-color: var(--brand-purple); box-shadow: 0 0 0 3px rgba(122, 62, 137, .1); }
.preview-dimensions input:disabled { cursor: not-allowed; opacity: .48; }
.preview-dimension-range { min-height: 44px !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; outline: none !important; background: transparent !important; accent-color: var(--brand-cyan); cursor: ew-resize; box-shadow: none !important; }
.preview-dimension-range:focus-visible { outline: 3px solid rgba(89, 201, 205, .38) !important; outline-offset: 3px !important; border-radius: 5px !important; }
.preview-mini-button { min-height: 42px; padding: 7px 10px; color: var(--brand-purple); border: 1px solid rgba(122, 62, 137, .2); border-radius: 9px; background: rgba(122, 62, 137, .06); font-size: 10px; font-weight: 800; transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out, transform 160ms ease-out; }
.preview-mini-button:hover, .preview-mini-button:focus-visible { color: #fff; border-color: var(--brand-purple); background: var(--brand-purple); outline: none; }
.preview-selection-card > .preview-tool-button { width: 100%; }
.preview-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.preview-hint { margin: 0; color: var(--muted); font-size: 10px; }
.preview-tools { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px; }
.preview-tool-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; color: var(--brand-purple); border: 1px solid rgba(122, 62, 137, .2); border-radius: 9px; background: rgba(122, 62, 137, .06); font-size: 10px; font-weight: 800; text-decoration: none; cursor: pointer; transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out, transform 160ms ease-out; }
.preview-tool-button:hover, .preview-tool-button:focus-visible { color: #fff; border-color: var(--brand-purple); background: var(--brand-purple); outline: none; }
.preview-tool-button:focus-visible { outline: 3px solid rgba(122, 62, 137, .22); outline-offset: 2px; }
.preview-tool-button:disabled { cursor: not-allowed; opacity: .45; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 70; max-width: min(380px, calc(100vw - 40px)); padding: 13px 15px; color: #fff; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: var(--ink); box-shadow: 0 16px 40px rgba(49, 38, 79, .25); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity 180ms ease-out, transform 180ms ease-out; font-size: 11px; }
.toast.visible { opacity: 1; transform: translateY(0); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 920px) {
  .shell { padding-top: 44px; }
  .hero { grid-template-columns: minmax(0, 1fr) minmax(280px, .78fr); gap: 22px; }
  .hero-art { min-height: 280px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .workflow-panel { order: 2; }
}

@media (max-width: 720px) {
  .topbar-inner, .shell { width: calc(100% - 28px); max-width: 620px; }
  .topbar-inner { min-height: 70px; }
  .brand-context, .mode-badge { display: none; }
  .brand-divider { display: none; }
  .brand-logo { width: 142px; }
  .hero { display: block; padding-bottom: 33px; }
  .hero-copy { font-size: 15px; }
  .hero-art { min-height: 275px; margin-top: 28px; }
  .engine-grid { grid-template-columns: minmax(0, 1fr); }
  .engine-grid > .section-heading-wide { grid-column: auto; }
  .panel { padding: 22px; }
  .preview-controls { grid-template-columns: 1fr; }
  .preview-mode-panel { grid-template-columns: 1fr; }
}

@media (max-width: 500px) {
  h1 { font-size: 35px; }
  h2 { font-size: 19px; }
  .shell { padding-top: 34px; padding-bottom: 62px; }
  .hero-points { gap: 7px; }
  .hero-points span { font-size: 10px; }
  .prompt-tools { display: block; }
  .prompt-tool-help { display: block; margin-bottom: 9px; line-height: 1.8; }
  .secondary-button { width: 100%; }
  .form-row { display: block; }
  .field-group + .field-group { margin-top: 18px; }
  .reference-options { grid-template-columns: 1fr; }
  .reference-preview { grid-template-columns: 1fr; }
  .reference-preview-main { grid-template-columns: 1fr; }
  .reference-preview-grid { grid-template-columns: repeat(4, minmax(48px, 1fr)); }
  .reference-preview-grid img { width: 100%; height: 58px; }
  .reference-remove { grid-column: 1 / -1; width: 100%; }
  .field-help { align-items: flex-start; flex-direction: column; gap: 2px; }
  .field-help span:last-child { white-space: normal; }
  .job-row { grid-template-columns: 1fr; }
  .job-progress { width: 100%; }
  .job-actions, .job-downloads { justify-content: flex-start; }
  .job-thumbnail { width: 100%; }
  .preview-stage { min-height: 280px; height: min(58dvh, 420px); }
  .preview-dimensions { grid-template-columns: 1fr; }
  .print-prep-row { grid-template-columns: 1fr; }
  .preview-footer { display: block; }
  .preview-tools { justify-content: flex-start; margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Chat workspace redesign */
:root {
  --chat-bg: #19152a;
  --chat-sidebar: #241535;
  --chat-surface: #302141;
  --chat-surface-soft: #291b39;
  --chat-border: rgba(89, 201, 205, .16);
  --chat-border-strong: rgba(89, 201, 205, .30);
  --chat-text: #fbf9fd;
  --chat-text-soft: #e8dfef;
  --chat-muted: #b6a9c1;
  --chat-faint: #8c7b99;
  --chat-brand: #7a3e89;
  --chat-brand-deep: #682c84;
  --chat-cyan: #59c9cd;
  --chat-teal: #00a98f;
  --chat-accent: #59c9cd;
  --chat-accent-strong: #00a98f;
  --chat-success: #00a98f;
  --chat-danger: #e56b83;
  --chat-width: 820px;
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
}

html { background: var(--chat-bg); scroll-behavior: auto; }
body { min-height: 100dvh; overflow: hidden; color: var(--chat-text); background: var(--chat-bg); direction: rtl; }
button, input, textarea, select { color-scheme: dark; }
.app-shell { display: grid; grid-template-columns: minmax(0, 1fr) 280px; height: 100vh; height: 100dvh; min-height: 100vh; min-height: 100dvh; overflow: hidden; direction: ltr; }
.app-sidebar { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; min-width: 0; min-height: 100dvh; padding: 14px 12px 12px; color: var(--chat-text-soft); background: var(--chat-sidebar); direction: rtl; }
.chat-main { grid-column: 1; grid-row: 1; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; width: 100%; min-width: 0; height: 100vh; height: 100dvh; min-height: 100vh; min-height: 100dvh; overflow: hidden; color: var(--chat-text); background: var(--chat-bg); direction: rtl; }
.sidebar-header { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 10px; padding: 0 4px 13px; }
.brand { display: inline-flex; align-items: center; min-width: 0; text-decoration: none; }
.brand-logo { width: 136px; max-width: 100%; filter: none; opacity: 1; }
.sidebar-header .icon-button { color: var(--chat-muted); border-color: var(--chat-border); background: transparent; }
.sidebar-header .icon-button:hover, .sidebar-header .icon-button:focus-visible { color: var(--chat-text); border-color: var(--chat-border-strong); background: var(--chat-surface); }
.mobile-only { display: none; }
.new-project-button { display: flex; align-items: center; width: 100%; min-height: 46px; gap: 11px; padding: 8px 12px; color: var(--chat-text); border: 1px solid var(--chat-border-strong); border-radius: 10px; background: transparent; font-size: 13px; font-weight: 700; text-align: right; transition: background 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 120ms ease-out; }
.new-project-button svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.new-project-button kbd { margin-right: auto; color: var(--chat-faint); border: 1px solid var(--chat-border); border-radius: 5px; padding: 2px 5px; font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.new-project-button:hover, .new-project-button:focus-visible { border-color: rgba(89, 201, 205, .55); background: rgba(89, 201, 205, .12); outline: none; }
.new-project-button:active, .composer-icon-button:active, .composer-tool-button:active, .send-button:active { transform: scale(.97); }
.sidebar-list-heading, .sidebar-status-heading { display: flex; align-items: center; gap: 8px; min-height: 38px; color: var(--chat-muted); font-size: 11px; font-weight: 700; }
.sidebar-list-heading { margin-top: 14px; padding: 0 4px; }
.sidebar-action { display: grid; place-items: center; width: 34px; height: 34px; margin-right: auto; padding: 0; color: var(--chat-muted); border: 0; border-radius: 8px; background: transparent; transition: color 160ms ease-out, background 160ms ease-out, transform 120ms ease-out; }
.sidebar-action svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-action:hover, .sidebar-action:focus-visible { color: var(--chat-text); background: var(--chat-surface); outline: none; }
.sidebar-action:active { transform: scale(.95); }
.sidebar-search { display: flex; align-items: center; min-height: 38px; gap: 8px; margin: 2px 0 8px; padding: 0 10px; color: var(--chat-faint); border: 1px solid transparent; border-radius: 8px; background: rgba(255, 255, 255, .05); }
.sidebar-search:focus-within { color: var(--chat-text-soft); border-color: rgba(89, 201, 205, .45); background: var(--chat-surface); }
.sidebar-search svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-search input { width: 100%; min-width: 0; min-height: 36px; padding: 0; color: var(--chat-text); border: 0; outline: 0; background: transparent; font-size: 12px; }
.sidebar-search input::placeholder { color: var(--chat-faint); }
.project-list { display: grid; min-height: 0; gap: 3px; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.project-list:empty::before { content: "لا توجد مشاريع بعد"; display: block; padding: 22px 11px; color: var(--chat-faint); font-size: 12px; text-align: center; }
.project-empty { margin: 0; padding: 22px 11px; color: var(--chat-faint); font-size: 11px; text-align: center; }
.project-item { display: flex; align-items: center; min-width: 0; gap: 2px; }
.project-item-button { display: flex; align-items: center; width: auto; min-width: 0; min-height: 48px; flex: 1; gap: 9px; padding: 8px 9px; color: var(--chat-text-soft); border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: right; cursor: pointer; transition: color 160ms ease-out, background 160ms ease-out, border-color 160ms ease-out; }
.project-item-button:hover, .project-item-button:focus-visible { color: var(--chat-text); background: rgba(255, 255, 255, .07); outline: none; }
.project-item-button[aria-current="page"] { color: var(--chat-text); border-color: rgba(89, 201, 205, .32); background: rgba(104, 44, 132, .24); }
.project-item-icon { display: grid; place-items: center; width: 26px; height: 26px; flex: 0 0 auto; color: var(--chat-muted); border: 1px solid var(--chat-border); border-radius: 7px; background: var(--chat-surface); }
.project-item-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.project-item-button[aria-current="page"] .project-item-icon { color: var(--chat-cyan); border-color: rgba(89, 201, 205, .45); }
.project-item-copy { min-width: 0; flex: 1; }
.project-item-title, .project-item-meta { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-item-title { font-size: 12px; font-weight: 700; line-height: 1.5; }
.project-item-meta { margin-top: 2px; color: var(--chat-faint); font-size: 10px; line-height: 1.4; }
.project-item-button[aria-current="page"] .project-item-meta { color: var(--chat-muted); }
.project-status-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--chat-faint); }
.project-status-dot.is-active { background: var(--chat-cyan); box-shadow: 0 0 0 3px rgba(89, 201, 205, .16); }
.project-status-dot.is-ready { background: var(--chat-success); }
.project-status-dot.is-error { background: var(--chat-danger); }
.project-delete-button { display: grid; place-items: center; width: 44px; min-width: 44px; min-height: 44px; padding: 0; color: var(--chat-faint); border: 1px solid transparent; border-radius: 8px; background: transparent; cursor: pointer; transition: color 160ms ease-out, background 160ms ease-out, border-color 160ms ease-out, transform 120ms ease-out; }
.project-delete-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.project-delete-button:hover, .project-delete-button:focus-visible { color: #fda4af; border-color: rgba(251, 113, 133, .3); background: rgba(225, 29, 72, .14); outline: none; }
.project-delete-button:active { transform: scale(.95); }
.project-delete-button:disabled { cursor: wait; opacity: .5; }
.sidebar-bottom { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--chat-border); }
.sidebar-status-heading { min-height: 35px; padding: 0 4px; font-size: 10px; }
.sidebar-status-summary { overflow: hidden; max-width: 96px; color: var(--chat-faint); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.engine-stack { display: grid; gap: 5px; }
.app-sidebar .engine-card { display: flex; align-items: center; min-height: 51px; gap: 9px; padding: 7px 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; box-shadow: none; }
.app-sidebar .engine-card:hover { border-color: var(--chat-border); background: rgba(255, 255, 255, .04); }
.app-sidebar .engine-icon { width: 26px; height: 26px; flex-basis: 26px; border-radius: 7px; font-size: 11px; box-shadow: none; }
.app-sidebar .engine-title-row { gap: 5px; }
.app-sidebar .engine-title-row h2 { min-width: 0; color: var(--chat-text-soft); font-size: 11px; font-weight: 700; }
.app-sidebar .engine-main p { margin: 1px 0 0; color: var(--chat-muted); font-size: 9px; }
.app-sidebar .engine-main small { display: none; }
.app-sidebar .status-chip { padding: 2px 5px; font-size: 8px; }
.app-sidebar .status-chip::before { width: 5px; height: 5px; }
.sidebar-footnote { display: flex; align-items: center; gap: 8px; margin: 11px 4px 0; color: var(--chat-faint); font-size: 9px; }
.sidebar-footnote .pulse-dot { width: 6px; height: 6px; background: var(--chat-success); box-shadow: 0 0 0 3px rgba(0, 169, 143, .16); }
.chat-topbar { display: flex; align-items: center; width: 100%; min-width: 0; min-height: 72px; gap: 14px; padding: 12px clamp(18px, 4vw, 42px); border-bottom: 1px solid var(--chat-border); background: rgba(25, 21, 42, .88); backdrop-filter: blur(18px); }
.chat-heading { min-width: 0; flex: 1; }
.chat-kicker { margin: 0 0 2px; color: var(--chat-faint); font-size: 10px; font-weight: 700; }
.chat-heading h1 { max-width: 100%; margin: 0; overflow: hidden; color: var(--chat-text); font-family: "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, sans-serif; font-size: 16px; font-weight: 700; line-height: 1.4; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }
.chat-heading > p:last-child { margin: 2px 0 0; overflow: hidden; color: var(--chat-muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.chat-top-actions { display: flex; align-items: center; gap: 8px; }
.chat-topbar .icon-button { color: var(--chat-muted); border-color: var(--chat-border); background: transparent; }
.chat-topbar .icon-button:hover, .chat-topbar .icon-button:focus-visible { color: var(--chat-text); border-color: var(--chat-border-strong); background: var(--chat-surface); }
.secure-badge { display: inline-flex; align-items: center; min-height: 32px; gap: 7px; padding: 5px 9px; color: var(--chat-muted); border: 1px solid var(--chat-border); border-radius: 999px; font-size: 10px; white-space: nowrap; }
.secure-badge .pulse-dot { width: 6px; height: 6px; background: var(--chat-success); box-shadow: 0 0 0 3px rgba(0, 169, 143, .16); }
.chat-viewport { width: 100%; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scroll-padding-block-end: 28px; scrollbar-color: rgba(255, 255, 255, .18) transparent; scrollbar-width: thin; }
.chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100%; padding: 54px 20px 40px; text-align: center; }
.chat-empty[hidden] { display: none; }
.welcome-mark { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 18px; border: 1px solid rgba(89, 201, 205, .38); border-radius: 18px; background: linear-gradient(145deg, rgba(104, 44, 132, .30), rgba(0, 169, 143, .14)); box-shadow: 0 14px 34px rgba(0, 0, 0, .22); }
.welcome-mark img { width: 34px; height: 38px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(89, 201, 205, .2)); }
.chat-empty .chat-kicker { margin-bottom: 7px; color: var(--chat-accent); font-size: 11px; }
.chat-empty h2 { margin: 0 0 10px; color: var(--chat-text); font-size: clamp(22px, 3vw, 31px); font-weight: 700; letter-spacing: -.035em; }
.chat-empty > p:not(.chat-kicker) { max-width: 420px; margin: 0; color: var(--chat-muted); font-size: 13px; line-height: 1.8; }
.welcome-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(620px, 100%); gap: 9px; margin-top: 28px; }
.suggestion-card { display: flex; align-items: center; min-height: 64px; gap: 9px; padding: 10px; color: var(--chat-text-soft); border: 1px solid var(--chat-border); border-radius: 11px; background: rgba(255, 255, 255, .035); font-size: 11px; font-weight: 600; text-align: right; transition: background 160ms ease-out, border-color 160ms ease-out, transform 120ms ease-out; }
.suggestion-card:hover, .suggestion-card:focus-visible { border-color: rgba(89, 201, 205, .5); background: rgba(0, 169, 143, .12); outline: none; }
.suggestion-card:active { transform: scale(.98); }
.suggestion-icon { display: grid; place-items: center; width: 27px; height: 27px; flex: 0 0 auto; color: var(--chat-cyan); border: 1px solid rgba(89, 201, 205, .30); border-radius: 8px; background: rgba(89, 201, 205, .10); }
.suggestion-icon svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.chat-messages { display: flex; flex-direction: column; width: min(var(--chat-width), calc(100% - 40px)); min-width: 0; gap: 27px; margin: 0 auto; padding: 34px 0 40px; }
.chat-messages:empty { display: none; }
.chat-message { display: flex; min-width: 0; gap: 12px; direction: rtl; }
.chat-message.message-user { justify-content: flex-start; }
.message-avatar { display: grid; place-items: center; width: 30px; height: 30px; flex: 0 0 auto; border-radius: 9px; font-size: 11px; font-weight: 800; }
.message-user .message-avatar { order: 0; color: #fff; background: linear-gradient(145deg, var(--chat-brand-deep), var(--chat-brand)); }
.message-assistant .message-avatar { order: 0; color: var(--chat-text); border: 1px solid rgba(89, 201, 205, .34); background: rgba(89, 201, 205, .12); }
.message-avatar svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.message-body { min-width: 0; }
.message-user .message-body { max-width: min(680px, calc(100% - 42px)); padding: 11px 14px; border: 1px solid var(--chat-border); border-radius: 15px 4px 15px 15px; background: var(--chat-surface); }
.message-content { margin: 0; color: var(--chat-text); font-size: 13px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-meta { margin: 5px 0 0; color: var(--chat-faint); font-size: 9px; }
.message-assistant .message-body { flex: 1; padding-top: 2px; }
.assistant-copy { margin: 0; color: var(--chat-text-soft); font-size: 13px; line-height: 1.85; }
.assistant-copy strong { color: var(--chat-text); font-weight: 700; }
.assistant-copy.error { color: #fecdd3; }
.message-reference { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.message-reference span { padding: 4px 7px; color: var(--chat-muted); border: 1px solid var(--chat-border); border-radius: 999px; font-size: 9px; }
.message-assistant .job-progress-wrap { max-width: 420px; margin-top: 13px; }
.message-assistant .job-progress-heading { color: var(--chat-muted); }
.message-assistant .job-progress-state { color: var(--chat-text-soft); }
.message-assistant .job-progress-value { color: var(--chat-accent); }
.message-assistant .job-progress { background: rgba(255, 255, 255, .10); }
.message-assistant .job-progress span { background: var(--chat-accent-strong); }
.assistant-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 13px; }
.message-assistant .job-downloads { display: flex; flex-wrap: wrap; gap: 6px; }
.message-assistant .job-actions a, .message-assistant .format-link, .message-assistant .delete-button { min-height: 38px; padding: 6px 10px; color: var(--chat-text-soft); border: 1px solid var(--chat-border-strong); border-radius: 8px; background: rgba(255, 255, 255, .05); font-size: 10px; }
.message-assistant .job-actions a:hover, .message-assistant .job-actions a:focus-visible, .message-assistant .format-link:hover, .message-assistant .format-link:focus-visible { color: var(--chat-text); border-color: rgba(89, 201, 205, .65); background: rgba(89, 201, 205, .14); }
.message-assistant .delete-button { color: #fda4af; border-color: rgba(251, 113, 133, .28); }
.message-assistant .delete-button:hover, .message-assistant .delete-button:focus-visible { color: #fff; border-color: var(--chat-danger); background: rgba(225, 29, 72, .72); }
.message-assistant .job-thumbnail { width: 168px; min-height: 106px; border-color: rgba(89, 201, 205, .38); background: #19152a; }
.message-assistant .job-thumbnail img { height: 106px; }
.message-assistant .job-thumbnail span { background: rgba(36, 21, 53, .88); }
.message-assistant .job-thumbnail:hover, .message-assistant .job-thumbnail:focus-visible { border-color: var(--chat-cyan); box-shadow: 0 0 0 4px rgba(89, 201, 205, .14); }
.composer-area { width: 100%; min-width: 0; padding: 16px clamp(16px, 4vw, 42px) clamp(22px, 3vh, 30px); background: transparent; }
.composer-form { position: sticky; z-index: 20; bottom: 0; width: min(var(--chat-width), 100%); min-width: 0; margin: 0 auto; padding: 10px 12px 11px; border: 1px solid var(--chat-border-strong); border-radius: 15px; background: var(--chat-surface); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.composer-form > textarea { display: block; width: 100%; min-height: 28px; max-height: 190px; margin: 0; padding: 5px 4px 7px; resize: none; color: var(--chat-text); border: 0; outline: 0; background: transparent; font-size: 13px; line-height: 1.75; }
.composer-form > textarea::placeholder { color: var(--chat-muted); }
.composer-form > textarea:focus { box-shadow: none; }
.composer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
.composer-tools, .composer-submit-tools { display: flex; align-items: center; gap: 5px; min-width: 0; }
.composer-icon-button { display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 auto; padding: 0; color: var(--chat-muted); border: 1px solid transparent; border-radius: 9px; background: transparent; transition: color 160ms ease-out, background 160ms ease-out, transform 120ms ease-out; }
.composer-icon-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.composer-icon-button:hover, .composer-icon-button:focus-visible { color: var(--chat-text); background: rgba(255, 255, 255, .08); outline: none; }
.composer-tool-button { display: inline-flex; align-items: center; min-height: 36px; gap: 6px; padding: 6px 8px; color: var(--chat-muted); border: 1px solid transparent; border-radius: 8px; background: transparent; font-size: 10px; font-weight: 700; transition: color 160ms ease-out, background 160ms ease-out, border-color 160ms ease-out, transform 120ms ease-out; }
.composer-tool-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.composer-tool-button:hover, .composer-tool-button:focus-visible, .composer-tool-button[aria-expanded="true"] { color: var(--chat-text); border-color: var(--chat-border-strong); background: rgba(255, 255, 255, .07); outline: none; }
.composer-tool-button[hidden] { display: none; }
.optimize-button { color: var(--chat-accent); }
.optimize-button svg { color: currentColor; }
.button-spinner { display: none; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .18); border-top-color: currentColor; border-radius: 50%; animation: spin 700ms linear infinite; }
.composer-tool-button.loading .button-spinner, .send-button.loading .button-spinner { display: inline-block; }
.composer-tool-button.loading > svg, .send-button.loading > svg { display: none; }
.char-count { color: var(--chat-faint); font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; white-space: nowrap; }
.send-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px; gap: 6px; padding: 7px 12px; color: #fff; border: 0; border-radius: 10px; background: var(--chat-accent-strong); font-size: 11px; font-weight: 800; transition: background 160ms ease-out, transform 120ms ease-out, opacity 160ms ease-out; }
.send-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.send-button:hover, .send-button:focus-visible { background: #008f7a; outline: none; }
.send-button:disabled { cursor: wait; opacity: .55; }
.composer-options { margin-top: 11px; padding-top: 12px; border-top: 1px solid var(--chat-border); }
.composer-options[hidden], .reference-upload[hidden] { display: none; }
.options-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.options-heading strong, .options-heading small { display: block; }
.options-heading strong { color: var(--chat-text); font-size: 11px; }
.options-heading small { margin-top: 2px; color: var(--chat-muted); font-size: 9px; }
.options-heading .icon-button { width: 32px; height: 32px; color: var(--chat-muted); border-color: var(--chat-border); background: transparent; }
.options-heading .icon-button:hover, .options-heading .icon-button:focus-visible { color: var(--chat-text); border-color: var(--chat-border-strong); background: rgba(255, 255, 255, .06); }
.options-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.options-grid .field-group { min-width: 0; }
.options-grid label, .options-grid .field-label { display: block; margin: 0 0 6px; color: var(--chat-text-soft); font-size: 10px; font-weight: 700; }
.options-grid select, .options-grid input[type="number"] { min-height: 40px; padding: 0 9px; color: var(--chat-text); border: 1px solid var(--chat-border-strong); border-radius: 8px; outline: 0; background: var(--chat-surface-soft); font-size: 10px; }
.options-grid select:focus, .options-grid input[type="number"]:focus { border-color: rgba(89, 201, 205, .7); box-shadow: 0 0 0 3px rgba(89, 201, 205, .14); }
.options-grid input[type="number"] { text-align: right; }
.output-group { grid-column: span 2; }
.output-pills { display: flex; flex-wrap: wrap; align-items: center; min-height: 40px; gap: 5px; }
.output-pills span { padding: 5px 7px; color: var(--chat-muted); border: 1px solid var(--chat-border); border-radius: 6px; font: 9px/1 ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.reference-upload { margin: 0 0 10px; }
.reference-picker { min-height: 66px; padding: 10px 12px; color: var(--chat-text-soft); border-color: rgba(89, 201, 205, .36); border-radius: 10px; background: rgba(89, 201, 205, .06); }
.reference-picker:hover { border-color: var(--chat-cyan); background: rgba(89, 201, 205, .11); }
.reference-picker svg { color: var(--chat-accent); stroke: currentColor; }
.reference-picker strong { color: var(--chat-text); font-size: 11px; }
.reference-picker small { color: var(--chat-muted); font-size: 9px; }
.reference-preview { min-height: 66px; border-color: rgba(0, 169, 143, .38); background: rgba(0, 169, 143, .08); }
.reference-preview-copy strong { color: var(--chat-text); font-size: 11px; }
.reference-preview-copy small, .field-help { color: var(--chat-muted); font-size: 9px; }
.reference-remove { min-height: 36px; color: #fda4af; border-color: rgba(251, 113, 133, .35); font-size: 9px; }
.reference-remove:hover, .reference-remove:focus-visible { color: #fff; border-color: var(--chat-danger); background: rgba(225, 29, 72, .72); }
.reference-calibration-help { margin: 8px 0 0; color: var(--chat-muted); font-size: 9px; }
.form-message { min-height: 0; margin: 5px 2px 0; color: var(--chat-muted); font-size: 10px; }
.form-message.success { color: var(--chat-success); }
.form-message.error { color: #fda4af; }
.composer-note { width: min(var(--chat-width), 100%); margin: 8px auto 0; color: var(--chat-faint); font-size: 9px; text-align: center; }
.toast { right: 20px; bottom: 20px; color: var(--chat-text); border-color: var(--chat-border-strong); border-radius: 10px; background: var(--chat-sidebar); box-shadow: 0 16px 40px rgba(0, 0, 0, .38); font-size: 11px; }
.sidebar-overlay { display: none; }
.jobs-pagination { display: flex !important; align-items: center; justify-content: space-between; gap: 6px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--chat-border); }
.jobs-pagination .pagination-button { display: grid; place-items: center; width: 34px; min-width: 34px; min-height: 34px; padding: 0; color: var(--chat-muted); border: 1px solid var(--chat-border); border-radius: 8px; background: transparent; font-size: 10px; font-weight: 800; }
.jobs-pagination .pagination-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.jobs-pagination .pagination-button:hover, .jobs-pagination .pagination-button:focus-visible { color: var(--chat-text); border-color: var(--chat-border-strong); background: var(--chat-surface); outline: none; }
.jobs-pagination .pagination-button:active { transform: scale(.95); }
.jobs-pagination .pagination-button:disabled { cursor: not-allowed; opacity: .35; }
.jobs-pagination .pagination-summary { min-width: 0; color: var(--chat-muted); font-size: 10px; font-weight: 700; text-align: center; }
.jobs-pagination[hidden] { display: none !important; }

.confirm-dialog { width: min(440px, calc(100% - 32px)); max-width: none; margin: auto; padding: 0; color: var(--chat-text); border: 1px solid var(--chat-border-strong); border-radius: 18px; background: var(--chat-sidebar); box-shadow: 0 28px 90px rgba(0, 0, 0, .48); }
.confirm-dialog::backdrop { background: rgba(0, 0, 0, .62); backdrop-filter: blur(5px); }
.confirm-shell { display: grid; gap: 20px; padding: 24px; direction: rtl; }
.confirm-header { display: flex; align-items: flex-start; gap: 12px; }
.confirm-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 auto; color: #fda4af; border: 1px solid rgba(251, 113, 133, .3); border-radius: 11px; background: rgba(225, 29, 72, .15); }
.confirm-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.confirm-header h2 { margin: 2px 0 0; color: var(--chat-text); font-size: 17px; }
.confirm-message { margin: 0; color: var(--chat-text-soft); font-size: 12px; line-height: 1.8; white-space: pre-line; overflow-wrap: anywhere; }
.confirm-actions { display: flex; justify-content: flex-start; gap: 8px; }
.confirm-button { min-width: 100px; min-height: 44px; padding: 8px 13px; color: var(--chat-text-soft); border: 1px solid var(--chat-border-strong); border-radius: 9px; background: var(--chat-surface); font-size: 11px; font-weight: 800; cursor: pointer; transition: color 160ms ease-out, border-color 160ms ease-out, background 160ms ease-out, transform 120ms ease-out; }
.confirm-button:hover, .confirm-button:focus-visible { color: var(--chat-text); border-color: rgba(255, 255, 255, .3); background: #3a3a3a; outline: none; }
.confirm-button:active { transform: scale(.97); }
.confirm-button-danger { color: #fff; border-color: #be123c; background: #be123c; }
.confirm-button-danger:hover, .confirm-button-danger:focus-visible { color: #fff; border-color: #e11d48; background: #e11d48; }
.confirm-button:disabled { cursor: wait; opacity: .5; }
.confirm-dialog[open] .confirm-shell { animation: confirm-dialog-in 180ms var(--ease-out); }
@keyframes confirm-dialog-in { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

@media (max-width: 900px) {
  body { overflow: hidden; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .app-sidebar { position: fixed; z-index: 80; top: 0; right: 0; bottom: 0; left: auto; width: min(310px, calc(100vw - 48px)); padding-top: max(14px, env(safe-area-inset-top) + 14px); padding-right: max(12px, env(safe-area-inset-right) + 12px); padding-bottom: max(12px, env(safe-area-inset-bottom) + 12px); padding-left: max(12px, env(safe-area-inset-left) + 12px); transform: translateX(102%); transition: transform 220ms var(--ease-drawer); box-shadow: -18px 0 48px rgba(0, 0, 0, .35); }
  .app-shell.sidebar-open .app-sidebar { transform: translateX(0); }
  .app-shell.sidebar-open .sidebar-overlay { display: block; position: fixed; z-index: 70; inset: 0; border: 0; background: rgba(0, 0, 0, .54); }
  .mobile-only { display: grid; }
  .chat-main { grid-column: 1; width: 100%; }
  .chat-topbar { padding-left: max(16px, env(safe-area-inset-left) + 16px); padding-right: max(16px, env(safe-area-inset-right) + 16px); }
  .chat-heading { min-width: 0; overflow: hidden; }
  .chat-top-actions { flex: 0 0 auto; min-width: 0; }
  .composer-form { max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(89, 201, 205, .30) transparent; }
  .composer-icon-button, .composer-tool-button, .send-button { min-height: 44px; }
  .composer-icon-button { width: 44px; height: 44px; }
  .composer-tool-button { min-width: 44px; }
  .options-heading .icon-button { width: 44px; height: 44px; }
  .options-grid select, .options-grid input[type="number"] { min-height: 44px; }
  .reference-remove { min-height: 44px; }
  .chat-topbar > .mobile-only { flex: 0 0 auto; color: var(--chat-muted); border-color: var(--chat-border); background: transparent; }
  .chat-top-actions .icon-button { display: none; }
  .sidebar-action { width: 44px; height: 44px; }
  .sidebar-search { min-height: 44px; }
  .sidebar-search input { min-height: 42px; }
  .jobs-pagination .pagination-button { width: 44px; min-width: 44px; min-height: 44px; }
}

@media (max-width: 640px) {
  .chat-topbar { min-height: 64px; gap: 8px; padding-top: max(8px, env(safe-area-inset-top)); padding-right: max(12px, env(safe-area-inset-right) + 12px); padding-bottom: 8px; padding-left: max(12px, env(safe-area-inset-left) + 12px); }
  .chat-heading h1 { font-size: 14px; }
  .secure-badge { min-height: 30px; padding-inline: 7px; font-size: 9px; }
  .sidebar-search input, .composer-form > textarea, .options-grid select, .options-grid input[type="number"], .preview-dialog select, .preview-dialog input[type="number"] { font-size: 16px; }
  .chat-messages { width: calc(100% - 28px); padding-top: 24px; }
  .chat-empty { padding-inline: 16px; }
  .welcome-cards { grid-template-columns: 1fr; width: min(330px, 100%); }
  .suggestion-card { min-height: 52px; }
  .composer-area { padding-top: 10px; padding-right: max(12px, env(safe-area-inset-right) + 12px); padding-bottom: max(16px, env(safe-area-inset-bottom) + 10px); padding-left: max(12px, env(safe-area-inset-left) + 12px); }
  .composer-form { width: 100%; padding: 8px 9px 9px; border-radius: 13px; }
  .composer-toolbar { align-items: flex-end; min-width: 0; flex-wrap: wrap; row-gap: 6px; }
  .composer-icon-button, .composer-tool-button, .send-button { min-height: 44px; }
  .composer-icon-button { width: 44px; height: 44px; }
  .composer-tool-button { min-width: 44px; }
  .options-heading .icon-button { width: 44px; height: 44px; }
  .options-grid select, .options-grid input[type="number"] { min-height: 44px; }
  .reference-remove { min-height: 44px; }
  .message-assistant .job-actions a, .message-assistant .format-link, .message-assistant .delete-button { min-height: 44px; }
  .composer-tool-button span { display: none; }
  .composer-tool-button { min-width: 44px; justify-content: center; }
  .optimize-button .button-label { display: none; }
  .char-count { display: none; }
  .options-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .output-group { grid-column: span 2; }
  .message-user .message-body { max-width: calc(100% - 42px); }
  .message-content, .assistant-copy { font-size: 12px; }
  .assistant-actions { align-items: stretch; }
  .message-assistant .job-thumbnail { width: 100%; max-width: 260px; }
  .preview-dialog { width: calc(100% - 20px); max-height: calc(100dvh - 20px); border-radius: 18px; }
  .preview-shell { gap: 14px; padding: 14px; }
  .confirm-dialog { width: calc(100% - 24px); border-radius: 16px; }
  .confirm-shell { gap: 16px; padding: 18px; }
  .confirm-actions { flex-wrap: wrap; }
  .confirm-button { flex: 1 1 120px; }
  .toast { right: max(12px, env(safe-area-inset-right) + 12px); bottom: max(12px, env(safe-area-inset-bottom) + 12px); left: max(12px, env(safe-area-inset-left) + 12px); max-width: none; text-align: center; }
}

@media (max-width: 390px) {
  .chat-top-actions .secure-badge { display: none; }
  .chat-heading h1 { font-size: 13px; }
  .chat-heading > p:last-child { font-size: 9px; }
  .chat-messages { width: calc(100% - 20px); }
  .composer-tools { gap: 0; }
  .composer-icon-button, .composer-tool-button { width: 44px; min-width: 44px; padding-inline: 8px; }
  .send-button { min-width: 44px; padding-inline: 9px; }
  .send-button .button-label { display: none; }
  .options-grid { grid-template-columns: 1fr; }
  .output-group { grid-column: auto; }
}

@media (max-height: 600px) and (max-width: 1100px) {
  .chat-topbar { min-height: 64px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 8px; }
  .composer-area { padding-top: 10px; padding-bottom: max(14px, env(safe-area-inset-bottom) + 8px); }
  .composer-form { max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(89, 201, 205, .30) transparent; }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar { transition: none; }
  .confirm-dialog[open] .confirm-shell { animation: none; }
}

/* BU3D brand palette and Arabic RTL polish */
.app-sidebar,
.chat-main,
.sidebar-header,
.sidebar-list-heading,
.sidebar-status-heading,
.sidebar-search,
.project-list,
.project-item,
.chat-topbar,
.chat-heading,
.chat-top-actions,
.chat-empty,
.chat-messages,
.composer-area,
.composer-form,
.composer-toolbar,
.composer-options,
.confirm-shell { direction: rtl; }

.app-sidebar .status-chip.connected { color: var(--chat-teal); background: rgba(0, 169, 143, .12); }
.app-sidebar .status-chip.checking { color: var(--chat-cyan); background: rgba(89, 201, 205, .12); }
.app-sidebar .agy-icon { color: #fff; background: linear-gradient(145deg, var(--chat-brand-deep), var(--chat-brand)); }
.app-sidebar .trellis-icon { color: #fff; background: linear-gradient(145deg, var(--chat-cyan), var(--chat-teal)); }
.project-item-title,
.project-item-meta,
.chat-heading h1,
.chat-heading > p,
.message-content,
.assistant-copy,
.message-meta,
.confirm-message { unicode-bidi: plaintext; }
.project-list, .chat-viewport { scrollbar-color: rgba(89, 201, 205, .30) transparent; }

.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 74px; min-height: 44px; padding: 0; color: var(--chat-muted); border: 0; background: transparent; }
.theme-toggle-track { position: relative; display: flex; align-items: center; justify-content: space-between; width: 64px; height: 32px; padding: 3px; overflow: hidden; border: 1px solid var(--chat-border-strong); border-radius: 999px; background: rgba(104, 44, 132, .24); direction: ltr; transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out); }
.theme-toggle-icon { position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; color: var(--chat-muted); }
.theme-toggle-icon svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle-thumb { position: absolute; z-index: 0; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--chat-cyan); box-shadow: 0 3px 10px rgba(0, 0, 0, .24); transition: transform 220ms var(--ease-out), background 180ms var(--ease-out); }
.theme-toggle[aria-pressed="true"] .theme-toggle-thumb { transform: translateX(32px); background: var(--chat-teal); }
.theme-toggle:hover .theme-toggle-track, .theme-toggle:focus-visible .theme-toggle-track { border-color: var(--chat-cyan); background: rgba(89, 201, 205, .16); }
.theme-toggle:focus-visible { outline: 3px solid rgba(89, 201, 205, .28); outline-offset: 2px; border-radius: 999px; }

html[data-theme="light"] {
  --chat-bg: #fbfaff;
  --chat-sidebar: #f4eef8;
  --chat-surface: #ffffff;
  --chat-surface-soft: #faf6fc;
  --chat-border: rgba(104, 44, 132, .14);
  --chat-border-strong: rgba(104, 44, 132, .24);
  --chat-text: #29243b;
  --chat-text-soft: #514b64;
  --chat-muted: #77728a;
  --chat-faint: #958ea2;
  --chat-cyan: #168b92;
  --chat-teal: #00886f;
  --chat-accent: #168b92;
  --chat-accent-strong: #00886f;
  --chat-success: #087d65;
  --chat-danger: #b33e55;
}

html[data-theme="light"] button,
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select { color-scheme: light; }
html[data-theme="light"] .chat-topbar { background: rgba(251, 250, 255, .90); }
html[data-theme="light"] .sidebar-search { background: rgba(104, 44, 132, .05); }
html[data-theme="light"] .project-item-button:hover, html[data-theme="light"] .project-item-button:focus-visible { background: rgba(104, 44, 132, .06); }
html[data-theme="light"] .project-item-button[aria-current="page"] { background: rgba(104, 44, 132, .10); }
html[data-theme="light"] .project-item-icon { background: rgba(104, 44, 132, .04); }
html[data-theme="light"] .app-sidebar .engine-card:hover { background: rgba(104, 44, 132, .045); }
html[data-theme="light"] .chat-viewport { scrollbar-color: rgba(104, 44, 132, .25) transparent; }
html[data-theme="light"] .suggestion-card { background: rgba(104, 44, 132, .025); }
html[data-theme="light"] .suggestion-card:hover, html[data-theme="light"] .suggestion-card:focus-visible { background: rgba(0, 169, 143, .08); }
html[data-theme="light"] .message-assistant .job-progress { background: rgba(104, 44, 132, .08); }
html[data-theme="light"] .message-assistant .job-actions a, html[data-theme="light"] .message-assistant .format-link, html[data-theme="light"] .message-assistant .delete-button { background: rgba(104, 44, 132, .035); }
html[data-theme="light"] .message-assistant .job-actions a:hover, html[data-theme="light"] .message-assistant .job-actions a:focus-visible, html[data-theme="light"] .message-assistant .format-link:hover, html[data-theme="light"] .message-assistant .format-link:focus-visible { background: rgba(0, 169, 143, .10); }
html[data-theme="light"] .composer-icon-button:hover, html[data-theme="light"] .composer-icon-button:focus-visible, html[data-theme="light"] .composer-tool-button:hover, html[data-theme="light"] .composer-tool-button:focus-visible, html[data-theme="light"] .composer-tool-button[aria-expanded="true"] { background: rgba(104, 44, 132, .06); }
html[data-theme="light"] .confirm-button:hover, html[data-theme="light"] .confirm-button:focus-visible { background: #f1eaf5; }
html[data-theme="light"] .theme-toggle-track { background: rgba(104, 44, 132, .08); }

/* Landing page */
:root {
  --landing-header-bg: rgba(25, 21, 42, .84);
  --landing-panel: rgba(48, 33, 65, .72);
  --landing-panel-solid: #302141;
  --landing-soft-text: #c8bdcf;
  --landing-grid: rgba(89, 201, 205, .14);
}

html[data-theme="light"] {
  --landing-header-bg: rgba(251, 250, 255, .88);
  --landing-panel: rgba(255, 255, 255, .82);
  --landing-panel-solid: #fff;
  --landing-soft-text: #77728a;
  --landing-grid: rgba(104, 44, 132, .12);
}

body.landing-active {
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--chat-text);
  background: radial-gradient(circle at 84% 8%, rgba(89, 201, 205, .13), transparent 25rem), radial-gradient(circle at 10% 42%, rgba(122, 62, 137, .18), transparent 30rem), var(--chat-bg);
}

body.chat-active { overflow: hidden; }
.landing-page[hidden], .app-shell[hidden] { display: none !important; }

.landing-page {
  min-height: 100dvh;
  overflow: hidden;
  color: var(--chat-text);
  background: radial-gradient(circle at 84% 8%, rgba(89, 201, 205, .13), transparent 25rem), radial-gradient(circle at 10% 42%, rgba(122, 62, 137, .18), transparent 30rem), var(--chat-bg);
  direction: rtl;
}

.landing-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid var(--chat-border);
  background: var(--landing-header-bg);
  backdrop-filter: blur(18px);
}

.landing-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  gap: 22px;
}

.landing-brand { display: inline-flex; align-items: center; min-width: 0; flex: 1 1 auto; text-decoration: none; }
.landing-brand-logo { display: block; width: clamp(126px, 14vw, 156px); max-width: 100%; height: auto; }
.landing-nav { display: flex; align-items: center; gap: 28px; margin-inline-start: auto; }
.landing-nav a { min-height: 44px; padding: 10px 0; color: var(--chat-muted); font-size: 11px; font-weight: 700; text-decoration: none; transition: color 160ms var(--ease-out); }
.landing-nav a:hover, .landing-nav a:focus-visible { color: var(--chat-text); outline: none; }
.landing-header-actions { display: flex; align-items: center; gap: 8px; }
.landing-icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; color: var(--chat-muted); border: 1px solid var(--chat-border); border-radius: 12px; background: transparent; transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), background 160ms var(--ease-out), transform 120ms ease-out; }
.landing-icon-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.landing-icon-button:hover, .landing-icon-button:focus-visible { color: var(--chat-text); border-color: var(--chat-border-strong); background: rgba(255, 255, 255, .07); outline: none; }
.landing-icon-button:active { transform: scale(.97); }
.landing-header-link { min-height: 44px; padding: 8px 13px; color: #fff; border: 1px solid var(--chat-teal); border-radius: 9px 14px 9px 14px; background: var(--chat-teal); box-shadow: 0 8px 18px rgba(0, 169, 143, .16); font-size: 11px; font-weight: 800; transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), background 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 120ms var(--ease-out); }
.landing-header-link:hover, .landing-header-link:focus-visible { color: #fff; border-color: var(--chat-cyan); background: var(--chat-cyan); box-shadow: 0 10px 22px rgba(89, 201, 205, .2); outline: none; transform: translateY(-1px); }
.landing-header-link:active { transform: translateY(0) scale(.97); }

.landing-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.landing-hero { display: grid; grid-template-columns: minmax(0, .92fr) minmax(360px, 1.08fr); align-items: center; gap: clamp(26px, 4.5vw, 60px); min-height: auto; padding: clamp(28px, 3.2vw, 42px) 0 clamp(28px, 3.2vw, 42px); }
.landing-hero-copy, .landing-visual { width: 100%; min-width: 0; }
.landing-hero-copy { max-width: 620px; }
.landing-eyebrow { display: inline-flex; align-items: center; gap: 9px; margin: 0 0 12px; color: var(--chat-cyan); font-size: 10px; font-weight: 800; letter-spacing: .04em; }
.landing-eyebrow > span { width: 22px; height: 1px; background: currentColor; }
.landing-hero h1 { width: 100%; max-width: 650px; margin: 0 0 14px; color: var(--chat-text); font-family: "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, sans-serif; font-size: clamp(36px, 5.2vw, 69px); font-weight: 800; line-height: 1.22; letter-spacing: -.055em; overflow-wrap: anywhere; }
.landing-hero h1 em { color: var(--chat-cyan); font-style: normal; }
.landing-lede { max-width: 540px; margin: 0; color: var(--landing-soft-text); font-size: clamp(14px, 1.5vw, 17px); line-height: 1.78; }
.landing-hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.landing-primary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; gap: 9px; padding: 7px 8px 7px 14px; color: #fff; border: 1px solid rgba(89, 201, 205, .7); border-radius: 9px 17px 9px 17px; background: linear-gradient(120deg, var(--chat-teal), #008f84); box-shadow: 0 10px 24px rgba(0, 169, 143, .18); font-size: 12px; font-weight: 800; transition: background 180ms var(--ease-out), border-color 180ms var(--ease-out), box-shadow 180ms var(--ease-out), transform 140ms var(--ease-out); }
.landing-primary-button span { padding-inline-start: 3px; }
.landing-primary-button svg { width: 25px; height: 25px; padding: 5px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; border: 1px solid rgba(255, 255, 255, .28); border-radius: 50%; background: rgba(25, 21, 42, .16); }
.landing-primary-button:hover, .landing-primary-button:focus-visible { border-color: var(--chat-cyan); background: linear-gradient(120deg, var(--chat-cyan), var(--chat-teal)); box-shadow: 0 15px 32px rgba(89, 201, 205, .22); outline: none; transform: translateY(-2px); }
.landing-primary-button:focus-visible, .landing-secondary-link:focus-visible { box-shadow: 0 0 0 3px rgba(89, 201, 205, .28); outline: none; }
.landing-primary-button:active { transform: translateY(0) scale(.97); }
.landing-secondary-link { display: inline-flex; align-items: center; min-height: 42px; gap: 6px; padding: 6px 1px 5px; color: var(--chat-text-soft); border: 0; border-bottom: 1px solid var(--chat-border-strong); border-radius: 0; font-size: 11px; font-weight: 800; text-decoration: none; transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), transform 120ms var(--ease-out); }
.landing-secondary-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.landing-secondary-link:hover, .landing-secondary-link:focus-visible { color: var(--chat-cyan); border-color: var(--chat-cyan); outline: none; }
.landing-secondary-link:active { transform: scale(.98); }
.landing-note { display: flex; align-items: center; gap: 9px; margin: 12px 0 0; color: var(--chat-faint); font-size: 10px; line-height: 1.55; }
.landing-note-dot { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: var(--chat-teal); box-shadow: 0 0 0 4px rgba(0, 169, 143, .13); }

.landing-visual { position: relative; min-width: 0; min-height: 0; aspect-ratio: 16 / 10; margin: 0; overflow: hidden; border: 1px solid var(--chat-border-strong); border-radius: 22px; background: #111329; box-shadow: 0 25px 70px rgba(0, 0, 0, .24); isolation: isolate; }
.landing-visual::before { position: absolute; z-index: 1; inset: 0; content: ""; background: linear-gradient(180deg, rgba(17, 19, 41, .05), rgba(17, 19, 41, .24)); pointer-events: none; }
.landing-hero-image { position: absolute; z-index: 0; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.landing-visual-header, .landing-visual-footer { position: absolute; z-index: 2; display: flex; align-items: center; justify-content: space-between; right: 22px; left: 22px; color: var(--chat-faint); font: 10px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.landing-visual-header { top: 21px; }
.landing-visual-footer { bottom: 20px; }
.landing-visual-status { display: inline-flex; align-items: center; gap: 7px; color: var(--chat-teal); font-family: "Noto Sans Arabic", Tahoma, sans-serif; font-weight: 700; direction: rtl; }
.landing-visual-status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(0, 169, 143, .12); }
.landing-visual-label { position: absolute; z-index: 3; right: 22px; bottom: 62px; display: grid; gap: 3px; padding: 10px 12px; border: 1px solid var(--chat-border); border-radius: 10px; background: rgba(25, 21, 42, .72); box-shadow: 0 12px 24px rgba(0, 0, 0, .16); }
.landing-visual-label span { color: var(--chat-faint); font-size: 9px; }
.landing-visual-label strong { color: var(--chat-text-soft); font-size: 11px; }

.landing-section { padding: clamp(32px, 3.8vw, 52px) 0 0; }
.landing-section-heading { max-width: 600px; }
.landing-section-heading .landing-eyebrow { margin-bottom: 8px; }
.landing-section-heading h2, .landing-final-cta h2 { margin: 0 0 7px; color: var(--chat-text); font-family: "Noto Kufi Arabic", "Noto Sans Arabic", Tahoma, sans-serif; font-size: clamp(25px, 3.3vw, 42px); font-weight: 800; line-height: 1.22; letter-spacing: -.04em; }
.landing-section-heading > p:last-child { max-width: 490px; margin: 0; color: var(--landing-soft-text); font-size: 13px; line-height: 1.6; }
.landing-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.landing-feature-card { position: relative; min-height: 190px; padding: 18px; overflow: hidden; border: 1px solid var(--chat-border); border-radius: 17px; background: var(--landing-panel); transition: border-color 180ms var(--ease-out), background 180ms var(--ease-out), transform 180ms var(--ease-out); }
.landing-feature-card::after { position: absolute; right: -28px; bottom: -37px; width: 110px; height: 110px; content: ""; border: 1px solid rgba(89, 201, 205, .12); border-radius: 50%; }
.landing-feature-card:hover { border-color: var(--chat-border-strong); background: rgba(89, 201, 205, .07); transform: translateY(-3px); }
.landing-feature-number { position: absolute; top: 18px; left: 18px; color: var(--chat-faint); font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.landing-feature-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px; color: var(--chat-cyan); border: 1px solid rgba(89, 201, 205, .26); border-radius: 12px; background: rgba(89, 201, 205, .1); }
.landing-feature-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.landing-feature-card h3 { margin: 0 0 6px; color: var(--chat-text); font-size: 15px; font-weight: 800; }
.landing-feature-card p { max-width: 240px; margin: 0; color: var(--landing-soft-text); font-size: 11px; line-height: 1.6; }

.landing-process { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1.2fr); align-items: start; gap: clamp(24px, 5vw, 64px); }
.landing-steps { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--chat-border); }
.landing-steps li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 16px; padding: 13px 0; border-bottom: 1px solid var(--chat-border); }
.landing-steps li > span { color: var(--chat-cyan); font: 10px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; direction: ltr; }
.landing-steps h3 { margin: 0 0 3px; color: var(--chat-text); font-size: 14px; font-weight: 800; }
.landing-steps p { max-width: 460px; margin: 0; color: var(--landing-soft-text); font-size: 11px; line-height: 1.6; }

.landing-final-cta { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: clamp(36px, 4vw, 56px) 0 0; padding: clamp(20px, 2.5vw, 28px); border: 1px solid var(--chat-border-strong); border-radius: 20px; background: linear-gradient(135deg, rgba(104, 44, 132, .26), rgba(0, 169, 143, .12)); }
.landing-final-cta .landing-eyebrow { margin-bottom: 8px; }
.landing-final-cta h2 { margin-bottom: 0; font-size: clamp(22px, 3vw, 34px); }
.landing-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1180px, calc(100% - 32px)); margin: 20px auto 0; padding: 17px 0 22px; color: var(--chat-faint); border-top: 1px solid var(--chat-border); font-size: 10px; }

.chat-home-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; gap: 7px; padding: 7px 10px; color: var(--chat-muted); border: 1px solid var(--chat-border); border-radius: 9px; background: transparent; font-size: 10px; font-weight: 800; white-space: nowrap; transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), background 160ms var(--ease-out), transform 120ms ease-out; }
.chat-home-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.chat-home-button:hover, .chat-home-button:focus-visible { color: var(--chat-text); border-color: var(--chat-border-strong); background: var(--chat-surface); outline: none; }
.chat-home-button:active { transform: scale(.97); }

@media (max-width: 1024px) {
  .landing-hero { grid-template-columns: minmax(0, .95fr) minmax(320px, 1.05fr); gap: 28px; }
}

@media (max-width: 760px) {
  .landing-header-inner, .landing-shell, .landing-footer { width: calc(100% - 28px); }
  .landing-header-inner { min-height: 68px; gap: 12px; }
  .landing-nav { display: none; }
  .landing-brand-logo { width: 134px; }
  .landing-hero { display: block; min-height: auto; padding: 26px 0 30px; }
  .landing-hero-copy { max-width: 620px; }
  .landing-hero h1 { max-width: 540px; font-size: clamp(34px, 9vw, 54px); line-height: 1.24; }
  .landing-lede { max-width: 500px; }
  .landing-visual { aspect-ratio: 16 / 10; margin-top: 22px; border-radius: 19px; }
  .landing-feature-grid { grid-template-columns: 1fr; }
  .landing-feature-card { min-height: 0; }
  .landing-feature-icon { margin-bottom: 18px; }
  .landing-process { display: block; }
  .landing-process .landing-section-heading { margin-bottom: 18px; }
  .landing-final-cta { align-items: flex-start; flex-direction: column; }
  .landing-final-cta .landing-primary-button { width: 100%; }
}

@media (max-width: 480px) {
  .landing-header-actions { gap: 4px; }
  .landing-header-link { padding-inline: 10px; font-size: 10px; }
  .landing-hero { padding-top: 25px; }
  .landing-eyebrow { margin-bottom: 10px; }
  .landing-hero h1 { font-size: 35px; line-height: 1.24; }
  .landing-lede { font-size: 14px; line-height: 1.75; }
  .landing-hero-actions { align-items: stretch; flex-direction: column; gap: 7px; margin-top: 16px; }
  .landing-primary-button, .landing-secondary-link { width: 100%; }
  .landing-secondary-link { justify-content: center; }
  .landing-note { align-items: flex-start; }
  .landing-visual { min-height: 250px; margin-top: 20px; }
  .landing-visual-header, .landing-visual-footer { right: 15px; left: 15px; font-size: 9px; }
  .landing-visual-label { right: 15px; bottom: 52px; }
  .landing-section { padding-top: 34px; }
  .landing-section-heading h2, .landing-final-cta h2 { font-size: 25px; }
  .landing-feature-card { min-height: 0; padding: 20px; }
  .landing-steps li { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
  .landing-final-cta { margin-top: 36px; padding: 19px; }
  .landing-footer { align-items: flex-start; flex-direction: column; gap: 4px; margin-top: 22px; }
  .chat-home-button { width: 44px; padding-inline: 0; }
  .chat-home-button span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-page *, .landing-page *::before, .landing-page *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
