/* 
 * -------------------------------------------------------------------
 * STYLE.CSS - Persian Bento Calendar Dashboard
 * -------------------------------------------------------------------
 * Designing a luxury modern Persian bento grid dashboard with responsive CSS grid, 
 * adaptive theme, glassmorphism, and smooth animations.
 */

/* Local font, no external dependency. */
@font-face {
  font-family: 'Vazirmatn';
  src: url('../fonts/vazirmatn/Vazirmatn-wght.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Roboto SemiCondensed SemiBold';
  src: url('../fonts/Roboto_SemiCondensed-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* 2. CSS Color Palette & Variables declaration */
:root {
  /* ========== Brand ========== */
  --color-primary: #2266AF;
  --color-primary-hover: #1D5B9D;
  --color-primary-active: #184F89;
  --color-primary-light: #E8F1FB;
  --color-primary-rgb: 34, 102, 175;

  /* Accent */
  --color-secondary: #C89A38;
  --color-secondary-light: #F7E8C5;
  --color-secondary-rgb: 200,154,56;

  /* Semantic */
  --color-success: #0F9D8A;
  --color-success-rgb: 15,157,138;

  --color-warning: #D99A1C;
  --color-warning-rgb: 217,154,28;

  --color-danger: #E5484D;
  --color-danger-rgb: 229,72,77;

  --color-info: #2B8AE2;
  --color-info-rgb: 43,138,226;

  /* Background */
  --color-bg-main: #F5F9FD;

  --color-bg-gradient:
      radial-gradient(circle at top left,
      #EEF5FD 0%,
      #F5F9FD 45%,
      #FFFFFF 100%);

  --color-bg-overlay:
      linear-gradient(
      180deg,
      rgba(245,249,253,.40),
      rgba(245,249,253,.82));

  --color-bg-image: url("../bg/lightmode.png");

  /* Surface */
  --color-surface: rgba(255,255,255,.78);
  --color-surface-soft: rgba(251,252,254,.92);
  --color-surface-hover: rgba(255,255,255,.97);

  /* Text */
  --color-text: #132238;
  --color-text-muted: #66788A;
  --color-text-light: #8FA1B3;

  /* Borders */
  --color-border: rgba(34,102,175,.12);
  --color-border-strong: rgba(34,102,175,.22);
  --color-border-focus: rgba(34,102,175,.38);

  /* Shadows */
  --shadow-soft:
      0 2px 10px rgba(21,40,70,.05);

  --shadow-card:
      0 12px 32px rgba(22,52,93,.08);

  --shadow-glow:
      0 0 20px rgba(34,102,175,.16);

  --glass-blur: blur(14px);

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 32px;

  --transition-speed: .28s;

  /* ===== New variables for consistent palette usage ===== */
  --color-clock-face: #0c0a09;
  --color-clock-face-bg: #ffffff;
  --color-clock-text: #0c0a09;
  --color-clock-hand-minute: #2a2a2a;
  --color-secondary-hover: #d97706;
  --color-brand-dark-overlay: rgba(17,14,31,0.72);
  --color-brand-light-overlay: rgba(237,233,254,0.8);
}

/* =============================== */

/* ==========================================
   Premium Dark Theme v2
   Brand: #2266AF
   ========================================== */

[data-theme="dark"] {

  /* ========= Background ========= */

  --color-bg-main: #060E18;

  --color-bg-gradient:
    radial-gradient(
      circle at top left,
      rgba(34,102,175,.07) 0%,
      rgba(7,14,24,.96) 40%,
      rgba(4,8,14,1) 100%
    );

  --color-bg-image: url("../bg/darkmode.png");

  --color-bg-overlay:
    linear-gradient(
      180deg,
      rgba(6,14,24,.34),
      rgba(6,14,24,.82)
    );

  /* ========= Surface ========= */

  --color-surface:
      rgba(15,24,38,.76);

  --color-surface-soft:
      rgba(19,31,48,.86);

  --color-surface-hover:
      rgba(26,41,63,.94);

  /* ========= Typography ========= */

  --color-text: #EDF5FC;

  --color-text-muted: #9DB1C5;

  --color-text-light: #7C91A7;

  /* ========= Borders ========= */

  --color-border:
      rgba(82,146,214,.08);

  --color-border-strong:
      rgba(82,146,214,.16);

  --color-border-focus:
      rgba(82,146,214,.34);

  /* ========= Shadows ========= */

  --shadow-soft:
      0 6px 16px rgba(0,0,0,.38);

  --shadow-card:
      0 18px 44px rgba(0,0,0,.62);

  --shadow-glow:
      0 0 14px rgba(34,102,175,.10);

  /* ========= Glass ========= */

  --glass-blur: blur(18px);

  /* ===== New variables for consistent palette usage (dark) ===== */
  --color-primary-hover: #3b82f6;
  --color-secondary-hover: #eab308;
  --color-clock-face: #0c0a09;
  --color-clock-face-bg: #ffffff;
  --color-clock-text: #0c0a09;
  --color-clock-hand-minute: #2a2a2a;
  --color-brand-dark-overlay: rgba(255,255,255,0.08);
  --color-brand-light-overlay: rgba(255,255,255,0.1);
}

/* 4. Global Standards & Core Setup (RTL & Font) */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Vazirmatn', 'IRANSans', 'Tahoma', sans-serif;
  font-size: 0.95rem;
  background-color: var(--color-bg-main);
  background-image: var(--color-bg-overlay), var(--color-bg-image);
  background-attachment: fixed;
  background-position: center top;
  background-repeat: no-repeat;
  background-size: cover;
  color: var(--color-text);
  margin: 0;
  padding: 0;
  direction: rtl;
  text-align: right;
  transition: background-color var(--transition-speed) ease, 
              background-image var(--transition-speed) ease, 
              color var(--transition-speed) ease;
  overflow-x: hidden;
  position: relative;
}

html,
body {
  max-width: 100%;
}

/* Decorative Persian Background Grid Pattern overlays with ultra low opacity */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(var(--color-border) 1.2px, transparent 1.2px);
  background-size: 32px 32px;
  opacity: 0.25;
  pointer-events: none;
  z-index: -1;
}

/* Smooth Scrolling & Typography Enhancements */
html {
  scroll-behavior: smooth;
}

.hero-wrapper,
.section-wrapper,
.date-distance-section,
.bento-card[id] {
  scroll-margin-top: 96px;
}

html:not([data-theme="dark"]) header.glass,
html:not([data-theme="dark"]) footer.glass {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-text);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html:not([data-theme="dark"]) header.glass a,
html:not([data-theme="dark"]) header.glass span,
html:not([data-theme="dark"]) header.glass button,
html:not([data-theme="dark"]) footer.glass a,
html:not([data-theme="dark"]) footer.glass span,
html:not([data-theme="dark"]) footer.glass p,
html:not([data-theme="dark"]) footer.glass svg {
  color: var(--color-text-muted);
}

html:not([data-theme="dark"]) header.glass .text-white,
html:not([data-theme="dark"]) footer.glass .text-white,
html:not([data-theme="dark"]) header.glass .group span,
html:not([data-theme="dark"]) footer.glass .font-bold {
  color: var(--color-text) !important;
}

html:not([data-theme="dark"]) header.glass a:hover,
html:not([data-theme="dark"]) footer.glass a:hover {
  color: var(--color-primary) !important;
}

html:not([data-theme="dark"]) footer.glass .glass {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(139, 92, 246, 0.14);
}

html:not([data-theme="dark"]) header.glass .bg-dark-card,
html:not([data-theme="dark"]) footer.glass .bg-dark-card {
  background-color: rgba(255, 255, 255, 0.86) !important;
}

html:not([data-theme="dark"]) header.glass .border-dark-border,
html:not([data-theme="dark"]) footer.glass .border-dark-border {
  border-color: rgba(139, 92, 246, 0.16) !important;
}

.brand-logo-mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(var(--color-primary-rgb), 0.28);
  background:
    radial-gradient(circle at 25% 20%, rgba(var(--color-secondary-rgb), 0.2), transparent 34%),
    linear-gradient(145deg, rgba(var(--color-primary-rgb), 0.24), var(--color-brand-dark-overlay));
  box-shadow: 0 10px 24px rgba(var(--color-primary-rgb), 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.brand-logo-mark::after {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.brand-logo-mark-header {
  width: 42px;
  height: 42px;
  border-radius: 14px;
}

.brand-logo-mark-footer {
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.brand-logo-img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: saturate(1.35) hue-rotate(24deg) contrast(1.08) drop-shadow(0 4px 8px rgba(var(--color-primary-rgb), 0.28));
  transform: translateY(1px);
}

html:not([data-theme="dark"]) .brand-logo-mark {
  background:
    radial-gradient(circle at 25% 20%, rgba(var(--color-secondary-rgb), 0.16), transparent 36%),
    linear-gradient(145deg, var(--color-surface-hover), var(--color-brand-light-overlay));
  border-color: rgba(var(--color-primary-rgb), 0.22);
  box-shadow: 0 10px 24px rgba(var(--color-primary-rgb), 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

a {
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color var(--transition-speed) ease;
}
a:hover {
  color: var(--color-text);
}

/* Customized scrollbar to blend with modern styling */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-bg-main);
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Core headings and text highlights */
.text-gradient-purple {
  color: var(--color-primary);
  font-weight: 800;
}

.text-gradient-gold {
  background: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-secondary-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

/* Custom premium badge styled pill badge */
.pill-badge {
  background: rgba(var(--color-primary-rgb), 0.08);
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  color: var(--color-primary);
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 10px rgba(var(--color-primary-rgb), 0.05);
  animation: float 4s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

/* Glassmorphism Generic Card Framework */
.bento-card {
  background-color: var(--color-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color var(--transition-speed) ease,
              background-color var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.bento-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(var(--color-primary-rgb), 0.15), var(--shadow-card);
  border-color: var(--color-border-focus);
}

.bento-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 12px;
}

.bento-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--color-text);
}

.bento-card-title i {
  color: var(--color-primary);
  font-size: 1.25rem;
}

/* -------------------------------------------------------------
 * THEME TOGGLE ELEMENT - Sliding Custom Switch Header area
 * ------------------------------------------------------------- */
.theme-switch-container {
  /* background: var(--color-surface-soft); */
  /* border: 1px solid var(--color-border); */
  border-radius: 50px;
  /* padding: 6px 12px; */
  display: inline-flex;
  align-items: center;
  /* gap: 12px; */
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-soft);
  transition: all 0.3s ease;
}

.theme-switch-container:hover {
  border-color: var(--color-border-focus);
  box-shadow: var(--shadow-glow);
}

.theme-switch-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
}

.theme-switch-track {
  width: 52px;
  height: 26px;
  background-color: rgba(var(--color-primary-rgb), 0.2);
  border-radius: 50px;
  position: relative;
  transition: all 0.3s ease;
}

.theme-switch-knob {
  width: 20px;
  height: 20px;
  background-color: var(--color-primary);
  border-radius: 50%;
  position: absolute;
  top: 3px;
  right: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.65rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}

header .theme-switch-container {
  margin: 0;
  padding: 4px 8px;
  min-height: 34px;
  background: rgba(var(--color-primary-rgb), 0.08);
  border: 1px solid rgba(var(--color-primary-rgb), 0.16);
}

header .theme-switch-label:empty {
  display: none;
}

[data-theme="dark"] .theme-switch-knob {
  transform: translateX(-26px);
  background-color: var(--color-primary-active);
}

/* -------------------------------------------------------------
 * SECTION 1: HERO & MAIN DASHBOARD LAYOUT (Bento Grid)
 * ------------------------------------------------------------- */
.hero-wrapper {
  padding: 80px 0 40px 0;
  position: relative;
  z-index: 2;
}

/* Unique Split ambient visual representation inspired by the split reference photo */
.hero-split-glow {
  position: absolute;
  top: 5%;
  right: 15%;
  width: 350px;
  height: 350px;
  background-all: ease;
  background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.18) 0%, transparent 60%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 1;
}

.hero-split-glow-left {
  position: absolute;
  top: 15%;
  left: 10%;
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(var(--color-secondary-rgb), 0.1) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 1;
}

[data-theme="dark"] .hero-split-glow {
  background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.25) 0%, transparent 75%);
}

