/* مِسار — design tokens (palette + fonts from the ui-ux-pro-max productivity/education set) */
:root {
  --font-body: 'IBM Plex Sans Arabic', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-head: 'Almarai', var(--font-body);

  --primary: #0F766E;
  --primary-hover: #115E59;
  --primary-bright: #0D9488;
  --primary-soft: #E4F2EF;
  --accent: #C2410C;
  --accent-bright: #EA580C;
  --accent-soft: #FDF0E7;

  --bg: #F5F6F4;
  --bg-glow: radial-gradient(ellipse 70% 55% at 85% -10%, rgba(13,148,136,.20), transparent 62%),
             radial-gradient(ellipse 60% 45% at 5% 0%, rgba(234,88,12,.10), transparent 60%);
  --surface: #FFFFFF;
  --surface-2: #F1F3F1;
  --surface-3: #E9ECE9;
  --border: #E2E6E3;
  --border-strong: #CBD3CE;
  --text: #12211F;
  --text-muted: #5E7370;
  --text-faint: #8A9C99;

  --success: #15803D;
  --success-soft: #E7F5EC;
  --warning: #B45309;
  --warning-soft: #FCF1E2;
  --danger: #B42318;
  --danger-soft: #FBEAE8;

  --r-xs: 8px; --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-full: 999px;
  --sh-1: 0 1px 2px rgba(16,32,30,.06), 0 1px 3px rgba(16,32,30,.04);
  --sh-2: 0 4px 14px rgba(16,32,30,.07);
  --sh-3: 0 14px 40px rgba(16,32,30,.12);
  --icon-sm: 16px; --icon-md: 20px; --icon-lg: 24px;
  --ease: cubic-bezier(.16,1,.3,1);
  --t-fast: 150ms var(--ease);
  --t: 220ms var(--ease);
}

body[data-theme='dark'] {
  --primary: #2DD4BF;
  --primary-hover: #5EEAD4;
  --primary-bright: #14B8A6;
  --primary-soft: #10312E;
  --accent: #FB923C;
  --accent-bright: #F97316;
  --accent-soft: #33231A;
  --bg: #080F0E;
  --bg-glow: radial-gradient(ellipse 70% 55% at 85% -10%, rgba(45,212,191,.16), transparent 62%),
             radial-gradient(ellipse 60% 45% at 5% 0%, rgba(249,115,22,.10), transparent 60%);
  --surface: #101B1A;
  --surface-2: #162321;
  --surface-3: #1D2C2A;
  --border: #22332F;
  --border-strong: #33473F;
  --text: #E9F3F1;
  --text-muted: #9DB3AF;
  --text-faint: #77908C;
  --success: #4ADE80; --success-soft: #0E2A1C;
  --warning: #FBBF24; --warning-soft: #2E2410;
  --danger: #F87171; --danger-soft: #2E1616;
  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 4px 16px rgba(0,0,0,.45);
  --sh-3: 0 18px 48px rgba(0,0,0,.6);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t), color var(--t);
}
.app-glow { position: fixed; inset: 0; background: var(--bg-glow); pointer-events: none; z-index: 0; }

/* ── Typography ── */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 800; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 3.4vw, 2.05rem); }
h2 { font-size: clamp(1.15rem, 2.2vw, 1.4rem); }
h3 { font-size: 1.02rem; }
p { color: var(--text-muted); }
a { color: var(--primary); }
strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }

