/* ============================================================================
   StudyNexus OS — premium design system (2026)
   Layer 2: loaded after styles.css. Adds tokens + components; never removes
   anything the base app already styles.
   ========================================================================== */

:root {
  --os-font: "Inter var", Inter, ui-sans-serif, system-ui, -apple-system,
    "Segoe UI", Roboto, "Noto Sans Devanagari", "Nirmala UI", "Kohinoor Devanagari",
    "Mangal", Arial, sans-serif;

  /* surfaces (light) */
  --os-bg: #f5f6fa;
  --os-surface: #ffffff;
  --os-surface-2: #f2f4f9;
  --os-surface-3: #e8ecf4;
  --os-line: rgba(15, 23, 42, .08);
  --os-line-2: rgba(15, 23, 42, .14);

  /* text */
  --os-text: #0c1322;
  --os-text-2: #55607a;
  --os-text-3: #737d95;

  /* accent + status */
  --os-accent: #4f5bd5;
  --os-accent-2: #7c5cff;
  --os-accent-soft: rgba(79, 91, 213, .10);
  --os-accent-line: rgba(79, 91, 213, .28);
  --os-ok: #0f8a4d;
  --os-ok-soft: rgba(15, 138, 77, .10);
  --os-warn: #a16207;
  --os-warn-soft: rgba(161, 98, 7, .12);
  --os-danger: #c0392b;
  --os-danger-soft: rgba(192, 57, 43, .10);
  --os-info: #0b6bcb;
  --os-info-soft: rgba(11, 107, 203, .10);

  /* radii */
  --os-r-xs: 8px;
  --os-r-sm: 11px;
  --os-r: 16px;
  --os-r-lg: 22px;
  --os-r-xl: 30px;

  /* spacing (4px scale) */
  --os-1: 4px; --os-2: 8px; --os-3: 12px; --os-4: 16px;
  --os-5: 20px; --os-6: 24px; --os-7: 32px; --os-8: 44px; --os-9: 60px;

  /* elevation */
  --os-sh-1: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --os-sh-2: 0 4px 14px rgba(15, 23, 42, .07), 0 1px 3px rgba(15, 23, 42, .04);
  --os-sh-3: 0 18px 44px rgba(15, 23, 42, .16), 0 2px 8px rgba(15, 23, 42, .06);

  /* motion */
  --os-ease: cubic-bezier(.2, .7, .3, 1);
  --os-dur: .18s;
  --os-dur-2: .32s;
}

html[data-theme="dark"] {
  --os-bg: #0a0c11;
  --os-surface: #12151d;
  --os-surface-2: #171b25;
  --os-surface-3: #1f2531;
  --os-line: rgba(255, 255, 255, .08);
  --os-line-2: rgba(255, 255, 255, .16);
  --os-text: #e9ecf4;
  --os-text-2: #a5adc2;
  --os-text-3: #7b8399;
  --os-accent: #8b96ff;
  --os-accent-2: #b39bff;
  --os-accent-soft: rgba(139, 150, 255, .14);
  --os-accent-line: rgba(139, 150, 255, .34);
  --os-ok: #3ddc84;
  --os-ok-soft: rgba(61, 220, 132, .13);
  --os-warn: #fbbf24;
  --os-warn-soft: rgba(251, 191, 36, .14);
  --os-danger: #ff7a70;
  --os-danger-soft: rgba(255, 122, 112, .14);
  --os-info: #6cc0ff;
  --os-info-soft: rgba(108, 192, 255, .13);
  --os-sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --os-sh-2: 0 6px 18px rgba(0, 0, 0, .45);
  --os-sh-3: 0 24px 60px rgba(0, 0, 0, .6);
}

html[data-theme="amoled"] {
  --os-bg: #000000;
  --os-surface: #08090d;
  --os-surface-2: #0e1015;
  --os-surface-3: #15181f;
  --os-line: rgba(255, 255, 255, .07);
  --os-line-2: rgba(255, 255, 255, .15);
  --os-text: #edf0f7;
  --os-text-2: #aab2c6;
  --os-text-3: #7f879b;
  --os-accent: #ff453a;
  --os-accent-2: #ff9f0a;
  --os-accent-soft: rgba(255, 59, 48, .15);
  --os-accent-line: rgba(255, 59, 48, .38);
  --os-ok: #4ade80;
  --os-warn: #fcd34d;
  --os-danger: #ff8a80;
  --os-info: #ff9f0a;
  --os-sh-1: 0 1px 2px rgba(0, 0, 0, .6);
  --os-sh-2: 0 6px 20px rgba(0, 0, 0, .7);
  --os-sh-3: 0 24px 64px rgba(0, 0, 0, .85);
}

html[data-theme="nothing"] {
  --os-bg: #0b0b0b;
  --os-surface: #121212;
  --os-surface-2: #191919;
  --os-surface-3: #222222;
  --os-line: rgba(255, 255, 255, .09);
  --os-line-2: rgba(255, 255, 255, .18);
  --os-text: #f0f0f0;
  --os-text-2: #adadad;
  --os-text-3: #838383;
  --os-accent: #d0d0d0;
  --os-accent-soft: rgba(255, 255, 255, .1);
  --os-accent-line: rgba(255, 255, 255, .3);
  --os-ok: #6ee7a8;
  --os-warn: #fcd34d;
  --os-danger: #ff8a80;
  --os-info: #9ad0ff;
}

/* ---------------------------------------------------------------- layout */
.os-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--os-6) var(--os-6) var(--os-9);
  display: flex;
  flex-direction: column;
  gap: var(--os-6);
  animation: os-in .34s var(--os-ease) both;
}
@keyframes os-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.os-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--os-4); flex-wrap: wrap; }
.os-greet { font-size: clamp(24px, 5.4vw, 34px); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 0; }
.os-greet-sub { color: var(--os-text-2); font-size: 14px; margin-top: 6px; }
.os-date { color: var(--os-text-3); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; }

.os-grid { display: grid; gap: var(--os-5); }
.os-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.os-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.os-grid-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }

/* ----------------------------------------------------------------- cards */
.os-card {
  background: var(--os-surface);
  border: 1px solid var(--os-line);
  border-radius: var(--os-r);
  box-shadow: var(--os-sh-1);
  transition: box-shadow var(--os-dur) var(--os-ease), transform var(--os-dur) var(--os-ease), border-color var(--os-dur) var(--os-ease);
}
.os-card:hover { box-shadow: var(--os-sh-2); }
.os-card--pad { padding: var(--os-5); }
.os-card--bare { background: none; border: 0; box-shadow: none; }
.os-card--bare:hover { box-shadow: none; }
.os-card--feature {
  border-radius: var(--os-r-lg);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--os-accent-soft), transparent 60%),
    var(--os-surface);
  border-color: var(--os-accent-line);
}
.os-card--quiet { background: var(--os-surface-2); box-shadow: none; }
.os-card--quiet:hover { box-shadow: none; }

.os-card-head { display: flex; align-items: center; gap: var(--os-3); padding: var(--os-4) var(--os-5); }
.os-card-title { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; }
.os-card-sub { color: var(--os-text-3); font-size: 12px; margin-top: 2px; }
.os-card-right { margin-left: auto; display: flex; align-items: center; gap: var(--os-2); }
.os-card-body { padding: 0 var(--os-5) var(--os-5); }

.os-eyebrow {
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  color: var(--os-text-3);
}