[data-theme="dark"] .hero-split-glow-left {
  background: radial-gradient(circle, rgba(var(--color-primary-rgb), 0.2) 0%, transparent 70%);
}

/* Bento Area Master Grid layout */
.bento-master-container {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 16px;
  align-items: start;
}

/* A) MINI NAVIGATION RAIL */
.nav-rail {
  background-color: var(--color-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--color-border);
  border-radius: 22px;
  padding: 18px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 590px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
  position: sticky;
  top: 24px;
  overflow: visible;
  z-index: 40;
}

.nav-rail-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  overflow: visible;
}

.nav-user-avatar {
  position: relative;
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: inherit;
  text-decoration: none;
}

.nav-user-avatar img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(139, 92, 246, 0.15);
}

.nav-user-avatar .brand-avatar {
  width: 44px;
  height: 44px;
}

.nav-user-avatar::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 10px;
  height: 10px;
  /* background-color: var(--color-success);
  border: 2px solid var(--color-bg-main); */
  border-radius: 50%;
}

.nav-rail-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  align-items: center;
  overflow: visible;
}

.nav-rail-item {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 2;
}

.nav-rail-item i {
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.nav-rail-item:hover {
  background-all: ease;
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary);
}

.nav-rail-item:hover i {
  transform: scale(1.1);
}

.nav-rail-item.active {
  background-color: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(var(--color-primary-rgb), 0.35);
}

/* Tooltips for vertical nav items */
.nav-rail-item::before {
  content: attr(data-title);
  position: absolute;
  right: 64px;
  background-color: var(--color-text);
  color: var(--color-bg-main);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(10px);
  pointer-events: none;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-soft);
  z-index: 80;
}

.nav-rail-item:hover::before {
  opacity: 1;
  transform: translateX(0);
}

.nav-rail-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.nav-action-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.nav-action-btn:hover {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.nav-badge-overlay {
  position: absolute;
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  background-color: var(--color-danger);
  border-radius: 50%;
}


/* MAIN BENTO INTEGRATED DASHBOARD GRID SYSTEM */
.bento-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.bento-dashboard-grid.hero-view-calendar {
  grid-template-columns: minmax(0, 1fr);
}

.bento-dashboard-grid.hero-view-calendar .bento-month-cal-card {
  grid-column: 1;
  width: min(100%, 920px);
  justify-self: center;
}

.hero-view-panel {
  grid-column: 1 / -1;
}

.bento-dashboard-grid.hero-view-convert,
.bento-dashboard-grid.hero-view-holidays,
.bento-dashboard-grid.hero-view-events {
  grid-template-columns: minmax(0, 1fr);
}

.bento-dashboard-grid > [data-hero-index] {
  order: var(--hero-index);
}

#main-bento-grid > .bento-card {
  padding: 18px;
  border-radius: 16px;
}