.ico { width: var(--icon-md); height: var(--icon-md); stroke: currentColor; fill: none;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-sm { width: var(--icon-sm); height: var(--icon-sm); }
.ico-lg { width: var(--icon-lg); height: var(--icon-lg); }

/* ── Layout ── */
.view, .footer, .topbar, .tabbar { position: relative; z-index: 1; }
.view { max-width: 1180px; margin: 0 auto; padding: 1.75rem 1.25rem 4rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row { display: flex; align-items: center; gap: .6rem; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.spacer { flex: 1; }
.hidden { display: none !important; }

/* ── Topbar ── */
.topbar {
  position: sticky; top: 0; z-index: 20; height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 clamp(1rem, 3vw, 2rem);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: .65rem; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(140deg, var(--primary-bright), var(--primary));
  color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 35%, transparent);
}
.brand-mark .ico { width: 21px; height: 21px; stroke-width: 2; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-head); font-size: 1.12rem; letter-spacing: 0; }
.brand-text small { font-size: .7rem; color: var(--text-faint); font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: .35rem; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; padding: .55rem 1.15rem; border: 1px solid transparent;
  border-radius: var(--r-full); font-family: var(--font-body); font-size: .88rem; font-weight: 600;
  cursor: pointer; background: transparent; color: var(--text);
  transition: transform var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast), opacity var(--t-fast);
}
.btn:active:not(:disabled) { transform: scale(.975); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 5px 16px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); transform: translateY(-1px); }
body[data-theme='dark'] .btn-primary { color: #04211D; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: var(--accent-bright); transform: translateY(-1px); }
.btn-ghost { border-color: var(--border-strong); background: var(--surface); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--primary); color: var(--primary); }
.btn-quiet { color: var(--text-muted); }
.btn-quiet:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-sm { min-height: 34px; padding: .25rem .7rem; font-size: .8rem; }
.btn-block { width: 100%; }

.icon-btn {
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-muted);
  cursor: pointer; transition: all var(--t-fast);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn:active { transform: scale(.94); }
.icon-btn.danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); background: var(--danger-soft); }
.ico-moon { display: none; }
body[data-theme='dark'] .ico-sun { display: none; }
body[data-theme='dark'] .ico-moon { display: block; }

:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--r-xs);
}

/* ── Tabbar ── */
.tabbar {
  position: sticky; top: 62px; z-index: 15;
  display: flex; gap: .3rem; padding: .5rem clamp(.75rem, 3vw, 2rem);
  overflow-x: auto; scrollbar-width: none;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
.tabbar::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: .45rem; white-space: nowrap;
  min-height: 40px; padding: .35rem .9rem; border-radius: var(--r-full);
  border: 1px solid transparent; background: transparent; color: var(--text-muted);
  font-family: var(--font-body); font-size: .86rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast);
}
.tab:hover { background: var(--surface); color: var(--text); }
.tab[aria-current='page'] { background: var(--primary); color: #fff; border-color: var(--primary); }
body[data-theme='dark'] .tab[aria-current='page'] { color: #04211D; }
.tab .ico { width: var(--icon-sm); height: var(--icon-sm); }

/* ── Cards ── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--sh-1); padding: 1.15rem;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--border-strong); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .9rem; }
.card-title { display: flex; align-items: center; gap: .5rem; font-family: var(--font-head); font-weight: 800; font-size: .98rem; }
.card-title .ico { color: var(--primary); width: 18px; height: 18px; }
.card-sub { font-size: .78rem; color: var(--text-faint); font-weight: 600; }

.kpi { display: flex; flex-direction: column; gap: .35rem; }
.kpi-value { font-family: var(--font-head); font-size: clamp(1.5rem, 3.6vw, 1.95rem); font-weight: 800; letter-spacing: -.02em; }
.kpi-label { font-size: .78rem; color: var(--text-muted); font-weight: 600; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.kpi-ico.accent { background: var(--accent-soft); color: var(--accent); }
.kpi-ico.ok { background: var(--success-soft); color: var(--success); }
.kpi-ico.warn { background: var(--warning-soft); color: var(--warning); }
.kpi-ico.bad { background: var(--danger-soft); color: var(--danger); }

/* ── Badges & chips ── */
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .55rem;
  border-radius: var(--r-full); font-size: .72rem; font-weight: 700; line-height: 1.7;
  background: var(--surface-3); color: var(--text-muted); white-space: nowrap;
}
.badge .ico { width: 13px; height: 13px; }
.badge.primary { background: var(--primary-soft); color: var(--primary); }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.dot-chip { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.course-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .78rem; font-weight: 600; color: var(--text-muted); }

/* ── Progress ── */
.bar { height: 8px; border-radius: var(--r-full); background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-full); background: var(--primary); transition: width var(--t); }
.bar.accent > i { background: var(--accent-bright); }
.bar.bad > i { background: var(--danger); }
.bar.ok > i { background: var(--success); }
.bar.thick { height: 12px; }