/* --------------------------------------------------------------- metrics */
.os-metric { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.os-metric-v { font-size: clamp(22px, 5vw, 30px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.os-metric-l { color: var(--os-text-3); font-size: 11.5px; font-weight: 600; }
.os-metric-d { font-size: 12px; font-weight: 700; }
.t-ok { color: var(--os-ok); } .t-warn { color: var(--os-warn); }
.t-danger { color: var(--os-danger); } .t-info { color: var(--os-accent); }
.t-mute { color: var(--os-text-2); }

/* --------------------------------------------------------------- buttons */
.os-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 15px; border-radius: var(--os-r-sm);
  border: 1px solid var(--os-line-2); background: var(--os-surface);
  color: var(--os-text); font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--os-dur) var(--os-ease), border-color var(--os-dur) var(--os-ease),
              transform .1s var(--os-ease), box-shadow var(--os-dur) var(--os-ease);
}
.os-btn:hover { background: var(--os-surface-2); border-color: var(--os-accent-line); }
.os-btn:active { transform: translateY(1px) scale(.99); }
.os-btn--primary {
  background: linear-gradient(135deg, var(--os-accent) 0%, var(--os-accent-2) 100%);
  border-color: transparent; color: #fff; box-shadow: 0 4px 14px var(--os-accent-soft);
}
html[data-theme="nothing"] .os-btn--primary { color: #0b0b0b; }
.os-btn--primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--os-accent) 0%, var(--os-accent-2) 100%); }
.os-btn--ghost { background: none; border-color: transparent; color: var(--os-text-2); }
.os-btn--ghost:hover { background: var(--os-surface-2); color: var(--os-text); }
.os-btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--os-r-xs); }
.os-btn--icon { width: 38px; padding: 0; }
.os-btn--block { width: 100%; }

/* --------------------------------------------------------- chips/badges */
.os-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: var(--os-surface-3); color: var(--os-text-2); border: 1px solid transparent;
}
.os-chip--ok { background: var(--os-ok-soft); color: var(--os-ok); }
.os-chip--warn { background: var(--os-warn-soft); color: var(--os-warn); }
.os-chip--danger { background: var(--os-danger-soft); color: var(--os-danger); }
.os-chip--info { background: var(--os-info-soft); color: var(--os-info); }
.os-chip--accent { background: var(--os-accent-soft); color: var(--os-accent); }

.os-prio { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 700; }
.os-prio-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.os-prio--critical .os-prio-dot { background: var(--os-danger); box-shadow: 0 0 0 3px var(--os-danger-soft); }
.os-prio--high .os-prio-dot { background: var(--os-warn); box-shadow: 0 0 0 3px var(--os-warn-soft); }
.os-prio--medium .os-prio-dot { background: var(--os-info); box-shadow: 0 0 0 3px var(--os-info-soft); }
.os-prio--low .os-prio-dot { background: var(--os-text-3); }

/* ------------------------------------------------------------- progress */
.os-bar { height: 6px; border-radius: 999px; background: var(--os-surface-3); overflow: hidden; }
.os-bar-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--os-accent), var(--os-accent-2)); transition: width .6s var(--os-ease); }

.os-ring { position: relative; display: grid; place-items: center; }
.os-ring svg { transform: rotate(-90deg); display: block; }
.os-ring-txt { position: absolute; text-align: center; }
.os-ring-v { font-size: 20px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.os-ring-l { font-size: 10.5px; color: var(--os-text-3); font-weight: 600; margin-top: 3px; }

/* ----------------------------------------------------------- task rows */
.os-task {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 13px; border-radius: var(--os-r-sm);
  background: var(--os-surface);
  border: 1px solid var(--os-line);
  transition: background var(--os-dur) var(--os-ease), border-color var(--os-dur) var(--os-ease), transform var(--os-dur) var(--os-ease);
}
.os-task:hover { border-color: var(--os-accent-line); transform: translateX(2px); }
.os-task--done { opacity: .55; }
.os-task--done .os-task-t { text-decoration: line-through; }
.os-task-t { font-size: 13.5px; font-weight: 600; line-height: 1.4; }
.os-task-m { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; font-size: 11.5px; color: var(--os-text-2); }
.os-check {
  width: 20px; height: 20px; border-radius: 7px; flex: none; cursor: pointer;
  border: 1.6px solid var(--os-line-2); background: var(--os-surface-2);
  display: grid; place-items: center; padding: 0; margin-top: 1px;
  transition: background var(--os-dur) var(--os-ease), border-color var(--os-dur) var(--os-ease), transform .12s var(--os-ease);
}
.os-check:hover { border-color: var(--os-accent); }
.os-check:active { transform: scale(.88); }
.os-check[aria-checked="true"] { background: var(--os-ok); border-color: var(--os-ok); }
.os-check svg { opacity: 0; transform: scale(.4); transition: all .18s var(--os-ease); }
.os-check[aria-checked="true"] svg { opacity: 1; transform: none; }

.os-group + .os-group { margin-top: var(--os-5); }
.os-group-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.os-group-t { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--os-text-2); }
.os-group-c { font-size: 11px; font-weight: 700; color: var(--os-text-3); }

/* ------------------------------------------------------------ empty/skel */
.os-empty { text-align: center; padding: var(--os-7) var(--os-5); }
.os-empty-i { font-size: 30px; }
.os-empty-t { font-weight: 700; font-size: 15px; margin-top: 8px; }
.os-empty-m { color: var(--os-text-2); font-size: 13px; margin-top: 5px; max-width: 420px; margin-inline: auto; line-height: 1.6; }

.os-skel { background: linear-gradient(90deg, var(--os-surface-2) 25%, var(--os-surface-3) 37%, var(--os-surface-2) 63%);
  background-size: 400% 100%; animation: os-shimmer 1.3s ease-in-out infinite; border-radius: var(--os-r-xs); }
@keyframes os-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.os-skel-line { height: 12px; margin-bottom: 8px; }
.os-skel-line.w60 { width: 60%; } .os-skel-line.w40 { width: 40%; } .os-skel-line.w80 { width: 80%; }