.hero-wrapper .display-5 {
  font-size: clamp(1.95rem, 4vw, 2.55rem);
}

.hero-wrapper .lead {
  font-size: 1rem;
  line-height: 1.75;
}

.hero-wrapper .badge {
  font-size: 0.72rem;
}

/* B) TODAY OVERVIEW HERO CELL (Span 2 columns) */
.bento-today-hero-card {
  grid-column: span 3;
  all: ease;
  background-color: var(--color-surface);
  position: relative;
  min-height: 220px;
}

.today-hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 18px;
  align-items: stretch;
}

.today-info-block {
  min-width: 0;
}

.today-clock-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding-inline-start: 0;
  transform: none;
  text-align: center;
}

.live-clock-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  margin-inline-end: auto;
  /* padding: 0; */
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font-family: "Roboto SemiCondensed SemiBold", "Arial Black", Impact, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.42rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1px;
  /* text-shadow: 1px 0 #3aa0ff, -1px 0 #ff6a3d; */
  white-space: nowrap;
}

#today-other-dates {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.date-chip-label {
  color: var(--color-primary);
  font-size: 0.68rem;
}

/* Decorative Persian Gardens/Geometric vector abstract background illustration in Bento */
.bento-today-bg-shape {
  position: absolute;
  left: -40px;
  top: -40px;
  width: 210px;
  height: 210px;
  background-image: radial-gradient(circle, var(--color-border) 1px, transparent 1px);
  background-size: 16px 16px;
  mask-image: radial-gradient(circle, black 40%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle, black 40%, transparent 70%);
  opacity: 0.35;
  pointer-events: none;
}

.persian-dome-outline {
  position: absolute;
  left: 20px;
  bottom: 10px;
  width: 160px;
  height: 160px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' opacity='0.12' stroke='%232266AF' stroke-width='0.5' fill='none'%3E%3Cpath d='M50,0 Q10,30 10,60 L10,100 L90,100 L90,60 Q90,30 50,0 Z'/%3E%3Ccircle cx='50' cy='50' r='10'/%3E%3Cpath d='M50,40 L50,60 M40,50 L60,50'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  pointer-events: none;
}

.today-quote {
  font-style: italic;
  font-weight: 300;
  border-right: 3px solid var(--color-primary);
  padding-right: 12px;
  margin-top: 1rem !important;
  margin-bottom: 1rem !important;
}

#main-bento-grid .display-6 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}


/* C) iOS-STYLE CLOCK WIDGET */
.bento-clock-card {
  grid-column: span 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.ios-clock-widget {
  width: 126px;
  height: 126px;
  border-radius: 28px;
  position: relative;
  box-shadow: 0 6px 13px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.ios-clock-face {
  width: 106px;
  height: 106px;
  background-color: var(--color-clock-face-bg);
  border-radius: 50%;
  position: relative;
}

.clock-number {
  position: absolute;
  width: 100%;
  height: 100%;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  font-size: 11px;
  color: var(--color-clock-text);
  transform-origin: center;
  padding: 4px;
}

.clock-number-12 { transform: rotate(0deg); }
.clock-number-12 span { display: inline-block; transform: rotate(0deg); }
.clock-number-3 { transform: rotate(90deg); }
.clock-number-3 span { display: inline-block; transform: rotate(-90deg); }
.clock-number-6 { transform: rotate(180deg); }
.clock-number-6 span { display: inline-block; transform: rotate(-180deg); }
.clock-number-9 { transform: rotate(270deg); }
.clock-number-9 span { display: inline-block; transform: rotate(-270deg); }

.ios-clock-hand {
  position: absolute;
  bottom: 50%;
  left: 50%;
  transform-origin: bottom center;
  border-radius: 4px;
}

.ios-clock-hand.hour {
  width: 4px;
  height: 29px;
  background-color: var(--color-clock-text);
  margin-left: -2px;
  z-index: 3;
}

.ios-clock-hand.minute {
  width: 2.5px;
  height: 41px;
  background-color: var(--color-clock-hand-minute);
  margin-left: -1.25px;
  z-index: 4;
}

.ios-clock-hand.second {
  width: 1.2px;
  height: 44px;
  background-color: var(--color-warning);
  margin-left: -0.6px;
  z-index: 5;
}

.clock-center-pin {
  width: 6px;
  height: 6px;
  background-color: var(--color-warning);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}


/* D) CURRENT MONTH MINI CALENDAR */
.bento-month-cal-card {
  grid-column: span 2;
  --mini-card-width: 100%;
  --mini-card-max-height: 720px;
  --mini-day-size: clamp(46px, 7.2vw, 54px);
  width: min(100%, var(--mini-card-width));
  max-height: none;
  justify-self: stretch;
  overflow-y: visible;
  overflow-x: hidden;
  padding-top: 22px !important;
}

.bento-month-cal-card::before,
.bento-month-cal-card::after {
  content: "";
  position: absolute;
  top: 0;
  width: 20px;
  height: 50px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 22px rgba(0, 0, 0, 0.18);
  opacity: 0.55;
  pointer-events: none;
}

.bento-month-cal-card::before {
  right: 90px;
}

.bento-month-cal-card::after {
  left: 90px;
}

.bento-month-events-card {
  grid-column: span 1;
  width: 100%;
  max-height: 720px;
  overflow: hidden;
}

.bento-month-events-card .mini-month-events-list {
  max-height: 635px;
  overflow-y: auto;
}

.bento-month-events-card .bento-card-header {
  align-items: center;
  gap: 10px;
}

.bento-month-events-card .bento-card-title {
  flex: 1;
}

.cal-header-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}

.mini-month-title-stack {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  flex-wrap: wrap;
}

.calendar-title-stack {
  display: inline-grid;
  gap: 3px;
  justify-items: center;
  line-height: 1.35;
  vertical-align: middle;
}

.calendar-title-main {
  display: block;
  color: inherit;
  font-weight: 950;
}

.calendar-title-sub {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.62em;
  font-weight: 700;
  line-height: 1.6;
  white-space: normal;
}

.calendar-title-stack-mini .calendar-title-main {
  font-size: 1em;
}

.calendar-title-stack-mini .calendar-title-sub {
  font-size: 0.58em;
  color: var(--color-text-muted);
}

.calendar-title-stack-large {
  justify-items: start;
}

.calendar-title-stack-large .calendar-title-sub {
  color: rgba(255, 255, 255, 0.72);
  font-size: 10px;
}

.calendar-title-stack-year {
  justify-items: start;
  text-align: start;
}

.calendar-title-stack-year .calendar-title-sub {
  font-size: 8px;
  margin-right: -15px;

}

.cal-nav-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-main);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cal-nav-btn:hover {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.cal-nav-btn .bi-chevron-right,
.cal-nav-btn .bi-chevron-left {
  transform: scaleX(-1);
}

.mini-year-jump-btn {
  width: auto;
  min-height: 26px;
  margin-bottom: 0;
  padding: 3px 8px;
  border: 1px solid rgba(var(--color-primary-rgb), 0.2);
  border-radius: 999px;
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mini-year-jump-btn:hover {
  border-color: rgba(var(--color-primary-rgb), 0.42);
  background: rgba(var(--color-primary-rgb), 0.14);
  transform: translateY(-1px);
}

.mini-today-return-btn {
  color: var(--color-secondary);
  border-color: rgba(var(--color-secondary-rgb), 0.26);
  background: rgba(var(--color-secondary-rgb), 0.1);
}

.mini-today-return-btn:hover {
  border-color: rgba(var(--color-secondary-rgb), 0.44);
  background: rgba(var(--color-secondary-rgb), 0.16);
}

.mini-today-return-btn[hidden] {
  display: none;
}

.weekday-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 4px;
}

.days-grid-mini {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 6px;
  text-align: center;
}

.bento-month-cal-card .days-grid-mini {
  gap: 4px;
  grid-auto-rows: minmax(0, var(--mini-day-size));
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.bento-month-cal-card.is-six-week-month {
  --mini-day-size: clamp(39px, 5.8vw, 47px);
}

.bento-month-cal-card.is-six-week-month .days-grid-mini {
  gap: 3px;
}

.day-cell {
  position: relative;
  padding: 4px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.bento-month-cal-card .day-cell {
  min-height: 0;
  height: var(--mini-day-size);
  padding: 4px 5px;
}

.bento-month-cal-card .day-cell-empty {
  min-height: 0;
  height: var(--mini-day-size);
}

.day-cell:hover {
  background-color: var(--color-surface-soft);
}

.day-cell-num {
  font-weight: bold;
  font-size: 0.95rem;
  color: var(--color-text);
}

.bento-month-cal-card .day-cell-num {
  font-size: 0.98rem;
}

.day-cell-sub {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  display: flex;
  justify-content: center;
  gap: 10px;
  width: auto;
  padding: 0;
  line-height: 1.2;
}

.bento-month-cal-card .day-cell-sub {
  font-size: 0.76rem;
}

.day-cell-gregorian {
  font-family: Arial, sans-serif;
  unicode-bidi: plaintext;
}

.day-cell-hijri {
  font-family: inherit;
}

.mini-selected-day-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.mini-month-events-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
}

.mini-panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--color-text);
  font-size: 0.84rem;
  font-weight: 700;
}

