/* Manus-inspired design tokens */
:root {
  --bg: #f8f8f7;
  --bg-2: #f1f1ef;
  --card: #ffffff;
  --ink: #1a1a19;
  --text: #34322d;
  --muted: #858481;
  --faint: #b9b8b4;
  --line: #e7e6e2;
  --line-2: #d9d8d4;
  --blue: #0081f2;
  --blue-bg: #e6f2fe;
  --green: #25ba3b;
  --red: #e5484d;
  --footer: #1b1b1a;
  --serif: "Libre Baskerville", "Rubik", Georgia, serif;
  --sans: "Inter", "IBM Plex Sans Arabic", -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 12px 32px rgba(0, 0, 0, .04), 0 1px 2px rgba(0, 0, 0, .03);
  --r: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
svg.lucide { width: 18px; height: 18px; stroke-width: 1.6; flex: none; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Header ---------- */
.nav { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.nav-in { max-width: 1320px; margin: 0 auto; padding: 12px 40px; display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-size: 22px; font-weight: 700; color: var(--ink); letter-spacing: -.3px; }
.logo svg { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 6px; margin-inline: auto; }
.nav-links button { background: none; border: 0; padding: 8px 14px; border-radius: 10px; cursor: pointer; color: var(--text); font-weight: 500; }
.nav-links button:hover { background: var(--bg-2); }
.nav-actions { display: flex; gap: 8px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); cursor: pointer; font-weight: 600; transition: background .15s, transform .1s, border-color .15s; white-space: nowrap; }
.btn:hover { background: var(--bg-2); }
.btn:active { transform: scale(.98); }
.btn.dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.dark:hover { background: #333; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13.5px; border-radius: 9px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero { max-width: 980px; margin: 0 auto; padding: 56px 24px 72px; text-align: center; }
.hero h1 { font-family: var(--sans); font-weight: 400; font-size: clamp(24px, 2.5vw, 30px); color: var(--ink); margin: 0 0 28px; letter-spacing: -.5px; line-height: 1.3; }
.composer { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px 16px 12px; text-align: start; transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: var(--line-2); box-shadow: 0 16px 40px rgba(0, 0, 0, .06); }
.composer .name-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px dashed var(--line); padding: 0 4px 10px; margin-bottom: 6px; color: var(--muted); }
.composer .name-row input { min-width: 0; border: 0; outline: 0; background: none; flex: 1; font-size: 16px; font-weight: 600; color: var(--ink); }
.composer textarea { width: 100%; border: 0; outline: 0; resize: none; background: none; min-height: 76px; font-size: 16px; padding: 6px 4px; }
.composer textarea::placeholder, .composer input::placeholder { color: var(--faint); font-weight: 400; }
.composer-bar { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: background .15s; }
.icon-btn:hover { background: var(--bg-2); }
.send { margin-inline-start: auto; width: 40px; height: 40px; border-radius: 50%; border: 0; display: grid; place-items: center; background: #e9e9e7; color: #fff; cursor: pointer; transition: background .2s, transform .15s; }
.send.on { background: var(--ink); }
.send.on:hover { transform: translateY(-1px); }
.send svg { width: 20px; height: 20px; }
.toggle-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; color: var(--text); cursor: pointer; }
.toggle-pill.on { background: var(--blue-bg); border-color: #bfe0fd; color: var(--blue); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; transition: background .15s, border-color .15s; color: var(--text); font-weight: 500; }
.chip:hover { background: var(--card); border-color: var(--line-2); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--blue-bg); color: var(--blue); font-weight: 600; }
.badge.gray { background: var(--bg-2); color: var(--muted); }
.badge.green { background: #e6f7e9; color: #1a8a2b; }
.badge.red { background: #fdecec; color: #c6363b; }

/* ---------- Workspace ---------- */
.ws { max-width: 1320px; margin: 0 auto; padding: 8px 40px 80px; display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }
.rail { position: sticky; top: 80px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.rail h3 { font-family: var(--sans); font-weight: 400; font-size: 19px; margin: 2px 4px 2px; color: var(--ink); overflow-wrap: anywhere; }
.rail .sub { color: var(--muted); font-size: 13px; margin: 0 4px 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps li { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; cursor: pointer; color: var(--muted); font-weight: 500; }
.steps li:hover { background: var(--bg); }
.steps li.cur { background: var(--bg-2); color: var(--ink); }
.steps li.done { color: var(--text); }
.dot { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font-size: 12px; background: var(--card); flex: none; }
.steps li.done .dot { background: var(--ink); border-color: var(--ink); color: #fff; }
.steps li.cur:not(.done) .dot { border-color: var(--ink); color: var(--ink); }
.steps li .dot svg { width: 14px; height: 14px; }
.rail-foot { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; }

.panel { min-width: 0; }
.panel-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 6px 0 20px; flex-wrap: wrap; }
.panel-head h2 { font-family: var(--sans); font-weight: 400; font-size: 32px; margin: 0; color: var(--ink); letter-spacing: -.3px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.label { font-size: 12.5px; color: var(--muted); font-weight: 600; letter-spacing: .2px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 4px 10px; border-radius: 999px; background: var(--bg-2); font-size: 13px; }
.next-bar { display: flex; justify-content: space-between; align-items: center; margin-top: 24px; gap: 12px; }

/* thinking (Manus task-style) */
.thinking { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px 20px; box-shadow: var(--shadow); }
.thinking .row { display: flex; align-items: center; gap: 10px; padding: 7px 0; color: var(--muted); opacity: 0; animation: rise .4s forwards; }
.thinking .row.on { color: var(--ink); }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--ink); animation: sp .8s linear infinite; flex: none; }
.thinking .ok { color: var(--green); }
@keyframes sp { to { transform: rotate(360deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.shimmer { background: linear-gradient(90deg, var(--muted) 0%, var(--ink) 50%, var(--muted) 100%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sh 1.6s linear infinite; }
@keyframes sh { to { background-position: -200% 0; } }

/* selectable cards */
.sel { cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .15s; position: relative; }
.sel:hover { border-color: var(--line-2); transform: translateY(-1px); }
.sel.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink), var(--shadow); }
.sel .check { position: absolute; top: 12px; inset-inline-end: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; display: none; place-items: center; }
.sel.on .check { display: grid; }
.sel .check svg { width: 14px; height: 14px; }

.name-card h4 { margin: 0; font-family: var(--sans); font-weight: 400; font-size: 22px; color: var(--ink); }
.name-card .latin { color: var(--muted); font-size: 13px; direction: ltr; }
.name-card p { margin: 6px 0 0; font-size: 13.5px; }

/* palettes */
.pal .sw { display: flex; height: 84px; border-radius: 12px; overflow: hidden; margin-bottom: 12px; border: 1px solid var(--line); }
.pal .sw span { flex: 1; position: relative; }
.pal .sw span:first-child { flex: 1.6; }
.pal h4 { margin: 0; font-size: 15.5px; color: var(--ink); }
.pal .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pal .mini { margin-top: 12px; border-radius: 10px; padding: 12px; font-size: 13px; border: 1px solid rgba(0, 0, 0, .06); }
.pal .mini b { display: block; font-size: 15px; }
.pal .mini i { display: inline-block; margin-top: 6px; padding: 4px 10px; border-radius: 999px; font-style: normal; font-size: 12px; }
.editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.editor label { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; background: var(--card); }
.editor input[type=color] { width: 28px; height: 28px; border: 0; padding: 0; background: none; border-radius: 6px; cursor: pointer; }

/* sites */
.site .shot { aspect-ratio: 1366/860; border-radius: 10px; overflow: hidden; background: var(--bg-2); border: 1px solid var(--line); margin-bottom: 12px; display: grid; place-items: center; color: var(--muted); }
.site .shot img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.site h4 { margin: 0; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.site .host { color: var(--muted); font-size: 12.5px; direction: ltr; text-align: start; }
.dots { display: flex; gap: 4px; margin-top: 8px; }
.dots i { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .08); }
.site .fonts { font-size: 12px; color: var(--muted); margin-top: 6px; direction: ltr; text-align: start; }
.add-url { display: flex; gap: 8px; }
.input { height: 42px; border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; background: var(--card); outline: 0; flex: 1; min-width: 0; }
.input:focus { border-color: var(--line-2); }
textarea.input { height: auto; padding: 10px 14px; resize: vertical; }

/* trends */
.trend { min-width: 0; }
.cat-title { font-family: var(--sans); font-size: 18px; color: var(--ink); margin: 26px 0 10px; font-weight: 400; }
.trend h4 { margin: 0 0 2px; font-size: 15px; color: var(--ink); }
.trend .en { font-size: 12px; color: var(--muted); direction: ltr; text-align: start; }
.trend p { margin: 8px 0 0; font-size: 13px; }
.trend .why { margin-top: 8px; font-size: 12.5px; color: var(--blue); display: flex; gap: 6px; }
.trend .demo { height: 70px; border-radius: 10px; margin-bottom: 12px; display: grid; place-items: center; overflow: hidden; }
.trend-preview { aspect-ratio: 4 / 3; position: relative; overflow: hidden; border-radius: 10px; margin-bottom: 16px; background: var(--bg-2); }
.trend-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.trend-preview img[hidden], .trend-preview-fallback[hidden] { display: none; }
.trend-preview-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 13px; }
.trend-credit { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 11px; color: var(--muted); }
.trend-credit span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trend-credit a { flex-shrink: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.trend-credit a:hover { color: var(--blue); }
.trend-example-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -6px 0 14px; }
.trend-example-controls > div { display: flex; gap: 4px; }
.trend-example-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; }
.trend-example-button[aria-pressed="true"] { background: var(--ink); color: white; border-color: var(--ink); }
.trend-example-button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* fonts */
.builder-colors { border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-top: 28px; background: var(--card); }
.builder-colors summary { cursor: pointer; font-weight: 600; }
.builder-colors summary .hint { display: inline-block; font-weight: 400; margin-inline-start: 12px; }
.builder-colors[open] summary { margin-bottom: 24px; }
.builder-colors .panel-head { flex-wrap: wrap; }
.builder-colors .panel-head h2 { font-size: 22px; }
.empty-state { padding: 36px; text-align: center; }
.capability-progress { display: flex; gap: 10px; margin: 0 0 24px; }
.capability-progress > span { display: flex; align-items: center; gap: 8px; flex: 1; padding: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 12px; }
.capability-progress > span.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.capability-progress b { display: grid; place-items: center; min-width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 50%; font-size: 10px; }
.capability-context { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-2); margin-bottom: 24px; }
.capability-context p { margin: 0 0 12px; }
.capability-section-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 24px 0 12px; }
.capability-section-title h3 { margin: 0; font-size: 16px; }
.capability-card, .motion-choice, .font-library-card { text-align: start; cursor: pointer; font: inherit; color: var(--text); display: flex; flex-direction: column; gap: 10px; }
.capability-card.on, .motion-choice.on, .font-library-card.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.capability-card:disabled { opacity: .45; cursor: not-allowed; }
.capability-category { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.capability-title { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; font-weight: 600; color: var(--ink); }
.capability-description { font-size: 13px; }
.capability-card .why { text-align: start; font-size: 12px; line-height: 1.6; }
.integration-note { color: var(--muted); font-size: 11px; }
.capability-alternatives { margin-top: 22px; }
.capability-alternatives > .grid { margin-top: 16px; }
.motion-choice span, .motion-choice small { font-size: 12px; color: var(--muted); }
.motion-choice small { color: var(--blue); }
.font-selection { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.font-selection > div { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.font-selection .label { display: block; }
.font-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.font-toolbar .input { width: auto; min-width: 0; flex: 1 1 140px; }
.font-results-label { font-size: 12px; color: var(--muted); margin: 16px 0 12px; }
.font-library-card .sample { font-size: 24px; overflow-wrap: anywhere; }
.font-pagination { display: flex; justify-content: flex-end; gap: 8px; margin: 12px 0 20px; }
.custom-font-preview { padding: 24px; }
.custom-font-preview h3 { font-size: 28px; margin: 0 0 12px; }
.summary-list b { text-align: end; overflow-wrap: anywhere; max-width: 75%; }
@media (max-width: 640px) {
  .capability-progress { gap: 5px; }
  .capability-progress > span { flex-direction: column; align-items: flex-start; font-size: 10px; padding: 9px 6px; }
  .capability-section-title { align-items: flex-start; }
  .capability-section-title .hint { flex-shrink: 0; }
  .builder-colors { padding: 12px; }
  .builder-colors .panel-head > div { max-width: 100%; }
  .builder-colors #palHint { width: 100% !important; }
  .next-bar { gap: 10px; }
  .next-bar .btn { white-space: normal; height: auto; min-height: 42px; text-align: center; padding: 10px; }
}
.font-card .sample { font-size: 26px; color: var(--ink); line-height: 1.4; }
.font-card .body-sample { font-size: 14px; margin-top: 6px; }

/* build */
.preview-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.preview-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.preview-bar .lights { display: flex; gap: 6px; margin-inline-end: 8px; }
.preview-bar .lights i { width: 11px; height: 11px; border-radius: 50%; background: var(--line-2); }
.seg { display: inline-flex; background: var(--bg-2); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; height: 30px; padding: 0 10px; border-radius: 8px; cursor: pointer; color: var(--muted); display: flex; align-items: center; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.frame-stage { background: var(--bg-2); display: flex; justify-content: center; padding: 0; }
.frame-stage iframe { width: 100%; height: 76vh; border: 0; background: #fff; transition: width .3s; }
.frame-stage.tablet iframe { width: 820px; margin: 16px 0; border-radius: 14px; }
.frame-stage.mobile iframe { width: 390px; margin: 16px 0; border-radius: 24px; }
.refine { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); align-items: flex-end; }
.refine textarea { flex: 1; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; resize: none; outline: 0; min-height: 44px; background: var(--bg); }
.summary-list { display: grid; gap: 10px; }
.summary-list > div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.summary-list > div:last-child { border: 0; padding: 0; }
.summary-list span { color: var(--muted); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 13.5px; background: var(--card); user-select: none; }
.checks label:has(input:checked) { background: var(--ink); color: #fff; border-color: var(--ink); }
.checks input { display: none; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(20, 20, 18, .35); backdrop-filter: blur(3px); z-index: 50; display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal-box { background: var(--card); border-radius: 22px; width: min(620px, 100%); max-height: 88vh; overflow: auto; padding: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .2); }
.modal-box h3 { font-family: var(--sans); font-weight: 400; font-size: 26px; margin: 0 0 4px; color: var(--ink); }
.provider { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; margin-bottom: 10px; }
.provider.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.provider .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--bg-2); display: grid; place-items: center; flex: none; }
.provider b { color: var(--ink); }
.provider small { color: var(--muted); display: block; }
.field { margin-top: 12px; }
.field .input { width: 100%; direction: ltr; text-align: left; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; direction: ltr; unicode-bidi: embed; }
@keyframes fade { from { opacity: 0; } }

/* projects list */
.proj { display: flex; gap: 12px; align-items: center; }
.proj .sw2 { width: 44px; height: 44px; border-radius: 12px; flex: none; border: 1px solid var(--line); }
.proj h4 { margin: 0; color: var(--ink); font-size: 15px; }
.proj p { margin: 0; color: var(--muted); font-size: 12.5px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box { width: min(420px, 100%); text-align: center; }
.login-box h1 { font-family: var(--sans); font-weight: 400; font-size: 36px; color: var(--ink); margin: 18px 0 6px; }
.login-box p { color: var(--muted); margin: 0 0 24px; }
.login-box .composer { display: flex; gap: 8px; align-items: center; padding: 8px 8px 8px 8px; border-radius: 16px; }
.login-box .composer input { min-width: 0; border: 0; outline: 0; flex: 1; background: none; padding: 0 8px; height: 40px; font-size: 15px; }
.err { color: var(--red); font-size: 13.5px; margin-top: 12px; min-height: 20px; }

/* toast */
.toast { position: fixed; bottom: 24px; inset-inline-start: 50%; transform: translateX(50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 12px; z-index: 60; font-size: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); animation: rise .25s; max-width: 90vw; }
[dir=rtl] .toast { transform: translateX(50%); }

/* ---------- Footer ---------- */
footer { background: var(--footer); color: #a3a29e; padding: 110px 40px 60px; margin-top: 40px; }
.foot-in { max-width: 1320px; margin: 0 auto; }
.slogan { font-family: var(--sans); font-style: normal; color: #fff; font-size: clamp(32px, 4.4vw, 52px); line-height: 1.35; margin: 0 0 80px; font-weight: 400; }
.cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px; }
.cols h5 { color: #fff; font-size: 16px; margin: 0 0 14px; font-weight: 600; }
.cols a, .cols button { display: block; color: #a3a29e; margin-bottom: 10px; background: none; border: 0; padding: 0; cursor: pointer; text-align: start; }
.cols a:hover, .cols button:hover { color: #fff; }
.copy { border-top: 1px solid #2e2e2c; margin-top: 50px; padding-top: 22px; display: flex; justify-content: space-between; font-size: 13px; }

@media (max-width: 980px) {
  .ws { grid-template-columns: 1fr; padding: 8px 16px 60px; }
  .rail { position: static; }
  .steps { display: flex; overflow-x: auto; gap: 4px; }
  .steps li { flex: none; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-in { padding: 10px 16px; }
  .nav-links { display: none; }
  .nav-actions { margin-inline-start: auto; }
  .cols { grid-template-columns: repeat(2, 1fr); }
  footer { padding: 70px 16px 40px; }
}
@media (max-width: 620px) {
  .g2, .g3 { grid-template-columns: 1fr; }
  .hero { padding: 32px 16px 48px; }
  .chip { height: 40px; padding: 0 14px; font-size: 14px; }
  .panel-head h2 { font-size: 26px; }
  .nav-actions .btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Full-screen studio: project navigation on the left, uninterrupted canvas on the right. */
.toast { transform: translateX(-50%); }
.studio-mode { background: #fafaf8; }
.studio { max-width: none; width: 100%; margin: 0; padding: 0; grid-template-columns: 260px minmax(0, 1fr); gap: 0; min-height: 100dvh; }
.studio .rail { top: 0; height: 100dvh; border: 0; border-inline-end: 1px solid var(--line); border-radius: 0; box-shadow: none; background: #f2f2ee; padding: 30px 20px 20px; display: flex; flex-direction: column; overflow-y: auto; }
.studio-logo { padding: 0 10px; margin-bottom: 32px; width: fit-content; }
.eyebrow { display: block; font-size: 10px; letter-spacing: 1.6px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.project-progress { padding: 0 10px 24px; }
.studio .rail h3 { margin: 0 0 8px; font-family: var(--sans); font-weight: 600; font-size: 16px; }
.studio .rail .sub { margin: 0 0 20px; font-size: 12px; line-height: 1.6; }
.progress-caption { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; margin-bottom: 8px; }
.project-progress progress { display: block; width: 100%; height: 4px; border: 0; border-radius: 4px; overflow: hidden; appearance: none; accent-color: var(--ink); }
.project-progress progress::-webkit-progress-bar { background: #deded7; }
.project-progress progress::-webkit-progress-value { background: var(--ink); border-radius: 4px; }
.studio .steps { display: grid; gap: 6px; overflow: visible; }
.studio .steps li { padding: 0; display: block; background: transparent; }
.studio .steps li button { display: flex; align-items: center; gap: 12px; width: 100%; border: 1px solid transparent; border-radius: 12px; padding: 13px 10px; background: transparent; cursor: pointer; text-align: start; color: var(--muted); font-size: 12px; }
.studio .steps li button:hover:not(:disabled) { background: #e9e9e3; }
.studio .steps li.cur button { background: var(--card); border-color: var(--line); color: var(--ink); box-shadow: 0 2px 5px #00000004; }
.step-copy { display: grid; gap: 4px; font-weight: 600; }
.step-copy small { color: var(--muted); font-size: 10px; font-weight: 400; }
.studio .steps li.cur small { color: #63735c; }
.studio-links { display: grid; gap: 2px; margin-top: auto; padding: 32px 0 12px; }
.studio-links button { display: flex; gap: 10px; align-items: center; text-align: start; padding: 10px; border: 0; border-radius: 8px; cursor: pointer; background: transparent; color: var(--text); font-size: 12px; }
.studio-links button:hover:not(:disabled) { background: #e9e9e3; }
.studio-links svg { width: 16px; height: 16px; }
.studio .rail-foot { margin-top: 0; font-size: 11px; }
.studio .rail-foot .icon-btn { margin-inline-start: auto; border: 0; background: transparent; width: 28px; height: 28px; }
.studio-panel { padding: 42px clamp(24px, 4vw, 72px) 32px; width: 100%; min-height: 100dvh; }
.studio .panel-head { margin: 0 0 28px; }
.studio .panel-head h2 { font-size: clamp(28px, 2.5vw, 40px); }
.studio .panel-head p { max-width: 720px; font-size: 13px; line-height: 1.7; margin-top: 10px; }
.studio .card { box-shadow: none; }
.studio .next-bar { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.studio-panel.has-preview { padding: 28px 24px; }
.studio .frame-stage iframe { height: max(600px, calc(100dvh - 250px)); max-width: 100%; }
.refine textarea { min-width: 0; }
.trend-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.trend-search { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.trend-search > svg { position: absolute; left: 13px; color: var(--muted); }
.trend-search input { width: 100%; padding-left: 40px; }
.trend-toolbar select { flex: 0 1 260px; max-width: 100%; }
.trend-toolbar .hint { margin: 0; }
.selected-trends { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0; }
.selected-trends .label { margin: 0 8px 0 0; }
.selected-tag { cursor: pointer; background: var(--ink); color: #fff; border-color: var(--ink); }
button:disabled { opacity: .5; cursor: not-allowed; }
@media (min-width: 1600px) { .studio .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 761px) and (max-width: 1100px) {
  .studio { grid-template-columns: 220px minmax(0, 1fr); }
  .studio .rail { padding-inline: 12px; }
  .studio-panel { padding: 30px 22px; }
  .studio .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .studio { display: block; }
  .studio .rail { position: static; height: auto; padding: 16px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .studio-logo { margin-bottom: 18px; padding: 0; font-size: 23px; }
  .project-progress { padding: 0 0 14px; }
  .project-progress .eyebrow, .project-progress .sub { display: none; }
  .studio .rail h3 { font-size: 14px; margin-bottom: 12px; }
  .studio .steps { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 6px; }
  .studio .steps li { flex: 0 0 auto; }
  .studio .steps li button { width: auto; padding: 10px; }
  .studio-links { display: flex; flex-wrap: wrap; padding: 10px 0 0; margin: 0; gap: 4px; }
  .studio .rail-foot { border-top: 0; padding-top: 4px; }
  .studio-panel, .studio-panel.has-preview { padding: 26px 16px; min-height: 60dvh; }
  .studio .panel-head { margin-bottom: 22px; }
  .studio .panel-head h2 { font-size: 28px; }
  .studio .next-bar { flex-wrap: wrap; gap: 12px; }
  .studio .frame-stage iframe { height: 65dvh; min-height: 420px; }
  .trend-toolbar select { flex: 1 1 100%; }
  .preview-bar { gap: 6px; }
}

/* Bilingual interface and image-guided design stage. */
html[lang="ar"] { --sans: "IBM Plex Sans Arabic", "Inter", sans-serif; }
html[lang="ar"] body { letter-spacing: 0; }
.ui-language { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 9px; padding: 3px; direction: ltr; flex: none; }
.ui-language button, .studio-links .ui-language button { border: 0; background: transparent; border-radius: 6px; padding: 5px 8px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.ui-language button[aria-pressed="true"] { background: var(--ink); color: white; }
.studio-links .ui-language { justify-self: start; margin: 0 8px 12px; }
.login { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 24px; }
.concept-prompt { margin-bottom: 18px; }
.concept-prompt-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.concept-prompt-title h3 { margin: 0; }
.concept-prompt pre { font-family: ui-monospace, monospace; font-size: 12px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 300px; overflow-y: auto; background: var(--bg-2); padding: 18px; border-radius: 10px; text-align: left; }
.concept-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.concept-actions .hint { margin-inline-start: auto; }
.concept-grid { margin-top: 24px; }
.concept-card { overflow: hidden; padding: 0; }
.concept-card.on { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.concept-image { aspect-ratio: 4/5; background: var(--bg-2); display: grid; place-items: center; overflow: hidden; }
.concept-image a { width: 100%; height: 100%; }
.concept-image img { width: 100%; height: 100%; display: block; object-fit: contain; }
.concept-image > div { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.concept-card-copy { padding: 18px; }
.concept-card-copy h3 { margin: 4px 0 16px; font-size: 19px; }
.concept-card .err { overflow-wrap: anywhere; }
html[dir="rtl"] .next-bar svg.lucide-arrow-right, html[dir="rtl"] .next-bar svg.lucide-arrow-left { transform: scaleX(-1); }
.capability-description[dir="rtl"], .trend p[dir="rtl"], .why[dir="rtl"] { text-align: right; line-height: 1.9; }
[dir="rtl"] .capability-title { justify-content: space-between; }
@media (max-width: 780px) {
  .nav-in { flex-wrap: wrap; gap: 10px; padding-inline: 16px; }
  .nav-actions { margin-inline-start: auto; flex-wrap: wrap; }
  .nav-actions .btn[data-act="settings"], .nav-actions .btn[data-act="logout"] { display: none; }
  .concept-prompt-title { flex-wrap: wrap; }
  .concept-prompt pre { max-height: 240px; padding: 12px; }
  .concept-actions .btn, .next-bar .btn { max-width: 100%; white-space: normal; height: auto; min-height: 40px; padding-block: 9px; }
  .concept-actions .hint { margin-inline-start: 0; }
}