/* -------------------------------------------------------- command palette */
.os-palette-wrap {
  position: fixed; inset: 0; z-index: 300; display: grid; place-items: start center;
  padding: clamp(12px, 8vh, 90px) 16px 16px;
  background: rgba(8, 10, 16, .55);
  backdrop-filter: blur(6px) saturate(120%);
  animation: os-fade .16s var(--os-ease);
}
@keyframes os-fade { from { opacity: 0; } to { opacity: 1; } }
.os-palette {
  width: min(680px, 100%); max-height: 74vh; display: flex; flex-direction: column;
  background: var(--os-surface); border: 1px solid var(--os-line-2);
  border-radius: var(--os-r-lg); box-shadow: var(--os-sh-3); overflow: hidden;
  animation: os-pop .2s var(--os-ease);
}
@keyframes os-pop { from { opacity: 0; transform: translateY(-10px) scale(.985); } to { opacity: 1; transform: none; } }
.os-palette-in {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--os-line);
}
.os-palette-in input {
  flex: 1; border: 0; background: none; outline: none; color: var(--os-text);
  font: inherit; font-size: 15.5px;
}
.os-palette-in input::placeholder { color: var(--os-text-3); }
.os-palette-list { overflow-y: auto; padding: 8px; }
.os-palette-sec { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--os-text-3); }
.os-palette-i {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px;
  border-radius: var(--os-r-sm); border: 0; background: none; color: var(--os-text);
  font: inherit; font-size: 13.5px; text-align: left; cursor: pointer;
}
.os-palette-i[aria-selected="true"] { background: var(--os-accent-soft); }
.os-palette-i .os-pi-ico { width: 22px; text-align: center; font-size: 15px; flex: none; }
.os-palette-i .os-pi-sub { color: var(--os-text-3); font-size: 11.5px; margin-left: 6px; }
.os-palette-i .os-pi-k { margin-left: auto; font-size: 10.5px; color: var(--os-text-3); border: 1px solid var(--os-line-2); border-radius: 6px; padding: 1px 6px; }
.os-palette-i mark { background: var(--os-accent-soft); color: var(--os-accent); border-radius: 3px; padding: 0 1px; }
.os-palette-foot {
  display: flex; gap: 14px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--os-line);
  font-size: 11px; color: var(--os-text-3);
}
.os-kbd { border: 1px solid var(--os-line-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; font-size: 10.5px; font-weight: 700; }

/* ------------------------------------------------------------ quick add */
.os-fab {
  position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: calc(18px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 20px; border: 0; cursor: pointer; z-index: 120;
  background: linear-gradient(135deg, var(--os-accent) 0%, var(--os-accent-2) 100%);
  color: #fff; font-size: 26px; line-height: 1; display: grid; place-items: center;
  box-shadow: 0 10px 26px var(--os-accent-soft), var(--os-sh-2);
  transition: transform .16s var(--os-ease), box-shadow .16s var(--os-ease);
}
html[data-theme="nothing"] .os-fab { color: #0b0b0b; }
.os-fab:hover { transform: translateY(-2px) scale(1.03); }
.os-fab:active { transform: scale(.94); }
.os-fab--center {
  right: auto; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: 54px; height: 54px; border-radius: 18px;
}
.os-fab--center:hover { transform: translateX(-50%) translateY(-2px); }

.os-qa {
  position: fixed; z-index: 200; width: min(300px, calc(100vw - 32px));
  background: var(--os-surface); border: 1px solid var(--os-line-2);
  border-radius: var(--os-r-lg); box-shadow: var(--os-sh-3); padding: 8px;
  animation: os-pop .18s var(--os-ease);
}
.os-qa-i {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px;
  border: 0; background: none; border-radius: var(--os-r-sm); cursor: pointer;
  color: var(--os-text); font: inherit; font-size: 13.5px; font-weight: 600; text-align: left;
}
.os-qa-i:hover { background: var(--os-surface-2); }
.os-qa-i .os-qa-ico {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--os-accent-soft); font-size: 15px; flex: none;
}

/* -------------------------------------------------------- notifications */
.os-bell { position: relative; }
.os-bell-dot {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--os-danger); color: #fff;
  font-size: 10px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--os-surface);
}
.os-notif {
  position: fixed; z-index: 220; width: min(380px, calc(100vw - 24px)); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--os-surface); border: 1px solid var(--os-line-2);
  border-radius: var(--os-r-lg); box-shadow: var(--os-sh-3); overflow: hidden;
  animation: os-pop .18s var(--os-ease);
}
.os-notif-i { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--os-line); text-align: left; }
.os-notif-i:last-child { border-bottom: 0; }
.os-notif-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--os-surface-3); }
.os-notif-t { font-size: 13px; font-weight: 700; line-height: 1.35; }
.os-notif-m { font-size: 12px; color: var(--os-text-2); margin-top: 3px; line-height: 1.45; }
.os-notif-empty { padding: 28px 18px; text-align: center; color: var(--os-text-2); font-size: 13px; }

/* ---------------------------------------------------------- mobile bottom nav */
.os-botnav { display: none; }

@media (max-width: 820px) {
  .os-page { padding: var(--os-5) var(--os-4) 96px; gap: var(--os-5); }
  .os-grid-2, .os-grid-3, .os-grid-main { grid-template-columns: minmax(0, 1fr); }
  .os-card--pad { padding: var(--os-4); }
  .os-card-head { padding: var(--os-4); }
  .os-card-body { padding: 0 var(--os-4) var(--os-4); }

  .os-botnav {
    display: grid; grid-template-columns: repeat(4, 1fr); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
    background: color-mix(in srgb, var(--os-surface) 92%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid var(--os-line);
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  }
  .os-botnav-i {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: 0; font: inherit; font-size: 10px; font-weight: 600;
    color: var(--os-text-3); text-decoration: none; padding: 4px 2px; border-radius: 10px;
  }
  .os-botnav-i.on { color: var(--os-accent); }
  .os-botnav-i span:first-child { font-size: 19px; line-height: 1.1; }
  /* floating center Add button — bottom nav ke theek upar */
  .os-fab {
    left: 50%; right: auto; transform: translateX(-50%);
    bottom: calc(70px + env(safe-area-inset-bottom));
    width: 54px; height: 54px; border-radius: 18px; font-size: 24px;
  }
  .os-fab:hover { transform: translateX(-50%) translateY(-2px); }
  .os-fab:active { transform: translateX(-50%) scale(.94); }
}

@media (prefers-reduced-motion: reduce) {
  .os-page, .os-palette, .os-palette-wrap, .os-qa, .os-notif { animation: none; }
  .os-card:hover, .os-task:hover, .os-fab:hover { transform: none; }
  .os-skel { animation: none; }
}

/* Analyzer ka apna mobile bottom nav — ab OS bottom nav hai, double bar na bane */
.an-botnav { display: none !important; }
.an-page { padding-bottom: 96px !important; }

/* ------------------------------------------------------------------ tabs */
.os-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--os-surface-2); }
.os-tab {
  border: 0; background: none; cursor: pointer; font: inherit; font-size: 12.5px; font-weight: 650;
  color: var(--os-text-2); padding: 7px 13px; border-radius: 9px; white-space: nowrap;
  transition: background var(--os-dur) var(--os-ease), color var(--os-dur) var(--os-ease);
}
.os-tab:hover { color: var(--os-text); }
.os-tab.on { background: var(--os-surface); color: var(--os-accent); box-shadow: var(--os-sh-1); }

/* -------------------------------------------------------- task calendar */
.os-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.os-cal-head { text-align: center; font-size: 10.5px; font-weight: 800; color: var(--os-text-3); padding-bottom: 2px; }
.os-cal-cell {
  min-height: 88px; border-radius: var(--os-r-sm); border: 1px solid var(--os-line);
  background: var(--os-surface); padding: 6px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; overflow: hidden;
  transition: border-color var(--os-dur) var(--os-ease), background var(--os-dur) var(--os-ease);
}
.os-cal-cell:hover { border-color: var(--os-accent-line); background: var(--os-surface-2); }
.os-cal-cell.empty { background: none; border-color: transparent; cursor: default; }
.os-cal-cell.today { border-color: var(--os-accent); box-shadow: 0 0 0 3px var(--os-accent-soft); }
.os-cal-d { font-size: 11.5px; font-weight: 800; color: var(--os-text-2); }
.os-cal-t {
  font-size: 10.5px; font-weight: 600; line-height: 1.3; padding: 3px 6px; border-radius: 6px;
  background: var(--os-accent-soft); color: var(--os-accent);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.os-cal-t.done { background: var(--os-ok-soft); color: var(--os-ok); text-decoration: line-through; }
.os-cal-more { font-size: 10px; color: var(--os-text-3); padding-left: 4px; }

/* --------------------------------------------------------- weekly planner */
.os-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.os-day {
  display: flex; flex-direction: column; gap: 6px; min-height: 130px; padding: 8px;
  border-radius: var(--os-r); border: 1px dashed var(--os-line); background: var(--os-surface-2);
  transition: border-color var(--os-dur) var(--os-ease), background var(--os-dur) var(--os-ease);
}
.os-day.over { border-color: var(--os-accent); background: var(--os-accent-soft); }
.os-day.today { border-style: solid; border-color: var(--os-accent-line); background: var(--os-surface); }
.os-day-h { display: flex; align-items: center; justify-content: space-between; }
.os-day-n { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--os-text-3); }
.os-day.today .os-day-n { color: var(--os-accent); }
.os-slot {
  border: 1px solid var(--os-line); border-radius: var(--os-r-xs); background: var(--os-surface);
  padding: 7px 8px; cursor: grab; font-size: 11.5px;
  transition: box-shadow var(--os-dur) var(--os-ease), transform var(--os-dur) var(--os-ease);
}
.os-slot:hover { box-shadow: var(--os-sh-2); transform: translateY(-1px); }
.os-slot-t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.os-slot-m { color: var(--os-text-3); font-size: 10.5px; margin-top: 2px; }
.os-slot-x { border: 0; background: none; color: var(--os-text-3); cursor: pointer; font-size: 12px; padding: 0 2px; }
.os-slot-x:hover { color: var(--os-danger); }
.os-add-slot {
  border: 0; background: none; color: var(--os-text-3); font-size: 18px; line-height: 1; cursor: pointer;
  border-radius: 8px; padding: 2px 8px;
}
.os-add-slot:hover { background: var(--os-surface-3); color: var(--os-text); }

