/* ==========================================================================
   MeedAgency Platform — customer dashboard.

   Design tokens are taken verbatim from assets/css/style.css so the platform
   and the marketing site are visibly the same product. Vanilla CSS, no
   preprocessor, no framework — the project convention.

   The dashboard is deliberately LIGHT while the marketing site is dark: a
   working tool is used for hours at a time, and the black/platinum identity is
   carried by the header, the accents and the type rather than by a dark field.
   ========================================================================== */

:root {
  /* Brand (shared with the marketing site) */
  --black: #111111;
  --bg-dark: #0A0A0A;
  --surface-dark: #141414;
  --platinum: #CFCFCF;
  --white: #FFFFFF;

  /* Dashboard surfaces */
  --bg: #F6F6F7;
  --surface: #FFFFFF;
  --surface-2: #FAFAFB;
  --border: #E4E4E7;
  --border-strong: #D4D4D8;

  /* Text */
  --text: #111111;
  --text-secondary: #52525B;
  --text-tertiary: #8A8A93;

  /* Status */
  --success: #0F7B4F;
  --success-bg: #E7F6EE;
  --danger: #B42318;
  --danger-bg: #FDECEA;
  --warning: #94620A;
  --warning-bg: #FDF4E3;
  --info-bg: #EEF2FF;

  /* Type */
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Layout */
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar: 244px;
  --shadow-sm: 0 1px 2px rgba(16, 16, 20, .06);
  --shadow: 0 4px 16px -6px rgba(16, 16, 20, .16);
  --ring: 0 0 0 3px rgba(17, 17, 17, .12);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img, svg { max-width: 100%; display: block; }

/* ---- Brand mark ---- */
.brand {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 800; letter-spacing: .02em; text-decoration: none; font-size: 15px;
}
.brand__mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--black); color: var(--white);
  display: grid; place-items: center; font-size: 13px; font-weight: 800;
}
.brand__muted { color: var(--text-tertiary); }