.mini-month-events-list {
  display: grid;
  grid-template-columns: 100%;
  gap: 8px;
  max-height: 138px;
  overflow-y: auto;
  padding-left: 2px;
}

.mini-year-modal[hidden] {
  display: none;
}

.mini-year-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
}

.mini-year-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 6, 15, 0.46);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mini-year-modal-dialog {
  position: relative;
  width: min(100%, 360px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface-hover);
  box-shadow: var(--shadow-card);
  padding: 22px;
  z-index: 1;
}

.mini-year-modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 30px;
  height: 30px;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: var(--color-surface-soft);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mini-year-input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg-main);
  color: var(--color-text);
  text-align: center;
  font-weight: 800;
  padding: 10px 12px;
}

.mini-month-events-list .my-event-item {
  margin: 0;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  font-size: 0.74rem;
  line-height: 1.6;
}

.mini-month-events-list .my-event-item.is-focused {
  border-color: rgba(var(--color-primary-rgb), 0.72);
  background: rgba(var(--color-primary-rgb), 0.16);
  box-shadow: 0 0 0 2px rgba(var(--color-primary-rgb), 0.12);
}

.mini-month-events-list .my-event-item.holiday {
  border-color: rgba(var(--color-danger-rgb), 0.34);
  border-right-color: var(--color-danger);
}

.mini-month-events-list .my-event-item.holiday span:first-child {
  color: var(--color-danger);
}

.mini-month-events-list .my-event-item span:first-child {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.day-cell.today {
  background-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(var(--color-primary-rgb), 0.35);
}

.day-cell.today .day-cell-num,
.day-cell.today .day-cell-sub {
  color: #ffffff;
}

.day-cell.holiday .day-cell-num {
  color: var(--color-danger);
}

/* Event marker dot on calendar cell */
.day-event-dot {
  width: 4px;
  height: 4px;
  background-color: var(--color-secondary);
  border-radius: 50%;
  position: static;
  bottom: 5px;
}

.day-event-dot.primary {
  background-color: var(--color-primary);
  top:90%;
  left: 50%;
  position: absolute; 
}


/* E) TODAY'S OCCASION MODULE */
.bento-occasions-card {
  grid-column: span 1;
}

.list-item-occasion {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(139, 92, 246, 0.05);
}

.occasion-content {
  display: grid;
  justify-items: start;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.occasion-badge {
  flex: 0 0 auto;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(var(--color-primary-rgb), 0.1);
  color: var(--color-primary);
  font-size: 0.68rem;
  font-weight: 800;
}

.occasion-badge.holiday {
  background: rgba(var(--color-danger-rgb), 0.12);
  color: var(--color-danger);
}

.list-item-occasion:last-child {
  border-bottom: none;
}

.occasion-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}


/* F) PRAYER TIMES CARD */
.bento-prayer-card {
  grid-column: span 1;
}

.prayer-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  background-color: var(--color-surface-soft);
  margin-bottom: 5px;
  transition: transform 0.2s ease;
}

.prayer-time-row:hover {
  transform: translateX(-4px);
  background-color: rgba(var(--color-primary-rgb), 0.05);
}

.prayer-time-row.active {
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.1) 0%, rgba(var(--color-primary-rgb), 0.02) 100%);
  border: 1px solid var(--color-border-focus);
}


/* G) DATE CONVERTER */
.bento-converter-card {
  grid-column: 1 / -1;
  min-height: 360px;
}

.converter-layout {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(260px, 2fr) minmax(160px, 1fr);
  gap: 14px;
  align-items: end;
}

.converter-box {
  background-color: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 0;
  transition: all 0.2s ease;
}

.converter-box:focus-within {
  border-color: var(--color-border-focus);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-glow);
}

.converter-date-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.converter-control {
  background: transparent;
  border: 0;
  color: var(--color-text);
  padding: 0;
  min-height: 32px;
  font-weight: 800;
  color-scheme: dark;
}

.converter-control:focus {
  box-shadow: none;
  background: transparent;
  color: var(--color-text);
}

.converter-control option {
  background-color: var(--color-bg-main);
  color: var(--color-text);
}

html:not([data-theme="dark"]) .converter-control {
  color-scheme: light;
}

.converter-submit-btn,
.converter-result {
  grid-column: 1 / -1;
}

.converter-submit-btn {
  border-radius: var(--radius-md);
  min-height: 44px;
  font-weight: 900;
}

.converter-result {
  background: var(--color-surface-soft);
  border: 1px dashed var(--color-border-focus);
  border-radius: var(--radius-md);
  padding: 18px;
  color: var(--color-text);
  font-weight: 800;
  text-align: center;
}


/* H) UPCOMING HOLIDAYS ROW */
.bento-holidays-card {
  grid-column: span 1;
}


/* I) MY EVENTS */
.bento-events-card {
  grid-column: span 1;
}

.my-event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--color-surface-soft);
  border-right: 3px solid var(--color-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.bento-year-list-card {
  grid-column: 1 / -1;
  min-height: 420px;
}

.year-data-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding-inline-end: 4px;
}

.holiday-tools-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(150px, auto);
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}

.holiday-year-control {
  display: grid;
  grid-template-columns: auto minmax(110px, 160px) auto;
  gap: 8px;
  align-items: center;
}

.holiday-year-input {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-main);
  color: var(--color-text);
  font-weight: 900;
  text-align: center;
}

.holiday-year-btn {
  min-height: 34px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 850;
}

.holiday-checkbox-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-text);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.holiday-checkbox-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
}

