:root {
  --bg: #FFFFFF; --cream: #FFFFFF; --card: #FFFFFF; --line: #E8E8E6;
  --acc: #3C6296; --acc-l: #F1F1EF; --acc-m: #7E9CC4; --acc-d: #2D4A75;
  --sand: #E2E2E0; --sand-l: #F3F3F1;
  --gold: #8FA9C8; --gold-l: #F1F1EF;
  --rose: #E3A18B; --rose-l: #F8E6DF; --rose-d: #B5654E;
  --sage: #9FB8A8; --sage-l: #E3EEE8;
  --ink: #1B2733; --ink2: #7C8087; --on-acc: #FFFFFF;
  --rug-fringe: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2213%22%20height%3D%2219%22%20viewBox%3D%220%200%2013%2019%22%3E%3Cpath%20d%3D%22M3.5%201l-2%2014M6.5%201v16M9.5%201l2%2014%22%20stroke%3D%22%23B9C6D8%22%20stroke-width%3D%225%22%20stroke-linecap%3D%22round%22%20fill%3D%22none%22/%3E%3Cpath%20d%3D%22M3.5%201l-2%2014M6.5%201v16M9.5%201l2%2014%22%20stroke%3D%22%23FFFFFF%22%20stroke-width%3D%223%22%20stroke-linecap%3D%22round%22%20fill%3D%22none%22/%3E%3C/svg%3E");
  }