@media (max-width: 820px) {
  .os-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .os-day { min-height: 110px; }
  .os-cal { gap: 4px; }
  .os-cal-cell { min-height: 62px; padding: 4px; }
  .os-cal-t { font-size: 9.5px; padding: 2px 4px; }
  .os-grid-3 { grid-template-columns: minmax(0, 1fr); }
}

/* Tasks — List/Focus rows ko naye design system ka look (purana markup bhi premium dikhe) */
.os-page .todo-row {
  border: 1px solid var(--os-line);
  border-radius: var(--os-r-sm);
  background: var(--os-surface);
  margin-bottom: 8px;
  transition: border-color var(--os-dur) var(--os-ease), background var(--os-dur) var(--os-ease);
}
.os-page .todo-row:hover { background: var(--os-surface-2); border-color: var(--os-accent-line); }
.os-page .todo-row.done { opacity: .6; }
.os-page .check { border-radius: 7px; }
.os-page .todo-row .chip { background: var(--os-surface-2); border: 1px solid transparent; }

/* Light mode me purane semantic chips (priority/due) thode aur gehre — 11px par WCAG pass karein */
html[data-theme="light"] .os-page .chip.p-low { color: #10633a; }
html[data-theme="light"] .os-page .chip.p-medium,
html[data-theme="light"] .os-page .chip.overdue { color: #8a4b00; }
html[data-theme="light"] .os-page .chip.p-high { color: #a52a1f; }
html[data-theme="light"] .os-page .chip.brand { color: #1d4ed8; }

/* --------------------------------------------------------------- revision rows */
.os-rev {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 12px; border: 1px solid var(--os-line);
  border-radius: var(--os-r-sm); background: var(--os-surface-2);
}
.os-rev:hover { border-color: var(--os-accent-line); }
.os-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* --------------------------------------------------------------- heatmap */
.os-heat { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.os-heat-c { aspect-ratio: 1 / 1; border-radius: 5px; min-height: 14px; }

/* --------------------------------------------------------------- insights (AI Coach) */
.os-insight {
  border: 1px solid var(--os-line); border-left: 3px solid var(--os-accent);
  border-radius: var(--os-r-sm); background: var(--os-surface-2); padding: 14px;
}
.os-insight--danger { border-left-color: var(--os-danger); }
.os-insight--warn { border-left-color: var(--os-warn); }
.os-insight--ok { border-left-color: var(--os-ok); }
.os-insight-h { display: flex; gap: 10px; align-items: flex-start; }
.os-insight-ico { font-size: 18px; line-height: 1.3; }
.os-insight-w { font-size: 14px; font-weight: 700; line-height: 1.55; }
.os-insight-b { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.os-insight-r { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; line-height: 1.7; color: var(--os-text-2); }
.os-insight-k {
  flex: 0 0 64px; padding-top: 2px; font-size: 10px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase; color: var(--os-text-3);
}
.os-insight-e { display: flex; gap: 6px; flex-wrap: wrap; }
.os-insight-a { margin-top: 4px; display: flex; gap: 8px; flex-wrap: wrap; }

@media (max-width: 900px) {
  .os-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .os-grid-4 { grid-template-columns: minmax(0, 1fr); }
  .os-heat { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .os-insight-k { flex-basis: 58px; }
}

/* =================================================================
   PHASE 4 — skeletons · motion · a11y · mobile polish
   ================================================================= */

/* ---------------------------------------------------------- a11y */
.os-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.os-skip {
  position: fixed; top: 8px; left: 8px; z-index: 400;
  transform: translateY(-200%);
  background: var(--os-accent); color: #fff; font-weight: 700; font-size: 13px;
  padding: 10px 16px; border-radius: var(--os-r-sm); text-decoration: none;
  transition: transform var(--os-dur-2) var(--os-ease);
}
.os-skip--on { transform: translateY(0); }
/* sirf keyboard users ke liye ring — mouse click par nahi */
body.os-kbd a:focus-visible,
body.os-kbd button:focus-visible,
body.os-kbd input:focus-visible,
body.os-kbd select:focus-visible,
body.os-kbd textarea:focus-visible,
body.os-kbd [tabindex]:focus-visible,
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--os-accent);
  outline-offset: 2px;
  border-radius: var(--os-r-xs);
}
.os-botnav-i:focus-visible { outline-offset: -2px; }

/* ---------------------------------------------------------- skeletons */
.os-page--skeleton { pointer-events: none; }
.os-skel-head { display: grid; gap: 10px; padding: 4px 0 6px; }
.os-skel-card {
  display: grid; gap: 9px; padding: 15px;
  border: 1px solid var(--os-line); border-radius: var(--os-r-sm);
  background: var(--os-surface);
}
.os-skel-chart { height: 116px; border-radius: var(--os-r-xs); }

/* ---------------------------------------------------------- reveal / motion */
@keyframes os-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.os-reveal { animation: os-rise .42s var(--os-ease) both; }

@keyframes os-ripple-out {
  from { opacity: .22; transform: scale(0); }
  to { opacity: 0; transform: scale(1); }
}
.os-ripple {
  position: absolute; border-radius: 50%; pointer-events: none;
  margin-left: -50%; margin-top: -50%;
  background: currentColor;
  animation: os-ripple-out .5s var(--os-ease) forwards;
}
.os-btn, .os-task, .os-tab, .os-rev, .os-slot, .os-botnav-i, .os-insight { overflow: hidden; }
.os-btn--primary .os-ripple { background: #fff; opacity: .3; }

/* press feedback */
.os-btn:active { transform: scale(.975); }
.os-task:active { transform: scale(.99); }
.os-tab:active { transform: scale(.96); }

/* card hover: halka lift (desktop) */
@media (hover: hover) {
  .os-card { transition: box-shadow var(--os-dur) var(--os-ease), transform var(--os-dur) var(--os-ease), border-color var(--os-dur) var(--os-ease); }
  .os-card:hover { transform: translateY(-2px); }
  .os-rev:hover, .os-task:hover { transform: translateX(2px); }
}

/* ---------------------------------------------------------- mobile bottom nav polish */
@media (max-width: 820px) {
  .os-botnav, .os-fab { transition: transform .26s var(--os-ease), box-shadow var(--os-dur) var(--os-ease); }
  .os-botnav--hide { transform: translateY(115%); }
  .os-fab--hide { transform: translateX(-50%) translateY(150%); }
  .os-botnav-i { position: relative; min-height: 46px; justify-content: center; }
  .os-botnav-i:active { transform: scale(.94); }
  .os-botnav-i.on::before {
    content: ''; position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
    width: 22px; height: 3px; border-radius: 999px; background: var(--os-accent);
    animation: os-pop .22s var(--os-ease);
  }
  .os-botnav-i.on { background: color-mix(in srgb, var(--os-accent) 10%, transparent); }
  /* tap targets: chhote buttons bhi ungli ke liye kaafi bade */
  .os-btn--sm { height: 38px; padding: 0 14px; font-size: 13px; }
  .os-btn--icon { width: 42px; height: 42px; }
  .os-slot-x, .os-check { min-width: 34px; min-height: 34px; }
  .os-tab { padding: 9px 14px; }
  .os-page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ---------------------------------------------------------- empty-state art */
.os-empty-art { color: var(--os-text-3); opacity: .95; margin-bottom: 4px; }
.os-empty-art svg { height: 86px; }
.os-empty { text-align: center; }

/* ---------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .os-reveal { animation: none; }
  .os-ripple { animation: none; opacity: 0; }
  .os-btn:active, .os-task:active, .os-tab:active, .os-botnav-i:active { transform: none; }
  .os-card:hover, .os-rev:hover, .os-task:hover { transform: none; }
  .os-botnav, .os-fab { transition: none; }
  .os-botnav-i.on::before { animation: none; }
}

/* ------------------------------------------------- tap targets (mobile) */
@media (max-width: 820px) {
  a.os-chip, button.os-chip { min-height: 34px; padding: 6px 12px; display: inline-flex; align-items: center; }
  .os-page .check, .check { width: 32px; height: 32px; }
  .os-add-slot { min-width: 34px; min-height: 32px; }
  .os-cal-more { min-height: 22px; }
  .os-insight { padding: 13px; }
}

/* ---------------------------------------------------------- route progress bar */
.os-route-bar {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 300;
  border-radius: 0 3px 3px 0; pointer-events: none; opacity: 0;
  background: linear-gradient(90deg, var(--os-accent), var(--os-accent-2, var(--os-accent)));
  box-shadow: 0 0 12px var(--os-accent);
}
.os-route-bar.on { opacity: 1; animation: os-bar 1.1s var(--os-ease) forwards; }
.os-route-bar.on.done { animation: os-bar-done .3s var(--os-ease) forwards; }
@keyframes os-bar { from { width: 0; } to { width: 72%; } }
@keyframes os-bar-done { from { width: 72%; opacity: 1; } to { width: 100%; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .os-route-bar { display: none; }
}

/* ---- mobile view (force-mobile: badi screen par bhi app jaisa UI) ---- */
html.force-mobile .os-page { padding: var(--os-5) var(--os-4) 96px; gap: var(--os-5); }
html.force-mobile .os-grid-2, html.force-mobile .os-grid-3, html.force-mobile .os-grid-main { grid-template-columns: minmax(0, 1fr); }
html.force-mobile .os-card--pad { padding: var(--os-4); }
html.force-mobile .os-card-head { padding: var(--os-4); }
html.force-mobile .os-card-body { padding: 0 var(--os-4) var(--os-4); }
html.force-mobile .os-botnav {
    display: grid; grid-template-columns: repeat(4, 1fr); align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 110;
    background: color-mix(in srgb, var(--os-surface) 92%, transparent);
    backdrop-filter: blur(14px) saturate(140%);
    border-top: 1px solid var(--os-line);
    padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
  }
html.force-mobile .os-botnav-i {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: 0; font: inherit; font-size: 10px; font-weight: 600;
    color: var(--os-text-3); text-decoration: none; padding: 4px 2px; border-radius: 10px;
  }
html.force-mobile .os-botnav-i.on { color: var(--os-accent); }
html.force-mobile .os-botnav-i span:first-child { font-size: 19px; line-height: 1.1; }
html.force-mobile /* floating center Add button — bottom nav ke theek upar */
  .os-fab {
    left: 50%; right: auto; transform: translateX(-50%);
    bottom: calc(70px + env(safe-area-inset-bottom));
    width: 54px; height: 54px; border-radius: 18px; font-size: 24px;
  }
html.force-mobile .os-fab:hover { transform: translateX(-50%) translateY(-2px); }
html.force-mobile .os-fab:active { transform: translateX(-50%) scale(.94); }

/* ---- mobile view (force-mobile: badi screen par bhi app jaisa UI) ---- */
html.force-mobile .os-week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.force-mobile .os-day { min-height: 110px; }
html.force-mobile .os-cal { gap: 4px; }
html.force-mobile .os-cal-cell { min-height: 62px; padding: 4px; }
html.force-mobile .os-cal-t { font-size: 9.5px; padding: 2px 4px; }
html.force-mobile .os-grid-3 { grid-template-columns: minmax(0, 1fr); }

/* ---- mobile view (force-mobile: badi screen par bhi app jaisa UI) ---- */
html.force-mobile .os-grid-4 { grid-template-columns: minmax(0, 1fr); }
html.force-mobile .os-heat { grid-template-columns: repeat(7, minmax(0, 1fr)); }
html.force-mobile .os-insight-k { flex-basis: 58px; }

/* ---- mobile view (force-mobile: badi screen par bhi app jaisa UI) ---- */
html.force-mobile .os-botnav, html.force-mobile .os-fab { transition: transform .26s var(--os-ease), box-shadow var(--os-dur) var(--os-ease); }
html.force-mobile .os-botnav--hide { transform: translateY(115%); }
html.force-mobile .os-fab--hide { transform: translateX(-50%) translateY(150%); }
html.force-mobile .os-botnav-i { position: relative; min-height: 46px; justify-content: center; }
html.force-mobile .os-botnav-i:active { transform: scale(.94); }
html.force-mobile .os-botnav-i.on::before {
    content: ''; position: absolute; top: 2px; left: 50%; transform: translateX(-50%);
    width: 22px; height: 3px; border-radius: 999px; background: var(--os-accent);
    animation: os-pop .22s var(--os-ease);
  }
html.force-mobile .os-botnav-i.on { background: color-mix(in srgb, var(--os-accent) 10%, transparent); }
html.force-mobile /* tap targets: chhote buttons bhi ungli ke liye kaafi bade */
  .os-btn--sm { height: 38px; padding: 0 14px; font-size: 13px; }
html.force-mobile .os-btn--icon { width: 42px; height: 42px; }
html.force-mobile .os-slot-x, html.force-mobile .os-check { min-width: 34px; min-height: 34px; }
html.force-mobile .os-tab { padding: 9px 14px; }
html.force-mobile .os-page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

/* ---- mobile view (force-mobile: badi screen par bhi app jaisa UI) ---- */
html.force-mobile a.os-chip, html.force-mobile button.os-chip { min-height: 34px; padding: 6px 12px; display: inline-flex; align-items: center; }
html.force-mobile .os-page .check, html.force-mobile .check { width: 32px; height: 32px; }
html.force-mobile .os-add-slot { min-width: 34px; min-height: 32px; }
html.force-mobile .os-cal-more { min-height: 22px; }
html.force-mobile .os-insight { padding: 13px; }

/* =================================================================
   LAYOUT MODE — Mobile view / Desktop view (user ki pasand)
   auto  → screen dekh kar (media queries)
   mobile  → html.force-mobile   (badi screen par bhi app jaisa)
   desktop → html.force-desktop  (chhoti screen par bhi poora layout)
   ================================================================= */

/* ---------------------------------------------- mobile mode extra polish */
html.force-mobile .content { max-width: 720px; }
html.force-mobile .os-layout-sw { width: 100%; }

/* ---------------------------------------------- desktop mode (force) */
html.force-desktop .os-botnav { display: none !important; }
html.force-desktop .os-fab {
  left: auto; right: var(--os-6); bottom: var(--os-6);
  transform: none; width: 54px; height: 54px; border-radius: 18px; font-size: 24px;
}
html.force-desktop .os-fab:hover { transform: translateY(-2px) scale(1.03); }
html.force-desktop .os-fab:active { transform: scale(.94); }
html.force-desktop .os-page { padding: var(--os-5) var(--os-6) var(--os-7); }
html.force-desktop .os-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.force-desktop .os-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.force-desktop .os-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html.force-desktop .os-grid-main { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
html.force-desktop .os-heat { grid-template-columns: repeat(10, minmax(0, 1fr)); }
html.force-desktop .os-week { grid-template-columns: repeat(7, minmax(0, 1fr)); }
html.force-desktop .os-cal-cell { min-height: 88px; padding: 6px; }
html.force-desktop .os-cal { gap: 6px; }
html.force-desktop .os-cal-t { font-size: 10px; padding: 2px 5px; }
html.force-desktop .os-card-head { padding: var(--os-4) var(--os-5); }
html.force-desktop .os-card-body { padding: 0 var(--os-5) var(--os-5); }
html.force-desktop .os-btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
html.force-desktop .os-btn--icon { width: 38px; height: 38px; }
html.force-desktop .os-tab { padding: 7px 13px; }
html.force-desktop .os-insight { padding: 14px; }
html.force-desktop .os-check, html.force-desktop .check { width: 21px; height: 21px; }
html.force-desktop .os-add-slot { min-width: 0; min-height: 0; }
html.force-desktop .os-slot-x { min-width: 0; min-height: 0; }
html.force-desktop a.os-chip, html.force-desktop button.os-chip { min-height: 0; padding: 2px 8px; }

/* styles.css ke mobile overrides ko wapas desktop jaisa karo */
html.force-desktop .sidebar {
  position: sticky; transform: none !important;
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  height: 100vh; box-shadow: none; border-right: 1px solid var(--border);
}
html.force-desktop .hamburger { display: none; }
html.force-desktop .content {
  padding: 22px;
  padding-left: max(22px, env(safe-area-inset-left, 0px));
  padding-right: max(22px, env(safe-area-inset-right, 0px));
  padding-bottom: max(22px, calc(env(safe-area-inset-bottom, 0px) + 12px));
  max-width: 1240px;
}
html.force-desktop .page-title { font-size: 24px; }
html.force-desktop .stat-value { font-size: 26px; }
html.force-desktop .grid-cards { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
html.force-desktop .modal-foot { justify-content: flex-end; }
html.force-desktop .modal-foot .btn { flex: none; }
html.force-desktop .v-num { display: grid; }
html.force-desktop .video-row .v-thumb { width: 110px; }
html.force-desktop .stat-grid { gap: 14px; }
html.force-desktop .nav-item { min-height: 40px; font-size: 13.5px; }
html.force-desktop .brand { padding-top: 16px; }
html.force-desktop .hero { padding: 24px; gap: 20px; }
html.force-desktop .card-pad { padding: 18px; }
html.force-desktop .btn { min-height: 38px; }
html.force-desktop .backdrop-mobile { display: none !important; }

/* ---------------------------------------------- layout switch UI */
.os-layout-sw {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px;
  padding: 4px; border-radius: 12px; background: var(--os-surface-2); margin-top: 10px;
}
.os-layout-opt {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; background: none; font: inherit; font-size: 12px; font-weight: 650;
  color: var(--os-text-2); padding: 8px 6px; border-radius: 9px; cursor: pointer;
  transition: background var(--os-dur) var(--os-ease), color var(--os-dur) var(--os-ease);
}
.os-layout-opt span:first-child { font-size: 17px; line-height: 1.1; }
.os-layout-opt:hover { color: var(--os-text); }
.os-layout-opt.on { background: var(--os-surface); color: var(--os-accent); box-shadow: var(--os-sh-1); }
.os-layout-btn { font-size: 15px; min-width: 44px; }
.os-layout-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px 10px; border-top: 1px solid var(--border);
}
.os-layout-row .os-eyebrow { flex: 1; }

/* sidebar me layout switch (mobile drawer me bhi dikhe) */
.sidebar .os-layout-sw { margin: 0 12px 10px; }

/* Desktop view chhoti screen par: asli "desktop site" jaisa — layout kam se kam
   1000px chauda rahega, zarurat padne par horizontal scroll (user ki pasand). */
@media (max-width: 1000px) {
  html.force-desktop .layout { min-width: 1000px; }
  html.force-desktop .sidebar { width: 220px; flex-basis: 220px; }
}

/* =================================================================
   MOBILE VIEW — top bar ko app jaisa chhota karo (search field chhupao,
   sirf icons rakho). Isse 390px screen par horizontal scroll khatam.
   ================================================================= */
html.force-mobile .topbar {
  gap: 8px;
  padding-left: max(12px, env(safe-area-inset-left, 0px));
  padding-right: max(12px, env(safe-area-inset-right, 0px));
  height: calc(54px + env(safe-area-inset-top, 0px));
}
html.force-mobile .topbar .search-wrap { display: none; }
html.force-mobile .topbar-actions { margin-left: auto; gap: 6px; min-width: 0; }
html.force-mobile .topbar-actions .btn:not(.os-btn) { display: none; }
html.force-mobile .topbar-actions .btn-label { display: none; }
html.force-mobile .os-btn--sm { height: 38px; padding: 0 11px; }

@media (max-width: 820px) {
  .topbar { gap: 8px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .topbar .search-wrap { display: none; }
  .topbar-actions { margin-left: auto; gap: 6px; min-width: 0; }
  .topbar-actions .btn:not(.os-btn) { display: none; }
  .os-btn--sm { height: 38px; padding: 0 11px; }
}

/* desktop view chhoti screen par FAB chhupao (top bar me + Add hai) */
@media (max-width: 1000px) {
  html.force-desktop .os-fab { display: none; }
}

/* ==================================================================
   ⭕ GOL (round) UI — sabhi themes me
   User: "home screen pe today, task, search — ye sab round nahi hai"
   ================================================================== */
/* search */
.search-wrap, .search-input { border-radius: 999px; }
.search-input { padding-left: 16px; }

/* buttons -> pill (bade/block buttons ko chhoti golayi) */
.btn, .os-btn, .filter-btn, .chip, .os-chip,
.nav-item, .os-botnav-i, .os-tab {
  border-radius: 999px;
}
.btn-lg, .os-btn--block, .btn-block, .os-btn--lg { border-radius: 18px; }
.hamburger, .os-layout-opt, .os-btn--icon, .os-btn--sm { border-radius: 999px; }

/* cards / blocks */
.card, .os-card { border-radius: 20px; }
.os-task, .os-rev, .os-empty, .os-stat { border-radius: 16px; }
.modal { border-radius: 24px; }
.toast { border-radius: 18px; }
.os-palette-in { border-radius: 22px; }
.list { border-radius: 18px; overflow: hidden; }

/* inputs */
.input, .select, .textarea { border-radius: 14px; }

/* ROUND ICON CHIPS — har theme me (pehle sirf glass me the) */
.nav-item .ico,
.os-task > span:first-child,
.os-nav a > span:first-child,
.metric-icon,
.ico-round {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 15px;
  line-height: 1;
}
.nav-item.active .ico { background: var(--brand); border-color: transparent; color: #fff; }

/* mobile bottom nav — floating round island */
.os-botnav {
  border-radius: 26px;
  margin: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
  border: 1px solid var(--border);
}
/* force-mobile/force-desktop wale rules zyada specific hote hain — unhe bhi saath likha */
html.force-mobile .os-botnav-i, html.force-desktop .os-botnav-i, .os-botnav-i {
  border-radius: 999px; margin: 4px 2px; padding: 7px 4px;
}
.os-botnav-i.on { background: var(--brand-soft); color: var(--brand); }
html.force-mobile .os-fab, html.force-desktop .os-fab,
.os-fab, .os-fab--center { border-radius: 50%; }

/* ==================================================================
   🕷️ SPIDERMAN THEME — "extra dark black + spidey red" (dono ka mix)
   ================================================================== */
html[data-theme="spiderman"] {
  --brand: #e23636;
  --brand-strong: #b91c1c;
  --brand-soft: #2b0d10;
  --brand-2: #ff5a5f;

  --bg: #05060a;              /* extra dark black */
  --surface: #0b0d14;
  --surface-2: #12151f;
  --border: #1e2333;
  --border-strong: #2b3145;
  --text: #f2f4f8;
  --text-2: #b9c0d0;
  --text-3: #7b839a;
  --track: #1a1f2e;

  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --info: #38bdf8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .6);
  --shadow: 0 4px 16px rgba(0, 0, 0, .55);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, .7);

  --r-xs: 10px;
  --r-sm: 14px;
  --r: 20px;
  --r-lg: 26px;
  --r-xl: 34px;
}

/* makdi ka jaala + lal chamak — halka, padhai me badha na kare */
html[data-theme="spiderman"] body {
  background-color: #05060a;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cg fill='none' stroke='%23e23636' stroke-opacity='.085' stroke-width='1'%3E%3Cpath d='M0 0L140 140M140 0L0 140M0 70H140M70 0V140'/%3E%3Ccircle cx='70' cy='70' r='34'/%3E%3Ccircle cx='70' cy='70' r='62'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(900px 520px at 12% -6%, rgba(226, 54, 54, .22), transparent 60%),
    radial-gradient(800px 500px at 92% 4%, rgba(56, 189, 248, .12), transparent 60%),
    radial-gradient(1000px 700px at 50% 112%, rgba(226, 54, 54, .14), transparent 62%);
  background-attachment: fixed;
}

/* lal chamak wale sur */
html[data-theme="spiderman"] .sidebar,
html[data-theme="spiderman"] .topbar,
html[data-theme="spiderman"] .card,
html[data-theme="spiderman"] .os-card {
  border-color: #232a3d;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .03);
}
html[data-theme="spiderman"] .nav-item.active,
html[data-theme="spiderman"] .os-botnav-i.on {
  background: linear-gradient(180deg, rgba(226, 54, 54, .30), rgba(226, 54, 54, .16));
  color: #ffd9d9;
  box-shadow: 0 0 0 1px rgba(226, 54, 54, .45), 0 6px 18px rgba(226, 54, 54, .22);
}
html[data-theme="spiderman"] .nav-item .ico,
html[data-theme="spiderman"] .os-task > span:first-child {
  background: #141824;
  border-color: #2b3145;
}
html[data-theme="spiderman"] .nav-item.active .ico {
  background: linear-gradient(180deg, #ff4d4d, #c62828);
  color: #fff;
  border-color: rgba(255, 120, 120, .6);
  box-shadow: 0 4px 14px rgba(226, 54, 54, .45);
}
html[data-theme="spiderman"] .btn-primary,
html[data-theme="spiderman"] .os-btn--primary {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  border-color: rgba(255, 140, 140, .35);
  color: #fff;
  box-shadow: 0 6px 18px rgba(226, 54, 54, .35), inset 0 1px 0 rgba(255, 255, 255, .18);
}
html[data-theme="spiderman"] .os-botnav {
  background: rgba(11, 13, 20, .92);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-color: #2b3145;
}
html[data-theme="spiderman"] .os-fab {
  background: linear-gradient(180deg, #ef4444, #b91c1c);
  color: #fff;
  box-shadow: 0 8px 22px rgba(226, 54, 54, .45);
}

/* ==================================================================
   🌙 MIDNIGHT COMMAND CENTER — premium dark intelligence dashboard
   Surfaces: #09090B / #111114 / #18181C / #222228   Border: #2A2A32
   Accent: Electric Violet #8B5CF6 · Cyan #22D3EE
   ================================================================== */
html[data-theme="midnight"] {
  --brand: #8B5CF6;
  --brand-strong: #7C3AED;
  --brand-soft: rgba(139, 92, 246, .14);
  --brand-2: #22D3EE;
  --accent: #22D3EE;

  --bg: #09090B;
  --surface: #111114;
  --surface-2: #18181C;
  --border: #2A2A32;
  --border-strong: #35353F;
  --text: #FAFAFA;
  --text-2: #A1A1AA;
  --text-3: #71717A;
  --track: #1F1F26;

  --ok: #10B981;
  --warn: #F59E0B;
  --danger: #EF4444;
  --info: #22D3EE;
  --ok-soft: rgba(16, 185, 129, .14);
  --warn-soft: rgba(245, 158, 11, .14);
  --danger-soft: rgba(239, 68, 68, .14);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  --shadow: 0 4px 16px rgba(0, 0, 0, .45);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, .6);

  --r-xs: 8px;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 18px;
  --r-xl: 24px;

  --font: "Inter var", "Inter", "Geist", -apple-system, BlinkMacSystemFont,
          "SF Pro Text", ui-sans-serif, "Segoe UI", Roboto, "Noto Sans Devanagari",
          "Helvetica Neue", Arial, sans-serif;

  /* OS layer ke tokens bhi isi palette se */
  --os-bg: #09090B;
  --os-surface: #111114;
  --os-surface-2: #18181C;
  --os-elev: #222228;
  --os-line: #2A2A32;
  --os-text: #FAFAFA;
  --os-text-2: #A1A1AA;
  --os-text-3: #71717A;
  --os-accent: #8B5CF6;
}

html[data-theme="midnight"] body {
  background-color: #09090B;
  background-image:
    radial-gradient(900px 520px at 82% -12%, rgba(139, 92, 246, .10), transparent 62%),
    radial-gradient(760px 460px at 8% 2%, rgba(34, 211, 238, .07), transparent 60%);
  background-attachment: fixed;
  color: #FAFAFA;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.01em;
}

/* ---------- layered surfaces (koi glassmorphism nahi) ---------- */
html[data-theme="midnight"] .sidebar,
html[data-theme="midnight"] .topbar {
  background: #0C0C0F;
  border-color: #2A2A32;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
html[data-theme="midnight"] .card,
html[data-theme="midnight"] .os-card {
  background: #111114;
  border: 1px solid #2A2A32;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
html[data-theme="midnight"] .os-card:hover,
html[data-theme="midnight"] .card:hover {
  border-color: #35353F;
  background: #131317;
}
html[data-theme="midnight"] .os-card--pad,
html[data-theme="midnight"] .os-stat,
html[data-theme="midnight"] .os-task,
html[data-theme="midnight"] .os-rev,
html[data-theme="midnight"] .list { background: #18181C; }
html[data-theme="midnight"] .modal,
html[data-theme="midnight"] .os-palette-in,
html[data-theme="midnight"] .toast { background: #18181C; border: 1px solid #2A2A32; }

html[data-theme="midnight"] .btn,
html[data-theme="midnight"] .os-btn,
html[data-theme="midnight"] .chip,
html[data-theme="midnight"] .os-chip,
html[data-theme="midnight"] .filter-btn,
html[data-theme="midnight"] .input,
html[data-theme="midnight"] .select,
html[data-theme="midnight"] .textarea {
  background: #18181C;
  border: 1px solid #2A2A32;
  color: #FAFAFA;
}
html[data-theme="midnight"] .btn:hover,
html[data-theme="midnight"] .os-btn:hover { background: #222228; border-color: #35353F; }
html[data-theme="midnight"] .btn-primary,
html[data-theme="midnight"] .os-btn--primary {
  background: #8B5CF6;
  border-color: #8B5CF6;
  color: #fff;
  box-shadow: 0 6px 20px rgba(139, 92, 246, .28);
}
html[data-theme="midnight"] .btn-primary:hover,
html[data-theme="midnight"] .os-btn--primary:hover { background: #7C3AED; border-color: #7C3AED; }

/* ---------- sidebar ---------- */
html[data-theme="midnight"] .nav-item { color: #A1A1AA; }
html[data-theme="midnight"] .nav-item:hover { background: #18181C; color: #FAFAFA; }
html[data-theme="midnight"] .nav-item.active {
  background: rgba(139, 92, 246, .14);
  color: #FAFAFA;
  box-shadow: inset 2px 0 0 #8B5CF6;
}
html[data-theme="midnight"] .nav-item .ico {
  background: #18181C;
  border-color: #2A2A32;
}
html[data-theme="midnight"] .nav-item.active .ico {
  background: #8B5CF6;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(139, 92, 246, .35);
}

/* ---------- typography: bade, dominant metrics ---------- */
html[data-theme="midnight"] .os-metric-v,
html[data-theme="midnight"] .os-stat-v {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.05;
  color: #FAFAFA;
}
html[data-theme="midnight"] .os-metric-l,
html[data-theme="midnight"] .os-card-sub { color: #71717A; font-size: 11.5px; letter-spacing: .04em; }
html[data-theme="midnight"] .os-card-title { color: #FAFAFA; font-weight: 650; letter-spacing: -.01em; }
html[data-theme="midnight"] .os-eyebrow { color: #71717A; text-transform: uppercase; letter-spacing: .14em; font-size: 10.5px; }
html[data-theme="midnight"] .page-title,
html[data-theme="midnight"] h1, html[data-theme="midnight"] h2 { letter-spacing: -.02em; }

/* ---------- accents kam, par theek jagah ---------- */
html[data-theme="midnight"] .os-bar-fill { background: #8B5CF6; }
html[data-theme="midnight"] .os-prio-dot { box-shadow: 0 0 0 3px rgba(139, 92, 246, .16); }
html[data-theme="midnight"] .os-chip--accent { background: rgba(139, 92, 246, .16); border-color: rgba(139, 92, 246, .4); color: #C4B5FD; }
html[data-theme="midnight"] .os-botnav { background: #0C0C0F; border-color: #2A2A32; }
html[data-theme="midnight"] .os-botnav-i.on { background: rgba(139, 92, 246, .14); color: #C4B5FD; }
html[data-theme="midnight"] .os-fab {
  background: #8B5CF6; color: #fff;
  box-shadow: 0 10px 26px rgba(139, 92, 246, .4);
}
html[data-theme="midnight"] .os-fab:active { transform: scale(.94); }

/* ---------- focus ring ---------- */
html[data-theme="midnight"] *:focus-visible {
  outline: 2px solid #8B5CF6;
  outline-offset: 2px;
}

/* ==================================================================
   🌙 COMMAND CENTER — hero + Today's Mission + streak ring
   ================================================================== */
.mcc-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--os-5, 20px); flex-wrap: wrap;
}
.mcc-hero-l { min-width: 0; flex: 1 1 320px; }
.mcc-date {
  font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--os-text-3, var(--text-3, #71717A));
}
.mcc-greet {
  margin: 6px 0 0; font-size: clamp(30px, 6.4vw, 46px);
  font-weight: 800; letter-spacing: -.035em; line-height: 1.04;
  text-transform: uppercase; color: var(--os-text, #FAFAFA);
}
html[data-theme="midnight"] .mcc-greet {
  background: linear-gradient(96deg, #FAFAFA 30%, #A78BFA 92%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.mcc-meta {
  margin-top: 12px; display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap; font-size: 13.5px; color: var(--os-text-2, #A1A1AA);
}
.mcc-meta-i { display: inline-flex; align-items: baseline; gap: 6px; }
.mcc-meta-i b {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em;
  color: var(--os-text, #FAFAFA); font-variant-numeric: tabular-nums;
}
.mcc-dot { color: var(--os-text-3, #71717A); }
.mcc-meta-next { min-width: 0; max-width: 100%; }
.mcc-next-l {
  font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--os-text-3, #71717A);
}
.mcc-next-v {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 260px; color: var(--os-text-2, #A1A1AA);
}
.mcc-hero-r { display: flex; align-items: center; gap: 16px; flex: 0 0 auto; }

/* circular animated streak ring */
.mcc-ring { position: relative; display: grid; place-items: center; }
.mcc-ring-svg, .mcc-ring-glow { position: absolute; inset: 0; display: grid; place-items: center; }
.mcc-ring-glow {
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--os-accent, #8B5CF6), var(--os-accent-2, #22D3EE), var(--os-accent, #8B5CF6));
  opacity: .16; filter: blur(14px);
  animation: mcc-spin 9s linear infinite;
}
@keyframes mcc-spin { to { transform: rotate(360deg); } }
.mcc-ring-txt { position: relative; text-align: center; line-height: 1.1; }
.mcc-ring-v {
  font-size: 30px; font-weight: 800; letter-spacing: -.03em;
  color: var(--os-text, #FAFAFA); font-variant-numeric: tabular-nums;
}
.mcc-ring-l {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--os-text-3, #71717A); margin-top: 2px;
}

/* TODAY'S MISSION */
.mcc-mission-t {
  font-size: clamp(18px, 4.2vw, 24px); font-weight: 750; letter-spacing: -.02em;
  margin-top: 10px; line-height: 1.25; color: var(--os-text, #FAFAFA);
}
.mcc-mstats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px; margin-top: 18px;
}
@media (max-width: 520px) { .mcc-mstats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; } }
.mcc-mstat {
  background: var(--os-surface-2, var(--surface-2, #18181C));
  border: 1px solid var(--os-line, var(--border, #2A2A32));
  border-radius: 14px; padding: 12px 10px; text-align: center;
}
.mcc-mstat-v {
  font-size: 24px; font-weight: 780; letter-spacing: -.03em; line-height: 1;
  color: var(--os-text, #FAFAFA); font-variant-numeric: tabular-nums;
}
.mcc-mstat-l {
  margin-top: 5px; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--os-text-3, #71717A);
}
@media (prefers-reduced-motion: reduce) {
  .mcc-ring-glow { animation: none; }
  .mcc-ring-arc { transition: none !important; }
}

/* ==================================================================
   🎯 MOCK TESTS HUB — ek hi jagah: Papers / Analysis / Question Bank /
   Weak Areas. TodoXMock ke mock page jaisa pill tab bar.
   ================================================================== */
.mockhub { display: block; }

.mockhub-tabs {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 6px;
  background: var(--os-bg, var(--bg));
  border: 1px solid var(--os-line, var(--border));
  border-radius: 999px;
  position: sticky; top: 6px; z-index: 5;
  overflow-x: auto; scrollbar-width: none;
}
.mockhub-tabs::-webkit-scrollbar { display: none; }

.mockhub-tab {
  flex: 0 0 auto;
  height: 38px; padding: 0 16px;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; color: var(--os-text-3, var(--text-3, #8A8A90));
  border: 1px solid transparent; border-radius: 999px;
  font: inherit; font-size: 13.5px; font-weight: 650;
  cursor: pointer; white-space: nowrap;
  transition: background .18s var(--os-ease, ease), color .18s var(--os-ease, ease),
              border-color .18s var(--os-ease, ease), transform .18s var(--os-ease, ease);
}
.mockhub-tab:hover { color: var(--os-text, #FAFAFA); transform: translateY(-1px); }
.mockhub-tab.is-active {
  background: var(--os-accent-soft, var(--brand-soft));
  color: var(--os-accent, var(--brand));
  border-color: color-mix(in srgb, var(--os-accent, var(--brand)) 38%, transparent);
}

.mockhub-body { display: block; }

/* Papers tab ke cards ko TodoXMock jaisa saaf look */
.mockhub-body .card-pad { border-radius: 16px; }
.mockhub-body .chip {
  border: 1px solid var(--os-line, var(--border));
  border-radius: 999px;
  font-size: 12px; font-weight: 650;
  padding: 4px 10px;
}

@media (max-width: 640px) {
  .mockhub-tabs { border-radius: 14px; padding: 5px; }
  .mockhub-tab { height: 34px; padding: 0 13px; font-size: 12.5px; }
}

/* ---- images in questions & notes ---- */
.ex-img, .note-img {
  display: block; max-width: 100%; height: auto;
  border-radius: 12px; border: 1px solid var(--os-line, var(--border));
  margin: 10px 0; background: var(--bare, #F8FAFC);
}
.note-img { margin: 12px 0; }
img[data-pending] { min-height: 56px; opacity: .75; }
@media (max-width: 640px) { .ex-img, .note-img { border-radius: 10px; } }
