/* ════════════════════════════════════════════════════════════════
   پرنیان — سیستم طراحی
   ─────────────────────────────────────────────
   لایه‌ها:  ۱.توکن‌ها  ۲.پایه  ۳.اجزا  ۴.چیدمان  ۵.صفحه‌ها  ۶.دسکتاپ
   پالت: زعفرانی · فیروزه · سفال · آلو — روی ذغالیِ گرم / عاج
   ════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: 'Vazirmatn';
  src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Regular.woff2') format('woff2');
  font-weight: 400; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Medium.woff2') format('woff2');
  font-weight: 500; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Bold.woff2') format('woff2');
  font-weight: 700; font-display: swap;
}
@font-face {
  font-family: 'Vazirmatn';
  src: url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/fonts/webfonts/Vazirmatn-Black.woff2') format('woff2');
  font-weight: 900; font-display: swap;
}

/* ═══ ۱. توکن‌ها ═══ */
:root {
  /* رنگ — شب */
  --bg: #131009;
  --surface: #1D1912;
  --surface-2: #292319;
  --ink: #F2ECDF;
  --ink-2: #A89E8B;
  --ink-3: #6E6656;
  --line: #2E281E;
  --line-2: #3E362A;

  --saffron: #E5A83E;
  --saffron-deep: #C4881F;
  --on-saffron: #241A08;
  --turquoise: #56BFA8;
  --terracotta: #D9705F;
  --plum: #B08BC9;

  --ring-track: #2E281E;

  /* افکت */
  --card-shadow: inset 0 1px 0 rgba(255, 245, 220, 0.04);
  --pop-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
  --fab-shadow: 0 8px 28px rgba(229, 168, 62, 0.32);
  --nav-blur: rgba(19, 16, 9, 0.86);

  /* اندازه */
  --r: 16px;
  --r-s: 11px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --gutter: 20px;

  --fn: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
}

[data-theme="light"] {
  --bg: #F6F1E6;
  --surface: #FDFBF4;
  --surface-2: #EFE8D7;
  --ink: #221C11;
  --ink-2: #6F644F;
  --ink-3: #A2967D;
  --line: #E6DDC9;
  --line-2: #D5CAB0;

  --saffron: #B0791C;
  --saffron-deep: #906013;
  --on-saffron: #FFF8EA;
  --turquoise: #1E8C76;
  --terracotta: #BC5240;
  --plum: #8A5FA8;

  --ring-track: #E6DDC9;

  --card-shadow: 0 1px 2px rgba(60, 44, 10, 0.05), 0 10px 30px rgba(60, 44, 10, 0.06);
  --pop-shadow: 0 24px 64px rgba(60, 44, 10, 0.18);
  --fab-shadow: 0 8px 24px rgba(176, 121, 28, 0.35);
  --nav-blur: rgba(246, 241, 230, 0.86);
}

/* رنگ‌مایه آیتم‌ها */
.hue-saffron    { --hue: var(--saffron); }
.hue-turquoise  { --hue: var(--turquoise); }
.hue-terracotta { --hue: var(--terracotta); }
.hue-plum       { --hue: var(--plum); }

/* ═══ ۲. پایه ═══ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--fn);
  direction: rtl;
  min-height: 100dvh;
  line-height: 1.6;
  transition: background 0.25s ease;
}
button {
  font: inherit; color: inherit;
  background: none; border: none; padding: 0; cursor: pointer;
}
input, select { font: inherit; }
svg { display: block; width: 100%; height: 100%; }
::selection { background: color-mix(in srgb, var(--saffron) 30%, transparent); }

.ico { width: 20px; height: 20px; flex: none; }
.ico-s { width: 16px; height: 16px; flex: none; }

/* ═══ ۳. اجزا ═══ */

/* — عنوان بخش: شمسه + متن — */
.label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.78rem; font-weight: 700;
  letter-spacing: 0.06em; color: var(--ink-2);
}
.label .ico-s { width: 13px; height: 13px; color: var(--saffron); }
.section-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 34px var(--gutter) 14px;
}
.link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.78rem; font-weight: 500; color: var(--ink-3);
  padding: 6px 2px;
  transition: color 0.15s;
}
.link-btn:hover, .link-btn:active { color: var(--saffron); }
.link-btn .ico-s { width: 14px; height: 14px; }

/* — کارت — */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--card-shadow);
}

/* — نوار پیشرفت — */
.meter {
  height: 5px; border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}
