
:root {
  color-scheme: light dark;
  --bg: #fff8ef;
  --surface: #ffffff;
  --surface-2: #f2e4d3;
  --text: #17130f;
  --dim: #6f6257;
  --border: #ddcdbb;
  --accent: #f36b21;
  --accent-dark: #b93f09;
  --green: #16845b;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(70, 43, 20, .10);
  font-family: "Avenir Next", Avenir, ui-sans-serif, system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#17130f; --surface:#221c17; --surface-2:#30261f; --text:#fff8ef; --dim:#c8b9aa; --border:#4a3b30; --accent:#ff7b32; --accent-dark:#ff9a62; --green:#44bd8b; --shadow:0 18px 55px rgba(0,0,0,.28); }
}
* { box-sizing: border-box; }
html, body, #root { margin:0; min-height:100%; background:var(--bg); color:var(--text); }
button, input, textarea, select { font:inherit; }
button { cursor:pointer; }
button:disabled { cursor:wait; opacity:.62; }
[lang="ar"], [dir="rtl"] { font-family:"Noto Sans Arabic", Tahoma, sans-serif; }
.app-shell { min-height:100vh; padding-bottom:calc(92px + env(safe-area-inset-bottom)); }
main { width:min(100%, 1120px); margin:0 auto; }
.announcement { background:var(--text); color:var(--bg); padding:10px 18px; text-align:center; font-size:13px; font-weight:700; }
.editorial-head { padding:42px 20px 24px; max-width:790px; }
.kicker,.eyebrow { color:var(--accent-dark); font-size:12px; font-weight:800; letter-spacing:.11em; text-transform:uppercase; }
.pulse { display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--green); margin-right:7px; }
.editorial-head h1 { margin:12px 0 14px; max-width:720px; font-size:clamp(38px,8.8vw,72px); line-height:.94; letter-spacing:-.052em; font-weight:750; }
.editorial-head p { max-width:610px; margin:0; color:var(--dim); font-size:17px; line-height:1.55; }
.composer { margin:0 16px 26px; background:var(--surface); box-shadow:var(--shadow); padding:20px; border-top:5px solid var(--accent); }
.form-row { display:grid; gap:14px; }
.form-row.two { grid-template-columns:1fr; }
label, legend { display:flex; flex-direction:column; gap:7px; font-size:13px; font-weight:750; }
label span { color:var(--dim); font-weight:500; }
input, textarea, select { width:100%; color:var(--text); background:var(--bg); border:1px solid var(--border); border-radius:10px; padding:12px 13px; outline:none; }
input:focus,textarea:focus,select:focus { border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 20%,transparent); }
textarea { min-height:118px; resize:vertical; line-height:1.45; }
fieldset { border:0; padding:0; margin:20px 0; }
legend { margin-bottom:9px; }
.choice-row { display:grid; grid-template-columns:repeat(2,1fr); gap:8px; }
.choice,.language { border:1px solid var(--border); color:var(--text); background:var(--bg); border-radius:10px; padding:11px 10px; font-weight:700; text-align:center; }
.choice.selected,.language.selected { background:var(--text); color:var(--bg); border-color:var(--text); }
.language-grid { display:grid; gap:8px; }
.language { display:flex; flex-direction:column; gap:2px; text-align:left; padding:13px 14px; }
.language small { color:var(--dim); font-weight:500; }
.language.selected small { color:color-mix(in srgb,var(--bg) 72%,transparent); }
.hint { color:var(--dim); font-weight:500; }
.action-row { margin-top:18px; align-items:end; }
.primary { min-height:50px; border:0; border-radius:10px; padding:12px 18px; background:var(--accent); color:#211208; font-weight:850; display:flex; justify-content:space-between; align-items:center; gap:18px; }
.allowance { color:var(--dim); font-size:12px; text-align:center; margin:12px 0 0; }
.result { margin:20px 16px 28px; background:var(--text); color:var(--bg); padding:22px; box-shadow:var(--shadow); }
.result-top { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; }
.result h2 { margin:6px 0 0; font-size:22px; }
.usage { flex:none; font-size:12px; color:var(--dim); background:var(--bg); padding:6px 9px; border-radius:99px; }
.caption { font-size:20px; line-height:1.7; margin:25px 0 12px; white-space:pre-wrap; }
.hashtags { color:var(--accent-dark); line-height:1.6; font-weight:650; }
.result .hashtags { color:#ff9a62; }
.why { border-top:1px solid color-mix(in srgb,var(--bg) 20%,transparent); margin-top:20px; padding-top:17px; }
.why strong { font-size:12px; text-transform:uppercase; letter-spacing:.08em; }
.why p { margin:7px 0 0; color:color-mix(in srgb,var(--bg) 77%,transparent); line-height:1.5; }
.copy { width:100%; margin-top:18px; padding:11px; border:1px solid color-mix(in srgb,var(--bg) 30%,transparent); color:var(--bg); background:transparent; border-radius:9px; font-weight:750; }
.error { margin:16px; padding:14px; background:#7b251f; color:#fff; border-radius:10px; }
.dock { position:fixed; z-index:20; left:50%; transform:translateX(-50%); bottom:max(12px,env(safe-area-inset-bottom)); width:calc(100% - 24px); max-width:520px; display:grid; grid-template-columns:repeat(4,1fr); padding:7px; background:color-mix(in srgb,var(--surface) 93%,transparent); border:1px solid var(--border); border-radius:18px; box-shadow:0 12px 40px rgba(28,18,10,.18); backdrop-filter:blur(18px); }
.dock button { min-height:56px; border:0; border-radius:12px; background:transparent; color:var(--dim); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; font-size:11px; font-weight:750; }
.dock svg { width:20px; height:20px; }
.dock button.active { background:var(--text); color:var(--bg); }
.page { padding:40px 16px 30px; }
.section-head { max-width:660px; margin-bottom:28px; }
.section-head h1,.admin-head h1 { font-size:clamp(34px,8vw,58px); line-height:1; letter-spacing:-.045em; margin:9px 0 12px; }
.section-head p { color:var(--dim); font-size:16px; line-height:1.55; margin:0; }
.empty { min-height:230px; border:1px dashed var(--border); display:flex; flex-direction:column; justify-content:center; align-items:center; text-align:center; gap:7px; color:var(--dim); padding:24px; }
.empty strong { color:var(--text); font-size:18px; }
.post-list { display:grid; gap:12px; }
.post-card { background:var(--surface); border-bottom:3px solid var(--border); padding:18px; }
.post-meta { display:flex; justify-content:space-between; gap:12px; }
.post-meta span { color:var(--dim); font-size:12px; }
.post-card>p { line-height:1.65; white-space:pre-wrap; }
.post-card button { border:0; background:var(--surface-2); color:var(--text); padding:9px 14px; border-radius:8px; font-weight:750; }
.lesson-list { border-top:1px solid var(--border); }
details { border-bottom:1px solid var(--border); }
summary { list-style:none; min-height:86px; display:grid; grid-template-columns:38px 1fr 24px; align-items:center; gap:12px; cursor:pointer; }
summary::-webkit-details-marker { display:none; }
summary>span { color:var(--accent-dark); font-weight:850; }
summary div { display:flex; flex-direction:column; gap:3px; }
summary small { color:var(--dim); font-size:14px; text-align:left; }
summary b { font-size:20px; font-weight:400; transition:transform .2s; }
details[open] summary b { transform:rotate(45deg); }
details>p { margin:0 0 22px 50px; max-width:650px; color:var(--dim); line-height:1.6; }
.week { margin-top:34px; padding:24px; background:var(--text); color:var(--bg); }
.week h2 { font-size:28px; line-height:1.08; margin:8px 0 22px; }
.week-step { display:grid; grid-template-columns:34px 1fr; gap:11px; border-top:1px solid color-mix(in srgb,var(--bg) 18%,transparent); padding:12px 0; align-items:center; }
.week-step span { width:28px; height:28px; border-radius:50%; display:grid; place-items:center; background:var(--accent); color:#211208; font-size:12px; font-weight:850; }
.week-step p { margin:0; }
.admin-head { display:flex; flex-direction:column; gap:16px; margin-bottom:22px; }
.billing-status { align-self:flex-start; border:1px solid var(--border); padding:9px 12px; border-radius:999px; font-size:12px; color:var(--dim); }
.billing-status span { display:inline-block; width:7px; height:7px; border-radius:50%; background:#d59b17; margin-right:6px; }
.subnav { display:flex; border-bottom:1px solid var(--border); margin-bottom:22px; }
.subnav button { border:0; border-bottom:3px solid transparent; background:transparent; color:var(--dim); padding:12px 14px; font-weight:750; }
.subnav button.active { color:var(--text); border-color:var(--accent); }
.date-filter { display:grid; grid-template-columns:1fr 1fr; gap:10px; align-items:end; }
.date-filter button { grid-column:1/-1; border:0; background:transparent; color:var(--accent-dark); text-align:left; padding:0; font-weight:700; }
.range-label { color:var(--dim); font-size:12px; }
.metrics { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.metrics div { background:var(--surface); padding:18px; min-height:106px; display:flex; flex-direction:column; justify-content:space-between; border-bottom:3px solid var(--border); }
.metrics div:first-child { grid-column:1/-1; background:var(--text); color:var(--bg); border-bottom-color:var(--accent); }
.metrics strong { font-size:36px; line-height:1; }
.metrics span { color:var(--dim); font-size:13px; }
.admin-note { margin-top:18px; padding:18px 0; border-top:1px solid var(--border); }
.admin-note p { color:var(--dim); line-height:1.5; margin:5px 0; }
.customer-list { display:grid; gap:10px; }
.customer-list article { display:grid; grid-template-columns:1fr 1fr; gap:12px; padding:16px; background:var(--surface); }
.customer-list article>div { grid-column:1/-1; display:flex; flex-direction:column; }
.customer-list article>div span { color:var(--dim); font-size:12px; margin-top:3px; }
.customer-list article button { align-self:end; min-height:43px; border-radius:9px; font-weight:750; }
.suspend { border:1px solid #b8483f; background:transparent; color:#b8483f; }
.reactivate { border:0; background:var(--green); color:#fff; }
.settings-form { display:grid; gap:22px; }
.settings-group { border-top:1px solid var(--border); padding-top:18px; }
.settings-group h2 { margin:0 0 14px; font-size:19px; }
.settings-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.settings-group>label { margin-top:12px; }
.switch { flex-direction:row; align-items:center; min-height:48px; background:var(--surface); padding:12px; border-radius:10px; }
.switch input { width:18px; height:18px; }
.switch span { color:var(--text); font-weight:700; }
.save { width:100%; }
@media (min-width:720px) {
  .editorial-head { padding:68px 38px 34px; }
  .composer,.result { margin-left:38px; margin-right:38px; padding:28px; }
  .form-row.two { grid-template-columns:1fr 1fr; }
  .choice-row { grid-template-columns:repeat(4,1fr); }
  .language-grid { grid-template-columns:repeat(3,1fr); }
  .action-row { grid-template-columns:220px 1fr; }
  .page { padding:64px 38px 40px; }
  .post-list { grid-template-columns:repeat(2,1fr); }
  .admin-head { flex-direction:row; align-items:flex-end; justify-content:space-between; }
  .billing-status { align-self:auto; margin-bottom:9px; }
  .date-filter { grid-template-columns:220px 220px 1fr; }
  .date-filter button { grid-column:auto; padding-bottom:12px; }
  .metrics { grid-template-columns:2fr 1fr 1fr; }
  .metrics div:first-child { grid-column:auto; }
  .customer-list article { grid-template-columns:2fr 140px 120px 110px; align-items:end; }
  .customer-list article>div { grid-column:auto; }
  .settings-grid { grid-template-columns:repeat(4,1fr); }
}
@media (min-width:980px) { .composer,.result { max-width:860px; } .page { max-width:980px; } }
@media (prefers-reduced-motion:reduce) { * { scroll-behavior:auto!important; transition:none!important; } }

/* ---- Auth screens ---- */
.auth-page { min-height:100vh; display:grid; place-items:center; padding:24px 16px; }
.auth-card { width:min(100%,430px); background:var(--surface); box-shadow:var(--shadow); padding:28px 24px; border-top:5px solid var(--accent); }
.auth-card h1 { font-size:30px; margin:6px 0 8px; letter-spacing:-.03em; }
.auth-card>p { color:var(--dim); font-size:14px; line-height:1.55; margin:0 0 18px; }
.auth-card form { display:grid; gap:13px; }
.auth-card .row-links { display:flex; justify-content:space-between; font-size:13px; margin-top:4px; }
.auth-card .row-links a, .link { color:var(--accent-dark); font-weight:700; text-decoration:none; background:none; border:0; padding:0; font-size:13px; }
.auth-alt { text-align:center; font-size:13px; color:var(--dim); margin-top:16px; }
.code-input { font-size:26px !important; letter-spacing:.35em; text-align:center; }
.notice { margin:0 0 14px; padding:12px 14px; border-radius:10px; font-size:13px; line-height:1.5; }
.notice.warn { background:#fdf3e3; border:1px solid #e8c87e; color:#7a5410; }
.notice.info { background:#eef4ff; border:1px solid #b9cdf5; color:#274b8f; }

/* ---- Top bar (logged in) ---- */
.topbar { display:flex; align-items:center; justify-content:space-between; padding:14px 20px; max-width:1120px; margin:0 auto; }
.brand { font-weight:850; font-size:19px; letter-spacing:-.02em; }
.brand em { font-style:normal; color:var(--accent); }
.topbar .userbox { display:flex; align-items:center; gap:10px; font-size:13px; color:var(--dim); }
.pill { background:var(--surface-2); border-radius:99px; padding:5px 11px; font-weight:700; font-size:12px; }
.topbar button.ghost { border:1px solid var(--border); background:transparent; color:var(--text); border-radius:9px; padding:8px 13px; font-weight:700; font-size:13px; }

/* ---- Pricing ---- */
.plans { display:grid; gap:12px; margin-top:8px; }
.plan-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:22px; display:flex; flex-direction:column; gap:8px; }
.plan-card.featured { border:2px solid var(--accent); }
.plan-card h3 { margin:0; font-size:20px; }
.plan-card .price { font-size:34px; font-weight:850; }
.plan-card .price small { font-size:14px; color:var(--dim); font-weight:600; }
.plan-card ul { margin:6px 0 12px; padding:0; list-style:none; display:grid; gap:7px; font-size:14px; color:var(--dim); }
.plan-card ul li::before { content:"✓ "; color:var(--green); font-weight:800; }
.plan-card .current { text-align:center; font-weight:800; color:var(--green); padding:11px; }
.faq details>p { margin:0 0 18px; color:var(--dim); line-height:1.6; max-width:640px; }

/* ---- Billing ---- */
.bill-card { background:var(--surface); padding:22px; border-radius:var(--radius); display:grid; gap:10px; }
.bill-row { display:flex; justify-content:space-between; font-size:14px; }
.bill-row strong { font-size:16px; }

/* ---- Landing ---- */
.hero-cta { display:flex; gap:10px; flex-wrap:wrap; margin-top:20px; }
.btn { border-radius:10px; padding:13px 20px; font-weight:850; border:0; text-decoration:none; display:inline-block; }
.btn.primary { background:var(--accent); color:#211208; }
.btn.secondary { background:transparent; border:1px solid var(--border); color:var(--text); }
.steps { display:grid; gap:12px; margin:26px 0; }
.step { background:var(--surface); padding:18px; border-radius:var(--radius); }
.step b { color:var(--accent-dark); }
.foot { text-align:center; color:var(--dim); font-size:12px; padding:30px 16px 120px; }
.foot a { color:var(--accent-dark); }

@media (min-width:720px) {
  .plans { grid-template-columns:repeat(3,1fr); }
  .steps { grid-template-columns:repeat(3,1fr); }
}