body.male { --acc: #3C6296; --acc-l: #F1F1EF; --acc-m: #7E9CC4; --acc-d: #2D4A75; --gold: #8FA9C8; --gold-l: #F1F1EF; --ink: #1F2933; }
body.period { --acc: #D9917A; --acc-l: #F8E6DF; --acc-m: #E3A18B; --acc-d: #A8553F; }
html, body { background-color: var(--bg); }
::placeholder, .inp::placeholder { color: #A9B4BF !important; }
.btn.danger { color: #B5654E; }
/* ریشه‌های بافتهٔ سجاده: آویزان از بالای هر صفحه */
#app { padding-top: 14px; }
#onb .wrap { padding-top: calc(40px + env(safe-area-inset-top)); }
.back-btn { top: calc(34px + env(safe-area-inset-top)); }
/* زیر کارت‌های معرفی و فعال‌سازی: ریشهٔ سجاده */
#onb .slide.card { margin-bottom: 36px; }
#onb .slide.card::after, .act-card::after { content: ""; position: absolute; left: 0; right: 0; top: auto; bottom: -29px; height: 30px; pointer-events: none; background: var(--rug-fringe) repeat-x 0 0 / 21px 30px; }
/* دکمه‌ها: مستطیل نوک‌تیز، آبیِ تخت، با خط ظریفِ داخلی مثل حاشیهٔ بافت */
.btn { min-height: 54px; font-weight: 800; }
.btn:not(.ghost):not(.soft):not(.danger):not(.rose) { color: #fff; }
.btn:not(.ghost):not(.soft):not(.danger):not(.rose)::after, .opt.on::after { content: ""; position: absolute; inset: 4px; border: 1.5px solid rgba(255,255,255,.38); pointer-events: none; z-index: 1; }
.btn.ghost { color: var(--acc-d); }
.btn.ghost::before { background: #fff !important; box-shadow: inset 0 0 0 1.5px var(--acc-m); }
.btn.soft { color: var(--acc-d); }
/* عنوان‌ها: لوزی کوچک دو طرف */
.hdr h1::before, .hdr h1::after { content: ""; display: inline-block; width: 10px; height: 10px; margin: 0 10px; background: var(--rug-mark) no-repeat center / 10px 10px; vertical-align: middle; }
/* کارت‌ها: سفید، لبهٔ نازک؛ نوار پایین با خط آبی بالا */
nav.tabs.cr { --fill: #fff; }
.tab.on { background: none !important; color: var(--acc-d) !important; box-shadow: inset 0 3px 0 var(--acc); }
.tab.on .li { color: var(--acc); }
.dots i.on { background: var(--acc); }
.note.gold { --fill: var(--gold-l); } .note.rose { --fill: var(--rose-l); } .note.ok { --fill: var(--sage-l); }
/* کارت بالای صفحهٔ خانه: بلوک آبیِ سجاده */
.h-top.card { --fill: var(--acc); color: #fff; }
.h-top.card .muted, .h-top.card .sm, .h-top.card .hint, .h-top.card .lbl { color: rgba(255,255,255,.82) !important; }

.h-top.card .btn.soft::before, .h-top.card .btn.ghost::before { background: #fff !important; }
.h-top.card .btn { color: var(--acc-d); }
.h-top.card b, .h-top.card h2, .h-top.card .nm { color: #fff; }
.h-top.card *:not(.btn):not(.btn *) { color: #fff !important; }
.h-top.card .btn, .h-top.card .btn * { color: var(--acc-d) !important; }

nav.tabs { bottom: calc(38px + env(safe-area-inset-bottom)) !important; }

@media (min-width: 900px) { nav.tabs::after { display: none; } }
:root { --gold: #F2B544; --gold-l: #FDF0D0; --rose: #EE7B63; --sage: #3FB6A8; }


:root { --rug-band: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%2221%22%20height%3D%2221%22%20viewBox%3D%220%200%2021%2021%22%3E%3Crect%20width%3D%2221%22%20height%3D%2221%22%20fill%3D%22%233C6296%22/%3E%3Crect%20x%3D%229%22%20y%3D%223%22%20width%3D%223%22%20height%3D%223%22%20fill%3D%22%23FFFFFF%22/%3E%3Crect%20x%3D%226%22%20y%3D%226%22%20width%3D%229%22%20height%3D%223%22%20fill%3D%22%23FFFFFF%22/%3E%3Crect%20x%3D%223%22%20y%3D%229%22%20width%3D%2215%22%20height%3D%223%22%20fill%3D%22%23FFFFFF%22/%3E%3Crect%20x%3D%226%22%20y%3D%2212%22%20width%3D%229%22%20height%3D%223%22%20fill%3D%22%23FFFFFF%22/%3E%3Crect%20x%3D%229%22%20y%3D%2215%22%20width%3D%223%22%20height%3D%223%22%20fill%3D%22%23FFFFFF%22/%3E%3Crect%20y%3D%2218%22%20width%3D%2221%22%20height%3D%223%22%20fill%3D%22%23FFFFFF%22/%3E%3Crect%20y%3D%220%22%20width%3D%2221%22%20height%3D%223%22%20fill%3D%22%23FFFFFF%22/%3E%3C/svg%3E"); }
#onb .slide.card.cr::before, .act-card.cr::before { background-image: var(--rug-band) !important; background-repeat: repeat-x; background-position: 0 0; background-size: 21px 21px; }
#onb .slide.card, .act-card { padding-top: 40px; }
#app .card.cr.rug-top::before { background-image: var(--rug-band) !important; background-repeat: repeat-x; background-position: 0 0; background-size: 21px 21px; }
#app .card.cr.rug-top { padding-top: calc(var(--cpt, 16px) + 12px); }

body, html { background: #FFFFFF !important; }
.card.cr, .tabs.cr { --fill: #FFFFFF; }
.tab.on .li{color:var(--acc)}
body, html { background: #F6F6F4 !important; }
.h-top.card.cr { --fill: var(--acc); }
.card.cr, .note.cr, nav.tabs.cr, .opt.cr, .inpw.cr { border: 1.5px solid #D6D6D1 !important; }
.h-top.card.cr { border-color: var(--acc-d) !important; }
#onb .slide.card.cr, .act-card.cr { border-top: 0 !important; }

html, body { background: #FFFFFF !important; }
:root { --ink2: #3A424C; }
.muted, .sm, .hint, .lbl, .lbl2, .tiny, .card > p, .note, .slide p, .act-card p, .act-card .tiny { color: #2F3640 !important; font-weight: 700; }
.note.cr, .note.cr.ok, .note.cr.gold, .note.cr.rose { --fill: #FFFFFF; border-right: 5px solid var(--acc) !important; }
.note.cr.gold { border-right-color: #F2B544 !important; } .note.cr.ok { border-right-color: #3FB6A8 !important; } .note.cr.rose { border-right-color: #EE7B63 !important; }
#app .card.cr.rug-bot::after { content: ""; position: absolute; left: 0; right: 0; bottom: -29px; height: 30px; pointer-events: none; background: var(--rug-fringe) repeat-x 0 0 / 21px 30px; }
#app { padding-bottom: calc(var(--nav-h) + 70px + env(safe-area-inset-bottom)); }
/* صفحه = یک مستطیل زیلویی: طرح بالا، ریشه پایین */
#app .card.cr.rug-top::before { background-image: none !important; }
#app .card.cr.rug-top { padding-top: 16px; }
#app .card.cr.rug-bot::after { display: none; }
#app { position: relative; width: calc(100% - 28px); max-width: 520px; margin: 14px auto calc(var(--nav-h) + 78px); padding: 38px 14px 22px !important; background: #FFFFFF; border: 1.5px solid #D6D6D1; }
#app::before { content: ""; position: absolute; left: -1.5px; right: -1.5px; top: -1.5px; height: 21px; background: var(--rug-band) repeat-x 0 0 / 21px 21px; }
#app::after { content: ""; position: absolute; left: -1.5px; right: -1.5px; bottom: -30px; height: 30px; background: var(--rug-fringe) repeat-x 0 0 / 21px 30px; }
@media (min-width: 900px) { #app { margin-right: 270px; } }

#app { min-height: calc(100vh - var(--nav-h) - 118px); }

.tile.cr { --fill: #FFFFFF; border: 1.5px solid #D6D6D1 !important; padding: 14px 4px !important; }
.tiles { gap: 10px; }
#onb .slide.card.cr:has(.art) { height: 667px; justify-content: center; }
#onb .slide.card.cr:has(.art) .art { width: 200px; height: 200px; flex: none; }

/* ---- حرکت نرم و ریز ---- */
:root { --ease-soft: cubic-bezier(.22,.8,.3,1); }
@keyframes softIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes slideInSoft { from { opacity: 0; transform: translateX(-34px); } to { opacity: 1; transform: none; } }
@keyframes slideOutSoft { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(34px); } }
@keyframes twk { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes floatSoft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
#onb .slide { animation: slideInSoft 1.1s var(--ease-soft) both !important; }
#onb .slide.leaving { animation: slideOutSoft .45s ease-in both !important; }
#onb .slide .art .float { animation: floatSoft 7s ease-in-out infinite !important; }
#onb .slide .art .tw { animation: twk 3.4s ease-in-out infinite; }
#onb .slide .art .tw:nth-of-type(2n) { animation-delay: -1.2s; } #onb .slide .art .tw:nth-of-type(3n) { animation-delay: -2.3s; }
.screen { animation: softIn .9s var(--ease-soft) both !important; }
#app .screen > * { animation: softIn .9s var(--ease-soft) both; }
#app .screen > *:nth-child(1) { animation-delay: .04s; } #app .screen > *:nth-child(2) { animation-delay: .12s; } #app .screen > *:nth-child(3) { animation-delay: .2s; }
#app .screen > *:nth-child(4) { animation-delay: .28s; } #app .screen > *:nth-child(5) { animation-delay: .36s; } #app .screen > *:nth-child(n+6) { animation-delay: .44s; }
.btn, .tile, .tab, .opt, .date-btn { transition: transform .35s var(--ease-soft), opacity .35s, color .35s; }
.btn:active, .tile:active, .opt:active { transform: scale(.985); }
@media (prefers-reduced-motion: reduce) { #onb .slide, .screen, #app .screen > *, .tw, .float { animation: none !important; } }

/* لوگوی صفحهٔ فعال‌سازی بزرگ‌تر */
.act-card .logo { width: 200px; height: 200px; margin: 0 auto 4px; display: block; }

/* جداسازی واضح‌تر کادرها از هم و از زمینه */
.card.cr, .note.cr, .opt.cr, .inpw.cr, .tile.cr { border: 2px solid #A9B4C4 !important; }
#app { border: 2px solid #A9B4C4; background: #F4F4F2; }
#app::before { left: -2px; right: -2px; top: -2px; }
#app::after { left: -2px; right: -2px; }
.card.cr, .tile.cr, .opt.cr, .inpw.cr { --fill: #FFFFFF; }
.card.cr + .card.cr, .card.cr + .note.cr, .note.cr + .card.cr, .note.cr + .note.cr { margin-top: 16px; }
.acc.cr { border: 2px solid #A9B4C4 !important; --fill: #FFFFFF; }
.acc.cr + .acc.cr, .card.cr + .acc.cr, .acc.cr + .card.cr { margin-top: 16px; }
.stat.cr { border: 2px solid #A9B4C4 !important; --fill: #FFFFFF; box-shadow: none !important; }
.stats { gap: 12px; }
.ptable tr + tr td { border-top: 1.5px solid #C9D0DA; }

/* وضعیت انتخاب‌شده باید کاملاً دیده شود */
.card.cr, .tile.cr, .inpw.cr { --fill: #FFFFFF; }
.opt.cr { --fill: #FFFFFF; }
.opt.on.cr, .opt.white.on.cr { --fill: var(--acc) !important; color: #FFFFFF !important; border-color: var(--acc-d) !important; }
.seg.cr { --fill: #FFFFFF; border: 2px solid #A9B4C4 !important; }
.seg button { color: #2F3640; background: transparent; }
.seg button.on { background: var(--acc) !important; background-image: none !important; color: #FFFFFF !important; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.tier.cr { --fill: #FFFFFF; border: 2px solid #A9B4C4 !important; box-shadow: none !important; }
.tier.cr small { color: #3A424C; font-weight: 700; }
.tier.on.cr { --fill: var(--acc) !important; border-color: var(--acc-d) !important; color: #FFFFFF !important; }
.tier.on.cr small, .tier.on.cr b, .tier.on.cr .v { color: #FFFFFF !important; }

/* صفحهٔ «من»: بدون سرتیتر تا بدون اسکرول جا شود */
#app:has(.tiles) .hdr-wrap { display: none; }
#app:has(.tiles) { padding-top: 34px !important; }
#app:has(.tiles) .tiles ~ p { display: none; }

/* موبایل: اعداد ۱ تا ۷ در یک ردیف، کادر تاریخ بدون بریده‌شدن */
.daysel { grid-template-columns: repeat(7, minmax(0, 1fr)) !important; gap: 4px; direction: rtl; }
.daysel .opt { min-width: 0; padding: 0 !important; min-height: 40px; font-size: .85em; justify-content: center; border-width: 1.5px !important; }
.daysel .opt.on::after { display: none; }
@media (max-width: 420px) {
  #app { padding-left: 8px !important; padding-right: 8px !important; }
  .dates .date-btn { padding: 8px 8px; font-size: .88em; gap: 4px; height: auto; min-height: 50px; }
  .dates .date-btn .li { display: none; }
  .dates .date-btn > span { overflow: visible; text-overflow: clip; white-space: normal; line-height: 1.5; text-align: center; }
}