/* ── Forms ── */
label { display: flex; flex-direction: column; gap: .35rem; font-size: .78rem; font-weight: 700; color: var(--text-muted); }
input, select, textarea {
  width: 100%; min-height: 44px; padding: .5rem .8rem;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  color: var(--text); font-family: var(--font-body); font-size: .92rem; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
select { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%); background-position: calc(0% + 14px) 50%, calc(0% + 19px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-inline-start: 2.1rem; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
input.invalid, select.invalid { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: .76rem; font-weight: 600; margin-top: .1rem; }
.form-grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { flex-direction: row; align-items: center; gap: .5rem; font-size: .85rem; color: var(--text); cursor: pointer; }
.check input { width: 20px; height: 20px; min-height: 20px; accent-color: var(--primary); cursor: pointer; }

/* ── Table ── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: start; padding: .7rem .8rem; font-size: .74rem; font-weight: 700; color: var(--text-muted);
  background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: .6rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: var(--surface-2); }
tfoot td { background: var(--surface-2); font-weight: 700; border-top: 1px solid var(--border); }

/* ── List rows ── */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex; align-items: center; gap: .75rem; padding: .7rem .3rem;
  border-bottom: 1px solid var(--border); transition: background var(--t-fast);
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--surface-2); }
.list-main { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.list-title { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; }
.list-meta { font-size: .76rem; color: var(--text-faint); display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.done .list-title { text-decoration: line-through; color: var(--text-faint); }

/* ── Modal ── */
.overlay {
  position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1rem;
  background: rgba(8,20,18,.55); backdrop-filter: blur(5px); animation: fade .2s var(--ease);
}
.modal {
  width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--sh-3); padding: 1.4rem; animation: pop .28s var(--ease);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; }
.modal-head h3 { font-size: 1.08rem; }
.modal-head p { font-size: .8rem; margin-top: .15rem; }
.modal-actions { display: flex; gap: .5rem; justify-content: flex-start; margin-top: 1.35rem; }

/* ── Toast ── */
.toast-wrap { position: fixed; inset-inline-end: 1.25rem; bottom: 1.25rem; z-index: 90; display: flex; flex-direction: column; gap: .5rem; }
.toast {
  display: flex; align-items: center; gap: .55rem; padding: .7rem 1rem; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--border-strong); box-shadow: var(--sh-3);
  font-size: .86rem; font-weight: 600; max-width: 320px; animation: slideIn .28s var(--ease);
}
.toast.ok { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); color: var(--success); }
.toast.err { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); color: var(--danger); }
.toast.info { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); color: var(--primary); }

/* ── Empty / callout ── */
.empty { text-align: center; padding: 2.25rem 1rem; color: var(--text-faint); }
.empty-mark { display: grid; place-items: center; width: 52px; height: 52px; margin: 0 auto .75rem;
  border-radius: 50%; background: var(--surface-2); color: var(--text-faint); }
.empty h4 { color: var(--text); font-size: .96rem; margin-bottom: .2rem; }
.empty p { font-size: .84rem; max-width: 340px; margin: 0 auto; }
.callout { display: flex; gap: .7rem; padding: .85rem 1rem; border-radius: var(--r-sm); font-size: .85rem; align-items: flex-start; }
.callout .ico { margin-top: .15rem; }
.callout.info { background: var(--primary-soft); color: var(--primary); }
.callout.warn { background: var(--warning-soft); color: var(--warning); }
.callout.bad { background: var(--danger-soft); color: var(--danger); }
.callout strong { display: block; }
.callout span { color: inherit; opacity: .88; }