.meter > i {
  display: block; height: 100%;
  width: var(--p, 0%);
  border-radius: 99px;
  background: var(--hue, var(--saffron));
  transition: width 0.4s cubic-bezier(0.3, 0.8, 0.3, 1);
}

/* — دکمه‌ها — */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px;
  font-size: 0.9rem; font-weight: 700;
  border-radius: var(--r-s);
  transition: transform 0.12s, opacity 0.15s, background 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn-fill { background: var(--saffron); color: var(--on-saffron); }
.btn-fill:hover { background: var(--saffron-deep); }
.btn-soft {
  background: var(--surface-2); color: var(--ink-2);
}
.btn-soft:hover { color: var(--ink); }
.btn-line {
  border: 1px solid var(--line-2); color: var(--ink-2);
  background: transparent;
}
.btn-line:hover { border-color: var(--saffron); color: var(--saffron); }
.btn-wide { width: 100%; }
.btn-danger { color: var(--terracotta); border-color: color-mix(in srgb, var(--terracotta) 40%, transparent); }
.btn-danger:hover { border-color: var(--terracotta); color: var(--terracotta); background: color-mix(in srgb, var(--terracotta) 8%, transparent); }

/* — چیپ — */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 700;
  padding: 4px 11px; border-radius: 99px;
  background: color-mix(in srgb, var(--hue, var(--saffron)) 14%, transparent);
  color: var(--hue, var(--saffron));
}