.holiday-total-stat {
  display: grid;
  gap: 2px;
  justify-items: center;
  min-width: 130px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: rgba(var(--color-primary-rgb), 0.1);
  border: 1px solid rgba(var(--color-primary-rgb), 0.18);
}

.holiday-total-stat strong {
  color: var(--color-primary);
  font-size: 1.15rem;
  line-height: 1.2;
}

.year-data-item {
  display: grid;
  grid-template-columns: minmax(92px, 106px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  background-color: var(--color-surface-soft);
  border: 1px solid var(--color-border);
  border-right: 3px solid var(--color-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  height: 64px;
  min-height: 64px;
}

.year-data-item.holiday {
  border-right-color: var(--color-danger);
}

.year-data-date {
  color: var(--color-text-muted);
  font-size: 0.72rem;
  direction: ltr;
  text-align: left;
  white-space: nowrap;
}

.year-data-title {
  display: grid;
  gap: 2px;
  color: var(--color-text);
  font-weight: 850;
  font-size: 0.86rem;
  line-height: 1.45;
  min-width: 0;
}

.year-data-title-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-data-meta {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  color: var(--color-text-muted);
  font-size: 0.68rem;
  margin-top: 2px;
  min-height: 16px;
  overflow: hidden;
  white-space: nowrap;
}

.year-data-weekday {
  color: var(--color-primary);
  font-size: 0.66rem;
  font-weight: 800;
  opacity: 0.86;
}


/* FEATURE STRIP */
.info-feature-strip {
  background: var(--color-surface);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 30px;
}


/* -------------------------------------------------------------
 * SECTION 2: MONTH-BY-MONTH DETAILED SECTION
 * ------------------------------------------------------------- */
.date-distance-section {
  position: relative;
  z-index: 2;
  padding-top: 34px;
  padding-bottom: 34px;
}

.date-distance-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  padding: 18px;
  background: var(--color-surface);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-card);
}

.date-distance-card::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 10% 12%, rgba(var(--color-secondary-rgb), 0.12), transparent 28%),
    linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.12), transparent 48%);
  pointer-events: none;
}

.date-distance-header {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.date-distance-title {
  color: var(--color-text);
  font-size: clamp(1.15rem, 2.3vw, 1.6rem);
  font-weight: 950;
  margin: 8px 0 0;
}

.date-distance-copy {
  color: var(--color-text-muted);
  line-height: 1.9;
  margin: 0;
  font-size: 0.9rem;
}

.date-distance-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.date-distance-group {
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}

.date-distance-label {
  display: block;
  color: var(--color-text-muted);
  font-size: 0.78rem;
  font-weight: 850;
  margin-bottom: 8px;
}

.date-distance-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.date-distance-input {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-bg-main);
  color: var(--color-text);
  font-weight: 900;
  text-align: center;
}

.date-distance-input::placeholder {
  color: var(--color-text-muted);
}

select.date-distance-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%23888' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: left 10px center;
  padding-left: 26px;
  cursor: pointer;
}

select.date-distance-input option {
  color: var(--color-text);
  font-weight: 400;
}

.date-distance-btn {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  border-radius: var(--radius-md);
  background: var(--color-primary);
  color: #fff;
  font-weight: 950;
}

.date-distance-result {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  padding: 12px;
  min-height: 48px;
  border: 1px dashed var(--color-border-focus);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  color: var(--color-text);
  text-align: center;
  font-weight: 900;
}

.date-distance-result.ready {
  display: grid;
  gap: 10px;
  text-align: center;
}

.distance-range-label {
  color: var(--color-text-muted);
  font-size: 0.86rem;
  line-height: 1.9;
}

.distance-result-title {
  color: var(--color-secondary);
  font-size: 0.92rem;
  font-weight: 900;
}

.distance-days-main {
  color: var(--color-text);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.25;
  font-weight: 950;
}

.distance-equivalents {
  display: grid;
  gap: 8px;
  color: var(--color-text);
  font-size: 1rem;
  line-height: 1.8;
}

.distance-note {
  color: var(--color-text-muted);
  font-size: 0.82rem;
  line-height: 1.9;
}

.age-tool-section {
  padding-top: 24px;
}

.age-mode-tabs {
  position: relative;
  z-index: 1;
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  margin-bottom: 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
}

.age-mode-tab {
  min-height: 34px;
  padding: 6px 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.82rem;
  font-weight: 900;
  transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}

.age-mode-tab.active {
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: var(--shadow-glow);
}

.age-tool-panel {
  position: relative;
  z-index: 1;
}

.age-single-grid {
  grid-template-columns: minmax(0, 1fr);
}

.age-birth-details {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.92rem;
  line-height: 1.9;
}

.age-birth-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--color-secondary);
  font-weight: 950;
}

.age-birth-title::before,
.age-birth-title::after {
  content: "";
  height: 1px;
  background: var(--color-border-focus);
}

.section-wrapper {
  padding: 60px 0;
  position: relative;
  z-index: 2;
}

/* Tab-like switching row for Farvardin, Ordibehesht, Khordad */
.month-detail-switcher {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.month-btn-tab {
  border: 1px solid var(--color-border);
  background-color: var(--color-surface);
  color: var(--color-text);
  padding: 10px 24px;
  border-radius: 50px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-soft);
}

.month-btn-tab:hover {
  border-color: var(--color-border-focus);
  transform: translateY(-2px);
}

.month-btn-tab.active {
  background-color: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 6px 20px rgba(var(--color-primary-rgb), 0.3);
}

/* Master Calendar container row width grid for Month Detail */
.month-detail-block {
  display: none; /* Controlled via JS */
  animation: fadeIn 0.5s ease-in-out forwards;
}

.month-detail-block.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

.large-month-calendar {
  height: 100%;
}

.month-detail-equal-row {
  --month-detail-panel-height: 620px;
}

.month-detail-equal-col {
  display: flex;
}

.month-detail-equal-col > .bento-card {
  width: 100%;
  height: var(--month-detail-panel-height);
  min-height: var(--month-detail-panel-height);
}

.month-occasion-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.large-month-header {
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 16px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Day grid for high fidelity calendar block */
.days-grid-large {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  padding: 0px 0;
}

.day-cell-large {
  min-height: 70px;
  border: 1px solid var(--color-border);
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.2s ease;
  cursor: pointer;
}

[data-theme="dark"] .day-cell-large {
  background-color: rgba(255, 255, 255, 0.02);
}

.day-cell-large:hover {
  background-color: var(--color-surface-soft);
  border-color: var(--color-border-focus);
  transform: scale(1.02);
}

.day-cell-large.holiday {
  border-color: rgba(239, 68, 68, 0.25);
  background-color: rgba(239, 68, 68, 0.04);
}

.day-cell-large.today {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  box-shadow: 0 4px 15px rgba(var(--color-primary-rgb), 0.3);
}

.day-cell-large.today .day-cell-num,
.day-cell-large.today .day-cell-sub {
  color: #ffffff !important;
}

/* Occasions timeline styled items */
.occasion-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding-left: 6px;
}

.timeline-item {
  display: flex;
  gap: 16px;
  padding: 12px;
  border-radius: var(--radius-md);
  background-color: var(--color-surface-soft);
  border-right: 4px solid var(--color-primary);
  transition: transform 0.2s ease;
}

.timeline-item:hover {
  transform: translateX(-5px);
  background-color: var(--color-surface-hover);
}

.timeline-item.holiday {
  border-right-color: var(--color-danger);
}


/* -------------------------------------------------------------
 * SECTION 3: FULL YEAR GRID
 * ------------------------------------------------------------- */