/* ==========================================================================
   Authenticated shell
   ========================================================================== */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar);
  background: var(--bg-dark); color: var(--platinum);
  display: flex; flex-direction: column; padding: 1.15rem 0;
  position: sticky; top: 0; height: 100vh;
}
.sidebar__brand { padding: 0 1.15rem 1.35rem; color: var(--white); }
.sidebar__nav { display: flex; flex-direction: column; gap: 1px; padding: 0 .6rem; flex: 1; }
.sidebar__nav a {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .58rem .7rem; border-radius: var(--radius-sm);
  color: var(--platinum); text-decoration: none; font-size: 14px; font-weight: 500;
  transition: background .16s ease, color .16s ease;
}
.sidebar__nav a:hover { background: rgba(255,255,255,.07); color: var(--white); }
.sidebar__nav a.is-active { background: var(--white); color: var(--black); font-weight: 600; }
.sidebar__nav a.is-disabled { opacity: .38; pointer-events: none; }
.sidebar__group {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em;
  color: #6E6E76; padding: 1.1rem .7rem .4rem; font-weight: 700;
}
.sidebar__foot { padding: 1rem 1.15rem 0; border-top: 1px solid rgba(255,255,255,.09); margin-top: 1rem; }
.sidebar__user { font-size: 12.5px; color: #8A8A93; line-height: 1.45; margin-bottom: .7rem; word-break: break-word; }
.sidebar__user strong { color: var(--white); display: block; font-weight: 600; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 1.05rem 1.75rem; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.topbar h1 { font-size: 1.22rem; font-weight: 700; letter-spacing: -.01em; }
.topbar__sub { font-size: 13px; color: var(--text-secondary); margin-top: .12rem; }
.topbar__actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }

.content { padding: 1.75rem; max-width: 1180px; width: 100%; }

/* ==========================================================================
   Components
   ========================================================================== */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.card__head {
  padding: 1.05rem 1.25rem; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.card__head h2 { font-size: 1rem; font-weight: 650; }
.card__body { padding: 1.25rem; }
.card__foot { padding: 1rem 1.25rem; border-top: 1px solid var(--border); background: var(--surface-2); }

.grid { display: grid; gap: 1.1rem; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }

.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.stat__label { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-tertiary); font-weight: 650; }
.stat__value { font-size: 1.95rem; font-weight: 750; letter-spacing: -.02em; margin-top: .3rem; line-height: 1.1; }
.stat__meta { font-size: 12.5px; color: var(--text-secondary); margin-top: .2rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .58rem 1.05rem; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: inherit;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .16s ease, border-color .16s ease, color .16s ease;
  white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn--primary { background: var(--black); color: var(--white); }
.btn--primary:hover { background: #262626; }
.btn--outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn--outline:hover { background: var(--surface-2); }
.btn--ghost { background: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger { background: var(--surface); color: var(--danger); border-color: #F0C6C1; }
.btn--danger:hover { background: var(--danger-bg); }
.btn--sm { padding: .38rem .7rem; font-size: 13px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .5; pointer-events: none; }

/* Forms */
.field { margin-bottom: 1.05rem; }
.field > label, .label {
  display: block; font-size: 13px; font-weight: 620; margin-bottom: .34rem; color: var(--text);
}
.input, input[type=text], input[type=email], input[type=password], input[type=url],
input[type=tel], input[type=search], select, textarea {
  width: 100%; padding: .58rem .72rem; font-family: inherit; font-size: 14px;
  color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .16s ease, box-shadow .16s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--black); box-shadow: var(--ring); }
textarea { min-height: 108px; resize: vertical; line-height: 1.55; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #71717A 50%), linear-gradient(135deg, #71717A 50%, transparent 50%); background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 2rem; }
.hint { display: block; font-size: 12.5px; color: var(--text-tertiary); margin-top: .3rem; line-height: 1.45; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--danger); }
.field__error { display: block; font-size: 12.5px; color: var(--danger); margin-top: .3rem; font-weight: 500; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 1.1rem; }
fieldset { border: none; }
legend { font-size: 13px; font-weight: 650; margin-bottom: .5rem; }

.checkbox { display: flex; align-items: flex-start; gap: .55rem; font-size: 14px; line-height: 1.5; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; margin-top: .16rem; flex: 0 0 16px; accent-color: var(--black); }

.input-group { display: flex; align-items: stretch; }
.input-group input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group__suffix {
  display: flex; align-items: center; padding: 0 .7rem;
  background: var(--surface-2); border: 1px solid var(--border-strong); border-left: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px; color: var(--text-secondary); white-space: nowrap;
}

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 1.1rem; border: 1px solid transparent; }
.alert--success { background: var(--success-bg); color: var(--success); border-color: #BFE6D2; }
.alert--error { background: var(--danger-bg); color: var(--danger); border-color: #F5C9C4; }
.alert--info { background: var(--info-bg); color: #3730A3; border-color: #C7D2FE; }
.alert--warning { background: var(--warning-bg); color: var(--warning); border-color: #F0DCB0; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .16rem .55rem; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .01em;
  background: var(--surface-2); color: var(--text-secondary); border: 1px solid var(--border);
}
.badge--new { background: var(--info-bg); color: #3730A3; border-color: #C7D2FE; }
.badge--published, .badge--closed { background: var(--success-bg); color: var(--success); border-color: #BFE6D2; }
.badge--draft, .badge--read { background: var(--warning-bg); color: var(--warning); border-color: #F0DCB0; }
.badge--home { background: var(--black); color: var(--white); border-color: var(--black); }

/* Tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; padding: .62rem 1.25rem; font-size: 11.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: var(--text-tertiary);
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data td { padding: .78rem 1.25rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .title { font-weight: 600; }
table.data .muted { color: var(--text-tertiary); }
.row-actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }
.inline-form { display: inline; }

/* Empty state */
.empty { text-align: center; padding: 3rem 1.5rem; }
.empty h3 { font-size: 1rem; font-weight: 650; margin-bottom: .35rem; }
.empty p { color: var(--text-secondary); font-size: 14px; max-width: 26rem; margin: 0 auto 1.1rem; }

/* Tabs / filters */
.filters { display: flex; gap: .4rem; flex-wrap: wrap; }
.filters a {
  padding: .34rem .75rem; border-radius: 999px; font-size: 13px; font-weight: 550;
  text-decoration: none; color: var(--text-secondary);
  border: 1px solid var(--border); background: var(--surface);
}
.filters a.is-active { background: var(--black); color: var(--white); border-color: var(--black); }

/* Pagination */
.pagination { display: flex; gap: .35rem; align-items: center; justify-content: center; padding: 1rem; }
.pagination a, .pagination span {
  padding: .35rem .68rem; border-radius: var(--radius-sm); font-size: 13.5px;
  text-decoration: none; border: 1px solid var(--border); color: var(--text-secondary);
}
.pagination .is-current { background: var(--black); color: var(--white); border-color: var(--black); }

/* Utilities */
.stack { display: flex; flex-direction: column; gap: 1.1rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.row--end { justify-content: flex-end; }
.row--between { justify-content: space-between; }
.muted { color: var(--text-secondary); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 26rem; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: .6rem } .mt-2 { margin-top: 1.1rem } .mt-3 { margin-top: 1.75rem }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: .6rem } .mb-2 { margin-bottom: 1.1rem }
.text-right { text-align: right }

/* ==========================================================================
   Guest screens (login, register, reset)
   ========================================================================== */
.guest {
  min-height: 100vh; display: grid; place-items: center;
  padding: 2.5rem 1.25rem; background: var(--bg-dark);
}
.guest__card {
  width: 100%; max-width: 428px; background: var(--surface);
  border-radius: 16px; padding: 2.1rem; box-shadow: 0 24px 60px -24px rgba(0,0,0,.7);
}
.guest__card--wide { max-width: 520px; }
.guest__brand { margin-bottom: 1.5rem; }
.guest__card h1 { font-size: 1.35rem; font-weight: 720; letter-spacing: -.015em; margin-bottom: .3rem; }
.guest__sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 1.5rem; }
.guest__foot { margin-top: 1.35rem; padding-top: 1.15rem; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--text-secondary); text-align: center; }
.guest__foot a { color: var(--text); font-weight: 600; }

/* ==========================================================================
   Onboarding
   ========================================================================== */
.onboarding { max-width: 720px; margin: 0 auto; }
.steps { display: flex; gap: .5rem; margin-bottom: 1.75rem; }
.steps__item { flex: 1; }
.steps__bar { height: 4px; border-radius: 999px; background: var(--border); }
.steps__item.is-done .steps__bar, .steps__item.is-active .steps__bar { background: var(--black); }
.steps__label { font-size: 12px; color: var(--text-tertiary); margin-top: .4rem; font-weight: 600; }
.steps__item.is-active .steps__label { color: var(--text); }

.preview-url {
  display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .6rem;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  color: var(--text-secondary); word-break: break-all;
}
.slug-status { font-size: 12.5px; margin-top: .3rem; font-weight: 600; }
.slug-status.is-free { color: var(--success); }
.slug-status.is-taken { color: var(--danger); }

/* ==========================================================================
   Block editor
   ========================================================================== */
.blocks { display: flex; flex-direction: column; gap: .85rem; }
.block {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); padding: .9rem 1rem;
}
.block__head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .65rem; }
.block__type { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-tertiary); }
.block__tools { display: flex; gap: .25rem; }
.block__tools button {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-secondary);
  width: 27px; height: 27px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1;
  display: grid; place-items: center; font-family: inherit;
}
.block__tools button:hover { background: var(--bg); color: var(--text); }
.block .field:last-child { margin-bottom: 0; }
.block__add { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: 1rem; }

/* Media picker */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(136px, 1fr)); gap: .8rem; }
.media-item { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.media-item img { width: 100%; height: 104px; object-fit: cover; background: var(--surface-2); }
.media-item__meta { padding: .45rem .55rem; font-size: 11.5px; color: var(--text-tertiary); }
.media-item__meta strong { display: block; color: var(--text); font-weight: 600; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: static;
    flex-direction: row; align-items: center; gap: .75rem;
    padding: .8rem 1rem; overflow-x: auto;
  }
  .sidebar__brand { padding: 0; }
  .sidebar__nav { flex-direction: row; flex: 1; padding: 0; gap: .25rem; }
  .sidebar__nav a { white-space: nowrap; padding: .45rem .65rem; font-size: 13px; }
  .sidebar__group, .sidebar__foot { display: none; }
  .content, .topbar { padding: 1.15rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   Solution Builder (Milestone 2)

   Same tokens, same vocabulary as the rest of the dashboard. Nothing here
   introduces a new colour or a new font — the design system is the one already
   defined at the top of this file.
   ========================================================================== */

.section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-tertiary); font-weight: 700; margin-bottom: .6rem;
}

/* ---- Project type cards (step 2) ---------------------------------------- */
.choice {
  display: flex; gap: .75rem; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; margin-bottom: .7rem; cursor: pointer;
  background: var(--surface); transition: border-color .12s, background .12s;
}
.choice:hover { border-color: var(--border-strong); background: var(--surface-2); }
.choice.is-selected { border-color: var(--black); box-shadow: var(--ring); }
.choice input { margin-top: .3rem; width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--black); }
.choice__body { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.choice__title { font-weight: 650; font-size: 15px; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.choice__summary { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.choice__meta { font-size: 12.5px; color: var(--text-tertiary); line-height: 1.5; }
.choice__meta strong { color: var(--text-secondary); font-weight: 600; }

/* ---- Capability lists ---------------------------------------------------- */
.cap-list { list-style: none; display: flex; flex-direction: column; gap: .55rem; }
.cap {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .6rem .75rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
}
.cap--fixed { background: var(--surface-2); }

/* Not built yet. Visually distinct from what works, deliberately: a customer
   must never have to read carefully to tell the difference. */
.cap--planned { border-style: dashed; background: transparent; }

.cap__tick { color: var(--success); font-weight: 700; line-height: 1.5; flex: 0 0 auto; }
.cap__text { display: flex; flex-direction: column; gap: .15rem; flex: 1; min-width: 0; }
.cap__text strong { font-weight: 600; font-size: 14px; }
.cap__summary { font-size: 12.5px; color: var(--text-secondary); line-height: 1.45; }
.cap .checkbox { align-items: flex-start; width: 100%; }

.reason-list { list-style: none; display: flex; flex-direction: column; gap: .45rem; font-size: 14px; }
.reason-list li { padding-left: 1.1rem; position: relative; line-height: 1.55; }
.reason-list li::before { content: "—"; position: absolute; left: 0; color: var(--text-tertiary); }

.stat__value--sm { font-size: 1.15rem; line-height: 1.35; letter-spacing: -.005em; }

/* ---- Project status badges ---------------------------------------------- */
.badge--configuring    { background: var(--info-bg);    color: #3730A3;         border-color: #C7D2FE; }
.badge--solution_ready { background: var(--success-bg); color: var(--success);  border-color: #BFE6D2; }
.badge--review_required{ background: var(--warning-bg); color: var(--warning);  border-color: #F0DCB0; }
.badge--approved,
.badge--activated      { background: var(--black);      color: var(--white);    border-color: var(--black); }
.badge--archived       { background: var(--surface-2);  color: var(--text-tertiary); border-color: var(--border); }

/* ==========================================================================
   Right-to-left

   Arabic is a first-class language here, not an afterthought: the layout is
   mirrored rather than merely translated. Only the properties that carry
   DIRECTION are flipped — spacing, alignment, borders — because the rest of
   the design system is already direction-neutral.
   ========================================================================== */
[dir="rtl"] { text-align: right; }
[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid rgba(255,255,255,.09); }
[dir="rtl"] .sidebar__nav a { text-align: right; }
[dir="rtl"] .text-right { text-align: left; }
[dir="rtl"] table.data th,
[dir="rtl"] table.data td { text-align: right; }
[dir="rtl"] .row-actions { justify-content: flex-start; }
[dir="rtl"] .reason-list li { padding-left: 0; padding-right: 1.1rem; }
[dir="rtl"] .reason-list li::before { left: auto; right: 0; }
[dir="rtl"] .input-group input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
[dir="rtl"] .input-group__suffix { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

/* Latin-script values — a web address, an email, a phone number — must keep
   their own direction inside Arabic text, or they render reversed. */
[dir="rtl"] .mono,
[dir="rtl"] .preview-url { direction: ltr; text-align: left; unicode-bidi: embed; }

/* ==========================================================================
   Milestone 3 — preview builder

   A form on the left, a live frame on the right. On narrow screens they stack,
   with the frame first: on a phone the point of this page is to SEE the
   result, and burying it under six panels of inputs would defeat that.
   ========================================================================== */

.preview-layout { display: grid; gap: 1.25rem; align-items: start; }
.preview-form { min-width: 0; }
.preview-form__foot { margin-top: .25rem; }

/* ---- Theme picker --------------------------------------------------------
   Radio inputs, styled as cards. Real inputs, so the picker keeps working with
   JavaScript disabled and remains reachable by keyboard.                      */
.theme-grid { display: grid; gap: .75rem; }

.theme-card {
  display: flex; gap: .85rem; align-items: flex-start;
  padding: .9rem 1rem; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); transition: border-color .12s, box-shadow .12s;
}
.theme-card:hover { border-color: var(--border-strong); }
.theme-card:focus-within { box-shadow: var(--ring); }
.theme-card.is-selected { border-color: var(--black); box-shadow: var(--ring); }
.theme-card input { margin-top: .25rem; width: 16px; height: 16px; flex: 0 0 16px; accent-color: var(--black); }

/* The swatch shows each THEME'S own default colours — literals in
   ThemeRegistry, never customer input. */
.theme-card__swatch {
  position: relative; flex: 0 0 46px; height: 46px;
  border-radius: 10px; border: 1px solid var(--border);
}
.theme-card__swatch span {
  position: absolute; right: -4px; bottom: -4px;
  width: 20px; height: 20px; border-radius: 7px;
  border: 2px solid var(--surface);
}
.theme-card__body { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.theme-card__body strong { font-weight: 650; font-size: 14.5px; }
.theme-card__text { font-size: 12.5px; color: var(--text-secondary); line-height: 1.5; }

/* ---- Offerings ------------------------------------------------------------ */
.offering-row { display: grid; gap: .5rem; margin-bottom: .6rem; }
.offering-row input { width: 100%; }

/* ---- The frame ------------------------------------------------------------ */
.preview-pane {
  position: sticky; top: 1.25rem;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); overflow: hidden;
}
.preview-pane__bar {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .7rem .9rem; border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.preview-pane__title { font-weight: 650; font-size: 13.5px; margin-inline-end: auto; }

.preview-pane__devices { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.preview-pane__devices button {
  border: none; background: transparent; cursor: pointer;
  padding: .35rem .8rem; font: inherit; font-size: 12.5px; color: var(--text-secondary);
}
.preview-pane__devices button.is-active { background: var(--black); color: var(--white); }

.preview-pane__stage {
  padding: 1rem; display: flex; justify-content: center;
  background:
    repeating-linear-gradient(45deg, #f2f2f4 0 8px, #f7f7f9 8px 16px);
}
.preview-pane__frame {
  width: 100%; max-width: 100%; height: 620px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #fff; transition: max-width .18s ease;
}
/* The mobile toggle changes the FRAME WIDTH and nothing else. It is not a
   device emulator, and pretending otherwise would be its own small lie. */
.preview-pane.is-mobile .preview-pane__frame { max-width: 390px; }

.preview-pane__note { padding: .75rem .9rem 1rem; }

/* ---- Preview + review panels on the project page -------------------------- */
.preview-cta {
  display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
}
.preview-cta__body { flex: 1; min-width: 220px; }

.review-panel__status { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

.badge--requested      { background: var(--warning-bg); color: var(--warning); border-color: #F0DCB0; }
.badge--in_review      { background: var(--info-bg);    color: #3730A3;        border-color: #C7D2FE; }
.badge--needs_customer { background: var(--warning-bg); color: var(--warning); border-color: #F0DCB0; }
.badge--approved_scope { background: var(--success-bg); color: var(--success); border-color: #BFE6D2; }
.badge--declined,
.badge--not_requested  { background: var(--surface-2);  color: var(--text-tertiary); border-color: var(--border); }
.badge--muted          { background: var(--surface-2);  color: var(--text-tertiary); border-color: var(--border); }
.badge--info           { background: var(--info-bg);    color: #3730A3;        border-color: #C7D2FE; }
.badge--success        { background: var(--success-bg); color: var(--success);  border-color: #BFE6D2; }
.badge--warning        { background: var(--warning-bg); color: var(--warning);  border-color: #F0DCB0; }

@media (min-width: 640px) {
  .theme-grid { grid-template-columns: repeat(3, 1fr); }
  .theme-card { flex-direction: column; }
  .offering-row { grid-template-columns: 1fr 1.6fr; }
}

@media (min-width: 1200px) {
  .preview-layout { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); }
  .preview-pane__frame { height: 720px; }
}

/* ---- RTL ------------------------------------------------------------------ */
[dir="rtl"] .theme-card__swatch span { right: auto; left: -4px; }

/* ==========================================================================
   Catalog (Milestone 4).

   Deliberately small: the catalog reuses the existing card, table, field,
   filter and badge components rather than introducing a parallel set. These
   are the few things that genuinely did not exist yet.
   ========================================================================== */

/* number inputs were the one field type the original rule set never used */
input[type=number] {
  font: inherit; font-size: 14px; color: var(--black);
  width: 100%; padding: .58rem .7rem;
  border: 1px solid var(--border-strong, #D4D4D8); border-radius: 8px;
  background: var(--white);
}
input[type=number]:focus { outline: none; border-color: var(--black); box-shadow: var(--ring); }

/* Two columns of equal weight: an attribute is a label AND a value, and a
   cramped value box makes "1600cc turbocharged" look like a mistake. */
.offering-row--attr { grid-template-columns: 1fr 1fr; }

/* Catalog item status badges, alongside the existing draft/published ones. */
.badge--archived { background: #F4F4F5; color: #52525B; }

/* ---- Client project commercial terms (Milestone 8.6-B) ---------------------
   A plain definition list: label on the start side, amount on the end side.
   Logical properties only, so Arabic mirrors without a separate rule. */
.terms-list { margin: 0 0 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.terms-list__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding: .8rem 1rem; border-block-end: 1px solid var(--border); }
.terms-list__row:last-child { border-block-end: 0; }
.terms-list dt { color: var(--text-secondary); font-size: 14px; }
.terms-list dd { margin: 0; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.terms-card__note { margin: 0 0 1rem; padding: .8rem 1rem; border-inline-start: 3px solid var(--black); background: var(--surface-2); color: var(--text); font-size: 14px; }
.terms-points { margin: 0 0 1rem; padding-inline-start: 1.2rem; color: var(--text); font-size: 14px; line-height: 1.6; }
.terms-points li + li { margin-block-start: .35rem; }
.terms-accept { border-block-start: 1px solid var(--border); padding-block-start: 1rem; }

/* ==========================================================================
   Milestone 8.6-D. Progress updates and feedback: a plain chronological list.
   Logical properties, so Arabic mirrors without a separate rule.
   ========================================================================== */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { padding-block: .8rem; padding-inline-start: 1rem; border-inline-start: 2px solid var(--border); }
.timeline__item + .timeline__item { margin-block-start: .25rem; }
.timeline__meta { display: flex; flex-wrap: wrap; gap: .35rem .75rem; align-items: center; color: var(--text-secondary); font-size: 13px; margin-block-end: .35rem; }
.timeline__body { color: var(--text); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