/* — فرم — */
.field { margin-bottom: 15px; }
.field > label {
  display: block; margin-bottom: 7px;
  font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.05em; color: var(--ink-2);
}
.field input, .field select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-s);
  color: var(--ink);
  padding: 12px 15px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
}
.field input:focus, .field select:focus { border-color: var(--saffron); }
.field input::placeholder { color: var(--ink-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ltr { direction: ltr; text-align: left; }

/* — انتخاب‌گر تک‌گزینه — */
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice > button {
  flex: 1; min-width: 70px;
  padding: 10px 8px;
  font-size: 0.8rem; font-weight: 500;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-s);
  color: var(--ink-3);
  transition: border-color 0.15s, color 0.15s;
}
.choice > button[aria-pressed="true"] {
  border-color: var(--hue, var(--saffron));
  color: var(--hue, var(--saffron));
  font-weight: 700;
}

/* — چک‌باکس فوری — */
.tick {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; cursor: pointer; user-select: none;
}
.tick input { width: 19px; height: 19px; accent-color: var(--saffron); cursor: pointer; }
.tick span { font-size: 0.87rem; color: var(--ink-2); }

/* — حالت خالی — */
.empty {
  padding: 40px 24px; text-align: center;
  color: var(--ink-3); font-size: 0.83rem; line-height: 2.1;
}
.empty .ico { width: 30px; height: 30px; margin: 0 auto 12px; opacity: 0.5; }
.empty b { color: var(--ink-2); font-weight: 700; }

/* — توست — */
.toast {
  position: fixed; z-index: 400;
  bottom: calc(var(--nav-h) + var(--safe-b) + 18px);
  right: 50%; translate: 50% 6px;
  background: var(--ink); color: var(--bg);
  font-size: 0.82rem; font-weight: 500;
  padding: 11px 22px; border-radius: 99px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s, translate 0.2s;
  white-space: nowrap;
}
.toast.show { opacity: 1; translate: 50% 0; }

/* — شیت — */
.sheet-veil {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(10, 8, 3, 0.55);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center;
}
.sheet-veil.open { display: flex; }
.sheet {
  width: 100%; max-width: 460px;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  box-shadow: var(--pop-shadow);
  padding: 12px 24px calc(26px + var(--safe-b));
  animation: rise 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes rise {
  from { translate: 0 48px; opacity: 0; }
  to { translate: 0 0; opacity: 1; }
}
.sheet-grip {
  width: 40px; height: 4px; border-radius: 99px;
  background: var(--line-2); margin: 0 auto 20px;
}
.sheet h3 { font-size: 1.05rem; font-weight: 900; }
.sheet .sub { font-size: 0.74rem; color: var(--ink-3); margin: 3px 0 18px; }
.sheet-foot { display: flex; gap: 10px; margin-top: 20px; }
.sheet-foot .btn-fill { flex: 1; }

/* — ردیف راهنما / تنظیمات — */
.info-row {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 13px 0;
}
.info-row + .info-row { border-top: 1px solid var(--line); }
.info-row > .ico { color: var(--saffron); margin-top: 2px; }
.info-row .t { font-size: 0.87rem; font-weight: 700; }
.info-row .d { font-size: 0.76rem; color: var(--ink-2); line-height: 1.9; margin-top: 2px; }
.info-row .end { margin-right: auto; align-self: center; }
.status-pill {
  font-size: 0.72rem; font-weight: 700;
  padding: 6px 14px; border-radius: 99px;
  border: 1.5px solid currentColor;
  white-space: nowrap;
}

/* ═══ ۴. چیدمان ═══ */
.shell { min-height: 100dvh; }
.page { display: none; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 28px); }
.page.on { display: block; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* — سربرگ — */
.masthead {
  display: flex; align-items: center; gap: 12px;
  padding: 18px var(--gutter) 14px;
}
.brand-star { width: 26px; height: 26px; color: var(--saffron); flex: none; }
.masthead-mid { flex: 1; min-width: 0; }
.brand-name { font-size: 0.85rem; font-weight: 900; letter-spacing: 0.02em; }
.brand-date { font-size: 0.68rem; color: var(--ink-3); }
.head-btn {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 12px; color: var(--ink-2);
  transition: color 0.15s, background 0.15s;
}
.head-btn:hover, .head-btn:active { color: var(--saffron); background: var(--surface); }
.head-btn .ico { width: 19px; height: 19px; }
.streak-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px; border-radius: 99px;
  background: color-mix(in srgb, var(--saffron) 12%, transparent);
  color: var(--saffron);
  font-size: 0.76rem; font-weight: 900;
}
.streak-pill .ico-s { width: 13px; height: 13px; }

/* جدول‌کشی: خط دوتایی زیر سربرگ */
.rule {
  margin: 0 var(--gutter);
  border-top: 1px solid var(--line-2);
  border-bottom: 1px solid var(--line);
  height: 3px;
}

/* ═══ ۵. صفحه‌ها ═══ */

/* — خانه: درود — */
.greet { padding: 26px var(--gutter) 0; }
.greet h1 {
  font-size: clamp(1.55rem, 6vw, 1.85rem);
  font-weight: 900; line-height: 1.35;
}
.greet h1 em { font-style: normal; color: var(--saffron); }
.greet p { font-size: 0.8rem; color: var(--ink-2); margin-top: 6px; }

/* — خانه: کارت امروز — */
.today-card {
  margin: 22px var(--gutter) 0;
  padding: 22px;
  display: flex; align-items: center; gap: 22px;
  position: relative; overflow: hidden;
}
.today-card .watermark {
  position: absolute; left: -30px; top: 50%;
  translate: 0 -50%;
  width: 170px; height: 170px;
  color: var(--ink); opacity: 0.035;
  pointer-events: none;
}
.dial { position: relative; width: 104px; height: 104px; flex: none; }
.dial-txt {
  position: absolute; inset: 0;
  display: grid; place-content: center; text-align: center;
}
.dial-n { font-size: 1.7rem; font-weight: 900; color: var(--saffron); line-height: 1.05; }
.dial-cap { font-size: 0.62rem; color: var(--ink-3); letter-spacing: 0.08em; }
.today-facts { flex: 1; display: grid; gap: 10px; position: relative; }
.fact { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.fact .k { font-size: 0.78rem; color: var(--ink-2); }
.fact .v { font-size: 1.05rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.fact .v.sf { color: var(--saffron); }
.fact .v.tq { color: var(--turquoise); }

/* — وظیفه — */
.tasks { padding: 0 var(--gutter); display: grid; gap: 9px; }
.task {
  display: flex; align-items: center; gap: 13px;
  padding: 14px 16px;
  transition: opacity 0.2s, border-color 0.15s;
}
.task:hover { border-color: var(--line-2); }
.task[data-done="1"] { opacity: 0.48; }
.task-toggle {
  width: 24px; height: 24px; flex: none;
  color: var(--ink-3);
  transition: color 0.15s, transform 0.12s;
}
.task-toggle:active { transform: scale(0.85); }
.task[data-done="1"] .task-toggle { color: var(--turquoise); }
.task-main { flex: 1; min-width: 0; }
.task-title {
  font-size: 0.92rem; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.task[data-done="1"] .task-title { text-decoration: line-through; }
.task-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.7rem; color: var(--ink-3); margin-top: 2px;
}
.task-meta .urgent { color: var(--terracotta); font-weight: 700; }
.task-meta .with-ico { display: inline-flex; align-items: center; gap: 4px; }
.task-meta .ico-s { width: 11px; height: 11px; }
.ghost-x {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  color: var(--ink-3); border-radius: 9px;
  opacity: 0.65;
  transition: color 0.15s, opacity 0.15s;
}
.ghost-x:hover { color: var(--terracotta); opacity: 1; }
.ghost-x .ico-s { width: 14px; height: 14px; }

/* — هدف (پیش‌نمایش خانه: اسکرول افقی) — */
.goal-rail {
  display: flex; gap: 12px;
  padding: 2px var(--gutter) 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.goal-rail::-webkit-scrollbar { display: none; }
.goal-mini {
  min-width: 215px; scroll-snap-align: start;
  padding: 17px 18px;
}
.goal-mini-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 11px;
}
.goal-mini-dl { font-size: 0.68rem; color: var(--ink-3); }
.goal-mini h4 {
  font-size: 0.9rem; font-weight: 700; line-height: 1.55;
  min-height: 2.8em; margin-bottom: 13px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* — پیوستگی — */
.streak-card {
  margin: 0 var(--gutter);
  padding: 18px 20px;
  display: flex; align-items: center; gap: 18px;
}
.streak-big { text-align: center; flex: none; }
.streak-big .n { font-size: 1.9rem; font-weight: 900; color: var(--saffron); line-height: 1; font-variant-numeric: tabular-nums; }
.streak-big .c { font-size: 0.62rem; color: var(--ink-3); margin-top: 3px; letter-spacing: 0.06em; }
.streak-stars {
  flex: 1; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
}
.streak-stars .ico-s {
  width: 15px; height: 15px;
  color: var(--ring-track);
}
.streak-stars .lit { color: var(--saffron); }
.streak-stars .today-star { color: var(--saffron); filter: drop-shadow(0 0 5px color-mix(in srgb, var(--saffron) 70%, transparent)); }

/* — عنوان صفحه — */
.page-head { padding: 26px var(--gutter) 0; }
.page-head h2 { font-size: 1.45rem; font-weight: 900; }
.page-head p { font-size: 0.76rem; color: var(--ink-3); margin-top: 4px; }

/* — آیتم (اهداف/پروژه‌ها) — */
.items { padding: 18px var(--gutter) 0; display: grid; gap: 11px; }
.item { padding: 18px 19px; }
.item-head { display: flex; align-items: flex-start; gap: 8px; }
.item-head h4 { flex: 1; font-size: 0.98rem; font-weight: 700; line-height: 1.6; }
.item-tools { display: flex; gap: 2px; margin-top: -4px; margin-left: -8px; }
.item-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 0.72rem; color: var(--ink-3);
  margin: 8px 0 13px;
}
.item-meta .pct { color: var(--hue); font-weight: 900; font-size: 0.8rem; }

/* — تقویم — */
.cal-wrap { margin: 18px var(--gutter) 0; padding: 20px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.cal-head h3 { font-size: 1.02rem; font-weight: 900; }
.cal-nav { display: flex; gap: 7px; }
.cal-nav button {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 10px;
  color: var(--ink-2);
  transition: border-color 0.15s, color 0.15s;
}
.cal-nav button:hover { border-color: var(--saffron); color: var(--saffron); }
.cal-nav .ico-s { width: 15px; height: 15px; }
.dow-row {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 8px;
}
.dow-row span {
  text-align: center; font-size: 0.62rem; font-weight: 700;
  color: var(--ink-3); letter-spacing: 0.05em;
}
.day-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day {
  aspect-ratio: 1;
  display: grid; place-items: center;
  font-size: 0.85rem; font-weight: 500;
  color: var(--ink-2);
  border-radius: 11px;
  position: relative;
  transition: background 0.13s, color 0.13s;
}
.day:hover { background: var(--surface-2); }
.day.void { visibility: hidden; }
.day.fri { color: var(--terracotta); }
.day.now {
  background: var(--saffron); color: var(--on-saffron); font-weight: 900;
}
.day.sel:not(.now) {
  box-shadow: inset 0 0 0 1.5px var(--saffron);
  color: var(--saffron); font-weight: 700;
}
.day.marked::after {
  content: ''; position: absolute; bottom: 5px;
  width: 4px; height: 4px; border-radius: 99px;
  background: var(--saffron);
}
.day.now.marked::after { background: var(--on-saffron); }

/* — رویداد — */
.events { padding: 0 var(--gutter); display: grid; gap: 9px; }
.event {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border-right: 3px solid var(--hue, var(--saffron));
}
.event-main { flex: 1; min-width: 0; }
.event-title { font-size: 0.9rem; font-weight: 700; }
.event-time {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.7rem; color: var(--ink-3); margin-top: 2px;
}
.event-time .ico-s { width: 11px; height: 11px; }
.event.is-task { border-right-color: var(--turquoise); }

/* ═══ ناوبری پایین ═══ */
.dock {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 90;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--nav-blur);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
}
.dock-item {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  font-size: 0.6rem; font-weight: 500;
  color: var(--ink-3);
  transition: color 0.15s;
  position: relative;
}
.dock-item[aria-current="true"] { color: var(--saffron); font-weight: 700; }
.dock-item .ico { width: 21px; height: 21px; }
.fab-slot { position: relative; }
.fab {
  position: absolute; top: -22px; right: 50%; translate: 50% 0;
  width: 54px; height: 54px;
  display: grid; place-items: center;
  background: var(--saffron); color: var(--on-saffron);
  border-radius: 18px;
  box-shadow: var(--fab-shadow);
  transition: transform 0.12s, background 0.15s;
}
.fab:hover { background: var(--saffron-deep); }
.fab:active { transform: scale(0.92); }
.fab .ico { width: 23px; height: 23px; }

/* ═══ آنبوردینگ ═══ */
.welcome {
  position: fixed; inset: 0; z-index: 500;
  background: var(--bg);
  display: none; align-items: center; justify-content: center;
  padding: 28px;
}
.welcome.open { display: flex; }
.welcome-box { width: 100%; max-width: 380px; text-align: center; }
.welcome-star { width: 58px; height: 58px; color: var(--saffron); margin: 0 auto 26px; }
.welcome h2 { font-size: 1.5rem; font-weight: 900; line-height: 1.5; }
.welcome h2 em { font-style: normal; color: var(--saffron); }
.welcome .lead { font-size: 0.88rem; color: var(--ink-2); line-height: 2.15; margin: 14px 0 30px; }
.welcome .feats { text-align: right; margin-bottom: 30px; display: grid; gap: 4px; }
.step-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 24px; }
.step-dots i {
  width: 6px; height: 6px; border-radius: 99px;
  background: var(--line-2); transition: all 0.2s;
}
.step-dots i.on { background: var(--saffron); width: 20px; }
.welcome .skip { margin-top: 14px; font-size: 0.76rem; color: var(--ink-3); padding: 8px; }
.welcome .field { text-align: right; }

/* ═══ ۶. دسکتاپ ═══ */
@media (min-width: 1024px) {
  :root { --gutter: 0px; }

  /* ریل عمودی */
  .dock {
    inset-inline: auto 0; top: 0; bottom: 0;
    width: 96px; height: auto;
    padding: 22px 0 26px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    border-top: none; border-inline-start: 1px solid var(--line);
  }
  .dock-item { flex: none; width: 74px; padding: 13px 0; border-radius: 14px; font-size: 0.64rem; }
  .dock-item[aria-current="true"] { background: var(--surface); }
  .dock-item:hover { color: var(--saffron); }
  .fab-slot { order: 99; margin-top: auto; width: 74px; height: 84px; }
  .fab { position: static; translate: 0 0; margin: 0 auto; }

  .shell { padding-inline-end: 96px; }
  .page { padding-bottom: 56px; }
  .frame { max-width: 1060px; margin: 0 auto; padding-inline: 40px; }
  .masthead { padding-block: 26px 16px; }
  .rule { margin-inline: 0; }

  /* خانه: دو ستون */
  .home-cols {
    display: grid; grid-template-columns: 1.12fr 0.88fr;
    gap: 0 44px; align-items: start;
  }
  .greet h1 { font-size: 2.15rem; }
  .goal-rail { flex-wrap: wrap; overflow: visible; padding-inline: 0; }
  .goal-mini { min-width: 0; flex: 1 1 calc(50% - 6px); }
  .tasks, .events { padding-inline: 0; }
  .today-card, .streak-card, .cal-wrap { margin-inline: 0; }
  .section-bar { margin-inline: 0; }

  /* تقویم: دو ستون */
  .cal-cols {
    display: grid; grid-template-columns: 430px 1fr;
    gap: 36px; align-items: start;
  }
  .cal-wrap { margin-top: 18px; }

  /* اهداف/پروژه‌ها: دو ستون */
  .items { grid-template-columns: 1fr 1fr; }
  .items .empty { grid-column: 1 / -1; }

  .sheet-veil { align-items: center; }
  .sheet { border-radius: 24px; }
  .toast { bottom: 34px; }
}

/* ════════════════════════════════════════════════════
   v5 — اجزای جدید
   ════════════════════════════════════════════════════ */

/* — بیت روز — */
.verse {
  margin-top: 14px; padding: 12px 16px;
  border-inline-start: 2px solid var(--saffron);
  background: color-mix(in srgb, var(--saffron) 5%, transparent);
  border-radius: 0 var(--r-s) var(--r-s) 0;
}
.verse-t { display: block; font-size: 0.8rem; color: var(--ink-2); line-height: 2; }
.verse-p { display: block; font-size: 0.66rem; color: var(--saffron); margin-top: 4px; font-weight: 700; }

/* — بنر — */
.banner {
  display: flex; align-items: center; gap: 10px;
  width: calc(100% - var(--gutter) * 2);
  margin: 14px var(--gutter) 0;
  padding: 12px 15px;
  font-size: 0.78rem; font-weight: 500; text-align: right;
  color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-s);
}
.banner .ico-s { color: var(--saffron); }
button.banner { cursor: pointer; transition: border-color 0.15s; }
button.banner:hover { border-color: var(--saffron); }
.banner.warn { border-color: color-mix(in srgb, var(--terracotta) 40%, transparent); }
.banner.warn .ico-s { color: var(--terracotta); }

/* — نقطه اولویت و نشان‌ها — */
.pri-dot {
  display: inline-block; width: 7px; height: 7px;
  border-radius: 99px; margin-left: 7px; vertical-align: middle;
}
.carried {
  font-size: 0.62rem; color: var(--terracotta);
  border: 1px solid color-mix(in srgb, var(--terracotta) 35%, transparent);
  border-radius: 99px; padding: 1px 8px;
}
.dusty {
  font-size: 0.62rem; font-weight: 700; color: var(--terracotta);
  border: 1px dashed color-mix(in srgb, var(--terracotta) 45%, transparent);
  border-radius: 99px; padding: 2px 9px; margin-inline-start: 6px;
}
.est-sum { font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.occ-chip {
  font-size: 0.6rem; font-weight: 700; color: var(--saffron);
  border: 1px solid var(--gold-line, color-mix(in srgb, var(--saffron) 35%, transparent));
  border-radius: 99px; padding: 1px 9px; margin-inline-start: 8px;
  vertical-align: middle;
}
.occ-line { padding: 0 var(--gutter) 10px; font-size: 0.78rem; color: var(--saffron); font-weight: 700; }
.space-switch {
  font-size: 0.68rem; font-weight: 900;
  padding: 7px 13px; border-radius: 99px;
  border: 1.5px solid var(--line-2); color: var(--ink-2);
}
.space-switch:hover { border-color: var(--saffron); color: var(--saffron); }

/* — انیمیشن ستاره — */
@keyframes starpop {
  0% { transform: scale(0.55) rotate(-40deg); }
  60% { transform: scale(1.25) rotate(8deg); }
  100% { transform: scale(1) rotate(0); }
}
.task-toggle.pop { animation: starpop 0.28s cubic-bezier(0.3, 0.9, 0.4, 1.2); }

/* — باغ شمسه — */
.garden { margin: 0 var(--gutter); padding: 16px 18px; }
.g-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.g-tile { width: 17px; height: 17px; color: var(--ring-track); transition: color 0.3s; }
.g-tile.lit { color: var(--saffron); }
.g-cap { font-size: 0.66rem; color: var(--ink-3); margin-top: 12px; }

/* — هفته — */
.week-grid { padding: 18px var(--gutter) 0; display: grid; gap: 11px; }
.wk-day { padding: 13px 15px; }
.wk-day.is-today { border-color: color-mix(in srgb, var(--saffron) 45%, transparent); }
.wk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.wk-name { font-size: 0.8rem; font-weight: 900; }
.is-today .wk-name { color: var(--saffron); }
.wk-num { font-size: 0.7rem; color: var(--ink-3); flex: 1; }
.wk-task {
  display: flex; align-items: center; width: 100%;
  padding: 8px 4px; text-align: right;
  font-size: 0.8rem; color: var(--ink);
  border-top: 1px solid var(--line);
  transition: color 0.13s;
}
.wk-task:hover { color: var(--saffron); }
.wk-task.dn { color: var(--ink-3); text-decoration: line-through; }
.wk-empty { font-size: 0.72rem; color: var(--ink-3); padding: 6px 4px; }

/* — قدم‌ها / گزینه‌های ردیفی — */
.ms-list { margin-top: 12px; display: grid; gap: 2px; }
.ms-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 6px; text-align: right;
  font-size: 0.82rem; color: var(--ink-2);
  border-top: 1px solid var(--line);
  transition: color 0.13s;
}
.ms-row:hover { color: var(--ink); }
.ms-row .ico-s { color: var(--hue, var(--saffron)); }
.ms-row.dn { color: var(--ink-3); text-decoration: line-through; }
.bump-row { display: flex; gap: 7px; margin-top: 12px; }
.bump-row .btn { padding: 8px 14px; font-size: 0.76rem; border-radius: 9px; }
.sheet-row-btns { display: flex; gap: 9px; margin-top: 16px; }
.sheet-row-btns .btn { flex: 1; padding: 11px; font-size: 0.8rem; }

/* — فرم — */
.field textarea {
  width: 100%; background: var(--surface);
  border: 1.5px solid var(--line-2); border-radius: var(--r-s);
  color: var(--ink); padding: 12px 15px; font-size: 0.9rem;
  outline: none; resize: vertical; font-family: var(--fn);
}
.field textarea:focus { border-color: var(--saffron); }
.sheet-scroll { max-height: min(62dvh, 560px); overflow-y: auto; overscroll-behavior: contain; padding-left: 2px; }

/* — گزارش — */
.stat-block { margin: 14px var(--gutter) 0; padding: 17px 18px; }
.pat-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; }
.pat-col { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.pat-bar {
  width: 100%; max-width: 26px; height: 74px;
  background: var(--surface-2); border-radius: 7px;
  display: flex; align-items: flex-end; overflow: hidden;
}
.pat-bar i { display: block; width: 100%; background: var(--saffron); border-radius: 7px 7px 0 0; }
.pat-pct { font-size: 0.6rem; color: var(--ink-2); font-weight: 700; }
.pat-day { font-size: 0.62rem; color: var(--ink-3); }
.stat-note { font-size: 0.74rem; color: var(--ink-2); margin-top: 12px; line-height: 1.9; }
.stat-note.warn { color: var(--terracotta); }
.stat-note b { color: var(--saffron); }

/* — منوی شناور شمسه (موبایل) — */
.float-btn {
  position: fixed; z-index: 210;
  bottom: calc(20px + var(--safe-b)); inset-inline-start: 18px;
  width: 58px; height: 58px;
  display: grid; place-items: center;
  background: var(--saffron); color: var(--on-saffron);
  border-radius: 20px;
  box-shadow: var(--fab-shadow);
  transition: transform 0.22s cubic-bezier(0.3, 0.9, 0.4, 1.2), background 0.15s;
}
.float-btn .fb-star { width: 27px; height: 27px; display: block; transition: transform 0.28s; }
.float-btn.open .fb-star { transform: rotate(45deg); }
.float-btn:active { transform: scale(0.92); }
.float-scrim {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 6, 2, 0.55);
  backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.float-scrim.open { opacity: 1; pointer-events: auto; }
.float-menu {
  position: fixed; z-index: 205;
  bottom: calc(88px + var(--safe-b)); inset-inline-start: 18px;
  display: flex; flex-direction: column; gap: 5px;
  opacity: 0; pointer-events: none;
  translate: 0 14px; transition: opacity 0.2s, translate 0.22s cubic-bezier(0.3, 0.9, 0.4, 1);
}
.float-menu.open { opacity: 1; pointer-events: auto; translate: 0 0; }
.fm-item {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 18px 11px 22px;
  font-size: 0.84rem; font-weight: 700;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: var(--pop-shadow);
}
.fm-item .ico { width: 18px; height: 18px; color: var(--ink-2); }
.fm-item:hover .ico { color: var(--saffron); }
.fm-accent { background: var(--saffron); color: var(--on-saffron); border-color: transparent; }
.fm-accent .ico { color: var(--on-saffron); }
.fm-sep { height: 1px; background: var(--line-2); margin: 3px 8px; }

/* — ریل دسکتاپ — */
.rail { display: none; }

/* — اورلی (جستجو/تمرکز) — */
.overlay {
  position: fixed; inset: 0; z-index: 250;
  background: var(--bg);
  display: none; flex-direction: column;
}
.overlay.open { display: flex; }
.overlay-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.search-inp {
  flex: 1; background: var(--surface);
  border: 1.5px solid var(--line-2); border-radius: var(--r-s);
  color: var(--ink); padding: 12px 16px; font-size: 0.95rem;
  outline: none; font-family: var(--fn);
}
.search-inp:focus { border-color: var(--saffron); }
.search-res { flex: 1; overflow-y: auto; padding: 12px 18px; }
.sr-row {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; padding: 12px 6px; text-align: right;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}
.sr-row:hover { background: var(--surface); }
.sr-kind { font-size: 0.64rem; color: var(--saffron); font-weight: 700; }
.sr-label { font-size: 0.88rem; color: var(--ink); }

/* — تمرکز — */
.focus-ov { align-items: center; justify-content: center; }
.focus-box { text-align: center; padding: 24px; max-width: 420px; width: 100%; }
.focus-cap { font-size: 0.7rem; letter-spacing: 0.2em; color: var(--saffron); font-weight: 700; margin-bottom: 14px; }
.focus-box h2 { font-size: 1.2rem; font-weight: 900; line-height: 1.6; margin-bottom: 24px; }
.focus-time {
  font-size: 4rem; font-weight: 900; color: var(--saffron);
  font-variant-numeric: tabular-nums; line-height: 1; margin-bottom: 32px;
}
.focus-btns { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }

/* — قفل — */
.lockveil {
  position: fixed; inset: 0; z-index: 600;
  background: var(--bg); background-image: var(--bg-glow);
  display: flex; align-items: center; justify-content: center; padding: 28px;
}
.lockveil[hidden] { display: none; }
.lockbox { width: 100%; max-width: 320px; text-align: center; }
.lockbox h2 { font-size: 1.3rem; font-weight: 900; }
.lockbox .lead { font-size: 0.8rem; color: var(--ink-2); margin: 8px 0 22px; }
.pin-inp {
  width: 100%; text-align: center; letter-spacing: 0.5em;
  background: var(--surface); border: 1.5px solid var(--line-2);
  border-radius: var(--r-s); color: var(--ink);
  padding: 14px; font-size: 1.3rem; outline: none; font-family: var(--fn);
  margin-bottom: 8px;
}
.pin-inp:focus { border-color: var(--saffron); }
.lock-err { font-size: 0.74rem; color: var(--terracotta); min-height: 20px; margin-bottom: 8px; }

/* — سربرگ جمع‌شونده — */
.masthead { transition: padding 0.2s; position: sticky; top: 0; z-index: 80;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.masthead.shrunk { padding-top: 8px; padding-bottom: 8px; }
.masthead.shrunk .brand-date { display: none; }
.rule { position: sticky; top: 0; z-index: 79; }

/* — دسکتاپ v5 — */
@media (min-width: 1024px) {
  .float-btn, .float-menu, .float-scrim { display: none; }
  .rail {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    position: fixed; inset-inline-end: 0; top: 0; bottom: 0; z-index: 90;
    width: 96px; padding: 22px 0 26px;
    background: var(--surface);
    border-inline-start: 1px solid var(--line);
  }
  .rail-item {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    width: 74px; padding: 12px 0; border-radius: 14px;
    font-size: 0.62rem; font-weight: 500; color: var(--ink-3);
    transition: color 0.15s, background 0.15s;
  }
  .rail-item:hover { color: var(--saffron); }
  .rail-item[aria-current="true"] { color: var(--saffron); font-weight: 700; background: var(--surface-2); }
  .rail-item .ico { width: 21px; height: 21px; }
  .rail-add { margin-top: auto; width: 52px; height: 52px; padding: 0; border-radius: 17px; }
  .rail-add .ico { width: 22px; height: 22px; }
  .week-grid { grid-template-columns: repeat(7, 1fr); padding-inline: 0; align-items: start; }
  .banner { width: 100%; margin-inline: 0; }
  .garden, .stat-block { margin-inline: 0; }
  .occ-line { padding-inline: 0; }
  .page { padding-bottom: 56px; }
}
@media (max-width: 1023px) {
  .page { padding-bottom: 110px; }
}
