@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Vazirmatn"; src: url("../fonts/Vazirmatn-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
:root { --green: #07875a; --green-d: #05704a; --green-l: #e4f7ec; --ink: #111827; --muted: #6b7280; --line: #e5e7eb; --bg: #ffffff; --soft: #f6fbf7; --red: #dc2626; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Vazirmatn", Tahoma, sans-serif; font-size: 15px; line-height: 1.7; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 14px 10px; background: #fff; border-bottom: 1px solid var(--line); }
.top h1 { font-size: 17px; margin: 0; color: var(--green-d); }
.iconbtn { border: 0; background: var(--green-l); color: var(--green-d); width: 36px; height: 36px; border-radius: 12px; font-size: 18px; cursor: pointer; }
.iconbtn[hidden] { display: none; }
.wrap { flex: 1; padding: 12px 14px 24px; max-width: 560px; width: 100%; margin: 0 auto; }
.card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; color: inherit; text-decoration: none; box-shadow: 0 1px 2px rgba(0,0,0,.03); }
.card.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card.err { border-color: #fecaca; background: #fff5f5; color: var(--red); }
.card.alt { width: 100%; text-align: right; font: inherit; cursor: pointer; background: #fff; }
.card.alt:active, .card.row:active { background: var(--soft); }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; padding: 24px 8px; }
.chev { color: var(--green); font-size: 22px; }
.pill { display: inline-block; background: var(--green-l); color: var(--green-d); border-radius: 999px; padding: 1px 10px; font-size: 12.5px; }
.slot-head { display: flex; justify-content: space-between; align-items: center; }
.meal { font-weight: 700; margin: 6px 0 2px; }
.macros { color: var(--muted); }
.btn { width: 100%; border: 0; border-radius: 14px; padding: 11px 12px; font: inherit; font-weight: 700; background: var(--green); color: #fff; cursor: pointer; margin-top: 8px; }
.btn.ghost { background: var(--green-l); color: var(--green-d); }
.btn:disabled { opacity: .5; cursor: default; }
.bigline { display: flex; justify-content: space-between; align-items: baseline; margin: 4px 0 8px; }
.bar { height: 10px; background: var(--green-l); border-radius: 999px; overflow: hidden; margin: 6px 0; }
.bar span { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .3s; }
.bar.thin { height: 6px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; }
.tab { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; cursor: pointer; color: var(--ink); }
.tab.on { background: var(--green); border-color: var(--green); color: #fff; }
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet[hidden] { display: none; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 80vh; background: #fff; border-radius: 20px 20px 0 0; padding: 12px 14px calc(env(safe-area-inset-bottom, 0px) + 16px); display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sheet-head h2 { font-size: 16px; margin: 0; }
.sheet-body { overflow-y: auto; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom, 0px) + 56px); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 12px; font-size: 14px; z-index: 30; max-width: 90%; }
.toast.bad { background: var(--red); }
.toast[hidden] { display: none; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 10px; }
.form h2 { margin: 2px 0 4px; font-size: 18px; }
.form label { display: block; font-weight: 700; font-size: 13px; margin: 12px 0; }
.form input, .form select, .form textarea { display: block; width: 100%; margin-top: 5px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); font: inherit; font-weight: 400; min-height: 42px; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--green-l); border-color: var(--green); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.actions .btn { margin-top: 0; }
@media (max-width: 360px) { .grid2 { grid-template-columns: 1fr; } .actions { grid-template-columns: 1fr; } }

/* ناوبری ثابت و ساده‌ی Mini App */
.bottom-nav { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); background: rgba(255,255,255,.97); border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.bottom-nav[hidden] { display: none; }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; min-height: 48px; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; }
.bottom-nav a .nav-icon { font-size: 20px; line-height: 1.25; }
.bottom-nav a.active { background: var(--green-l); color: var(--green-d); }
.foot { padding-bottom: 8px; }
@media (min-width: 700px) { .bottom-nav { left: 50%; right: auto; transform: translateX(-50%); width: min(560px, 100%); border: 1px solid var(--line); border-bottom: 0; border-radius: 18px 18px 0 0; } }