.year-grid-master {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.year-month-card {
  padding: 16px;
  position: relative;
}

.year-month-card .days-grid-mini {
  row-gap: 4px;
}

.year-month-card .day-cell {
  min-height: 44px;
  padding: 3px 2px;
  border-radius: 6px;
}

.year-month-card .day-cell-sub {
  gap: 7px;
  font-size: 0.6rem;
}

.year-month-compact-hdr {
  font-size: 0.95rem;
  font-weight: bold;
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
}

.year-month-sub-hdr {
  font-size: 0.65rem;
}

.year-month-holidays {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 5px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--color-border);
  color: var(--color-text-muted);
  font-size: 0.56rem;
  line-height: 1.75;
}

.year-month-holiday-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.year-month-holiday-item span {
  color: var(--color-danger);
  font-weight: 900;
}

.year-month-holiday-item strong {
  color: var(--color-text-muted);
  font-weight: 750;
}

.year-month-holiday-separator {
  color: rgba(var(--color-primary-rgb), 0.55);
  font-weight: 800;
}


/* -------------------------------------------------------------
 * SECTION 4: PDF DOWNLOAD / CALL TO ACTION
 * ------------------------------------------------------------- */
.download-prominent-card {
  all: ease;
  background: linear-gradient(135deg, rgba(var(--color-primary-rgb), 0.15) 0%, rgba(var(--color-secondary-rgb), 0.05) 100%), var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: 0 30px 60px -15px rgba(139, 92, 246, 0.2), var(--shadow-card);
}

.download-pattern-decor {
  position: absolute;
  top: 50%;
  left: 5%;
  transform: translateY(-50%);
  width: 280px;
  height: 280px;
  opacity: 0.12;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='%232266AF'%3E%3Cpath d='M50,0 C22.4,0 0,22.4 0,50 C0,77.6 22.4,100 50,100 C77.6,100 100,77.6 100,50 C100,22.4 77.6,0 50,0 Z M50,90 Q50,50 10,50 Q50,50 10,50 Q50,50 50,10 Q50,50 90,50 Q50,50 50,90 Z'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  pointer-events: none;
}