/* ── Page header ── */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head p { font-size: .88rem; max-width: 60ch; }
.eyebrow { display: inline-flex; align-items: center; gap: .35rem; font-size: .74rem; font-weight: 700; color: var(--primary);
  text-transform: uppercase; letter-spacing: .09em; margin-bottom: .35rem; }
.section-title { display: flex; align-items: center; gap: .5rem; font-family: var(--font-head); font-weight: 800; font-size: 1.02rem; margin-bottom: .8rem; }
.section-title .ico { color: var(--primary); width: 18px; height: 18px; }

/* ── Hero ── */
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: clamp(1.25rem, 3vw, 2rem);
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 92%, #000), var(--primary-bright));
  color: #fff; box-shadow: var(--sh-2); margin-bottom: 1.5rem;
}
body[data-theme='dark'] .hero { background: linear-gradient(135deg, #0B2E2B, #114A44); }
.hero::after { content: ''; position: absolute; inset-inline-start: -60px; top: -70px; width: 230px; height: 230px;
  border-radius: 50%; background: rgba(255,255,255,.09); }
.hero-inner { position: relative; z-index: 1; display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.hero h1 { color: #fff; margin-bottom: .3rem; }
.hero p { color: rgba(255,255,255,.82); font-size: .92rem; max-width: 46ch; }
.hero-stats { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.hero-stat b { display: block; font-family: var(--font-head); font-size: 1.5rem; font-weight: 800; }
.hero-stat span { font-size: .76rem; color: rgba(255,255,255,.75); }

/* ── Schedule grid ── */
.sched { display: grid; gap: .6rem; }
.sched-grid { display: grid; grid-template-columns: 62px repeat(5, minmax(0, 1fr)); gap: .4rem; min-width: 620px; }
.sched-scroll { overflow-x: auto; padding-bottom: .25rem; }
.sched-head { font-size: .78rem; font-weight: 700; text-align: center; padding: .45rem .2rem; border-radius: var(--r-xs);
  background: var(--surface-2); color: var(--text-muted); }
.sched-head.today { background: var(--primary); color: #fff; }
body[data-theme='dark'] .sched-head.today { color: #04211D; }
.sched-time { font-size: .7rem; font-weight: 600; color: var(--text-faint); text-align: center; padding-top: .3rem; font-variant-numeric: tabular-nums; }
.sched-cell { border-radius: var(--r-xs); background: var(--surface-2); min-height: 46px; padding: .2rem; }
.sched-cell.today { background: color-mix(in srgb, var(--primary) 8%, var(--surface-2)); }
.slot {
  display: flex; flex-direction: column; gap: .1rem; padding: .35rem .45rem; border-radius: var(--r-xs);
  border-inline-start: 3px solid var(--slot, var(--primary)); background: var(--surface);
  box-shadow: var(--sh-1); min-height: 100%; cursor: pointer; border-top: none; border-inline-end: none; border-bottom: none;
  text-align: start; width: 100%; font-family: var(--font-body); transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.slot:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.slot b { font-size: .76rem; font-weight: 700; line-height: 1.35; }
.slot span { font-size: .67rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.slot.now { outline: 2px solid var(--accent-bright); outline-offset: 1px; }

/* ── Attendance / course cards ── */
.course-card { display: flex; flex-direction: column; gap: .7rem; }
.course-head { display: flex; align-items: flex-start; gap: .6rem; }
.course-name { font-family: var(--font-head); font-weight: 800; font-size: .96rem; }
.att-dials { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; text-align: center; }
.att-dial { background: var(--surface-2); border-radius: var(--r-sm); padding: .5rem .3rem; }
.att-dial b { display: block; font-family: var(--font-head); font-size: 1.08rem; font-weight: 800; }
.att-dial span { font-size: .68rem; color: var(--text-faint); font-weight: 600; }
.stepper { display: inline-flex; align-items: center; gap: .1rem; border: 1px solid var(--border-strong); border-radius: var(--r-full); overflow: hidden; }
.stepper button { width: 34px; height: 34px; display: grid; place-items: center; border: none; background: var(--surface);
  color: var(--text-muted); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.stepper button:hover { background: var(--surface-2); color: var(--primary); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }

/* ── Pomodoro ring ── */
.timer-wrap { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.ring { position: relative; width: 208px; height: 208px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 12; stroke-linecap: round; }
.ring .track { stroke: var(--surface-3); }
.ring .prog { stroke: var(--primary); transition: stroke-dashoffset .6s linear; }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; }
.ring-time { font-family: var(--font-head); font-size: 2.35rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.ring-label { font-size: .74rem; color: var(--text-faint); font-weight: 700; }

/* ── Mini bar chart ── */
.chart { display: flex; align-items: flex-end; gap: .45rem; height: 130px; padding-top: .5rem; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: .35rem; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 34px; border-radius: var(--r-xs) var(--r-xs) 3px 3px;
  background: linear-gradient(180deg, var(--primary-bright), var(--primary)); min-height: 4px;
  transition: height var(--t); position: relative; }
.chart-bar.today { background: linear-gradient(180deg, var(--accent-bright), var(--accent)); }
.chart-bar b { position: absolute; top: -17px; inset-inline: 0; text-align: center; font-size: .68rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.chart-x { font-size: .68rem; color: var(--text-faint); font-weight: 600; }

/* ── Skeleton ── */
.skeleton-page { display: flex; flex-direction: column; gap: 1rem; }
.skeleton { border-radius: var(--r-md); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.sk-lg { height: 150px; } .sk-card { height: 108px; } .sk-block { height: 260px; }

/* ── Footer ── */
.footer { border-top: 1px solid var(--border); padding: 1.5rem 1.25rem; text-align: center; }
.footer p { font-size: .78rem; color: var(--text-faint); }
.footer .dot { color: var(--accent-bright); }

/* ── Segmented filter ── */
.seg { display: inline-flex; gap: .2rem; padding: .2rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-full); flex-wrap: wrap; }
.seg button {
  min-height: 34px; padding: .2rem .75rem; border: none; border-radius: var(--r-full); background: transparent;
  color: var(--text-muted); font-family: var(--font-body); font-size: .8rem; font-weight: 600; cursor: pointer;
  transition: all var(--t-fast);
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--primary); box-shadow: var(--sh-1); }

/* ── Task checkbox ── */
.task-box {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border-strong); background: transparent;
  display: grid; place-items: center; cursor: pointer; flex: none; color: transparent; transition: all var(--t-fast);
}
.task-box:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.06); }
.task-box.on { background: var(--success); border-color: var(--success); color: #fff; }
.stat-inline { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.stat-inline > div b { font-family: var(--font-head); font-size: 1.12rem; font-weight: 800; display: block; }
.stat-inline > div span { font-size: .72rem; color: var(--text-faint); font-weight: 600; }

/* ── Animations ── */
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98) } to { opacity: 1; transform: none } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-16px) } to { opacity: 1; transform: none } }
@keyframes shimmer { from { background-position: 200% 0 } to { background-position: -200% 0 } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }
.view > * { animation: fadeUp .42s var(--ease) backwards; }
.view > *:nth-child(2) { animation-delay: .05s; }
.view > *:nth-child(3) { animation-delay: .1s; }
.view > *:nth-child(4) { animation-delay: .14s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .sched-grid { grid-template-columns: 52px repeat(5, minmax(88px, 1fr)); }
}
@media (max-width: 640px) {
  .view { padding: 1.25rem .85rem 3.5rem; }
  .brand-text small { display: none; }
  .hero-stats { gap: 1.1rem; }
  .card { padding: 1rem; }
  .modal { padding: 1.1rem; }
  .att-dials { grid-template-columns: repeat(3, 1fr); }
  .toast-wrap { inset-inline: .85rem; }
  .toast { max-width: none; }
}
@media (max-width: 420px) {
  .topbar { height: 58px; }
  .tabbar { top: 58px; }
}