/* داشبورد مربی */
.hero { padding: 20px 18px 18px; margin-bottom: 12px; border-radius: 22px; color: #f2fbf6; background: radial-gradient(circle at 100% 0%, rgba(134,239,172,.30), transparent 42%), linear-gradient(140deg, #04402b, #05704a 58%, #07875a); box-shadow: 0 10px 28px rgba(7,135,90,.16); }
.hero-kicker { font-size: 10px; letter-spacing: 1.5px; opacity: .78; font-weight: 700; direction: ltr; text-align: right; }
.hero h2 { font-size: 21px; line-height: 1.55; margin: 10px 0 5px; }
.hero p { font-size: 12.5px; margin: 0 0 10px; color: #e4f7ec; }
.hero .btn { background: #fff; color: #05704a; box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-bottom: 18px; }
.stat { border: 1px solid var(--line); background: var(--soft); border-radius: 16px; padding: 11px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat span { color: var(--muted); font-size: 12px; }
.stat b { font-size: 22px; color: var(--green-d); }
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 8px; }
.section-head h3 { margin: 0; font-size: 15px; }
.client-row { gap: 12px !important; padding: 13px !important; }
.avatar { flex: 0 0 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: var(--green-l); color: var(--green-d); font-size: 18px; font-weight: 700; }
.client-meta { flex: 1; min-width: 0; }
.client-meta b { overflow-wrap: anywhere; }
.empty-state { padding: 28px 18px; }
.empty-icon { width: 48px; height: 48px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 16px; background: var(--green-l); color: var(--green-d); font-size: 28px; }

.color-field { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.color-field input[type="color"] { width: 56px; height: 44px; padding: 4px; margin: 0; flex: 0 0 56px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* رابط‌های اشتراک و دستیار */
.bottom-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding-left: 5px; padding-right: 5px; align-items: end; }
.bottom-nav a.nav-home { transform: translateY(-10px); background: var(--green); color: #fff; border-radius: 50%; width: 56px; height: 56px; min-height: 56px; margin: 0 auto; box-shadow: 0 6px 16px rgba(7,135,90,.4); }
.bottom-nav a.nav-home .nav-icon { font-size: 26px; }
.bottom-nav a.nav-home span:last-child { display: none; }
.bottom-nav a.nav-home.active { background: var(--green-d); color: #fff; }
.bottom-nav a { font-size: 10px; white-space: nowrap; }
.bottom-nav a .nav-icon { font-size: 18px; }
.offer-card { border: 1px solid #bfeed3; background: linear-gradient(150deg,#fff,#f2fbf6); }
.offer-price { color: var(--green-d); font-size: 22px; font-weight: 700; }
.chat-log { display: flex; flex-direction: column; gap: 9px; margin-bottom: 12px; }
.chat-bubble { max-width: 92%; padding: 10px 13px; border-radius: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-bubble.user { align-self: flex-start; background: #f3f4f6; border-bottom-left-radius: 4px; }
.chat-bubble.assistant { align-self: flex-end; background: var(--green-l); border-bottom-right-radius: 4px; }
.chat-compose { position: sticky; bottom: 78px; background: white; padding-top: 8px; }
.chat-compose textarea { min-height: 76px; }
.status-pill { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: 12px; background: #f3f4f6; }
.status-pill.ok { background: #e4f7ec; color: #05704a; }
.status-pill.wait { background: #fef3c7; color: #92400e; }
@media (max-width: 360px) { .bottom-nav a { font-size: 9px; } .bottom-nav a .nav-icon { font-size: 16px; } }

.quick-faq { display:flex; flex-wrap:wrap; gap:6px; margin:8px 0 12px; }
.quick-faq p { width:100%; margin:0; }
#app[aria-busy="true"] { opacity:.78; transition: opacity .12s ease; }

/* حالت روشن/تاریک قابل انتخاب؛ انتخاب کاربر در localStorage حفظ می‌شود. */
:root { color-scheme: light; --card: #ffffff; --top-bg: rgba(255,255,255,.97); --field-bg: #ffffff; --bubble-user: #f3f4f6; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --green: #4ade80; --green-d: #8be3b3; --green-l: #173b2a;
  --ink: #e5e7eb; --muted: #a1a1aa; --line: #374151; --bg: #111827; --soft: #1f2937;
  --red: #f87171; --card: #1f2937; --top-bg: rgba(17,24,39,.97); --field-bg: #111827; --bubble-user: #374151;
}
:root[data-theme="dark"] body { background: var(--bg); color: var(--ink); }
:root[data-theme="dark"] .top, :root[data-theme="dark"] .bottom-nav { background: var(--top-bg); }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .sheet-panel, :root[data-theme="dark"] .chat-compose { background: var(--card); color: var(--ink); }
:root[data-theme="dark"] .form input, :root[data-theme="dark"] .form select, :root[data-theme="dark"] .form textarea { background: var(--field-bg); color: var(--ink); }
:root[data-theme="dark"] .tab { background: var(--card); color: var(--ink); }
:root[data-theme="dark"] .tab.on { background: var(--green); color: #052e16; }
:root[data-theme="dark"] .chat-bubble.user { background: var(--bubble-user); }
:root[data-theme="dark"] .offer-card { background: linear-gradient(150deg,#1f2937,#172b21); border-color: #28543a; }
:root[data-theme="dark"] .card.err { background: #351c22; }
:root[data-theme="dark"] .status-pill { background: var(--soft); color: var(--ink); }
:root[data-theme="dark"] .status-pill.ok { background: #04402b; color: #bfeed3; }
:root[data-theme="dark"] .status-pill.wait { background: #78350f; color: #fde68a; }
:root[data-theme="dark"] .badge { background: var(--soft); color: var(--ink); }
:root[data-theme="dark"] .dropzone, :root[data-theme="dark"] .paycard .pc-label { color: var(--ink); }
:root[data-theme="dark"] .fab-ai { box-shadow: 0 8px 20px rgba(0,0,0,.45); }
.theme-toggle { margin-right: auto; flex: 0 0 36px; }

/* ═══════════ v1.3.0: روانی، انیمیشن و ظاهر جدید ═══════════ */
* { -webkit-tap-highlight-color: transparent; }
a, button, label, summary { touch-action: manipulation; }
html { scroll-behavior: smooth; }
.btn, .tab, .iconbtn, .card.row, .card.alt, .faq-item, .offer, .chip { transition: transform .16s ease, box-shadow .2s ease, background-color .2s ease, opacity .2s ease; }
.btn:active, .tab:active, .iconbtn:active, .faq-item:active, .chip:active { transform: scale(.97); }
.top { background: var(--top-bg); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); }
.top h1 { flex: 1; text-align: center; }
.theme-toggle { margin-right: 0; }

/* انیمیشن ورود صفحه و اسکلت بارگذاری */
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 100% { transform: translateX(-100%); } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.06); } 100% { transform: scale(1); opacity: 1; } }
.page-in { animation: pageIn .26s cubic-bezier(.2,.8,.2,1); }
#app[aria-busy="true"] { opacity: 1; }
.skel { display: grid; gap: 12px; padding-top: 6px; }
.sk { position: relative; overflow: hidden; height: 84px; border-radius: 18px; background: var(--soft); border: 1px solid var(--line); }
.sk.h1 { height: 130px; } .sk.short { height: 56px; width: 70%; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(100%); background: linear-gradient(90deg, transparent, rgba(128,128,128,.14), transparent); animation: shimmer 1.2s infinite; }
.sheet:not([hidden]) .sheet-bg { animation: fadeIn .2s ease; }
.sheet:not([hidden]) .sheet-panel { animation: slideUp .28s cubic-bezier(.2,.8,.2,1); }
.sheet-panel.tall { max-height: 92vh; }
.toast { animation: rise .22s ease; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* پروفایل */
.avatar-btn { position: relative; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--green); background: var(--green-l); color: var(--green-d); font: inherit; font-weight: 700; font-size: 17px; display: grid; place-items: center; overflow: hidden; cursor: pointer; padding: 0; }
.avatar-btn img, .prof-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-btn[hidden], .avatar-btn img[hidden], .avatar-btn span[hidden] { display: none; }
.prof-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 14px; }
.prof-avatar { position: relative; width: 96px; height: 96px; border-radius: 50%; background: var(--green-l); color: var(--green-d); display: grid; place-items: center; font-size: 38px; font-weight: 700; margin-bottom: 6px; box-shadow: 0 0 0 4px var(--green-l), 0 8px 22px rgba(7,135,90,.25); }
.prof-avatar > img, .prof-avatar > span { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: grid; place-items: center; }
.prof-avatar .cam { position: absolute; bottom: -2px; left: -2px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; font-size: 16px; cursor: pointer; box-shadow: 0 3px 10px rgba(0,0,0,.25); border: 2px solid var(--card, #fff); }
.prof-name { font-size: 18px; font-weight: 700; }
.menu-list { display: grid; gap: 8px; margin-top: 6px; }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card, #fff); color: var(--ink); text-decoration: none; font: inherit; font-weight: 700; width: 100%; cursor: pointer; text-align: right; }
.menu-item:active { background: var(--soft); }
.menu-item .mi { font-size: 20px; width: 28px; text-align: center; }
.menu-item.danger { color: var(--red); }

/* ═══ اشتراک ═══ */
.plan-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 18px; margin-bottom: 14px; color: #fff; background: radial-gradient(circle at 0% 0%, rgba(255,255,255,.22), transparent 45%), linear-gradient(135deg, #0f766e, #07875a 55%, #4ade80); box-shadow: 0 14px 30px rgba(7,135,90,.28); animation: rise .35s ease both; }
.plan-hero.none { background: radial-gradient(circle at 0% 0%, rgba(255,255,255,.18), transparent 45%), linear-gradient(135deg, #334155, #475569 60%, #64748b); box-shadow: 0 14px 30px rgba(51,65,85,.25); }
.plan-hero .ph-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-hero .ph-kicker { font-size: 10.5px; letter-spacing: 1.4px; opacity: .8; direction: ltr; font-weight: 700; }
.plan-hero h2 { margin: 6px 0 2px; font-size: 23px; }
.plan-hero p { margin: 0; font-size: 12.5px; opacity: .9; }
.ph-days { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3); border-radius: 14px; padding: 6px 12px; text-align: center; line-height: 1.3; flex: 0 0 auto; }
.ph-days b { display: block; font-size: 22px; }
.ph-days span { font-size: 11px; opacity: .9; }
.meters { display: grid; gap: 10px; margin-top: 14px; }
.meter .m-row { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; opacity: .95; }
.meter .m-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.25); overflow: hidden; }
.meter .m-bar i { display: block; height: 100%; border-radius: 999px; background: #fff; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card, #fff); color: var(--ink); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.chip.on { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 6px 14px rgba(7,135,90,.28); }
:root[data-theme="dark"] .chip.on { color: #052e16; }
.offer { --c1: #07875a; --c2: #16c060; position: relative; overflow: hidden; border-radius: 22px; padding: 16px 16px 14px; margin-bottom: 14px; background: var(--card, #fff); border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0,0,0,.06); animation: rise .4s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i, 0) * 70ms); }
.offer::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.offer.best { border-color: var(--c1); box-shadow: 0 10px 28px color-mix(in srgb, var(--c1) 30%, transparent); }
.offer .o-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
.o-tier { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.o-emoji { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 5px 12px color-mix(in srgb, var(--c1) 35%, transparent); }
.o-dur { padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--c1); background: color-mix(in srgb, var(--c1) 13%, transparent); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.badge { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: #f3f4f6; color: #374151; }
.badge.gold { background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #422006; }
.badge.red { background: #fee2e2; color: #b91c1c; } .badge.blue { background: #dbeafe; color: #1d4ed8; }
.badge.amber { background: #fef3c7; color: #92400e; } .badge.green { background: #e4f7ec; color: #05704a; }
.o-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin: 12px 0 2px; }
.o-price b { font-size: 28px; line-height: 1.2; background: linear-gradient(135deg, var(--c1), var(--c2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.o-price small { color: var(--muted); font-size: 13px; } .o-price s { color: var(--muted); font-size: 13px; }
.o-perday { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.o-banner { white-space: pre-line; font-size: 13px; line-height: 1.9; padding: 10px 12px; border-radius: 14px; margin: 8px 0; background: color-mix(in srgb, var(--c1) 9%, transparent); border: 1px dashed color-mix(in srgb, var(--c1) 45%, transparent); }
.o-feats { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 6px 10px; margin: 10px 0; padding: 0; list-style: none; font-size: 12.5px; }
.o-feats li::before { content: "✓"; color: var(--c1); font-weight: 700; margin-left: 6px; }
.o-cta { width: 100%; border: 0; border-radius: 15px; padding: 13px; font: inherit; font-weight: 700; font-size: 15px; color: #fff; cursor: pointer; background: linear-gradient(135deg, var(--c1), var(--c2)); box-shadow: 0 8px 18px color-mix(in srgb, var(--c1) 35%, transparent); transition: transform .15s ease, filter .2s; }
.o-cta:active { transform: scale(.98); filter: brightness(.95); }
.o-cta:disabled { opacity: .55; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: #fef3c7; color: #78350f; font-size: 13px; margin-bottom: 12px; }
:root[data-theme="dark"] .notice { background: #3a2f12; color: #fde68a; }

/* ═══ خرید کارت‌به‌کارت ═══ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 2px 0 12px; }
.step { text-align: center; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.step i { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto 3px; border-radius: 50%; font-style: normal; background: var(--green-l); color: var(--green-d); }
.pay-sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--soft); border: 1px solid var(--line); margin-bottom: 12px; }
.pay-sum b.amt { font-size: 22px; color: var(--green-d); }
.paycard { position: relative; overflow: hidden; border-radius: 22px; padding: 18px 18px 14px; color: #fff; margin-bottom: 10px; cursor: pointer; background: radial-gradient(circle at 100% 0%, rgba(255,255,255,.2), transparent 45%), linear-gradient(135deg, #1e293b, #0f766e 60%, #07875a); box-shadow: 0 12px 28px rgba(15,118,110,.35); animation: rise .35s ease both; }
.paycard .pc-label { font-size: 11px; opacity: .8; letter-spacing: 1px; }
.paycard .pc-num { direction: ltr; text-align: center; font-size: clamp(20px, 6.4vw, 28px); font-weight: 700; letter-spacing: 2px; margin: 14px 0 12px; font-variant-numeric: tabular-nums; text-shadow: 0 2px 6px rgba(0,0,0,.25); }
.paycard .pc-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.paycard .pc-copy { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 12px; padding: 5px 12px; font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.copy-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.copy-row .btn { margin-top: 0; padding: 10px; font-size: 13px; }
.howto { counter-reset: s; list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.howto li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.8; }
.howto li::before { content: counter(s, persian); flex: 0 0 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--green); color: #fff; font-weight: 700; font-size: 13px; }
.dropzone { display: flex; align-items: center; gap: 12px; padding: 12px; border: 2px dashed var(--line); border-radius: 16px; cursor: pointer; margin-top: 5px; font-weight: 400; background: var(--soft); }
.dropzone:active { background: var(--green-l); }
.dropzone .dz-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--green-l); font-size: 22px; flex: 0 0 48px; overflow: hidden; }
.dropzone .dz-ico img { width: 100%; height: 100%; object-fit: cover; }
.dropzone input { display: none !important; }

/* ═══ دستیار و چت ═══ */
.ai-head { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 20px; margin-bottom: 12px; color: #fff; background: radial-gradient(circle at 0% 0%, rgba(255,255,255,.2), transparent 45%), linear-gradient(135deg, #4c1d95, #7c3aed 60%, #a78bfa); box-shadow: 0 12px 26px rgba(124,58,237,.28); animation: rise .35s ease both; }
.ai-head .ai-logo { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 24px; background: rgba(255,255,255,.2); }
.ai-head b { display: block; font-size: 16px; } .ai-head span.sub { font-size: 12px; opacity: .9; }
.ai-quota { margin-right: auto; background: rgba(255,255,255,.2); border-radius: 999px; padding: 3px 11px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.faq-box { padding: 12px; }
.faq-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.faq-head b { flex: 1; }
.faq-list { display: grid; gap: 6px; }
.faq-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: right; font: inherit; font-size: 13.5px; padding: 10px 12px; border-radius: 13px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); cursor: pointer; }
.faq-item:active { background: var(--green-l); }
.faq-item.extra { display: none; } .faq-list.open .faq-item.extra { display: flex; animation: rise .25s ease both; }
.faq-more { margin-top: 8px; width: 100%; border: 0; background: none; color: var(--green-d); font: inherit; font-weight: 700; cursor: pointer; padding: 6px; }
.chat-log { gap: 10px; padding-bottom: 6px; }
.chat-bubble { position: relative; max-width: 88%; line-height: 1.9; scroll-margin-bottom: 190px; animation: rise .28s cubic-bezier(.2,.8,.2,1) both; }
.chat-bubble.user { align-self: flex-start; background: var(--green); color: #fff; border-bottom-left-radius: 5px; }
:root[data-theme="dark"] .chat-bubble.user { color: #052e16; }
.chat-bubble.assistant { align-self: flex-end; background: var(--card, #fff); border: 1px solid var(--line); border-bottom-right-radius: 5px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.chat-bubble.error { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
:root[data-theme="dark"] .chat-bubble.error { background: #3b1d22; color: #fecaca; border-color: #7f1d1d; }
.msg-meta { margin-top: 4px; font-size: 11px; color: var(--muted); }
.typing { display: inline-flex; align-items: center; gap: 5px; padding: 14px 16px; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: bounce 1.1s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-6px); opacity: 1; } }
.composer { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); z-index: 4; display: flex; align-items: flex-end; gap: 8px; padding: 8px; margin-top: 10px; border-radius: 22px; background: var(--card, #fff); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.composer textarea { flex: 1; resize: none; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; line-height: 1.7; max-height: 120px; padding: 8px 10px; min-height: 40px; }
.composer .send { flex: 0 0 42px; width: 42px; height: 42px; border: 0; border-radius: 50%; display: grid; place-items: center; cursor: pointer; color: #fff; background: linear-gradient(135deg, #7c3aed, #a78bfa); box-shadow: 0 6px 14px rgba(124,58,237,.35); transition: transform .15s, opacity .2s; }
.composer .send svg { transform: scaleX(-1); }
.composer .send:active { transform: scale(.92); } .composer .send:disabled { opacity: .45; }

/* ویرایشگر سوالات متداول (ادمین) */
.faq-edit { padding: 12px; position: relative; }
.faq-edit .fe-top { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.faq-edit .fe-top b { flex: 1; font-size: 13px; color: var(--muted); }
.mini { border: 0; width: 34px; height: 34px; border-radius: 10px; background: var(--green-l); color: var(--green-d); font-size: 16px; cursor: pointer; }
.mini.del { background: #fee2e2; color: #b91c1c; } .mini:disabled { opacity: .35; }
.pdf-ready-pop { animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }

/* پاپ‌آپ تشکر از خرید + امتیازدهی سریع */
.thanks-pop { text-align: center; padding: 6px 4px 10px; }
.thanks-ico { font-size: 42px; animation: rise .4s ease both; }
.thanks-pop h3 { margin: 6px 0 4px; }
.thanks-stars { font-size: 30px; display: flex; justify-content: center; gap: 6px; margin: 14px 0 6px; }
.thanks-stars span { cursor: pointer; filter: grayscale(1) opacity(.45); transition: filter .15s, transform .15s; }
.thanks-stars span:hover, .thanks-stars span:active { filter: grayscale(0) opacity(1); transform: scale(1.15); }
.tracking-code { font-weight: 700; direction: ltr; unicode-bidi: embed; }
.row-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* دکمه شناور دستیار AI (پایین-راست، بالاتر از منو) */
.fab-ai { position: fixed; left: 14px; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); width: 48px; height: 48px; border-radius: 14px; border: 0; z-index: 10;
  background: linear-gradient(135deg, #7c3aed, #a78bfa); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer;
  box-shadow: 0 8px 20px rgba(124,58,237,.35); display: grid; place-items: center; }

.faq-edit input, .faq-edit textarea { width: 100%; margin-top: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--field-bg, #fff); color: var(--ink); font: inherit; }
.faq-edit textarea { min-height: 96px; resize: vertical; }
.sticky-save { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); z-index: 4; padding-top: 6px; }

/* ───── ویرایشگر رژیم (diet_flow، v1.4.0) ───── */
:root { --amber: #d97706; --amber-l: #fef3c7; --red-l: #fee2e2; }
:root[data-theme="dark"] { --amber: #fbbf24; --amber-l: #3a2f12; --red-l: #351c22; }
.d-head { position: sticky; top: var(--top-h, 57px); z-index: 4; box-shadow: 0 6px 14px rgba(0,0,0,.06); }
.d-head { padding: 8px 12px 10px; }
.d-who { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; min-width: 0; }
.d-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-who .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.d-who .status-pill { margin-inline-start: auto; flex: 0 0 auto; padding: 0 8px; font-size: 11px; }
.d-bars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.d-bar { font-size: 11.5px; }
.d-bar-top { display: flex; flex-direction: column; line-height: 1.35; }
.d-bar-top span { color: var(--muted); }
.d-bar-top b { font-size: 13px; white-space: nowrap; }
.d-bar-top small { font-weight: 400; color: var(--muted); font-size: 10.5px; }
.d-bar .bar { margin: 4px 0 0; }
.d-bar.lv-ok .bar span { background: var(--green); }
.d-bar.lv-warn .bar span { background: var(--amber); }
.d-bar.lv-warn b { color: var(--amber); }
.d-bar.lv-bad .bar span { background: var(--red); }
.d-bar.lv-bad b { color: var(--red); }
.d-bar.lv-prog .bar span { background: #86c9a0; }
:root[data-theme="dark"] .d-bar.lv-prog .bar span { background: #3f7a57; }
.d-slots .chip { display: inline-flex; align-items: center; gap: 6px; }
.d-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--line); }
.d-dot.lv-ok { background: var(--green); } .d-dot.lv-warn { background: var(--amber); } .d-dot.lv-bad { background: var(--red); }
.chip.on .d-dot { box-shadow: 0 0 0 2px #fff; }
.d-meal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.d-recipe { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 8px; border-bottom: 1px dashed var(--line); }
.d-recipe b { font-size: 15.5px; }
.btn.d-mini { width: auto; margin: 0; padding: 7px 12px; font-size: 13px; flex: 0 0 auto; }
.btn.d-add { display: block; margin: 8px 0 0; width: 100%; }
.d-rnote { margin: 6px 0 0; }
.d-items { display: flex; flex-direction: column; }
.d-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.d-name { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; line-height: 1.45; }
.d-name b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.d-ctrl { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; direction: rtl; }
.d-step { width: 34px; height: 38px; border: 1px solid var(--line); background: var(--card, #fff); color: var(--green-d); border-radius: 10px; font: inherit; font-size: 20px; font-weight: 700; line-height: 1; cursor: pointer; touch-action: manipulation; }
.d-step:active { background: var(--green-l); }
.d-amt { width: 62px; height: 38px; text-align: center; border: 1px solid var(--line); border-radius: 10px; font: inherit; font-weight: 700; font-size: 15px; background: var(--field-bg, #fff); color: var(--ink); padding: 0 4px; }
.d-amt:focus { outline: 2px solid var(--green-l); border-color: var(--green); }
.d-amt.invalid { border-color: var(--red); background: var(--red-l); }
.d-amt:disabled { background: transparent; border-color: transparent; }
.d-unit { font-size: 11px; color: var(--muted); min-width: 34px; text-align: center; line-height: 1.2; }
.d-del { width: 28px; height: 38px; border: 0; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; }
.d-sum { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 2px; font-size: 13px; }
.d-sum .lv-ok b { color: var(--green-d); } .d-sum .lv-warn b { color: var(--amber); } .d-sum .lv-bad b { color: var(--red); }
.d-result { margin-top: 10px; padding: 9px 11px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); font-size: 13px; }
.d-result.ai { background: var(--green-l); border-color: transparent; }
.d-search { display: block; width: 100%; margin: 0 0 10px; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; font: inherit; background: var(--field-bg, #fff); color: var(--ink); }
.d-search:focus { outline: 2px solid var(--green-l); border-color: var(--green); }
.card.alt:disabled { opacity: .5; cursor: default; }
.center-text { text-align: center; }
#d-save.bad { color: var(--red); }
/* گوشی‌ها: نام ماده یک خط کامل، کنترل‌ها خط دوم (نام‌های بلند نمی‌شکنند و دکمه‌ها بزرگ می‌مانند) */
@media (max-width: 460px) {
  .d-item { flex-wrap: wrap; row-gap: 6px; }
  .d-name { flex-direction: row; align-items: baseline; gap: 8px; width: 100%; }
  .d-name b { white-space: nowrap; }
  .d-name .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .d-ctrl { width: 100%; justify-content: flex-start; }
  .d-ctrl .d-del { margin-inline-start: auto; }
}
@media (max-width: 340px) { .d-bars { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.d-meal { margin-bottom: 14px; }
#d-save { padding-bottom: 70px; }
:root[data-theme="dark"] .toast { background: #f3f4f6; color: #111827; }
:root[data-theme="dark"] .toast.bad { background: var(--red); color: #111827; }
/* ───── v1.5.0: نوار روزها، همه‌ی وعده‌ها زیر هم، نام وعده، قفل وعده/روز، علامت بالانس، حساسیت‌ها ───── */
.d-tabs { padding: 2px 0 8px; margin: 0 0 4px; scrollbar-width: none; }
.d-tabs::-webkit-scrollbar { display: none; }
.d-tabs .tab { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 6px 12px; font-size: 13px; }
.d-daybar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 2px 10px; }
.d-daybar b { margin-inline-end: auto; font-size: 15px; }
.btn.d-mini.on { background: var(--amber-l); border-color: var(--amber); color: var(--ink); }
.d-meal-head { gap: 8px; flex-wrap: wrap; justify-content: flex-start; }
.d-meal-head .d-share { margin-inline-start: auto; }
.d-mname { display: block; width: 100%; margin: 2px 0 6px; padding: 8px 10px; min-height: 42px; border: 1px solid var(--line); border-radius: 11px; font: inherit; font-weight: 700; font-size: 15px; background: var(--field-bg, #fff); color: var(--ink); }
.d-mname:focus { outline: 2px solid var(--green-l); border-color: var(--green); }
.d-mname:disabled { border-color: transparent; background: transparent; padding-inline: 0; }
.d-item.banned { background: var(--red-l); border-radius: 10px; padding-inline: 6px; }
.d-flag { font-size: 11.5px; font-weight: 700; color: var(--amber); }
.d-flag.bad { color: var(--red); }
.d-meal-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.d-meal-actions .btn.d-mini { flex: 1 1 auto; }
.d-empty { padding: 10px 0 4px; }
.d-restr-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.d-restr p, .d-viol p, .d-rep p { margin: 5px 0; }
.d-viol { border: 1px solid var(--red); background: var(--red-l); }
.d-warn { color: var(--amber); }
.form .check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.form .check input { width: auto; min-height: 0; }
@media (max-width: 460px) { .d-meal-head .d-share { width: auto; } }
/* ───── v1.6.0: راهنمای اصلاح (قرمز)، AI Assisted (بنفش)، کالری روزانه ───── */
:root { --purple: #7c3aed; --purple-l: #f3e8ff; --red-d: #b91c1c; }
:root[data-theme="dark"] { --purple: #c4b5fd; --purple-l: #2e1f4d; --red-d: #fca5a5; }
@keyframes d-blink { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .25; transform: scale(.7); } }
.d-dot.lv-alert { background: var(--red); box-shadow: 0 0 0 3px rgba(239,68,68,.25); animation: d-blink 1s ease-in-out infinite; }
.tab.alert { border-color: var(--red); }
.tab.on .d-dot.lv-alert { box-shadow: 0 0 0 2px #fff; }
.btn.d-red { background: var(--red); border-color: var(--red); color: #fff; }
:root[data-theme="dark"] .btn.d-red { color: #111827; }
.d-dayhint { border: 2px solid var(--red); background: var(--red-l); margin-bottom: 12px; }
.d-dayhint > b { color: var(--red-d); }
.d-dayhint p { margin: 5px 0; font-size: 13px; }
.d-dayhint .btn.d-mini { width: 100%; margin-top: 6px; }
.d-meal.fix { border: 2px solid var(--red); background: linear-gradient(0deg, var(--card, #fff), var(--card, #fff)) padding-box; box-shadow: 0 0 0 3px rgba(239,68,68,.12); }
.d-badge { border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 700; }
.d-badge.red { background: var(--red-l); color: var(--red-d); }
.d-fix { background: var(--red-l); border-radius: 12px; padding: 8px 10px; margin: 4px 0 8px; color: var(--red-d); font-size: 13px; }
.d-fix p { margin: 4px 0 0; color: var(--ink); }
.d-item.sug .d-amt { border-color: var(--red); background: var(--red-l); }
.d-sug { color: var(--red-d); font-weight: 700; }
.d-meal.ai { border: 2px solid var(--purple); background: linear-gradient(0deg, var(--purple-l), var(--purple-l)); position: relative; }
.d-ai-label { font-size: 10px; font-weight: 700; letter-spacing: .4px; color: var(--purple); direction: ltr; text-align: left; margin: -4px 0 2px; }
.d-item.ai .d-amt { border-color: var(--purple); background: var(--card, #fff); color: var(--purple); }
.d-prev { color: var(--purple); font-weight: 700; }
.d-calbtn { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card, #fff); color: var(--ink); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.d-energy { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: var(--soft); }
.d-energy-row { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 13.5px; }
.d-energy-row b { white-space: nowrap; }
h3.d-sub { margin: 14px 0 6px; font-size: 15px; }
.linkbtn { border: 0; background: none; color: var(--green-d); font: inherit; font-size: inherit; text-decoration: underline; cursor: pointer; padding: 0; }
@media (prefers-reduced-motion: reduce) { .d-dot.lv-alert { animation: none; } }
.chat-lock { text-align: center; border: 1px solid var(--red); background: var(--red-l); }
.chat-lock p { margin: 6px 0 12px; line-height: 1.8; }

/* ═════════════════════════════════════════════════════════════════════════
   v1.7.0 — Liquid Glass: شیشه‌ی مات، نور و انیمیشن (حالت سبک خودکار برای گوشی‌های ضعیف)
   ═════════════════════════════════════════════════════════════════════════ */
:root {
  --glass: rgba(255,255,255,.58); --glass-2: rgba(255,255,255,.78); --glass-brd: rgba(255,255,255,.75);
  --glass-hi: inset 0 1px 0 rgba(255,255,255,.9), inset 0 -1px 0 rgba(255,255,255,.25);
  --shadow: 0 10px 30px rgba(15,40,30,.10), 0 2px 6px rgba(15,40,30,.05);
  --blur: blur(20px) saturate(175%);
  --bg: #eaf2ee; --card: rgba(255,255,255,.66); --field-bg: rgba(255,255,255,.85); --top-bg: rgba(255,255,255,.55);
  --ease: cubic-bezier(.2,.8,.2,1); --spring: cubic-bezier(.34,1.56,.64,1);
  --acc1: #07875a; --acc2: #16c060; --violet: #7c3aed; --violet2: #a855f7;
}
:root[data-theme="dark"] {
  --glass: rgba(22,26,44,.56); --glass-2: rgba(30,35,58,.82); --glass-brd: rgba(255,255,255,.09);
  --glass-hi: inset 0 1px 0 rgba(255,255,255,.08), inset 0 -1px 0 rgba(0,0,0,.25);
  --shadow: 0 12px 34px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.3);
  --bg: #070b17; --card: rgba(24,28,48,.68); --field-bg: rgba(8,12,26,.7); --top-bg: rgba(10,14,28,.6);
  --ink: #eef0f7; --muted: #b3b9cc; --line: rgba(255,255,255,.12); --soft: rgba(255,255,255,.05);
  --green: #4ade80; --green-d: #8be3b3; --green-l: rgba(74,222,128,.14);
}
html, body { background: var(--bg); }
body { position: relative; isolation: isolate; }

/* پس‌زمینه‌ی زنده: سه حباب رنگی محو و شناور */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs i { position: absolute; width: 62vmax; height: 62vmax; border-radius: 50%; filter: blur(70px); opacity: .55; will-change: transform; }
.bg-blobs i:nth-child(1) { background: radial-gradient(circle, #34d399 0%, transparent 62%); top: -22vmax; right: -18vmax; animation: blob1 22s ease-in-out infinite; }
.bg-blobs i:nth-child(2) { background: radial-gradient(circle, #a78bfa 0%, transparent 62%); bottom: -26vmax; left: -20vmax; animation: blob2 26s ease-in-out infinite; }
.bg-blobs i:nth-child(3) { background: radial-gradient(circle, #38bdf8 0%, transparent 62%); top: 30%; left: 40%; width: 44vmax; height: 44vmax; opacity: .35; animation: blob3 30s ease-in-out infinite; }
:root[data-theme="dark"] .bg-blobs i { opacity: .32; }
@keyframes blob1 { 50% { transform: translate(-10vmax, 12vmax) scale(1.12); } }
@keyframes blob2 { 50% { transform: translate(12vmax, -10vmax) scale(1.18); } }
@keyframes blob3 { 50% { transform: translate(-16vmax, -8vmax) scale(.86); } }

/* سطح‌های شیشه‌ای */
.top, .card, .sheet-panel, .composer, .offer, .stat, .menu-item, .faq-item, .tab, .chip, .d-head, .bottom-nav,
.res-tile, .seg, .tpl, .ai-loader, .rc-row, .pay-sum, .notice, .d-energy, .dropzone {
  background: var(--glass); border: 1px solid var(--glass-brd);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--shadow), var(--glass-hi);
}
.card { border-radius: 22px; padding: 14px 16px; margin-bottom: 12px; }
.top { border: 0; border-bottom: 1px solid var(--glass-brd); background: var(--top-bg); border-radius: 0 0 22px 22px; box-shadow: 0 6px 24px rgba(0,0,0,.06); }
.top h1 { color: var(--ink); font-size: 16.5px; letter-spacing: -.2px; }
.iconbtn { background: var(--glass-2); color: var(--ink); border: 1px solid var(--glass-brd); border-radius: 14px; box-shadow: var(--glass-hi); }
.sheet-panel { border-radius: 28px 28px 0 0; background: var(--glass-2); padding-top: 8px; }
.sheet-panel::before { content: ""; display: block; width: 44px; height: 5px; border-radius: 9px; background: var(--line); margin: 2px auto 10px; }
.sheet-bg { background: rgba(5,10,20,.32); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.form input, .form select, .form textarea, .d-search, .d-amt, .d-mname, .code-row input, .faq-edit input, .faq-edit textarea {
  background: var(--field-bg); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.form input:focus, .form select:focus, .form textarea:focus, .d-search:focus, .d-mname:focus, .code-row input:focus { outline: 0; border-color: var(--green); box-shadow: 0 0 0 4px var(--green-l); }

/* دکمه‌ها: براق، فنری، با موج لمس — و رفع خط زیر لینک‌های دکمه‌ای */
a.btn, a.btn:visited, a.res-tile, a.menu-item, .hero a { text-decoration: none !important; }
a.btn { display: block; text-align: center; }
.btn, .o-cta { position: relative; overflow: hidden; border-radius: 16px; background: linear-gradient(135deg, var(--acc1), var(--acc2)); box-shadow: 0 8px 20px rgba(7,135,90,.30), inset 0 1px 0 rgba(255,255,255,.35); transition: transform .18s var(--spring), box-shadow .2s, filter .2s; }
.btn::after, .o-cta::after { content: ""; position: absolute; inset: 0 0 52% 0; background: linear-gradient(180deg, rgba(255,255,255,.28), transparent); pointer-events: none; border-radius: inherit; }
.btn:active, .o-cta:active { transform: scale(.965); }
.btn.ghost { background: var(--glass-2); color: var(--green-d); border: 1px solid var(--glass-brd); box-shadow: var(--glass-hi), 0 4px 12px rgba(0,0,0,.05); }
.btn.ghost::after { display: none; }
:root[data-theme="dark"] .btn { color: #04120a; }
:root[data-theme="dark"] .btn.ghost { color: var(--green-d); }
.btn.ai-btn { color: var(--violet); }
:root[data-theme="dark"] .btn.ai-btn { color: #d8b4fe; }
.rip { position: absolute; border-radius: 50%; background: rgba(255,255,255,.45); transform: scale(0); animation: rip .65s var(--ease); pointer-events: none; }
:root[data-theme="dark"] .rip { background: rgba(255,255,255,.18); }
@keyframes rip { to { transform: scale(2.4); opacity: 0; } }

/* ورود پله‌ای محتوای هر صفحه */
.page-in > * { animation: rise .5s var(--ease) both; }
.page-in > *:nth-child(2) { animation-delay: .05s; } .page-in > *:nth-child(3) { animation-delay: .1s; }
.page-in > *:nth-child(4) { animation-delay: .15s; } .page-in > *:nth-child(5) { animation-delay: .2s; }
.page-in > *:nth-child(n+6) { animation-delay: .24s; }

/* داشبورد */
.hero { position: relative; overflow: hidden; border-radius: 28px; padding: 22px 20px 20px; background: linear-gradient(125deg, #064e3b, #05704a 40%, #16c060 70%, #0ea5e9); background-size: 220% 220%; animation: heroShift 14s ease infinite; box-shadow: 0 18px 40px rgba(7,135,90,.28), inset 0 1px 0 rgba(255,255,255,.25); }
.hero::before { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; top: -90px; left: -60px; background: radial-gradient(circle, rgba(255,255,255,.35), transparent 65%); animation: floaty 9s ease-in-out infinite; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.18) 45%, transparent 60%); background-size: 250% 100%; animation: sheen 6s ease-in-out infinite; pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h2 { font-size: 22px; } .hero p { color: #ecfdf5; }
.hero .btn.hero-btn { background: rgba(255,255,255,.95); color: #04402b; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
@keyframes heroShift { 50% { background-position: 100% 50%; } }
@keyframes floaty { 50% { transform: translate(30px, 24px) scale(1.1); } }
@keyframes sheen { 0%, 40% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.stat { border-radius: 20px; }
.stat b { background: linear-gradient(135deg, var(--acc1), #0ea5e9); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* منوی پایین شناور و دکمه‌ی سبز AI بالای «برنامه جدید» */
.bottom-nav { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding: 6px 6px; border-radius: 26px; background: var(--top-bg); }
.bottom-nav a { border-radius: 18px; transition: background .25s, color .25s, transform .2s var(--spring); }
.bottom-nav a.active { background: var(--green-l); color: var(--green-d); }
.bottom-nav a:active { transform: scale(.92); }
.bottom-nav a.nav-home { background: linear-gradient(135deg, var(--acc1), var(--acc2)); box-shadow: 0 10px 22px rgba(7,135,90,.45), inset 0 1px 0 rgba(255,255,255,.4); }
:root[data-theme="dark"] .bottom-nav a.nav-home { color: #04120a; }
@media (min-width: 700px) { .bottom-nav { left: 50%; right: auto; width: min(560px, calc(100% - 24px)); border-radius: 26px; border: 1px solid var(--glass-brd); } }
body { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.fab-ai { left: auto; right: calc(12px + (100vw - 24px) / 10 - 28px); bottom: calc(86px + env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #059669, #16c060 60%, #8be3b3); color: #fff; font-size: 15px; letter-spacing: .5px;
  box-shadow: 0 12px 26px rgba(7,135,90,.45), inset 0 1px 0 rgba(255,255,255,.5); border: 2px solid rgba(255,255,255,.6); overflow: visible; transition: transform .2s var(--spring); z-index: 11; }
.fab-ai b { position: relative; z-index: 1; }
.fab-ai .fab-glow { position: absolute; inset: -6px; border-radius: 50%; background: radial-gradient(circle, rgba(34,197,94,.55), transparent 70%); animation: pulse 2.4s ease-in-out infinite; }
.fab-ai:active { transform: scale(.9); }
@keyframes pulse { 0%, 100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.25); opacity: 0; } }
@media (min-width: 700px) { .fab-ai { right: calc((100vw - min(560px, 100vw - 24px)) / 2 + min(560px, 100vw - 24px) / 10 - 28px); } }
:root[data-theme="dark"] .fab-ai { border-color: rgba(255,255,255,.25); box-shadow: 0 12px 26px rgba(0,0,0,.5), 0 0 24px rgba(34,197,94,.35); }

/* اعلان‌ها (toast): روشن = شیشه‌ی تیره؛ تاریک = بنفش و سفید */
.toast { display: flex; align-items: center; gap: 10px; bottom: calc(100px + env(safe-area-inset-bottom, 0px)); padding: 10px 16px 10px 14px; border-radius: 18px; color: #fff;
  background: rgba(17,24,39,.86); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 16px 36px rgba(0,0,0,.28); animation: toastIn .42s var(--spring); }
.toast .t-ic { flex: 0 0 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: #16c060; color: #fff; }
.toast.bad { background: rgba(185,28,28,.92); } .toast.bad .t-ic { background: #fff; color: #b91c1c; }
.toast.out { animation: toastOut .26s ease forwards; }
:root[data-theme="dark"] .toast, :root[data-theme="dark"] .toast.ok { background: linear-gradient(135deg, #6d28d9, #9333ea 55%, #a855f7); color: #fff; border-color: rgba(255,255,255,.25); box-shadow: 0 16px 40px rgba(109,40,217,.45); }
:root[data-theme="dark"] .toast .t-ic { background: #fff; color: #6d28d9; }
:root[data-theme="dark"] .toast.bad { background: linear-gradient(135deg, #7c3aed, #be123c); color: #fff; }
:root[data-theme="dark"] .toast.bad .t-ic { color: #be123c; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 18px) scale(.94); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, 12px) scale(.96); } }

/* خوانایی حالت شب (چت، برچسب‌ها، کادرها) */
:root[data-theme="dark"] .chat-bubble.user { background: linear-gradient(135deg, #05704a, #07875a); color: #fff; }
:root[data-theme="dark"] .chat-bubble.assistant { background: var(--glass-2); color: var(--ink); border-color: var(--glass-brd); }
:root[data-theme="dark"] .msg-meta, :root[data-theme="dark"] .muted { color: var(--muted); }
:root[data-theme="dark"] .composer textarea::placeholder, :root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: #8e95ab; }
:root[data-theme="dark"] .pill { background: rgba(74,222,128,.16); color: #bfeed3; }
:root[data-theme="dark"] .d-fix { background: rgba(248,113,113,.14); color: #fecaca; }
:root[data-theme="dark"] .d-fix p { color: var(--ink); }
:root[data-theme="dark"] .d-dayhint { background: rgba(248,113,113,.10); }
:root[data-theme="dark"] .d-meal.ai { background: rgba(167,139,250,.12); }
:root[data-theme="dark"] .notice { background: rgba(251,191,36,.12); color: #fde68a; }
:root[data-theme="dark"] .faq-item, :root[data-theme="dark"] .menu-item { color: var(--ink); }
:root[data-theme="dark"] .ai-quota { color: #fff; }
:root[data-theme="dark"] .tab.on, :root[data-theme="dark"] .chip.on { color: #04120a; }
:root[data-theme="dark"] .status-pill.ok { background: rgba(74,222,128,.18); color: #bfeed3; }
:root[data-theme="dark"] .status-pill.wait { background: rgba(251,191,36,.18); color: #fde68a; }
:root[data-theme="dark"] .badge { background: rgba(255,255,255,.1); color: var(--ink); }
:root[data-theme="dark"] .o-banner { color: var(--ink); }
:root[data-theme="dark"] .linkbtn { color: #8be3b3; }

/* مراحل */
.step-dots { display: flex; gap: 6px; justify-content: center; margin: 0 0 8px; }
.step-dots i { width: 22px; height: 5px; border-radius: 9px; background: var(--line); transition: background .3s, width .3s var(--spring); }
.step-dots i.on { width: 34px; background: linear-gradient(90deg, var(--acc1), var(--acc2)); }

/* لودر هوش مصنوعی */
.ai-loader { text-align: center; padding: 26px 18px 18px; border-radius: 26px; }
.ai-orb { position: relative; width: 92px; height: 92px; margin: 0 auto 14px; display: grid; place-items: center; }
.ai-orb span { position: relative; z-index: 2; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--violet), #16c060); box-shadow: 0 10px 26px rgba(124,58,237,.45); animation: breathe 1.8s ease-in-out infinite; }
.ai-orb i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; border-top-color: var(--violet); border-left-color: rgba(124,58,237,.25); animation: spin 1.4s linear infinite; }
.ai-orb i:nth-child(2) { inset: 9px; border-top-color: #16c060; animation-duration: 1.9s; animation-direction: reverse; }
.ai-orb i:nth-child(3) { inset: -8px; border-top-color: #38bdf8; opacity: .6; animation-duration: 2.6s; }
.ai-steps { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; text-align: right; }
.ai-steps li { font-size: 13px; padding: 7px 12px; border-radius: 12px; background: var(--soft); opacity: 0; animation: stepIn .5s var(--ease) forwards; animation-delay: calc(var(--i) * .9s + .2s); }
.ai-steps li::before { content: "✦ "; color: var(--violet); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.08); box-shadow: 0 14px 34px rgba(124,58,237,.6); } }
@keyframes stepIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }

/* کارت تأیید حساسیت‌ها */
.rc-card { padding: 14px; }
.rc-ai { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 16px; margin-bottom: 10px; background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(34,197,94,.10)); border: 1px solid rgba(124,58,237,.25); }
.rc-ai p { margin: 2px 0 0; font-size: 13px; }
.rc-spark { font-size: 20px; color: var(--violet); animation: twinkle 2.2s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: scale(1.25) rotate(20deg); opacity: .7; } }
.rc-fail { padding: 12px; border-radius: 16px; margin-bottom: 10px; border: 1px solid var(--red); background: var(--red-l); }
.rc-fail p { margin: 4px 0; }
.rc-group { margin: 10px 0; }
.rc-gh { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rc-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; margin-bottom: 6px; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
.rc-row.off { opacity: .45; }
.rc-row.off b { text-decoration: line-through; }
.rc-check { flex: 0 0 26px; height: 26px; border-radius: 9px; border: 2px solid var(--line); background: transparent; color: #fff; font-weight: 800; cursor: pointer; transition: all .2s var(--spring); }
.rc-check.on { background: linear-gradient(135deg, var(--acc1), var(--acc2)); border-color: transparent; }
.rc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.45; }
.rc-src { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.rc-src.s-ai { background: rgba(124,58,237,.14); color: var(--violet); }
.rc-src.s-rule { background: rgba(217,119,6,.14); color: var(--amber); }
.rc-kind { border: 0; border-radius: 999px; padding: 3px 9px; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; }
.rc-kind.k-hard { background: var(--red-l); color: var(--red); }
.rc-kind.k-soft { background: var(--amber-l); color: var(--amber); }
:root[data-theme="dark"] .rc-src.s-ai { color: #d8b4fe; }
.rc-note { padding: 8px 10px; border-radius: 12px; background: var(--soft); }
.rc-add { margin: 10px 0 0; }
.rc-mini { color: var(--violet); }
:root[data-theme="dark"] .rc-mini { color: #d8b4fe; }
.d-src { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: rgba(124,58,237,.12); color: var(--violet); }
:root[data-theme="dark"] .d-src { color: #d8b4fe; }

/* بازبینی AI */
.rv-head { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.rv-head p { margin: 0; }
.rv-score { flex: 0 0 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; align-content: center; color: #fff; background: linear-gradient(135deg, var(--violet), var(--violet2)); box-shadow: 0 8px 20px rgba(124,58,237,.35); animation: pop .5s var(--spring); }
.rv-score b { font-size: 24px; line-height: 1; } .rv-score span { font-size: 10.5px; opacity: .9; }
.rv-ic { flex: 0 0 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: #0ea5e9; }
.rv-body { flex: 1; } .rv-body p { margin: 0 0 4px; font-size: 13.5px; }
.rv-fix { display: block; color: var(--violet); font-weight: 700; margin-bottom: 6px; }
:root[data-theme="dark"] .rv-fix { color: #d8b4fe; }
.btn.rv-apply { width: auto; margin: 0; padding: 7px 14px; font-size: 13px; background: linear-gradient(135deg, var(--violet), var(--violet2)); box-shadow: 0 6px 16px rgba(124,58,237,.35); color: #fff; }

/* صفحه‌ی بعد از PDF */
.res-hero { text-align: center; padding: 26px 18px 20px; margin-bottom: 14px; border-radius: 28px; color: #fff; background: linear-gradient(135deg, #065f46, #07875a 55%, #16c060); box-shadow: 0 18px 40px rgba(7,135,90,.32); position: relative; overflow: hidden; }
:root[data-theme="dark"] .res-hero { background: linear-gradient(135deg, #3b0764, #6d28d9 55%, #a855f7); box-shadow: 0 18px 40px rgba(109,40,217,.4); }
.res-hero h2 { margin: 10px 0 4px; font-size: 20px; } .res-hero p { margin: 0; opacity: .92; font-size: 13px; }
.res-check { width: 84px; height: 84px; }
.res-check circle { fill: rgba(255,255,255,.18); stroke: #fff; stroke-width: 2.5; stroke-dasharray: 160; stroke-dashoffset: 160; animation: draw .7s var(--ease) forwards; }
.res-check path { fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s .55s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.res-tile { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 16px 14px; border-radius: 22px; font: inherit; text-align: right; color: var(--ink); cursor: pointer; animation: rise .5s var(--ease) both; transition: transform .2s var(--spring); }
.res-tile:active { transform: scale(.96); }
.res-tile .ri { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; font-size: 22px; margin-bottom: 6px; color: #fff; }
.res-tile b { font-size: 14.5px; } .res-tile small { color: var(--muted); font-size: 11.5px; }
.res-tile.t1 .ri { background: linear-gradient(135deg, #0ea5e9, #38bdf8); } .res-tile.t2 .ri { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.res-tile.t3 .ri { background: linear-gradient(135deg, #f59e0b, #fbbf24); } .res-tile.t4 .ri { background: linear-gradient(135deg, #07875a, #16c060); }
.res-tile:nth-child(2) { animation-delay: .07s; } .res-tile:nth-child(3) { animation-delay: .14s; } .res-tile:nth-child(4) { animation-delay: .21s; }
.invite-box { padding: 12px; border-radius: 14px; background: var(--soft); border: 1px dashed var(--line); font-size: 13px; word-break: break-all; margin: 10px 0; }

/* اشتراک: سوئیچ مدت و کارت پلن‌ها */
.seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 5px; border-radius: 20px; margin-bottom: 14px; }
.seg button { position: relative; z-index: 1; border: 0; background: transparent; color: var(--ink); font: inherit; padding: 8px 4px; border-radius: 15px; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.35; overflow: hidden; }
.seg button b { font-size: 13.5px; } .seg button small { font-size: 10px; color: var(--muted); }
.seg button.on { color: #fff; } .seg button.on small { color: rgba(255,255,255,.9); }
.seg .seg-ind { position: absolute; top: 5px; bottom: 5px; border-radius: 15px; background: linear-gradient(135deg, var(--acc1), var(--acc2)); box-shadow: 0 8px 18px rgba(7,135,90,.35); transition: left .35s var(--spring), width .35s var(--spring); }
:root[data-theme="dark"] .seg button.on, :root[data-theme="dark"] .seg button.on small { color: #04120a; }
.offer { border-radius: 26px; }
.offer.best { box-shadow: 0 14px 34px color-mix(in srgb, var(--c1) 35%, transparent), var(--glass-hi); border: 1.5px solid var(--c1); }
.o-ribbon { position: absolute; top: 14px; left: -34px; transform: rotate(-45deg); background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #422006; font-size: 11px; font-weight: 800; padding: 3px 40px; box-shadow: 0 4px 10px rgba(0,0,0,.15); }
.o-save { font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #dc2626, #f97316); padding: 2px 9px; border-radius: 999px; }
.o-feats li.key { font-weight: 800; }
.notice.info { background: rgba(14,165,233,.12); color: var(--ink); border-color: rgba(14,165,233,.3); }
.code-row { display: flex; gap: 8px; margin-bottom: 12px; }
.code-row input { flex: 1; min-height: 44px; padding: 8px 12px; font: inherit; }
.code-row .btn { width: auto; margin: 0; padding: 8px 16px; }
.ph-queue { margin-top: 10px; padding: 7px 10px; border-radius: 12px; background: rgba(255,255,255,.18); font-size: 12.5px; }

/* باشگاه: گالری ۳۰ قالب، پیش‌نمایش زنده و رنگ‌ها */
.glass-sec h2, .glass-sec h3 { margin-top: 0; }
.logo-row { display: flex; gap: 12px; align-items: center; }
.logo-prev { flex: 0 0 84px; height: 84px; border-radius: 22px; background: #fff; display: grid; place-items: center; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); }
.logo-prev img { max-width: 86%; max-height: 86%; object-fit: contain; }
.file-btn { display: block; text-align: center; cursor: pointer; }
.tpl-gallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tpl { position: relative; padding: 6px; border-radius: 16px; cursor: pointer; font: inherit; color: var(--ink); animation: rise .45s var(--ease) both; animation-delay: calc(var(--i) * 25ms); transition: transform .2s var(--spring), box-shadow .2s; }
.tpl:active { transform: scale(.95); }
.tpl.on { border: 2px solid var(--acc1); box-shadow: 0 10px 24px rgba(7,135,90,.3); }
.tpl.locked .mk { filter: grayscale(.7) opacity(.55); }
.tpl-name { display: block; font-size: 10.5px; font-weight: 700; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-lock { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); font-size: 12px; }
.tpl-preview { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0; }
.color-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cg { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; background: var(--soft); border: 1px solid var(--line); font-size: 11px; text-align: center; cursor: pointer; }
.cg input { width: 40px; height: 40px; border: 0; padding: 0; border-radius: 50%; overflow: hidden; background: none; cursor: pointer; }
.cg input::-webkit-color-swatch-wrapper { padding: 0; } .cg input::-webkit-color-swatch { border: 2px solid rgba(255,255,255,.8); border-radius: 50%; }
.cg.changed { border-color: var(--violet); box-shadow: 0 0 0 2px rgba(124,58,237,.2); }

/* ماکت‌های قالب (پیش‌نمایش CSS؛ PDF واقعی با reportlab ساخته می‌شود) */
.mk { position: relative; aspect-ratio: 595 / 842; background: var(--pg); border-radius: 8px; overflow: hidden; box-shadow: 0 6px 16px rgba(0,0,0,.14); border: 1px solid rgba(0,0,0,.06); }
.mk i { position: absolute; display: block; font-style: normal; }
.mk .mk-logo { width: 24%; aspect-ratio: 1; left: 38%; top: 8%; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.18); display: grid; place-items: center; overflow: hidden; border: 1.5px solid var(--b); z-index: 2; }
.mk .mk-logo img { width: 76%; height: 76%; object-fit: contain; }
.mk .mk-logo b { color: var(--p); font-size: 9px; }
.mk .mk-l1 { width: 46%; height: 2.6%; left: 27%; top: 33%; border-radius: 4px; background: var(--ct); z-index: 2; }
.mk .mk-l2 { width: 30%; height: 1.8%; left: 35%; top: 37.5%; border-radius: 4px; background: var(--ct); opacity: .8; z-index: 2; }
.mk .mk-pill { width: 34%; height: 3.2%; left: 33%; top: 41.5%; border-radius: 9px; background: var(--a); z-index: 2; }
.mk .mk-grid { width: 84%; height: 16%; left: 8%; top: 50%; border-radius: calc(var(--r) * .4); background: #fff; border: 1px solid var(--b); z-index: 2; }
.mk .mk-boxes { width: 84%; height: 8%; left: 8%; top: 70%; display: grid !important; grid-template-columns: repeat(4, 1fr); gap: 3%; z-index: 2; }
.mk .mk-boxes i { position: static; background: var(--mbg); border: 1px solid var(--b); border-radius: calc(var(--r) * .4); border-top: 2px solid var(--a); }
.mk .mk-deco { position: absolute; inset: 0; }
.mk.c-band .mk-deco, .mk.c-stripes .mk-deco { bottom: 54%; background: var(--cbg); border-bottom: 1.6px solid var(--a); }
.mk.c-stripes .mk-deco { background: repeating-linear-gradient(60deg, var(--cbg) 0 9%, color-mix(in srgb, var(--a) 30%, var(--cbg)) 9% 13%); }
.mk.c-full .mk-deco { background: var(--cbg); }
.mk.c-full .mk-deco::after { content: ""; position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%; right: -20%; top: -12%; background: color-mix(in srgb, var(--a) 22%, transparent); }
.mk.c-split .mk-deco { left: 65%; background: var(--cbg); border-left: 1.6px solid var(--a); }
.mk.c-split .mk-logo { left: 70.5%; top: 14%; }
.mk.c-split .mk-l1 { left: 69%; width: 27%; top: 36%; } .mk.c-split .mk-l2 { left: 72%; width: 21%; top: 40%; } .mk.c-split .mk-pill { left: 70%; width: 25%; top: 44%; }
.mk.c-split .mk-grid { left: 5%; width: 55%; top: 10%; height: 44%; } .mk.c-split .mk-boxes { left: 5%; width: 55%; top: 60%; height: 18%; grid-template-columns: 1fr 1fr; }
.mk.c-frame .mk-deco { inset: 3%; border: 2.4px solid var(--p); box-shadow: inset 0 0 0 2px var(--pg), inset 0 0 0 2.6px var(--a); }
.mk.c-frame .mk-l1, .mk.c-frame .mk-l2, .mk.c-circles .mk-l1, .mk.c-circles .mk-l2 { background: var(--p); }
.mk.c-minimal .mk-l1, .mk.c-minimal .mk-l2 { background: var(--tx); }
.mk.c-minimal .mk-logo { background: transparent; box-shadow: none; border: 1.5px solid var(--p); }
.mk.c-arc .mk-deco { width: 176%; aspect-ratio: 1; height: auto; left: -38%; top: -134%; border-radius: 50%; background: var(--cbg); box-shadow: 18px 6px 0 color-mix(in srgb, var(--a) 40%, transparent); }
.mk.c-arc .mk-l1 { top: 30%; } .mk.c-arc .mk-l2 { top: 34%; } .mk.c-arc .mk-pill { top: 43%; } .mk.c-arc .mk-pill { background: var(--a); }
.mk.c-circles .mk-deco { background: radial-gradient(circle at 104% -2%, var(--p) 0 26%, transparent 26.5%), radial-gradient(circle at 12% 9%, color-mix(in srgb, var(--a) 60%, transparent) 0 13%, transparent 13.5%), radial-gradient(circle at 0% 100%, color-mix(in srgb, var(--p) 10%, transparent) 0 34%, transparent 34.5%); }
.mk.c-band .mk-logo, .mk.c-stripes .mk-logo, .mk.c-arc .mk-logo { top: 5%; }
.mk.c-band .mk-l1, .mk.c-stripes .mk-l1 { top: 27%; } .mk.c-band .mk-l2, .mk.c-stripes .mk-l2 { top: 31%; } .mk.c-band .mk-pill, .mk.c-stripes .mk-pill { top: 35%; }
.mk.c-band .mk-grid, .mk.c-stripes .mk-grid { top: 51%; }
/* صفحه‌ی داخلی */
.mk-inner .mk-head { left: 0; right: 0; top: 0; height: 9%; }
.mk-inner.h-bar .mk-head { background: var(--hbg); border-bottom: 1.4px solid var(--a); }
.mk-inner .mk-head .mk-logo { width: 9%; left: 45.5%; top: 18%; border-width: 1px; }
.mk-inner .mk-hl { right: 6%; top: 40%; width: 26%; height: 18%; border-radius: 3px; background: var(--ht); opacity: .9; }
.mk-inner.h-line .mk-head { border-bottom: 1.4px solid var(--p); } .mk-inner.h-line .mk-hl, .mk-inner.h-tab .mk-hl { background: var(--p); }
.mk-inner.h-pill .mk-head { left: 24%; right: 24%; top: 2%; height: 6%; border-radius: 99px; background: var(--hbg); }
.mk-inner.h-pill .mk-head .mk-logo { left: 78%; top: 10%; width: 14%; } .mk-inner.h-pill .mk-hl { right: 26%; width: 40%; top: 35%; height: 28%; background: var(--ht); }
.mk-inner.h-tab .mk-head { left: 52%; height: 7%; top: 2%; border-radius: 12px 0 0 12px; background: var(--hbg); }
.mk-inner.h-tab .mk-head .mk-logo { left: -66%; top: 6%; width: 17%; } .mk-inner.h-tab .mk-hl { background: var(--ht); right: 10%; width: 60%; }
.mk-inner .mk-day { right: 6%; top: 12.5%; width: 88%; height: 4%; border-radius: calc(var(--r) * .4); background: var(--p); }
.mk-inner.d-badge .mk-day { width: 6%; aspect-ratio: 1; height: auto; border-radius: 50%; background: var(--a); box-shadow: -6px 0 0 -1px var(--p); }
.mk-inner.d-underline .mk-day { width: 18%; height: 2.6%; background: var(--p); box-shadow: 0 5px 0 -1px var(--a); }
.mk-inner.d-ribbon .mk-day { width: 30%; background: var(--a); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 8% 50%); }
.mk-inner .mk-meal { left: 6%; right: 6%; height: 27%; border-radius: calc(var(--r) * .4); overflow: hidden; }
.mk-inner .mk-meal:nth-of-type(3) { top: 19.5%; } .mk-inner .mk-meal:nth-of-type(4) { top: 50%; }
.mk-meal .mk-mt { left: 0; right: 0; top: 0; height: 17%; background: var(--mbg); border: 1px solid var(--b); }
.mk-meal .mk-row { left: 0; right: 0; height: 17%; background: #fff; border-bottom: 1px solid var(--b); }
.mk-meal .mk-row.z { background: var(--z); }
.mk-meal .mk-row:nth-of-type(2) { top: 20%; } .mk-meal .mk-row:nth-of-type(3) { top: 40%; } .mk-meal .mk-row:nth-of-type(4) { top: 60%; }
.mk-meal.m-table .mk-mt { background: transparent; border: 0; border-bottom: 2px solid var(--th); } .mk-meal.m-table .mk-row:nth-of-type(2) { background: var(--th); }
.mk-meal.m-card { background: #fff; border: 1px solid var(--b); box-shadow: inset -3px 0 0 var(--p); }
.mk-meal.m-card .mk-mt { background: transparent; border: 0; } .mk-meal.m-card .mk-row { left: 6%; right: 6%; border: 0; }
.mk-meal.m-list .mk-mt { background: transparent; border: 0; border-bottom: 2px solid var(--a); } .mk-meal.m-list .mk-row { background: transparent; border-bottom: 1px dotted var(--b); }
.mk-inner .mk-total { left: 6%; right: 6%; top: 80%; height: 6%; border-radius: calc(var(--r) * .4); background: var(--mbg); border: 1.4px solid var(--p); }

/* حالت سبک: بدون شیشه‌ی مات و حباب‌های متحرک (گوشی‌های ضعیف/کاهش حرکت) */
html.lite *, html.lite *::before, html.lite *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.lite .bg-blobs i { animation: none; filter: blur(40px); opacity: .25; }
html.lite .card, html.lite .top, html.lite .bottom-nav, html.lite .sheet-panel, html.lite .offer, html.lite .tab:not(.on), html.lite .chip:not(.on), html.lite .menu-item,
html.lite .faq-item, html.lite .composer, html.lite .d-head, html.lite .res-tile, html.lite .seg, html.lite .tpl, html.lite .rc-row, html.lite .stat { background: var(--glass-2); }
html.lite:not([data-theme="dark"]) .card { background: #fff; }
html.lite .hero, html.lite .hero::before, html.lite .hero::after, html.lite .fab-ai .fab-glow { animation: none; }
html.lite .page-in > * { animation-duration: .2s; }
@media (prefers-reduced-motion: reduce) { .bg-blobs i, .hero, .hero::after, .fab-glow, .rc-spark { animation: none !important; } }
.toast { width: max-content; max-width: min(92vw, 460px); line-height: 1.6; }
.file-btn input { display: none !important; }


/* ───── v1.8.0: ماده‌ی خارج از لیست ───── */
.ci-open { margin: 8px 0 10px; border-style: dashed; }
.ci-badge { background: rgba(124,58,237,.14); color: #7c3aed; border-color: rgba(124,58,237,.35); }
:root[data-theme="dark"] .ci-badge { color: #c4b5fd; }
.ci-actions { display: grid; gap: 8px; margin-top: 10px; }
.btn.ai { background: linear-gradient(135deg, #07875a, #16c060); color: #fff; }
.btn.ai .small { opacity: .9; font-weight: 400; }
.ci-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 6px 0 12px; }
.ci-seg label { display: block; margin: 0; }
.ci-seg input { position: absolute; opacity: 0; pointer-events: none; }
.ci-seg span { display: block; text-align: center; padding: 9px 6px; border-radius: 14px; border: 1px solid var(--line, rgba(0,0,0,.12)); cursor: pointer; font-size: 13.5px; }
.ci-seg input:checked + span { background: linear-gradient(135deg, var(--acc1, #07875a), var(--acc2, #16c060)); color: #fff; border-color: transparent; }
#ci-check.ok { color: #07875a; } #ci-check.warn { color: #d97706; } #ci-check.bad { color: #dc2626; }
.linkbtn { background: none; border: 0; padding: 0; color: #2563eb; text-decoration: underline; font: inherit; cursor: pointer; }
:root[data-theme="dark"] .linkbtn { color: #93c5fd; }
.sheet-body input, .sheet-body textarea, .sheet-body select { background-color: var(--card, #fff); }
.ci-pg[hidden] { display: none !important; }

/* ═════ v1.9.0: ویرایشگر آرام (بدون چشمک/پرش)، راهنمای بررسی AI، نوارهای مات ═════ */
:root { --solid-bg: #f2f7f4; }
:root[data-theme="dark"] { --solid-bg: #0c1122; }
.d-bar .bar span { background: var(--green); }
:root[data-theme="dark"] .d-bar .bar span { background: #3f9a63; }
.d-sum span { color: var(--ink); } .d-sum b { color: var(--ink); }
.d-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--line); animation: none !important; }
.d-dot.st-ok { background: var(--green); } .d-dot.st-bad, .d-dot.st-empty { background: var(--red); }
.d-dot.st-edit { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.d-guide { border: 1px solid var(--line); }
.d-guide.bad { border: 1.5px solid var(--red); }
.d-guide.good { border: 1.5px solid var(--green); }
.d-guide-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-guide-head b { font-size: 15px; }
.d-guide.bad .d-guide-head b { color: var(--red-d); }
.d-guide.good .d-guide-head b { color: var(--green-d); }
.d-guide-src { margin-inline-start: auto; font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }
.d-guide p { margin: 6px 0 0; }
.d-guide-sum { font-size: 13.5px; line-height: 1.8; }
.d-guide-row { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; font-size: 13px; padding: 8px 10px; border-radius: 12px; background: var(--soft); }
.d-guide-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 260px; overflow-y: auto; }
.d-guide-day { display: flex; gap: 8px; align-items: baseline; text-align: start; border: 1px solid rgba(239,68,68,.35); background: var(--card, #fff); color: var(--ink); border-radius: 12px; padding: 8px 10px; font: inherit; font-size: 12.5px; line-height: 1.7; cursor: pointer; width: 100%; }
.d-guide-day b { color: var(--red-d); white-space: nowrap; }
.d-guide-day span { flex: 1; }
.d-guide-day .chev { font-style: normal; color: var(--muted); }
.d-guide-stale { color: var(--amber); font-weight: 700; }
.d-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--green); animation: d-spin .8s linear infinite; }
@keyframes d-spin { to { transform: rotate(360deg); } }
.d-fix { background: var(--red-l); border-radius: 12px; padding: 9px 11px; margin: 4px 0 8px; color: var(--red-d); font-size: 13px; }
.d-fix.done { background: var(--green-l); color: var(--green-d); display: flex; flex-direction: column; gap: 2px; }
.d-fix.done .small { color: var(--ink); }
.d-sug-box { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--card, #fff); color: var(--ink); border: 1px solid var(--line); }
.d-sug-src { font-size: 11.5px; font-weight: 700; color: var(--violet, #7c3aed); }
.d-sug-box p { margin: 4px 0 0; }
.d-sug-list { margin: 6px 0 0; padding-inline-start: 18px; line-height: 1.9; font-size: 13px; }
.btn.d-apply { width: 100%; margin-top: 8px; }
.btn.d-apply:disabled { white-space: normal; line-height: 1.6; font-size: 12px; opacity: .8; }
:root[data-theme="dark"] .d-fix.done { background: rgba(34,197,94,.14); color: #8be3b3; }
:root[data-theme="dark"] .d-sug-box { background: rgba(255,255,255,.04); }
.d-final { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; margin: 4px 0 6px; }
.d-final .btn { margin: 0; }
.d-confirm .actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.d-confirm .actions .btn { margin: 0; }
.btn.ghost.d-force, .btn.d-force { color: var(--red-d); border-color: rgba(239,68,68,.45); }
#d-save { padding-bottom: 90px; }
.d-meal, #d-guide, .d-daybar { scroll-margin-top: calc(var(--top-h, 57px) + var(--dhead-h, 160px) + 12px); }
/* ═════ v1.9.0: صفحه‌ی دستیار هوشمند ═════ */
.composer.dock { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h, 76px) + 8px); margin: 0 auto; max-width: 536px; z-index: 9; }
.ai-log { padding-bottom: calc(var(--composer-h, 64px) + 18px); }
.ai-log .chat-bubble { scroll-margin-bottom: calc(var(--composer-h, 64px) + var(--nav-h, 76px) + 24px); }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin: -6px 0 12px; padding-bottom: calc(var(--composer-h, 64px) + 18px); }
.ai-suggest .chip { white-space: normal; text-align: start; line-height: 1.6; }
.ai-log:has(+ .ai-suggest) { padding-bottom: 6px; }
.fab-ai[hidden] { display: none !important; }


/* ═════════════════════════════════════════════════════════════════════════
   v1.9.1 — Liquid Glass کامل: شیشه‌ی شفاف با لبه‌ی نورانی، عدسی متحرک منو، فنر و درخشش
   (خوانایی: هرچه سطح مهم‌تر باشد، رنگ شیشه پررنگ‌تر و تاری بیشتر؛ حالت سبک = بدون blur)
   ═════════════════════════════════════════════════════════════════════════ */
:root {
  --lg-tint: rgba(255,255,255,.55); --lg-tint-bar: rgba(255,255,255,.80); --lg-tint-sheet: rgba(255,255,255,.86);
  --lg-rim: linear-gradient(140deg, rgba(255,255,255,.95), rgba(255,255,255,.25) 38%, rgba(255,255,255,.12) 62%, rgba(255,255,255,.7));
  --lg-blur: blur(22px) saturate(190%) brightness(1.04);
  --lg-blur-strong: blur(30px) saturate(200%) brightness(1.05);
  --lg-spec: inset 0 1px 1px rgba(255,255,255,.9), inset 0 -1px 1px rgba(255,255,255,.25);
  --lg-drop: 0 12px 32px rgba(16,48,34,.12), 0 2px 6px rgba(16,48,34,.06);
}
:root[data-theme="dark"] {
  --lg-tint: rgba(22,27,46,.55); --lg-tint-bar: rgba(14,18,34,.82); --lg-tint-sheet: rgba(18,22,40,.88);
  --lg-rim: linear-gradient(140deg, rgba(255,255,255,.32), rgba(255,255,255,.06) 38%, rgba(255,255,255,.03) 62%, rgba(255,255,255,.2));
  --lg-spec: inset 0 1px 1px rgba(255,255,255,.14), inset 0 -1px 1px rgba(0,0,0,.3);
  --lg-drop: 0 14px 36px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.3);
}
/* سطح‌ها: لبه‌ی گرادیانی نورانی (بدون شبه‌عنصر، تا ::before/::after کارت‌ها آزاد بماند) */
.card, .menu-item, .faq-item, .stat, .composer, .pay-sum, .res-tile, .tpl, .seg, .dropzone {
  border: 1px solid transparent !important;
  background: linear-gradient(var(--lg-tint), var(--lg-tint)) padding-box, var(--lg-rim) border-box;
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
  box-shadow: var(--lg-drop), var(--lg-spec);
}
.card.err { background: linear-gradient(rgba(254,226,226,.75), rgba(254,226,226,.75)) padding-box, var(--lg-rim) border-box; }
.d-viol { background: linear-gradient(var(--red-l), var(--red-l)) padding-box, linear-gradient(140deg, var(--red), rgba(239,68,68,.3)) border-box !important; }
.d-guide.bad { background: linear-gradient(var(--lg-tint), var(--lg-tint)) padding-box, linear-gradient(140deg, var(--red), rgba(239,68,68,.25) 50%, var(--red)) border-box; border-width: 1.5px !important; }
.d-guide.good { background: linear-gradient(var(--lg-tint), var(--lg-tint)) padding-box, linear-gradient(140deg, var(--green), rgba(34,197,94,.25) 50%, var(--green)) border-box; border-width: 1.5px !important; }
.d-meal.fix { background: linear-gradient(var(--lg-tint), var(--lg-tint)) padding-box, linear-gradient(140deg, rgba(239,68,68,.85), rgba(239,68,68,.2) 50%, rgba(239,68,68,.7)) border-box; }
/* نوارها و پنجره‌ها: شیشه‌ی پررنگ‌تر برای خوانایی */
.top, .d-head, .bottom-nav {
  background: linear-gradient(var(--lg-tint-bar), var(--lg-tint-bar)) padding-box, var(--lg-rim) border-box !important;
  -webkit-backdrop-filter: var(--lg-blur-strong); backdrop-filter: var(--lg-blur-strong);
  box-shadow: var(--lg-drop), var(--lg-spec);
}
.top { border: 1px solid transparent; border-top: 0; }
.d-head, .bottom-nav { border: 1px solid transparent !important; }
.sheet-panel {
  background: linear-gradient(var(--lg-tint-sheet), var(--lg-tint-sheet)) padding-box, var(--lg-rim) border-box !important;
  border: 1px solid transparent; border-bottom: 0;
  -webkit-backdrop-filter: var(--lg-blur-strong); backdrop-filter: var(--lg-blur-strong);
  box-shadow: 0 -12px 40px rgba(0,0,0,.18), var(--lg-spec);
}
.sheet:not([hidden]) .sheet-panel { animation: lgSheet .5s var(--spring); }
@keyframes lgSheet { 0% { transform: translateY(100%); } 70% { transform: translateY(-1.5%); } 100% { transform: none; } }
.tab, .chip { background: linear-gradient(var(--lg-tint), var(--lg-tint)) padding-box, var(--lg-rim) border-box; border: 1px solid transparent; box-shadow: var(--lg-spec); transition: transform .45s var(--spring), background .3s, color .3s, box-shadow .3s; }
.tab.on, .chip.on { background: linear-gradient(135deg, var(--acc1), var(--acc2)) padding-box, linear-gradient(140deg, rgba(255,255,255,.8), rgba(255,255,255,.1)) border-box; box-shadow: 0 6px 16px rgba(7,135,90,.35), inset 0 1px 1px rgba(255,255,255,.55); animation: lgPop .45s var(--spring); }
@keyframes lgPop { 0% { transform: scale(.9); } 100% { transform: none; } }

/* فشار «مایع»: فشرده شدن سریع و برگشت فنری */
.btn, .o-cta, .card.row, .card.alt, .menu-item, .faq-item, .tab, .chip, .iconbtn, .d-step, .res-tile, .tpl { transition: transform .5s var(--spring), box-shadow .3s, filter .3s, background .3s; }
.btn:active, .o-cta:active, .iconbtn:active, .d-step:active { transform: scale(.95, .93); transition-duration: .1s; }
.card.row:active, .card.alt:active, .menu-item:active, .faq-item:active, .res-tile:active, .tpl:active { transform: scale(.98); transition-duration: .12s; }
.tab:active, .chip:active { transform: scale(.92); transition-duration: .1s; }
/* درخشش عبوری روی دکمه‌ی اصلی (هر چند ثانیه یک بار، آرام) */
.btn:not(.ghost):not(:disabled)::before, .o-cta::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.38) 50%, transparent 65%); background-size: 260% 100%; background-position: 160% 0;
  animation: lgSheen 5.5s ease-in-out infinite; }
@keyframes lgSheen { 0%, 70% { background-position: 160% 0; } 100% { background-position: -60% 0; } }

/* منوی پایین: عدسی شیشه‌ای که بین آیتم‌ها می‌لغزد */
.bottom-nav { isolation: isolate; }
.bottom-nav a.active:not(.nav-home) { background: transparent; }
.nav-lens { position: absolute; top: 0; left: 0; z-index: -1; border-radius: 18px; opacity: 0; pointer-events: none;
  background: linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,.25)) padding-box, var(--lg-rim) border-box; border: 1px solid transparent;
  box-shadow: 0 4px 14px rgba(7,135,90,.22), inset 0 1px 1px rgba(255,255,255,.95), inset 0 -2px 6px rgba(7,135,90,.12);
  transition: transform .55s var(--spring), width .4s var(--spring), opacity .25s; }
.nav-lens.on { opacity: 1; }
:root[data-theme="dark"] .nav-lens { background: linear-gradient(rgba(74,222,128,.18), rgba(74,222,128,.08)) padding-box, var(--lg-rim) border-box; box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 1px 1px rgba(255,255,255,.18); }
.bottom-nav a.active .nav-icon { animation: lgBounce .5s var(--spring); }
@keyframes lgBounce { 0% { transform: scale(.7) translateY(3px); } 100% { transform: none; } }

/* وعده بعد از «اعمال پیشنهاد»: یک درخشش سبز کوتاه تا مربی بداند کجاست */
.d-meal.d-flash { animation: lgFlash 1.25s var(--ease); }
@keyframes lgFlash {
  0% { box-shadow: 0 0 0 0 rgba(34,197,94,.0), var(--lg-drop); transform: scale(1); }
  18% { box-shadow: 0 0 0 4px rgba(34,197,94,.55), 0 10px 34px rgba(34,197,94,.35); transform: scale(1.012); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0), var(--lg-drop); transform: none; }
}
.d-fix { animation: fadeIn .3s var(--ease); }

/* سربرگ جمع‌شونده (html.compact فقط در ویرایشگر رژیم) */
html.compact .top { padding-top: calc(env(safe-area-inset-top, 0px) + 4px); padding-bottom: 4px; }
html.compact .top h1 { font-size: 14px; }
html.compact .top .iconbtn, html.compact .top .avatar-btn { width: 30px; height: 30px; flex-basis: 30px; font-size: 14px; border-radius: 10px; }
html.compact .top .avatar-btn { border-radius: 50%; }
html.compact .d-head { padding: 5px 10px 6px; border-radius: 18px; }
html.compact .d-who { margin-bottom: 2px; }
html.compact .d-who > .muted, html.compact .d-who .status-pill { display: none; }
html.compact .d-who b { font-size: 13.5px; }
html.compact .d-calbtn { font-size: 12px; padding: 1px 8px; }
html.compact .d-tabs { padding: 0 0 4px; margin: 0 0 2px; }
html.compact .d-tabs .tab { padding: 2px 9px; font-size: 12px; }
html.compact .d-bars { gap: 6px; }
html.compact .d-bar-top { flex-direction: row; justify-content: space-between; align-items: baseline; gap: 4px; }
html.compact .d-bar-top span { font-size: 10.5px; }
html.compact .d-bar-top b { font-size: 12px; }
html.compact .d-bar-top small { display: none; }
html.compact .d-bar .bar { height: 4px; margin-top: 2px; }
html.compact .d-head > *, html.compact .top > * { animation: fadeIn .22s ease; }

/* حالت سبک و کاهش حرکت */
html.lite .card, html.lite .menu-item, html.lite .faq-item, html.lite .stat, html.lite .composer, html.lite .tab:not(.on), html.lite .chip:not(.on) { background: linear-gradient(var(--lg-tint-sheet), var(--lg-tint-sheet)) padding-box, var(--lg-rim) border-box; }
html.lite .top, html.lite .d-head, html.lite .bottom-nav, html.lite .sheet-panel { background: linear-gradient(var(--lg-tint-sheet), var(--lg-tint-sheet)) padding-box, var(--lg-rim) border-box !important; }
html.lite .btn::before, html.lite .o-cta::before { animation: none; display: none; }
@media (prefers-reduced-motion: reduce) { .btn::before, .o-cta::before, .nav-lens, .d-meal.d-flash { animation: none !important; transition: none !important; } }
/* نوار روزها اسکرول افقی دارد؛ سایه‌ی بزرگ آن‌جا بریده و مستطیلی دیده می‌شد */
.d-tabs { padding-inline: 4px; }
.d-tabs .tab.on { box-shadow: 0 2px 6px rgba(7,135,90,.28), inset 0 1px 1px rgba(255,255,255,.55); }
.foot { padding-inline: 72px; }

/* ═════ v1.9.1: تقسیم کالری وعده‌ها ═════ */
.d-shares { padding: 10px 12px; }
.d-shares-head { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; color: var(--ink); font: inherit; padding: 0 0 8px; cursor: pointer; text-align: start; }
.d-shares-head b { font-size: 14.5px; }
.d-shares-src { margin-inline-start: auto; font-size: 11px; font-weight: 700; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.d-shares-head .chev { font-style: normal; color: var(--muted); font-size: 16px; line-height: 1; }
.d-shares-bar { display: flex; height: 26px; border-radius: 13px; overflow: hidden; gap: 2px; box-shadow: inset 0 1px 2px rgba(0,0,0,.08); }
.d-shares-bar i { display: grid; place-items: center; min-width: 0; color: #fff; font-style: normal; font-size: 11px; font-weight: 700; transition: width .45s var(--spring); position: relative; }
.d-shares-bar i::after { content: ""; position: absolute; inset: 0 0 50% 0; background: linear-gradient(180deg, rgba(255,255,255,.35), transparent); pointer-events: none; }
.d-shares-bar i span { overflow: hidden; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.25); }
.d-shares-rows { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; animation: fadeIn .25s ease; }
.d-shares-row { display: grid; grid-template-columns: 10px 1fr auto 34px 46px 34px; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.d-shares-row:last-child { border-bottom: 0; }
.d-sh-dot { width: 10px; height: 10px; border-radius: 50%; }
.d-sh-name { font-weight: 700; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d-sh-kcal { font-size: 12px; color: var(--muted); white-space: nowrap; }
.d-sh-pct { text-align: center; font-size: 15px; }
.d-shares-row .d-step { width: 34px; height: 34px; }
.d-shares-row .d-step:disabled { opacity: .35; }
.d-shares .btn.d-mini { width: 100%; margin-top: 4px; }
.d-sharefix { border: 1px solid color-mix(in srgb, var(--green) 40%, transparent); }
.d-sharefix .btn.d-mini { margin-top: 6px; width: 100%; }

/* ═════ v1.10.0: ویرایشگر با واحد خانگی، سهم هر وعده روی کارتش، «＋» برای دستور پخت، بالانس با کد ═════ */
.d-dot.st-ok { background: var(--green); }
.d-dot.st-todo { background: transparent; box-shadow: inset 0 0 0 2px var(--amber, #f59e0b); }
.d-dot.st-stale { background: transparent; box-shadow: inset 0 0 0 2px var(--muted); }
.d-link-ic { font-size: 10px; margin-inline-start: 3px; opacity: .75; }
.d-meal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.d-meal-head .d-share { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 6px; }
.d-share b { min-width: 40px; text-align: center; font-size: 14px; }
.d-step.sm { width: 28px; height: 28px; font-size: 16px; border-radius: 8px; }
.d-step.sm:disabled { opacity: .35; }
.d-plus { display: flex; align-items: center; gap: 12px; width: 100%; margin: 8px 0 4px; padding: 14px 12px; border: 1.5px dashed var(--green); border-radius: 14px;
          background: var(--green-l); color: var(--ink); font: inherit; text-align: start; cursor: pointer; }
.d-plus:active { transform: scale(.99); }
.d-plus-ic { width: 38px; height: 38px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 700; flex: none; }
.d-plus span:last-child { display: flex; flex-direction: column; gap: 2px; }
.d-plus small { color: var(--muted); font-size: 12px; }
:root[data-theme="dark"] .d-plus { background: rgba(34,197,94,.10); }
.d-custom-meal { border: 1.5px dashed var(--line); }
.d-ctrl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.d-meas { height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--card, #fff); color: var(--ink); font: inherit; font-size: 13px; padding: 0 6px; max-width: 128px; }
.d-meas:disabled { opacity: .7; }
.d-amt { width: 64px; }
.d-mstate { font-style: normal; font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 0 7px; margin-inline-start: 4px; }
.d-mstate.ok { color: var(--green-d); background: var(--green-l); }
.d-mstate.off { color: var(--muted); background: var(--soft); }
.d-status { border: 1px solid var(--line); }
.d-status.good { border: 1.5px solid var(--green); }
.d-status.good b { color: var(--green-d); }
.d-status.todo { border: 1.5px solid var(--amber, #f59e0b); }
.d-status-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.d-status .d-guide-day { border-color: var(--line); }
.d-status .d-guide-day b { color: var(--ink); }
.d-linkchip { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; background: var(--soft); color: var(--ink); }
.d-linkchip.off { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.d-linknote { margin-inline-start: auto; }
.d-linkhelp { margin: -4px 4px 10px; }
.d-final3 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 6px; }
.d-final3 .btn { margin: 0; }
.d-final3 .btn:last-child { grid-column: 1 / -1; }
.d-final3 .btn:only-child, .d-final3 .btn:nth-child(2):last-child { grid-column: auto; }
.d-balrep { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.d-balrep p { margin: 4px 0; }
.d-fixes { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.d-fixes .btn { margin: 0; white-space: normal; line-height: 1.6; }
@media (max-width: 380px) { .d-meas { max-width: 104px; font-size: 12px; } .d-amt { width: 56px; } }
@media (max-width: 460px) {
  .d-name { flex-direction: column; align-items: flex-start; gap: 2px; }
  .d-name b, .d-name .small { white-space: normal; overflow: visible; text-overflow: clip; }
}