.btn-premium-action {
  background-color: var(--color-primary);
  color: #fff;
  border: none;
  font-weight: 600;
  border-radius: 50px;
  padding: 12px 30px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 20px rgba(var(--color-primary-rgb), 0.25);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.btn-premium-action:hover {
  background-color: var(--color-primary-hover);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(var(--color-primary-rgb), 0.35);
}

.btn-premium-gold {
  background-color: var(--color-secondary);
  box-shadow: 0 6px 20px rgba(var(--color-secondary-rgb), 0.25);
}

.btn-premium-gold:hover {
  background-color: var(--color-secondary-hover);
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(var(--color-secondary-rgb), 0.35);
}


/* -------------------------------------------------------------
 * 12. RESPONSIVE DESIGN - STRICT BREAKPOINTS and mobile stack
 * ------------------------------------------------------------- */

/* Tablet Optimization */
@media (max-width: 1200px) {
  .bento-dashboard-grid {
    grid-template-columns: minmax(300px, 0.85fr) minmax(540px, 1.35fr);
  }

  .bento-today-hero-card {
    grid-column: 1 / -1;
  }

  .bento-month-cal-card,
  .bento-month-events-card {
    grid-column: span 1;
  }

  .bento-month-cal-card {
    --mini-day-size: clamp(42px, 4.3vw, 50px);
  }

  .bento-month-cal-card.is-six-week-month {
    --mini-day-size: clamp(38px, 3.8vw, 44px);
  }

  .bento-month-cal-card .days-grid-mini {
    gap: 3px;
  }

  .bento-month-cal-card .day-cell {
    padding: 3px 4px;
  }

  .bento-month-cal-card .day-cell-num {
    font-size: 0.9rem;
  }

  .bento-month-cal-card .day-cell-sub {
    gap: 4px;
    font-size: 0.48rem;
  }

  .year-grid-master {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .bento-master-container {
    grid-template-columns: 100%;
  }
  
  .nav-rail {
    flex-direction: row;
    min-height: auto;
    width: 100%;
    position: static;
    padding: 12px 20px;
    height: auto;
    border-radius: var(--radius-lg);
    justify-content: space-between;
  }
  
  .nav-rail-top {
    flex-direction: row;
    width: auto;
    gap: 16px;
  }
  
  .nav-rail-menu {
    flex-direction: row;
    width: auto;
    gap: 8px;
  }
  
  .nav-rail-bottom {
    flex-direction: row;
    width: auto;
    gap: 12px;
  }
  
  .nav-rail-item::before {
    display: none; /* Turn off tooltip side-pop on mobile view */
  }

  .bento-dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .bento-today-hero-card {
    grid-column: span 2;
  }

  .today-hero-content {
    grid-template-columns: minmax(0, 1fr) 170px;
  }
  
  .year-grid-master {
    grid-template-columns: repeat(2, 1fr);
  }

  .converter-layout,
  .year-data-list,
  .holiday-tools-panel {
    grid-template-columns: 100%;
  }

  .holiday-year-control {
    grid-template-columns: 100%;
  }

  .month-detail-equal-col {
    display: block;
  }

  .month-detail-equal-col > .bento-card {
    height: auto;
    min-height: 0;
  }

  .occasion-timeline {
    max-height: 520px;
  }

  .date-distance-header,
  .date-distance-grid {
    grid-template-columns: 100%;
  }
}

/* Mobile Screen optimization */
@media (max-width: 768px) {
  .container {
    width: min(100% - 20px, 1140px);
  }

  .hero-wrapper {
    padding: 24px 0 18px;
    overflow-x: clip;
  }

  .bento-master-container {
    gap: 12px;
    min-width: 0;
  }
  
  .nav-rail {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    scrollbar-width: none;
  }

  .nav-rail::-webkit-scrollbar {
    display: none;
  }

  .nav-rail-top,
  .nav-rail-menu,
  .nav-rail-bottom {
    flex: 0 0 auto;
  }
  
  .nav-rail-menu {
    flex-wrap: nowrap;
  }

  .nav-rail-item,
  .nav-action-btn {
    flex: 0 0 auto;
  }
  
  .bento-dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
  }

  #main-bento-grid > .bento-card {
    min-width: 0;
    padding: 14px;
    border-radius: 14px;
  }
  
  .bento-today-hero-card {
    grid-column: span 1;
  }

  .today-hero-content {
    grid-template-columns: 100%;
  }

  .today-clock-inline {
    min-height: auto;
    padding-inline-start: 0;
    padding-top: 14px;
    transform: none;
    border-inline-start: 0;
    border-top: 1px solid var(--color-border);
  }

  .live-clock-pill {
    margin-inline-end: 0;
    min-width: auto;
  }

  .bento-month-cal-card {
    grid-column: span 1;
    justify-self: stretch;
    width: 100% !important;
    max-width: 100%;
    max-height: none !important;
    --mini-day-size: clamp(44px, 12vw, 56px) !important;
  }

  .bento-month-events-card {
    grid-column: span 1;
  }

  .cal-header-mini {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 8px;
  }

  .mini-month-title-stack {
    min-width: 0;
  }

  .mini-month-title-stack h6 {
    font-size: clamp(1rem, 5vw, 1.35rem);
  }

  .mini-year-jump-btn {
    min-height: 24px;
    padding: 3px 8px;
    font-size: 0.62rem;
  }

  .weekday-row,
  .days-grid-mini {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .bento-month-cal-card .days-grid-mini {
    gap: 3px;
  }

  .day-cell {
    min-width: 0;
  }

  .bento-month-cal-card .day-cell {
    padding: 3px 2px;
  }

  .bento-month-cal-card .day-cell-num {
    font-size: 0.88rem;
  }

  .bento-month-cal-card .day-cell-sub {
    gap: 4px;
    font-size: 0.48rem;
  }

  .mini-selected-day-panel .bento-card-header,
  .bento-month-events-card .bento-card-header {
    gap: 8px;
    align-items: flex-start;
  }

  .bento-card-title {
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .mini-month-events-list {
    grid-template-columns: 100%;
    max-height: none;
  }

  .converter-date-fields {
    grid-template-columns: 100%;
  }

  .date-distance-card {
    padding: 14px;
  }

  .date-distance-fields {
    grid-template-columns: 100%;
  }

  .year-data-item {
    grid-template-columns: 100%;
    height: auto;
  }
  
  .year-grid-master {
    grid-template-columns: 100%;
  }

  .year-data-list {
    grid-template-columns: minmax(0, 1fr);
    max-height: min(560px, 70vh);
  }

  .my-event-item,
  .year-data-item,
  .date-distance-card,
  .download-prominent-card {
    min-width: 0;
  }
  
  .month-detail-block th, .month-detail-block td {
    padding: 6px 2px;
  }
  
  .day-cell-large {
    min-height: 52px;
    padding: 4px;
  }
  
  .day-cell-large .day-cell-num {
    font-size: 0.85rem;
  }
  
  .day-cell-large .day-cell-sub {
    font-size: 0.55rem;
  }
  
  .btn-premium-action {
    width: 100%;
    justify-content: center;
    margin-bottom: 12px;
  }
}

/* Local Bootstrap subset used by the imported template. */
.container { width: min(100% - 32px, 1140px); margin-inline: auto; }
.row { display: flex; flex-wrap: wrap; margin-inline: -12px; }
.row > * { padding-inline: 12px; }
.g-2 { gap: 0.5rem 0; }
.col-6 { width: 50%; }
.col-lg-5, .col-lg-7 { width: 100%; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.d-block { display: block; }
.d-none { display: none; }
.flex-column { flex-direction: column; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.text-center { text-align: center; }
.text-start { text-align: right; }
.text-lg-end { text-align: left; }
.position-relative { position: relative; }
.z-3 { z-index: 3; }
.overflow-hidden { overflow: hidden; }
.m-0 { margin: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.my-4 { margin-block: 1.5rem; }
.mx-auto { margin-inline: auto; }
.me-1 { margin-left: 0.25rem; }
.ms-1 { margin-right: 0.25rem; }
.ms-2 { margin-right: 0.5rem; }
.p-0 { padding: 0; }
.p-5 { padding: 3rem; }
.px-2 { padding-inline: 0.5rem; }
.px-3 { padding-inline: 1rem; }
.px-4 { padding-inline: 1.5rem; }
.py-1 { padding-block: 0.25rem; }
.py-2 { padding-block: 0.5rem; }
.py-3 { padding-block: 1rem; }
.py-5 { padding-block: 3rem; }
.pt-1 { padding-top: 0.25rem; }
.pt-3 { padding-top: 1rem; }
.pb-5 { padding-bottom: 3rem; }
.ps-3 { padding-right: 1rem; }
.w-100 { width: 100%; }
.fw-light { font-weight: 300; }
.fw-bold { font-weight: 700; }
.lead { font-size: 1.12rem; line-height: 1.9; }
.display-5 { font-size: clamp(2.25rem, 5vw, 3rem); line-height: 1.25; }
.display-6 { font-size: clamp(1.75rem, 4vw, 2.5rem); line-height: 1.3; }
.text-uppercase { text-transform: uppercase; }
.letter-spacing-1 { letter-spacing: 1px; }
.text-muted { color: var(--color-text-muted) !important; }
.text-color { color: var(--color-text) !important; }
.text-white { color: #fff !important; }
.text-primary { color: var(--color-primary) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-success { color: var(--color-success) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-secondary { color: var(--color-text-muted) !important; }
.bg-light { background: var(--color-surface-soft) !important; }
.bg-primary { background: var(--color-primary) !important; }
.bg-danger { background: var(--color-danger) !important; }
.bg-success { background: var(--color-success) !important; }
.bg-warning-subtle { background: rgba(var(--color-secondary-rgb), 0.12) !important; }
.bg-primary-subtle { background: rgba(var(--color-primary-rgb), 0.12) !important; }
.bg-danger-subtle { background: rgba(var(--color-danger-rgb), 0.12) !important; }
.bg-secondary-subtle { background: rgba(100, 116, 139, 0.12) !important; }
.text-dark { color: var(--color-text) !important; }
.border { border: 1px solid var(--color-border) !important; }
.border-top { border-top: 1px solid var(--color-border) !important; }
.border-start { border-right: 1px solid var(--color-primary) !important; }
.border-primary { border-color: var(--color-primary) !important; }
.rounded-pill { border-radius: 999px; }
.rounded-md { border-radius: var(--radius-md); }
.badge { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 700; }
.btn { border: 0; cursor: pointer; text-decoration: none; }
.btn-link { background: transparent; color: var(--color-primary); }
.btn-sm { font-size: 0.85rem; }
.btn-primary { background: var(--color-primary); color: #fff; }
.form-control { width: 100%; color: var(--color-text); outline: none; }
.form-control-sm { font-size: 0.9rem; }
.border-0 { border: 0; }
.bg-transparent { background: transparent; }
.shadow-soft { box-shadow: var(--shadow-soft); }
.font-size-sm { font-size: 0.86rem; }
.font-size-xs, .text-xs { font-size: 0.74rem; }
.small { font-size: 0.86rem; line-height: 1.8; }
.alert { border: 1px solid var(--color-border); }
.alert-success { background: rgba(var(--color-success-rgb), 0.1); color: var(--color-success); }
.spinner-border { display: inline-block; width: 1rem; height: 1rem; border: 2px solid currentColor; border-left-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Minimal local icon fallback for Bootstrap Icons. */
.bi::before { display: inline-block; font-style: normal; line-height: 1; }
.bi-sparkles::before { content: "*"; }
.bi-sun-fill::before { content: "☀"; }
.bi-moon-stars::before, .bi-moon-fill::before { content: "☾"; }
.bi-lightning-charge::before { content: "⚡"; }
.bi-window-sidebar::before { content: "▣"; }
.bi-house-door-fill::before { content: "⌂"; }
.bi-calendar3::before { content: "□"; }
.bi-calendar-check::before { content: "▣"; }
.bi-bookmark-star::before { content: "★"; }
.bi-arrow-left-right::before, .bi-arrow-repeat::before { content: "↔"; }
.bi-calendar2-range::before { content: "◫"; }
.bi-journal-text::before { content: "☷"; }
.bi-x-lg::before { content: "×"; }
.bi-bell::before { content: "◦"; }
.bi-gear::before { content: "⚙"; }
.bi-clock::before { content: "◷"; }
.bi-geo-alt-fill::before { content: "⌖"; }
.bi-brightness-alt-high::before { content: "☼"; }
.bi-pin-angle::before { content: "⌙"; }
.bi-sliders::before { content: "≡"; }
.bi-chevron-right::before { content: "›"; }
.bi-chevron-left::before { content: "‹"; }
.bi-arrow-left::before { content: "←"; }
.bi-circle-fill::before { content: "●"; }
.bi-download::before { content: "⇩"; }
.bi-file-pdf::before, .bi-file-earmark-pdf::before { content: "PDF"; font-size: 0.7em; }
.bi-shield-check-fill::before, .bi-check-circle-fill::before { content: "✓"; }

.day-cell-empty { min-height: 44px; }
.day-cell.selected, .day-cell-large.selected { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.calendar-loading, .calendar-empty { padding: 24px; text-align: center; color: var(--color-text-muted); border: 1px dashed var(--color-border); border-radius: var(--radius-md); }
.brand-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.12);
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.24);
  color: var(--color-primary);
}

.brand-avatar::before {
  display: none;
}

.brand-avatar-svg {
  width: 34px;
  height: 34px;
  display: block;
  fill: currentColor;
}

.brand-avatar-svg-cut {
  fill: var(--color-bg-main);
}

[data-theme="dark"] .brand-avatar {
  background: rgba(var(--color-primary-rgb), 0.16);
}

@media (min-width: 768px) {
  .d-md-block { display: block; }
}

@media (min-width: 992px) {
  .col-lg-5 { width: 41.666%; }
  .col-lg-7 { width: 58.333%; }
  .mb-lg-0 { margin-bottom: 0; }
  .text-lg-end { text-align: left; }
  .text-lg-start { text-align: right; }
}

h6#mini-month-title {
    font-size: 23px;
}

button#btn-view-all-occasions {
    font-size: 10px;
}

/* Bootstrap Icons are rendered locally as inline SVG by local-bootstrap-icons.js. */
.bi::before {
  content: none !important;
}

.bi-svg,
svg.bi {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  flex: 0 0 auto;
}

.nav-rail-item .bi,
.nav-action-btn .bi {
  font-size: 1.1rem;
  transition: transform 0.2s ease;
}

.nav-rail-item:hover .bi {
  transform: scale(1.1);
}

.bento-card-title .bi,
.mini-year-jump-btn .bi,
.cal-nav-btn .bi,
.btn .bi,
.pill-badge .bi,
.date-chip .bi {
  font-size: 1em;
}
span.badge.bg-light.text-dark.rounded-pill {
    padding: 10px;
}
a.inline-flex.items-center.justify-center.rounded-lg.border.border-primary-500\/35.bg-primary-500\/12.px-4.py-2.font-bold.text-primary-300.transition-colors.hover\:border-primary-400.hover\:bg-primary-500\/20.hover\:text-white {
    background: var(--color-surface-soft);
}

@media (max-width: 768px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  .hero-wrapper .container,
  .section-wrapper .container {
    width: min(100% - 20px, 1140px);
    padding-inline: 0;
  }

  .bento-master-container,
  .bento-dashboard-grid,
  .year-grid-master,
  .month-detail-block,
  .large-month-calendar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .bento-dashboard-grid.hero-view-calendar .bento-month-cal-card,
  .bento-month-cal-card,
  .year-month-card,
  .large-month-calendar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    overflow-x: hidden;
  }

  .bento-month-cal-card {
    --mini-day-size: clamp(38px, 10.3vw, 48px) !important;
    padding-inline: 10px !important;
  }

  .cal-header-mini {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    align-items: center;
  }

  .mini-month-title-stack {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .calendar-title-stack,
  .calendar-title-sub {
    max-width: 100%;
  }

  .weekday-row,
  .days-grid-mini,
  .days-grid-large {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .days-grid-mini,
  .days-grid-large {
    gap: 4px;
  }

  .day-cell,
  .day-cell-empty,
  .day-cell-large {
    min-width: 0;
    overflow: hidden;
  }

  .year-month-card {
    padding: 12px;
  }

  .year-month-card .day-cell {
    min-height: clamp(36px, 9vw, 42px);
    padding: 3px 1px;
  }

  .day-cell-large {
    min-height: clamp(42px, 11vw, 52px);
    padding: 4px 2px;
    border-radius: 10px;
  }

  .day-cell-num,
  .day-cell-large .day-cell-num {
    font-size: clamp(0.74rem, 3.2vw, 0.9rem);
  }

  .day-cell-sub,
  .year-month-card .day-cell-sub,
  .day-cell-large .day-cell-sub {
    gap: 3px;
    font-size: clamp(0.42rem, 1.7vw, 0.52rem);
    line-height: 1.1;
  }
}

@media (max-width: 430px) {
  .bento-month-cal-card {
    --mini-day-size: clamp(34px, 9.4vw, 42px) !important;
    padding-inline: 8px !important;
  }

  .days-grid-mini,
  .days-grid-large {
    gap: 3px;
  }

  .year-month-card {
    padding: 10px;
  }

  .year-month-card .day-cell,
  .day-cell-large {
    border-radius: 9px;
  }
}
/* Right side header group */
header .flex.items-center.gap-4 {
    gap: 1.25rem;
}

@media (max-width: 992px) {
    header nav {
        display: none; /* در تبلت و موبایل لینک‌ها مخفی بشن یا منو موبایل فعال بشه */
    }
}

/* مخفی کردن بخش سمت راست هدر در موبایل */
@media (max-width: 767px) {
  header .flex.items-center.gap-3 {
    display: none !important;
  }
}
@media (max-width: 767px) {
  header .container {
    justify-content: space-between;
  }
  #mobile-menu-btn {
    order: 2; /* یا هر ترتیبی که نیاز دارید */
  }
}

/* استایل دکمه Theme Switch در منوی موبایل */
#mobile-menu .theme-switch-container {
    background: rgba(var(--color-primary-rgb), 0.12);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
    border-radius: 50px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

#mobile-menu .theme-switch-container:hover {
    border-color: var(--color-border-focus);
    box-shadow: var(--shadow-glow);
}

#mobile-menu .theme-switch-track {
    width: 48px;
    height: 24px;
}

#mobile-menu .theme-switch-knob {
    width: 18px;
    height: 18px;
    top: 3px;
    right: 3px;
}

[data-theme="dark"] #mobile-menu .theme-switch-knob {
    transform: translateX(-24px);
}

#mobile-menu .theme-switch-container {
    margin-bottom: 0.5rem;
}

#mobile-menu {
    background: var(--color-bg-main); /* یا var(--color-bg-main) با opacity */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* لینک‌های داخل منو */
#mobile-menu .mobile-link {
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    transition: color 0.3s ease, border-color 0.3s ease;
    background-color: var(--color-primary);
}
#mobile-menu .mobile-link:hover {
    color: var(--color-primary-dark);
}

/* دکمه بستن منو */
#mobile-menu .mobile-menu-close {
    color: var(--color-text);
    background-color: var(--color-primary);

}
#mobile-menu .mobile-menu-close:hover {
    color: var(--color-primary);
}

/* پنل داخلی منو (در صورت وجود) */
#mobile-menu .mobile-menu-panel {
    background: var(--color-bg-main); /* یا هر تنظیم دلخواه */
}
#mobile-menu,
#mobile-menu * {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, fill 0.3s ease;
}
footer.glass.py-12.px-4.border-t.border-white\/5 {
    padding-block: 0px;
}
p.text-neutral-500.text-sm.whitespace-nowrap {
    color: var(--color-text-muted);
}
.absolute.right-0.top-0.z-20.flex.h-8.w-8.items-center.justify-center.rounded-full.border-2.border-dark-bg.text-xs.font-black.text-white.shadow-lg.shadow-primary-600\/25 {
    border-color: var(--primary);
}