/* ==========================================================================
   UI Challenge Randomizer — Pure macOS HIG & Apple Document UI
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Apple HIG Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "SF Pro", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  --font-brand: "Gloria Hallelujah", cursive;

  /* macOS Dark Appearance (Rich Purple Graphite) */
  --bg-window: #1b1724;
  --bg-sidebar: #15121d;
  --bg-card: #241f2e;
  --bg-control: #2b2536;
  --bg-control-hover: #382f46;
  --bg-input: #121018;
  --bg-active-row: rgba(191, 90, 242, 0.14);
  --material-sidebar: rgba(21, 18, 29, 0.9);

  --separator: rgba(232, 222, 255, 0.08);
  --separator-strong: rgba(232, 222, 255, 0.16);

  --label-primary: #ffffff;
  --label-secondary: rgba(255, 255, 255, 0.68);
  --label-tertiary: rgba(255, 255, 255, 0.42);

  /* Apple System Colors */
  --system-blue: #0a84ff;
  --system-indigo: #5e5ce6;
  --system-purple: #bf5af2;
  --system-pink: #ff375f;
  --system-green: #30d158;
  --system-orange: #ff9f0a;
  --system-yellow: #ffd60a;
  --system-teal: #40cbe0;
  --system-red: #ff453a;

  --fill-hover: rgba(232, 222, 255, 0.08);
  --fill-muted: rgba(232, 222, 255, 0.04);
  --fill-muted-strong: rgba(232, 222, 255, 0.055);
  --fill-muted-hover: rgba(232, 222, 255, 0.085);
  --card-hover-fill: rgba(232, 222, 255, 0.035);
  --progress-track-fill: rgba(232, 222, 255, 0.08);
  --ring-track-fill: rgba(232, 222, 255, 0.075);
  --ring-shell-fill: rgba(232, 222, 255, 0.04);
  --ring-border-fill: rgba(232, 222, 255, 0.08);
  --ring-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  --activity-grid-line: rgba(232, 222, 255, 0.052);
  --activity-muted-bar: rgba(232, 222, 255, 0.08);
  --activity-empty-bar: rgba(232, 222, 255, 0.105);
  --activity-muted-solved: rgba(232, 222, 255, 0.09);
  --secondary-btn-bg: rgba(232, 222, 255, 0.06);
  --secondary-btn-border: rgba(232, 222, 255, 0.14);
  --secondary-btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --secondary-btn-hover-shadow: 0 2px 5px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --tertiary-btn-bg: rgba(232, 222, 255, 0.035);
  --tertiary-btn-hover-bg: rgba(232, 222, 255, 0.055);
  --tertiary-btn-disabled-bg: rgba(232, 222, 255, 0.03);
  --tertiary-btn-border: rgba(232, 222, 255, 0.08);
  --tertiary-btn-hover-border: rgba(232, 222, 255, 0.12);
  --tertiary-btn-disabled-border: rgba(232, 222, 255, 0.075);
  --primary-btn-border: rgba(232, 222, 255, 0.18);
  --primary-btn-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  --primary-btn-hover-shadow: 0 2px 6px rgba(191, 90, 242, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  --theme-toggle-bg: rgba(191, 90, 242, 0.12);
  --theme-toggle-hover-bg: rgba(191, 90, 242, 0.18);
  --floating-surface-bg: rgba(36, 31, 46, 0.96);
  --floating-surface-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --modal-backdrop-fill: rgba(8, 6, 14, 0.62);
  --placeholder-label: rgba(255, 255, 255, 0.28);
  --timer-ring-muted: rgba(255, 255, 255, 0.12);
  --popover-shadow: 0 8px 24px rgba(10, 7, 18, 0.38);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-card: 16px;
  --radius-capsule: 9999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  color: var(--label-primary);
  background-color: var(--bg-window);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
}

/* Tabular figures for numbers */
.tnum, [data-tnum] {
  font-family: var(--font-mono);
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* Universal Apple SF / Lucide Icon Sizing & 1.5px Baseline Stroke */
svg.lucide, i[data-lucide] {
  display: inline-block;
  vertical-align: middle;
  width: 14px;
  height: 14px;
  stroke-width: 1.5px !important;
  stroke: currentColor;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

/* Layout */
.mac-window {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: var(--bg-window);
}

.mac-layout {
  display: flex;
  flex: 1;
  height: 100%;
  overflow: hidden;
}

/* Sidebar Header */
.sidebar-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 10px 4px;
  height: 28px;
  overflow: hidden;
}

.sidebar-version-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--label-tertiary);
  margin-left: auto;
  opacity: 0.8;
  white-space: nowrap;
  transition: opacity 0.15s ease;
  user-select: none;
}

/* Sidebar */
.mac-sidebar {
  width: 210px;
  min-width: 210px;
  max-width: 240px;
  background: var(--material-sidebar);
  border-right: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px 6px;
  z-index: 10;
  transition: width 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
              min-width 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
              max-width 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
              padding 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  overflow: hidden;
  white-space: nowrap;
}

/* Collapsed Icon Dock / Rail Mode (Compact & Sleek Apple Rail) */
.sidebar-collapsed .mac-sidebar {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  padding: 8px 6px !important;
}

.sidebar-collapsed .sidebar-top-header {
  justify-content: center;
  padding: 0 0 10px 0;
}

.sidebar-collapsed .sidebar-version-tag {
  display: none;
  opacity: 0;
}

.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-row {
  display: flex;
  position: relative;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--label-secondary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  user-select: none;
}

.sidebar-row[hidden] {
  display: none !important;
}

.sidebar-icon-box {
  width: 20px;
  height: 20px;
  min-width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  background: transparent;
  transition: all 0.12s ease;
  flex-shrink: 0;
  color: var(--label-secondary);
}

.sidebar-row-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
  transition: opacity 0.15s ease;
  font-size: 12.5px;
}

.sidebar-row:hover {
  background: var(--bg-control);
  color: var(--label-primary);
}

.sidebar-row:hover .sidebar-icon-box {
  color: var(--label-primary);
}

.sidebar-row.active {
  background: rgba(10, 132, 255, 0.16);
  color: var(--label-primary);
  font-weight: 600;
}

.sidebar-row.active .sidebar-icon-box {
  color: var(--system-blue) !important;
}

.sidebar-row.active svg.lucide {
  color: var(--system-blue) !important;
  stroke-width: 2px !important;
}

.sidebar-row.has-forum-unread::after {
  content: "";
  position: absolute;
  right: 9px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--system-blue);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15);
  transform: translateY(-50%);
  pointer-events: none;
}

.sidebar-row.has-forum-unread.active::after {
  background: var(--system-green);
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.14);
}

/* Collapsed Rows styling (Apple Minimalist Dock Icons: 32x32px) */
.sidebar-collapsed .sidebar-row {
  justify-content: center;
  align-items: center;
  padding: 0;
  width: 32px;
  height: 32px;
  min-width: 32px;
  max-width: 32px;
  margin: 1px auto;
  border-radius: var(--radius-sm);
  border: none !important;
  box-shadow: none !important;
}

.sidebar-collapsed .sidebar-row.has-forum-unread::after {
  top: 5px;
  right: 5px;
  transform: none;
}

.sidebar-collapsed .sidebar-row-label {
  display: none;
  opacity: 0;
  width: 0;
}

.sidebar-collapsed .sidebar-icon-box {
  width: 32px;
  height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-collapsed .sidebar-row.active {
  background: rgba(10, 132, 255, 0.16);
  border: none !important;
  box-shadow: none !important;
}

.sidebar-row svg.lucide, .sidebar-row i[data-lucide] {
  width: 14px;
  height: 14px;
}

.icon-blue { color: var(--system-blue); }
.icon-indigo { color: var(--system-indigo); }
.icon-purple { color: var(--system-purple); }
.icon-pink { color: var(--system-pink); }
.icon-green { color: var(--system-green); }
.icon-orange { color: var(--system-orange); }
.icon-yellow { color: var(--system-yellow); }
.icon-teal { color: var(--system-teal); }
.icon-red { color: var(--system-red); }

/* Sidebar User Footer */
.sidebar-user-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--separator);
  transition: all 0.2s ease;
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: background 0.12s ease;
  user-select: none;
}

.sidebar-user-card:hover {
  background: var(--bg-control);
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.user-info-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--label-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.user-role {
  font-size: 10px;
  color: var(--label-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  margin-top: 1px;
}

.sidebar-user-action-btn {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--label-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  padding: 0;
}

.sidebar-user-action-btn:hover {
  color: var(--label-primary);
  background: var(--fill-hover);
}

.sidebar-user-action-btn.btn-danger:hover {
  color: var(--system-red);
  background: rgba(255, 69, 58, 0.15);
}

.theme-toggle-btn {
  color: var(--system-blue);
  background: var(--theme-toggle-bg);
}

.theme-toggle-btn:hover {
  color: var(--system-blue);
  background: var(--theme-toggle-hover-bg);
}

.sidebar-user-action-btn svg, .sidebar-user-action-btn i {
  width: 12px !important;
  height: 12px !important;
}

/* Collapsed Sidebar User Footer */
.sidebar-collapsed .sidebar-user-footer {
  padding: 8px 0;
  align-items: center;
  gap: 8px;
}

.sidebar-collapsed .sidebar-user-card {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 0;
  background: transparent !important;
  cursor: default;
}

.sidebar-collapsed .user-avatar-circle {
  cursor: pointer;
  transition: transform 0.12s ease;
}

.sidebar-collapsed .user-avatar-circle:hover {
  transform: scale(1.05);
}

.sidebar-collapsed .user-info-text {
  display: none !important;
}

.sidebar-collapsed #sound-toggle-btn,
.sidebar-collapsed #theme-toggle-btn {
  display: inline-flex !important;
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 6px;
  background: transparent;
  color: var(--label-secondary);
}

.sidebar-collapsed #sound-toggle-btn:hover,
.sidebar-collapsed #theme-toggle-btn:hover {
  background: var(--bg-control);
  color: var(--label-primary);
}

.sidebar-collapsed #sound-toggle-btn svg,
.sidebar-collapsed #sound-toggle-btn i,
.sidebar-collapsed #theme-toggle-btn svg,
.sidebar-collapsed #theme-toggle-btn i {
  width: 14px !important;
  height: 14px !important;
}

.sidebar-icon-btn, .mac-tool-btn {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 5px;
  background: transparent;
  border: none;
  color: var(--label-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  padding: 0;
}

.sidebar-icon-btn:hover, .mac-tool-btn:hover {
  background: var(--bg-control);
  color: var(--label-primary);
}

.sidebar-icon-btn:active, .mac-tool-btn:active {
  transform: scale(0.94);
}

.sidebar-icon-btn svg.lucide, .sidebar-icon-btn i[data-lucide],
.mac-tool-btn svg.lucide, .mac-tool-btn i[data-lucide] {
  width: 14px !important;
  height: 14px !important;
  stroke-width: 1.5px !important;
}

/* Main Canvas */
.mac-canvas {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-window);
}

.mac-view {
  display: none;
  height: 100%;
  width: 100%;
}

.mac-view.active {
  display: flex;
  flex-direction: column;
  animation: macViewFadeIn 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.mac-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
}

.card-wrapper {
  max-width: 860px;
  margin: 0 auto;
}

/* Dashboard */
.dashboard-view {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  padding: 48px 56px 56px;
  background: var(--bg-window);
}

.dashboard-shell {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-focus-shell {
  max-width: 960px;
}

.dashboard-main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}

.dashboard-hero-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 18px;
}

.dashboard-hero-main {
  min-width: 0;
  flex: 1 1 0;
  max-width: 100%;
}

.dashboard-title-row {
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.dashboard-gold-pill {
  height: 24px;
  padding: 0 10px;
  color: var(--system-yellow);
  background: rgba(255, 214, 10, 0.11);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 10, 0.2);
  font-size: 11.5px;
  font-weight: 700;
}

.dashboard-gold-pill svg,
.dashboard-gold-pill i {
  color: var(--system-yellow);
}

.dashboard-hero h1 {
  font-family: var(--font-brand);
  min-width: 0;
  min-inline-size: 0;
  max-width: 100%;
  margin: 0;
  color: var(--label-primary);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.dashboard-hero p {
  margin: 10px 0 0;
  color: var(--label-secondary);
  font-size: 13px;
  line-height: 1.45;
  max-width: 520px;
}

.dashboard-action-row svg,
.dashboard-action-row i {
  width: 14px;
  height: 14px;
}

.dashboard-status-pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.12);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.dashboard-progress-ring {
  --progress: 0deg;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  padding: 6px;
  background:
    conic-gradient(from 0deg, var(--system-blue) 0deg, var(--system-green) var(--progress), var(--ring-track-fill) var(--progress) 360deg),
    var(--ring-shell-fill);
  box-shadow:
    inset 0 0 0 1px var(--ring-border-fill),
    var(--ring-shadow);
  flex: 0 0 auto;
}

.dashboard-progress-ring-inner {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--bg-window);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.dashboard-progress-ring-inner svg,
.dashboard-progress-ring-inner i {
  width: 14px;
  height: 14px;
  color: var(--system-blue);
}

.dashboard-progress-ring-inner strong {
  color: var(--label-primary);
  font-size: 16px;
  line-height: 1;
}

.dashboard-progress-section {
  padding: 2px 0 0;
}

.dashboard-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--label-secondary);
  font-size: 12px;
}

.dashboard-progress-head strong {
  color: var(--label-primary);
  font-size: 13px;
}

.dashboard-progress-track {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--progress-track-fill);
}

.dashboard-progress-large {
  height: 6px;
}

.dashboard-progress-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--system-blue), var(--system-green));
}

.dashboard-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--label-tertiary);
  font-size: 11px;
  margin-top: 8px;
}

.dashboard-stat-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding: 17px 0;
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
}

.dashboard-stat {
  min-width: 0;
  padding: 0;
  border-left: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.dashboard-stat:first-child {
  padding-left: 0;
}

.dashboard-stat:last-child {
  padding-right: 0;
}

.dashboard-stat span {
  display: block;
  color: var(--label-tertiary);
  font-size: 11.5px;
  line-height: 1.2;
}

.dashboard-stat-icon,
.dashboard-section-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: transparent;
}

.dashboard-stat-icon svg,
.dashboard-stat-icon i,
.dashboard-section-icon svg,
.dashboard-section-icon i {
  width: 15px;
  height: 15px;
}

.dashboard-stat-icon.blue,
.dashboard-section-icon {
  color: var(--system-blue);
}

.dashboard-stat-icon.green { color: var(--system-green); }
.dashboard-stat-icon.orange { color: var(--system-orange); }
.dashboard-stat-icon.pink { color: var(--system-pink); }

.dashboard-stat strong {
  display: block;
  margin-top: 2px;
  color: var(--label-primary);
  font-size: 18px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: 0;
}

.dashboard-activity-section {
  padding: 2px 0 18px;
  border-bottom: 0;
}

.dashboard-activity-section .dashboard-section-heading {
  margin-bottom: 14px;
}

.dashboard-heading-lockup {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.dashboard-heading-lockup > div {
  min-width: 0;
}

.dashboard-activity-summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.dashboard-summary-badge {
  height: 23px;
  padding: 0 7px;
  color: var(--label-secondary);
  background: var(--fill-muted);
  font-size: 11.5px;
}

.dashboard-summary-badge svg,
.dashboard-summary-badge i {
  color: var(--system-blue);
}

.dashboard-summary-solved svg,
.dashboard-summary-solved i {
  color: var(--system-green);
}

.dashboard-activity-summary strong {
  color: var(--label-primary);
  font-weight: 700;
}

.dashboard-activity-plot {
  position: relative;
  min-height: 176px;
}

.dashboard-activity-plot::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 24px;
  bottom: 24px;
  pointer-events: none;
  background-image: linear-gradient(to bottom, var(--activity-grid-line) 1px, transparent 1px);
  background-size: 100% 32px;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 6%, #000 94%, transparent 100%);
  opacity: 0.88;
}

.dashboard-activity-plot.is-empty::before {
  opacity: 0.58;
}

.dashboard-activity-plot.is-empty .dashboard-activity-day:not(.is-active) .dashboard-activity-bar {
  background: var(--activity-empty-bar);
}

.dashboard-activity-chart {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
  min-height: 176px;
}

.dashboard-activity-day {
  min-width: 0;
  height: 176px;
  display: grid;
  grid-template-rows: 20px 132px 16px;
  align-items: end;
  justify-items: center;
  gap: 5px;
}

.dashboard-activity-metrics {
  min-height: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transform: translateY(2px);
}

.dashboard-activity-value {
  min-height: 11px;
  color: var(--label-tertiary);
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
}

.dashboard-activity-solved {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--system-green);
  font-size: 10px;
  line-height: 1;
  font-weight: 800;
}

.dashboard-activity-solved svg,
.dashboard-activity-solved i {
  width: 10px;
  height: 10px;
}

.dashboard-activity-day.is-active .dashboard-activity-metrics {
  opacity: 0.82;
}

.dashboard-activity-day.is-peak .dashboard-activity-value {
  color: var(--system-blue);
}

.dashboard-activity-day.has-solved .dashboard-activity-metrics {
  opacity: 1;
}

.dashboard-activity-bar-track {
  position: relative;
  width: 100%;
  height: 132px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 0;
}

.dashboard-activity-bar {
  width: min(100%, 22px);
  height: var(--activity-height);
  border-radius: 999px;
  background: var(--system-blue);
  opacity: var(--activity-intensity);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    0 8px 18px rgba(10, 132, 255, 0.14);
}

.dashboard-activity-day:not(.is-active) .dashboard-activity-bar {
  width: min(100%, 18px);
  background: var(--activity-muted-bar);
  opacity: 1;
  box-shadow: none;
}

.dashboard-activity-day.is-peak .dashboard-activity-bar {
  width: min(100%, 28px);
  background: var(--system-blue);
  opacity: 1;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 10px 22px rgba(10, 132, 255, 0.22);
}

.dashboard-activity-solved-bar {
  position: absolute;
  right: calc(50% - 23px);
  bottom: 0;
  width: 5px;
  height: var(--solved-height);
  border-radius: 999px;
  background: var(--system-green);
  opacity: var(--solved-intensity);
  box-shadow: 0 6px 14px rgba(48, 209, 88, 0.12);
}

.dashboard-activity-day:not(.has-solved) .dashboard-activity-solved-bar {
  background: var(--activity-muted-solved);
  opacity: 1;
  box-shadow: none;
}

.dashboard-activity-label {
  color: var(--label-tertiary);
  font-size: 11px;
  line-height: 1;
}

.dashboard-activity-day.is-active .dashboard-activity-label {
  color: var(--label-secondary);
  font-weight: 600;
}

.dashboard-activity-day.is-peak .dashboard-activity-label {
  color: var(--label-primary);
}

.dashboard-next-panel {
  display: flex;
  justify-content: flex-start;
  padding: 0 0 10px;
}

.dashboard-challenge-list {
  width: 100%;
  display: grid;
  gap: 6px;
}

.dashboard-challenge-card {
  position: relative;
  width: 100%;
  max-width: none;
  margin: 0;
  overflow: visible;
  border-radius: var(--radius-card);
  border: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-challenge-card:hover,
.dashboard-challenge-card:focus-visible {
  background: var(--card-hover-fill);
}

.dashboard-challenge-card:active {
  transform: scale(0.995);
}

.dashboard-challenge-card:focus-visible {
  outline: 2px solid rgba(10, 132, 255, 0.5);
  outline-offset: 2px;
}

.dashboard-challenge-surface {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  grid-template-areas: "icon content";
  align-items: start;
  gap: 9px 10px;
  padding: 13px 58px 13px 10px;
  border-radius: inherit;
}

.dashboard-challenge-icon {
  grid-area: icon;
  margin-top: 2px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--system-blue);
  background: transparent;
  box-shadow: none;
}

.dashboard-challenge-icon svg,
.dashboard-challenge-icon i {
  width: 15px;
  height: 15px;
}

.dashboard-challenge-label-row {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 5px;
}

.dashboard-challenge-label {
  color: var(--label-secondary);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
}

.dashboard-challenge-index {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--label-tertiary);
  background: var(--fill-muted);
  box-shadow: inset 0 0 0 1px var(--fill-muted-strong);
}

.dashboard-challenge-content {
  grid-area: content;
  min-width: 0;
  min-inline-size: 0;
  max-width: 640px;
}

.dashboard-challenge-badge-row {
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.dashboard-task-badge,
.dashboard-industry-badge {
  max-width: 100%;
}

.dashboard-task-badge {
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.12);
}

.dashboard-industry-badge {
  color: var(--label-primary);
  background: var(--fill-muted-strong);
}

.dashboard-task-badge svg,
.dashboard-task-badge i,
.dashboard-industry-badge svg,
.dashboard-industry-badge i {
  color: currentColor;
}

.dashboard-task-badge span,
.dashboard-industry-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.dashboard-section-heading h2 {
  margin: 0;
  color: var(--label-primary);
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: 0;
}

.dashboard-section-heading p {
  display: block;
  margin: 5px 0 0;
  color: var(--label-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-next-title {
  display: block;
  color: var(--label-primary);
  font-weight: 700;
  letter-spacing: 0;
  white-space: normal;
}

.dashboard-next-title {
  max-width: 100%;
  font-size: 18px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.dashboard-next-copy {
  max-width: 100%;
  color: var(--label-secondary);
  font-size: 12px;
  line-height: 1.35;
  margin: 4px 0 0;
  overflow-wrap: anywhere;
}

.dashboard-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.dashboard-challenge-actions {
  position: absolute;
  top: 18px;
  right: 20px;
  justify-content: flex-start;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(4px);
  transition: opacity 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-challenge-card:hover .dashboard-challenge-actions,
.dashboard-challenge-card:focus-visible .dashboard-challenge-actions,
.dashboard-challenge-card:focus-within .dashboard-challenge-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.dashboard-challenge-action {
  width: 30px;
  height: 30px;
  min-width: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--label-secondary);
  background: var(--fill-muted-strong);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-challenge-action:hover,
.dashboard-challenge-action:focus-visible {
  color: var(--label-primary);
  background: var(--fill-muted-hover);
}

.dashboard-challenge-action:active {
  transform: scale(0.96);
}

.dashboard-challenge-play {
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.14);
}

.dashboard-challenge-action svg,
.dashboard-challenge-action i {
  width: 14px;
  height: 14px;
}

@media (max-width: 980px) {
  .dashboard-view {
    padding: 30px 22px 38px;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .dashboard-stat-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-stat:nth-child(odd) {
    border-left: 0;
  }

  .dashboard-stat:nth-child(n + 3) {
    border-top: 1px solid var(--separator);
    padding-top: 14px;
    margin-top: 14px;
  }

  .dashboard-section-heading {
    flex-direction: column;
  }

  .dashboard-activity-chart {
    gap: 8px;
  }

  .dashboard-activity-bar {
    width: min(100%, 28px);
  }

}

@media (max-width: 560px) {
  .dashboard-view {
    padding: 28px 16px 38px;
  }

  .mac-sidebar {
    width: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    padding: 8px 6px !important;
  }

  .sidebar-top-header {
    justify-content: center;
    padding: 0 0 10px 0;
  }

  .sidebar-version-tag,
  .user-info-text {
    display: none !important;
  }

  .sidebar-row-label {
    display: none !important;
  }

  .sidebar-row {
    justify-content: center;
    padding: 0;
    width: 32px;
    min-width: 32px;
    max-width: 32px;
    margin: 1px auto;
  }

  .sidebar-icon-box {
    width: 32px;
    min-width: 32px;
    height: 32px;
  }

  .sidebar-user-footer {
    padding: 8px 0;
    align-items: center;
  }

  .sidebar-user-card {
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    padding: 4px 0;
  }

  #sound-toggle-btn,
  #theme-toggle-btn {
    display: inline-flex !important;
    width: 26px;
    height: 26px;
    min-width: 26px;
  }

  .dashboard-stat-strip {
    grid-template-columns: 1fr;
  }

  .dashboard-stat {
    border-left: 0;
    border-top: 1px solid var(--separator);
  }

  .dashboard-stat:first-child {
    border-top: 0;
  }

  .dashboard-hero-lockup {
    align-items: flex-start;
    gap: 14px;
  }

  .dashboard-title-row {
    gap: 8px;
  }

  .dashboard-title-row h1 {
    flex: 1 1 100%;
  }

  .dashboard-progress-ring {
    width: 72px;
    height: 72px;
    padding: 5px;
  }

  .dashboard-hero h1 {
    font-size: 24px;
  }

  .dashboard-next-title {
    font-size: 16px;
  }

  .dashboard-challenge-surface {
    grid-template-columns: 22px minmax(0, 1fr);
    grid-template-areas: "icon content";
    align-items: stretch;
    gap: 9px 10px;
    padding: 12px 46px 12px 8px;
  }

  .dashboard-challenge-actions {
    width: auto;
    top: 12px;
    right: 8px;
  }

.dashboard-challenge-action {
    width: 30px;
    min-width: 30px;
  }

}

/* ==========================================================================
   MARK: - Leaderboard View
   ========================================================================== */

.leaderboard-view {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 24px 44px 64px 0;
}

.leaderboard-shell {
  width: min(920px, 100%);
  margin: 0 auto;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.leaderboard-header {
  flex: 0 0 auto;
  margin-bottom: 22px;
}

.leaderboard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--system-blue);
  font-size: 12px;
  font-weight: 800;
}

.leaderboard-kicker svg,
.leaderboard-kicker i {
  width: 14px;
  height: 14px;
}

.leaderboard-header h1 {
  margin: 0;
  color: var(--label-primary);
  font-family: var(--font-brand);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0;
}

.leaderboard-header p {
  max-width: 610px;
  margin: 8px 0 0;
  color: var(--label-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.leaderboard-summary-bar {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
}

.leaderboard-summary-pill {
  height: 25px;
  padding: 0 9px;
  color: var(--label-secondary);
  background: var(--fill-muted);
  font-size: 11.5px;
}

.leaderboard-summary-pill svg,
.leaderboard-summary-pill i {
  width: 13px;
  height: 13px;
  color: var(--system-blue);
}

.leaderboard-summary-pill.is-you {
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.14);
}

.leaderboard-list {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 4px 12px 0;
  scrollbar-width: thin;
}

.leaderboard-row {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-columns: 46px 34px minmax(0, 1fr) minmax(360px, 0.9fr);
  align-items: center;
  gap: 12px;
  min-height: 50px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-card);
  color: var(--label-primary);
  transition: background 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.leaderboard-row:hover {
  background: var(--card-hover-fill);
}

.leaderboard-row:active {
  transform: scale(0.995);
}

.leaderboard-row.is-current {
  background: rgba(10, 132, 255, 0.12);
}

.leaderboard-row.is-current:hover {
  background: rgba(10, 132, 255, 0.16);
}

.leaderboard-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--label-tertiary);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
}

.leaderboard-rank span {
  min-width: 30px;
  text-align: center;
}

.leaderboard-row.is-top-1 .leaderboard-rank {
  color: var(--system-orange);
}

.leaderboard-row.is-top-2 .leaderboard-rank {
  color: var(--system-blue);
}

.leaderboard-row.is-top-3 .leaderboard-rank {
  color: var(--system-pink);
}

.leaderboard-avatar {
  width: 30px;
  height: 30px;
  min-width: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.14);
  font-size: 10px;
  font-weight: 800;
}

.leaderboard-avatar-img {
  width: 30px;
  height: 30px;
  display: block;
  object-fit: cover;
}

.leaderboard-identity {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.leaderboard-name-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.leaderboard-name-line strong {
  min-width: 0;
  color: var(--label-primary);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-identity > span {
  color: var(--label-tertiary);
  font-size: 11.5px;
  font-weight: 700;
}

.leaderboard-you-pill {
  height: 18px;
  display: inline-flex;
  align-items: center;
  padding: 0 7px;
  border-radius: var(--radius-capsule);
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.16);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.leaderboard-metrics {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(62px, 1fr));
  gap: 6px;
}

.leaderboard-metrics span {
  min-width: 0;
  display: grid;
  gap: 2px;
  justify-items: end;
}

.leaderboard-metrics strong {
  color: var(--label-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.05;
}

.leaderboard-metrics small {
  color: var(--label-tertiary);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

@media (max-width: 900px) {
  .leaderboard-view {
    padding: 24px 20px 56px;
  }

  .leaderboard-row {
    grid-template-columns: 38px 34px minmax(0, 1fr);
    align-items: start;
  }

  .leaderboard-metrics {
    grid-column: 3;
    grid-template-columns: repeat(4, minmax(54px, 1fr));
  }

  .leaderboard-metrics span {
    justify-items: start;
  }
}

@media (max-width: 640px) {
  .leaderboard-header h1 {
    font-size: 34px;
  }

  .leaderboard-row {
    grid-template-columns: 32px 30px minmax(0, 1fr);
    gap: 9px;
    padding: 5px 8px;
  }

  .leaderboard-metrics {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 71px;
  }
}

/* ==========================================================================
   MARK: - Admin View
   ========================================================================== */

.admin-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 44px 64px 0;
  background: var(--bg-window);
}

.users-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 44px 64px 0;
  background: var(--bg-window);
}

.admin-shell {
  width: min(980px, 100%);
  margin: 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.users-shell {
  width: min(920px, 100%);
  margin: 0 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-header,
.users-header {
  max-width: 680px;
}

.users-header {
  max-width: none;
}

.users-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.users-create-open-btn {
  flex-shrink: 0;
  margin-top: 2px;
}

.admin-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  color: var(--system-blue);
  font-size: 12px;
  font-weight: 800;
}

.admin-kicker svg,
.admin-kicker i {
  width: 14px;
  height: 14px;
}

.admin-header h1,
.users-header h1 {
  margin: 0;
  color: var(--label-primary);
  font-family: var(--font-brand);
  font-size: 40px;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: 0;
}

.admin-header h1 {
  font-family: var(--font-brand);
}

.admin-header p,
.users-header p {
  max-width: 620px;
  margin: 8px 0 0;
  color: var(--label-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.admin-hero-grid,
.users-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 0;
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
}

.admin-hero-grid {
  border-top: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
}

.admin-metric-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  grid-template-areas:
    "icon label"
    "icon value";
  align-items: center;
  gap: 2px 9px;
  min-height: 50px;
  padding: 5px 8px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-card);
}

.admin-metric-icon {
  grid-area: icon;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--system-blue);
}

.admin-metric-icon svg,
.admin-metric-icon i {
  width: 15px;
  height: 15px;
}

.admin-metric-label {
  grid-area: label;
  color: var(--label-tertiary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
}

.admin-metric-row strong {
  grid-area: value;
  min-width: 0;
  color: var(--label-primary);
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-tone-green .admin-metric-icon { color: var(--system-green); }
.admin-tone-orange .admin-metric-icon { color: var(--system-orange); }
.admin-tone-purple .admin-metric-icon { color: var(--system-purple); }

.admin-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-section-heading h2 {
  margin: 0;
  color: var(--label-primary);
  font-size: 13px;
  line-height: 1.2;
}

.admin-section-heading p {
  margin: 5px 0 0;
  color: var(--label-secondary);
  font-size: 12px;
  line-height: 1.35;
}

.admin-soft-badge {
  height: 23px;
  padding: 0 7px;
  color: var(--label-secondary);
  background: var(--fill-muted);
  font-size: 11.5px;
}

.admin-soft-badge svg,
.admin-soft-badge i {
  color: var(--system-blue);
}

.admin-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 24px;
  align-items: start;
}

.admin-panel {
  min-width: 0;
  display: grid;
  gap: 12px;
}

.admin-side-column {
  min-width: 0;
  display: grid;
  gap: 22px;
}

.admin-config-list,
.admin-approval-list,
.admin-user-list,
.users-list {
  display: grid;
  gap: 4px;
}

.users-list {
  display: grid;
  gap: 4px;
}

.admin-approval-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-card);
  color: var(--label-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease;
}

.admin-approval-row:hover {
  background: var(--card-hover-fill);
}

.admin-approval-thumb {
  width: 54px;
  aspect-ratio: 4 / 3;
  border: 0;
  border-radius: 9px;
  background: var(--fill-muted);
  color: var(--system-blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.admin-approval-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-approval-main {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.admin-approval-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.admin-approval-copy strong,
.admin-user-copy strong {
  color: var(--label-primary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-approval-copy small,
.admin-user-copy small {
  color: var(--label-tertiary);
  font-size: 11px;
  font-weight: 700;
}

.admin-approval-open {
  color: var(--label-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-approval-open svg,
.admin-approval-open i {
  width: 15px;
  height: 15px;
}

.admin-config-list > div,
.admin-user-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 4px 0;
}

.admin-config-list span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--label-secondary);
  font-size: 12px;
  font-weight: 800;
}

.admin-config-list svg,
.admin-config-list i {
  width: 14px;
  height: 14px;
  color: var(--system-blue);
}

.admin-config-list strong {
  color: var(--label-primary);
  font-size: 12px;
  font-weight: 800;
}

.admin-ios-switch {
  width: 36px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-capsule);
  background: transparent;
  color: inherit;
  cursor: pointer;
  outline: none;
}

.admin-ios-switch-track {
  position: relative;
  width: 36px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-capsule);
  background: var(--fill-muted);
  transition: background 0.18s ease;
}

.admin-ios-switch-knob {
  width: 16px;
  height: 16px;
  margin-left: 2px;
  border-radius: 50%;
  background: #ffffff;
  transform: translateX(0);
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.admin-ios-switch.is-on .admin-ios-switch-track {
  background: var(--system-blue);
}

.admin-ios-switch.is-on .admin-ios-switch-knob {
  transform: translateX(16px);
}

.admin-ios-switch:hover .admin-ios-switch-track,
.admin-ios-switch:focus-visible .admin-ios-switch-track {
  background: var(--fill-muted-hover);
}

.admin-ios-switch.is-on:hover .admin-ios-switch-track,
.admin-ios-switch.is-on:focus-visible .admin-ios-switch-track {
  background: var(--system-blue);
}

.admin-ios-switch:active .admin-ios-switch-knob {
  transform: scaleX(1.08);
}

.admin-ios-switch.is-on:active .admin-ios-switch-knob {
  transform: translateX(16px) scaleX(1.08);
}

.admin-ios-switch:disabled {
  cursor: default;
  opacity: 0.52;
}

.admin-user-row {
  width: 100%;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  min-height: 46px;
  padding: 6px 7px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--label-primary);
  font: inherit;
  text-align: left;
  cursor: default;
  transition: background 0.14s ease;
}

.admin-user-row:hover {
  background: var(--card-hover-fill);
}

.admin-user-row.is-terminated {
  opacity: 0.58;
}

.admin-contributor-avatar {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.14);
  font-size: 8px;
  font-weight: 800;
}

.admin-user-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.admin-user-stats {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 6px;
  align-items: baseline;
  color: var(--label-tertiary);
  font-size: 10px;
  font-weight: 700;
}

.admin-user-stats strong {
  color: var(--label-primary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.admin-user-action {
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-capsule);
  background: var(--fill-muted);
  color: var(--system-blue);
  font: inherit;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
}

.admin-user-action.is-danger {
  color: var(--system-red);
}

.users-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 5px 7px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--label-primary);
  font: inherit;
  cursor: pointer;
  transition: background 0.14s ease;
}

.users-row:hover {
  background: var(--card-hover-fill);
}

.users-row.is-terminated {
  opacity: 0.58;
}

.users-avatar {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.14);
  font-size: 8px;
  font-weight: 800;
}

.users-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.users-copy strong {
  color: var(--label-primary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-copy small {
  color: var(--label-tertiary);
  font-size: 11px;
  font-weight: 700;
}

.users-stats {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 6px;
  align-items: baseline;
  color: var(--label-tertiary);
  font-size: 10px;
  font-weight: 700;
}

.users-stats strong {
  color: var(--label-primary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.users-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.users-action {
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-capsule);
  background: var(--fill-muted);
  color: var(--system-blue);
  font: inherit;
  font-size: 10.5px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.users-action:hover {
  background: rgba(10, 132, 255, 0.14);
}

.users-action:active {
  transform: scale(0.96);
}

.users-action svg,
.users-action i {
  width: 12px;
  height: 12px;
}

.users-action.is-danger {
  color: var(--system-red);
}

.users-action.is-success {
  color: var(--system-green);
}

.users-modal {
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.users-modal-sheet {
  position: relative;
  width: min(430px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
}

.users-modal-titlebar {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  min-height: 32px;
}

.users-modal-titlebar h2 {
  margin: 0;
  color: var(--label-primary);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.users-detail-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 8px;
}

.users-detail-avatar {
  width: 30px;
  height: 30px;
}

.users-detail-identity div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.users-detail-identity strong {
  color: var(--label-primary);
  font-size: 13px;
  font-weight: 800;
}

.users-detail-identity small {
  color: var(--label-tertiary);
  font-size: 11px;
  font-weight: 700;
}

.users-detail-list,
.users-form-group {
  display: grid;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
}

[data-theme="light"] .users-detail-list,
[data-theme="light"] .users-form-group {
  background: rgba(0, 0, 0, 0.035);
}

.users-detail-row,
.users-form-row {
  min-height: 38px;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
}

.users-detail-row:not(:last-child),
.users-form-row:not(:last-child) {
  border-bottom: 1px solid var(--separator);
}

.users-detail-row span,
.users-form-row span {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--label-secondary);
  font-size: 11px;
  font-weight: 800;
}

.users-detail-row svg,
.users-detail-row i {
  width: 13px;
  height: 13px;
  color: var(--system-blue);
}

.users-detail-row strong {
  min-width: 0;
  color: var(--label-primary);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.users-password-reset {
  display: grid;
  gap: 8px;
}

.users-password-reset .mac-btn {
  justify-content: center;
}

.users-form-row-stack {
  grid-template-columns: 1fr;
  gap: 5px;
}

.users-form-input {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  background: var(--bg-input);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  color: var(--label-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.users-form-input:focus {
  border-color: var(--system-blue);
  box-shadow: 0 0 0 2.5px rgba(10, 132, 255, 0.2);
}

.users-switch-row input {
  justify-self: end;
  width: 16px;
  height: 16px;
  accent-color: var(--system-blue);
}

.users-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-readonly-note {
  color: var(--label-tertiary);
  font-size: 11px;
  font-weight: 700;
}

.admin-empty-state {
  min-height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--label-tertiary);
  font-size: 12px;
  font-weight: 700;
}

.admin-empty-state svg,
.admin-empty-state i {
  width: 14px;
  height: 14px;
  color: var(--system-blue);
}

.forum-thread-preview,
.leaderboard-row,
.users-row,
.admin-approval-row {
  content-visibility: auto;
  contain-intrinsic-size: 72px;
}

@media (max-width: 980px) {
  .admin-view,
  .users-view {
    padding: 24px 20px 56px;
  }

  .admin-content-grid {
    grid-template-columns: 1fr;
  }

  .admin-hero-grid,
  .users-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .admin-view,
  .users-view,
  .forum-view,
  .leaderboard-view {
    padding: 22px 14px 44px;
  }

  .admin-header h1,
  .users-header h1 {
    font-size: 34px;
  }

  .admin-header p,
  .users-header p {
    font-size: 12px;
  }

  .admin-hero-grid,
  .users-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 6px;
    padding: 10px 0;
  }

  .admin-metric-row {
    min-height: 44px;
    padding: 4px 2px;
  }

  .admin-approval-row {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 9px;
    padding: 7px 4px;
  }

  .admin-approval-thumb {
    width: 42px;
    border-radius: var(--radius-sm);
  }

  .admin-approval-open {
    display: none;
  }

  .users-header-row {
    flex-direction: column;
    align-items: stretch;
  }

  .users-create-open-btn {
    width: 100%;
    margin-top: 0;
  }

  .users-row {
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: 7px 4px;
  }

  .users-avatar {
    width: 22px;
    height: 22px;
  }

  .users-stats,
  .users-actions {
    grid-column: 2;
    justify-content: flex-start;
  }

  .users-stats {
    margin-top: 2px;
  }

  .users-actions {
    flex-wrap: wrap;
    margin-top: 5px;
  }

  .users-detail-row,
  .users-form-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 5px;
  }

  .users-detail-row strong {
    text-align: left;
  }

}

/* Buttons */
/* ==========================================================================
   MARK: - Apple HIG Tactile Button System (Unified Primary, Secondary, Sizes)
   ========================================================================== */

.mac-btn, .randomize-magic-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.15px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition:
    background 0.12s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.12s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.12s cubic-bezier(0.4, 0, 0.2, 1),
    color 0.12s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.12s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  flex-shrink: 0;
}

.mac-btn:active, .randomize-magic-btn:active {
  transform: translateY(0.5px) scale(0.98);
}

/* Primary Button (Apple System Blue with Tactile Bevel) */
.mac-btn-primary, .randomize-magic-btn {
  background: #007aff;
  color: #ffffff !important;
  border: 1px solid var(--primary-btn-border);
  box-shadow: var(--primary-btn-shadow);
}

.mac-btn-primary:hover, .randomize-magic-btn:hover {
  background: #0a84ff;
  color: #ffffff !important;
  transform: translateY(-0.5px);
  box-shadow: var(--primary-btn-hover-shadow);
}

.mac-btn-primary:active, .randomize-magic-btn:active,
.randomize-magic-btn.rolling {
  transform: translateY(0.5px) scale(0.98);
  filter: brightness(0.92);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

/* Secondary Button (Apple Tactile Card with Crisp Border & Bevel) */
.mac-btn-secondary {
  background: var(--secondary-btn-bg);
  color: var(--label-primary) !important;
  border: 1px solid var(--secondary-btn-border);
  box-shadow: var(--secondary-btn-shadow);
}

.mac-btn-secondary:hover {
  background: var(--bg-control-hover);
  color: var(--label-primary) !important;
  border-color: var(--separator-strong);
  transform: translateY(-0.5px);
  box-shadow: var(--secondary-btn-hover-shadow);
}

.mac-btn-secondary:active {
  transform: translateY(0.5px) scale(0.98);
  background: var(--bg-control);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* Tertiary Button (Muted Apple Control for Completed/Settled Actions) */
.mac-btn-tertiary {
  background: var(--tertiary-btn-bg);
  color: var(--label-tertiary) !important;
  border: 1px solid var(--tertiary-btn-border);
  box-shadow: none;
}

.mac-btn-tertiary:hover {
  background: var(--tertiary-btn-hover-bg);
  color: var(--label-secondary) !important;
  border-color: var(--tertiary-btn-hover-border);
}

.mac-btn-tertiary:active {
  transform: translateY(0.5px) scale(0.98);
  background: var(--tertiary-btn-bg);
}

.mac-btn-tertiary:disabled,
.mac-btn-tertiary:disabled:hover {
  background: var(--tertiary-btn-disabled-bg);
  color: var(--label-tertiary) !important;
  border-color: var(--tertiary-btn-disabled-border);
  box-shadow: none;
  cursor: default;
  transform: none;
}

/* Link Button (Borderless Minimalist Action) */
.mac-btn-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--system-blue);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  transition: all 0.12s ease;
}

.mac-btn-link:hover {
  background: rgba(0, 122, 255, 0.08);
  color: #0a84ff;
}

.mac-btn-link:active {
  transform: scale(0.96);
}

/* Button Sizing Hierarchy */
/* 1. Small (sm) - 24px */
.mac-btn-sm {
  height: 24px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  border-radius: 5px !important;
  gap: 5px !important;
}

.mac-btn-sm svg.lucide {
  width: 12px !important;
  height: 12px !important;
}

/* 2. Medium (md) - 28px (Default) */
.mac-btn-md, .randomize-magic-btn {
  height: 28px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  border-radius: var(--radius-sm) !important;
  gap: 6px !important;
}

.mac-btn-md svg.lucide, .randomize-magic-btn svg.lucide {
  width: 14px !important;
  height: 14px !important;
}

/* 3. Large (lg) - 36px */
.mac-btn-lg {
  height: 36px !important;
  padding: 0 18px !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  border-radius: var(--radius-md) !important;
  gap: 8px !important;
}

.mac-btn-lg svg.lucide {
  width: 16px !important;
  height: 16px !important;
}

/* Randomizer Magic Button Specifics */
.randomize-magic-btn {
  padding: 0 10px 0 9px !important;
  gap: 7px !important;
}

.magic-dice-icon {
  font-size: 14px !important;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.randomize-magic-btn:hover .magic-dice-icon {
  transform: rotate(45deg) scale(1.18);
}

.randomize-magic-btn.rolling .magic-dice-icon {
  animation: diceRollSpin 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes diceRollSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.35); }
  100% { transform: rotate(360deg) scale(1); }
}

.magic-btn-text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: -0.15px;
}

.magic-btn-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 16px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.28);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #ffffff;
}

.mac-btn-secondary .magic-btn-kbd {
  background: var(--bg-control);
  border: 1px solid var(--separator);
  color: var(--label-secondary);
}

.text-red { color: var(--system-red) !important; }
.text-orange { color: var(--system-orange) !important; }
.text-purple { color: var(--system-purple) !important; }

/* Clean Generator Toolbar */
.generator-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 48px;
  padding: 0 32px;
  background: var(--bg-window);
  border-bottom: 1px solid var(--separator);
  position: relative;
}

.generator-greeting-box {
  display: flex;
  align-items: center;
  user-select: none;
  min-width: 0;
}

.generator-greeting-text {
  font-family: "Gloria Hallelujah", cursive, sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0.2px;
  color: var(--label-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.95;
}

.generator-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.lock-filter-wrapper {
  position: relative;
}

.lock-filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  width: 290px;
  background: var(--bg-card);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  padding: 12px;
  z-index: 50;
  animation: popoverFadeIn 0.12s ease;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.lock-popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 2px 8px 2px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 10px;
}

.lock-popover-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--label-tertiary);
  text-transform: uppercase;
}

.lock-popover-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lock-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.lock-form-group label {
  font-size: 11px;
  font-weight: 700;
  color: var(--label-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.lock-form-group label svg.lucide {
  width: 13px !important;
  height: 13px !important;
  color: var(--system-blue);
  stroke-width: 1.5px !important;
}

.lock-popover-actions {
  padding-top: 8px;
  border-top: 1px solid var(--separator);
  margin-top: 2px;
}

/* ==========================================================================
   MARK: - Apple HIG Seamless Document Layout (No Big Boxy Card)
   ========================================================================== */

.apple-doc-view {
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  animation: cardFadeScaleIn 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardFadeScaleIn {
  from { opacity: 0.55; transform: translateY(4px) scale(0.996); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header Metadata & Toolbar Bar */
.apple-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 0;
  margin-bottom: 18px;
  border-bottom: none;
  flex-wrap: wrap;
}

.mac-badges-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.mac-badges-group::-webkit-scrollbar {
  display: none;
}

.mac-capsule-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-capsule);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), filter 0.12s ease;
}

.mac-capsule-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.mac-capsule-badge svg.lucide,
.mac-capsule-badge i[data-lucide] {
  width: 12px !important;
  height: 12px !important;
  stroke-width: 1.5px !important;
  flex-shrink: 0;
}

.apple-task-badge-group {
  flex-wrap: wrap;
  overflow: visible;
}

.apple-task-badge {
  max-width: min(100%, 320px);
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.12);
}

.apple-industry-badge {
  max-width: min(100%, 320px);
  color: var(--label-primary);
  background: rgba(255, 255, 255, 0.08);
}

.apple-task-badge svg,
.apple-task-badge i,
.apple-industry-badge svg,
.apple-industry-badge i {
  color: currentColor;
}

.apple-task-badge span,
.apple-industry-badge span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apple-actions-cluster {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.apple-icon-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--label-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.apple-icon-btn:hover {
  background: var(--bg-control);
  color: var(--label-primary);
}

.apple-icon-btn:active {
  transform: scale(0.94);
}

.apple-icon-btn svg.lucide,
.apple-icon-btn i[data-lucide] {
  width: 15px !important;
  height: 15px !important;
  stroke-width: 1.5px !important;
}

.apple-icon-btn.done {
  color: var(--system-green) !important;
}

.apple-icon-btn.done svg.lucide {
  color: var(--system-green);
  stroke-width: 2px !important;
}

.apple-icon-btn.active-star {
  color: var(--system-yellow);
}

.apple-icon-btn.active-star svg.lucide {
  color: var(--system-yellow);
  fill: var(--system-yellow);
  stroke-width: 2px !important;
}

.apple-icon-btn.active-notes {
  color: var(--system-blue);
  background: rgba(0, 122, 255, 0.12);
}

.apple-icon-btn.active-notes svg.lucide {
  color: var(--system-blue);
  stroke-width: 1.8px !important;
}

.apple-icon-btn.sprint-btn {
  color: var(--system-blue);
}

.apple-icon-btn.sprint-btn:hover {
  background: rgba(0, 122, 255, 0.12);
  color: var(--system-blue);
}

/* Title Section */
.apple-title-block {
  padding: 0 0 20px 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apple-title-heading {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.25;
  color: var(--label-primary);
}

.apple-subtitle-text {
  font-size: 14px;
  font-weight: 400;
  color: var(--label-secondary);
  line-height: 1.5;
}

/* Target Persona & Friction Statement Card */
.apple-persona-card {
  margin: 18px 0 26px 0;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--bg-control);
  border: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.12s ease;
}

.persona-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.persona-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-capsule);
  background: rgba(0, 122, 255, 0.12);
  color: var(--system-blue);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.persona-badge-icon {
  width: 11px !important;
  height: 11px !important;
  stroke-width: 2.5px;
}

.persona-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--label-primary);
  letter-spacing: -0.2px;
}

.persona-friction-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.persona-quote-icon {
  width: 14px !important;
  height: 14px !important;
  color: var(--system-blue);
  opacity: 0.75;
  margin-top: 2px;
  flex-shrink: 0;
}

.persona-problem-text {
  font-size: 13px;
  line-height: 1.55;
  color: var(--label-secondary);
  font-style: italic;
  margin: 0;
}

/* Practice Reflections (Apple Notes Style) */
.apple-notes-drawer {
  margin: 0 0 24px 0;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-control);
  border: 1px solid var(--separator);
}

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

.apple-notes-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--system-blue);
}

.apple-autosave-badge {
  font-size: 9px;
  font-weight: 600;
  color: var(--label-tertiary);
  text-transform: uppercase;
}

.apple-notes-textarea {
  width: 100%;
  min-height: 80px;
  background: var(--bg-input);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--label-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.5;
  outline: none;
  resize: none;
}

.apple-notes-textarea::placeholder {
  color: var(--label-tertiary);
}

/* Seamless Underline Tab Navigation (Apple HIG - Fixed, Non-Scrollable) */
.apple-tab-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--separator);
  margin-bottom: 20px;
  overflow: hidden;
  flex-wrap: nowrap;
}

.apple-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 6px;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--label-secondary);
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color 0.12s ease;
  flex-shrink: 0;
}

.apple-tab-btn:hover {
  color: var(--label-primary);
}

.apple-tab-btn.active {
  color: var(--system-blue);
  font-weight: 700;
}

.apple-tab-btn.active svg.lucide {
  color: var(--system-blue);
  stroke-width: 2px !important;
}

.apple-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--system-blue);
  border-radius: 2px;
}

.apple-tab-btn svg.lucide,
.apple-tab-btn i[data-lucide] {
  width: 14px !important;
  height: 14px !important;
  stroke-width: 1.5px !important;
}

/* Tab Panes */
.apple-tab-body {
  padding: 4px 0 24px 0;
  min-height: 240px;
}

.apple-tab-pane {
  display: none;
  opacity: 0;
}

.apple-tab-pane.active {
  display: block;
  animation: tabFadeIn 0.12s ease forwards;
}

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

.apple-section-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--label-tertiary);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Apple Reminders Style Interactive Checklist */
.apple-checklist {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.apple-check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s ease;
  user-select: none;
}

.apple-check-row:hover {
  background: var(--bg-control);
}

.apple-checkbox-icon {
  width: 16px !important;
  height: 16px !important;
  color: var(--label-tertiary);
  margin-top: 2px;
  flex-shrink: 0;
  transition: color 0.12s ease;
}

.apple-check-row.done .apple-checkbox-icon {
  color: var(--system-green);
}

.apple-check-text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--label-primary);
  transition: all 0.12s ease;
}

.apple-check-row.done .apple-check-text {
  text-decoration: line-through;
  color: var(--label-tertiary);
}

/* Deliverables List */
.apple-deliverables-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apple-deliverable-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 2px 0;
  color: var(--label-secondary);
}

.deliverable-icon {
  width: 14px !important;
  height: 14px !important;
  color: var(--system-blue);
  flex-shrink: 0;
}

/* Accent Cards (Twists & Motion) */
.apple-accent-card {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
}

.accent-orange {
  background: rgba(255, 159, 10, 0.08);
  border-left: 3px solid var(--system-orange);
  color: var(--label-primary);
}

.accent-purple {
  background: rgba(191, 90, 242, 0.08);
  border-left: 3px solid var(--system-purple);
  color: var(--label-primary);
}

.apple-token-box {
  background: var(--bg-card);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--label-primary);
}

.apple-code-box {
  background: var(--bg-input);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--label-primary);
  line-height: 1.5;
}

/* ==========================================================================
   MARK: - Split Views (Mastery, Saved, History, Sprint)
   ========================================================================== */

.mac-split-view {
  display: flex;
  height: 100%;
  width: 100%;
}

.split-left-pane {
  width: 350px;
  min-width: 300px;
  max-width: 440px;
  border-right: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  background: var(--bg-window);
}

.split-right-pane {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  background: var(--bg-window);
}

#mastery-detail-mount {
  padding-top: 32px;
}

/* Search Bar */
.search-bar-container {
  padding: 10px;
  border-bottom: 1px solid var(--separator);
  position: relative;
}

.search-input-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  background: var(--bg-input);
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  padding: 0 8px;
}

.search-input-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--label-primary);
}

.search-icon {
  width: 13px;
  height: 13px;
  color: var(--label-tertiary);
}

.filter-icon-btn {
  background: transparent;
  border: none;
  color: var(--label-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.filter-icon-btn:hover {
  color: var(--system-blue);
}

.clear-btn {
  background: transparent;
  border: none;
  color: var(--label-tertiary);
  cursor: pointer;
}

/* Filter Popover */
.filter-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 12px;
  right: 12px;
  background: var(--bg-card);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-md);
  padding: 12px;
  z-index: 50;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: popoverFadeIn 0.12s ease;
}

.filter-popover-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-popover-item label {
  font-size: 11px;
  font-weight: 700;
  color: var(--label-secondary);
}

.mac-select {
  width: 100%;
  height: 30px;
  background-color: var(--bg-input);
  border: 1px solid var(--separator);
  color: var(--label-primary);
  padding: 0 28px 0 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(140,140,140,0.85)' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
  transition: all 0.12s ease;
}

.mac-select:hover {
  background-color: var(--bg-control-hover);
  border-color: var(--separator-strong);
}

.mac-select:focus {
  border-color: var(--system-blue);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.25);
}

.mac-select option {
  background-color: var(--bg-card);
  color: var(--label-primary);
  padding: 4px;
}

.filter-popover-actions {
  display: flex;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--separator);
}

.active-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.active-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  background: rgba(10, 132, 255, 0.12);
  color: var(--system-blue);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
}

.active-tag-pill button {
  background: transparent;
  border: none;
  color: inherit;
  cursor: pointer;
  font-weight: bold;
}

/* List Rows Scroll */
.mastery-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 10px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mastery-row {
  padding: 9px 12px;
  margin: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.mastery-row:hover {
  background: var(--bg-control);
  border: none !important;
  box-shadow: none !important;
}

.mastery-row.selected {
  background: rgba(10, 132, 255, 0.16);
  border: none !important;
  box-shadow: none !important;
}

.mastery-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.mastery-row-meta-left {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  flex: 1;
}

.mastery-index-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--label-tertiary);
  background: var(--bg-input);
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}

.mastery-row-category {
  font-size: 11px;
  color: var(--label-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-star-icon {
  font-size: 11px !important;
  color: var(--system-yellow);
  -webkit-text-stroke: 0.35px var(--system-yellow);
  flex-shrink: 0;
}

.mastery-row-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--label-primary);
  word-break: break-word;
}

.mastery-row-bottom {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--label-tertiary);
}

/* ==========================================================================
   MARK: - Leaderboard & 3 Contributor Standards (Gold, Silver, Bronze)
   ========================================================================== */

/* ==========================================================================
   MARK: - Product Design Library & In-App PDF Research Reader
   ========================================================================== */

.library-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 32px 48px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ==========================================================================
   macOS Apple Notes App Styling & Split View
   ========================================================================== */

.notes-app-container {
  display: flex;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg-window);
}

/* Left Pane: Notes List & Filter */
.notes-list-pane {
  width: 320px;
  min-width: 280px;
  max-width: 360px;
  background: var(--material-sidebar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--separator);
  display: flex;
  flex-direction: column;
  height: 100%;
  flex-shrink: 0;
}

.notes-pane-header {
  padding: 16px 16px 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.notes-pane-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.notes-pane-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--label-primary);
  margin: 0;
}

.notes-count-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--label-secondary);
  background: var(--fill-muted-strong);
  padding: 2px 7px;
  border-radius: var(--radius-capsule);
}

.notes-new-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--fill-muted-strong);
  border: 1px solid var(--separator);
  color: var(--label-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.notes-new-btn:hover {
  background: var(--system-yellow);
  color: #000000;
  border-color: var(--system-yellow);
  transform: scale(1.05);
}

/* Search Box */
.notes-search-wrapper {
  padding: 0 14px 10px 14px;
}

.notes-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px;
  transition: border-color 0.15s ease;
}

.notes-search-box:focus-within {
  border-color: var(--system-yellow);
  background: rgba(255, 255, 255, 0.09);
}

.notes-search-box input {
  flex: 1;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 12.5px;
  font-family: var(--font-sans);
  outline: none;
}

.notes-search-box input::placeholder {
  color: var(--label-tertiary);
}

/* Category Filter Pills */
.notes-folder-pills {
  display: flex;
  gap: 6px;
  padding: 0 14px 12px 14px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-shrink: 0;
}

.notes-folder-pills::-webkit-scrollbar {
  display: none;
}

.note-filter-pill {
  padding: 4px 10px;
  border-radius: var(--radius-capsule);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--label-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s ease;
}

.note-filter-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.note-filter-pill.active {
  background: #ffd60a;
  color: #000000;
  border-color: #ffd60a;
  font-weight: 700;
}

/* Notes List Scroll */
.notes-list-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 20px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.notes-group-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--label-tertiary);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  padding: 10px 8px 4px 8px;
}

/* Apple Note Card */
.apple-note-card {
  padding: 10px 12px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.12s ease;
  user-select: none;
}

.apple-note-card:hover {
  background: rgba(255, 255, 255, 0.06);
}

.apple-note-card.active {
  background: #ffd60a;
  color: #000000 !important;
  box-shadow: 0 4px 12px rgba(255, 214, 10, 0.2);
}

.apple-note-card.active .note-card-title,
.apple-note-card.active .note-card-preview,
.apple-note-card.active .note-card-date {
  color: #000000 !important;
}

.apple-note-card.active .note-category-tag {
  background: rgba(0, 0, 0, 0.15) !important;
  color: #000000 !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
}

.note-card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.note-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.note-pin-icon {
  color: #ffd60a;
  font-size: 11px;
  flex-shrink: 0;
}

.note-card-preview-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
}

.note-card-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--label-secondary);
  white-space: nowrap;
  font-feature-settings: "tnum";
}

.note-card-preview {
  color: var(--label-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.note-category-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--label-secondary);
  align-self: flex-start;
  margin-top: 2px;
}

/* Right Pane: Note Editor Canvas */
.notes-editor-pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-window);
  overflow: hidden;
  position: relative;
}

.notes-editor-toolbar {
  height: 48px;
  background: var(--material-sidebar);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--separator);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  z-index: 10;
}

.notes-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.notes-date-label {
  font-size: 11.5px;
  color: var(--label-secondary);
  font-feature-settings: "tnum";
}

.notes-category-select {
  background: var(--fill-muted-strong);
  border: 1px solid var(--separator);
  color: var(--label-primary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
}

.notes-toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-action-icon-btn {
  height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--label-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}

.note-action-icon-btn:hover {
  background: var(--fill-muted-strong);
  color: var(--label-primary);
}

.note-action-icon-btn.active {
  color: #ffd60a;
  background: rgba(255, 214, 10, 0.15);
  border-color: rgba(255, 214, 10, 0.3);
}

.note-action-icon-btn.danger:hover {
  color: var(--system-red);
  background: rgba(255, 69, 58, 0.12);
}

/* Note Editor Content Scroll */
.notes-editor-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 36px 56px 80px 56px;
  display: flex;
  flex-direction: column;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

.note-title-input {
  border: none;
  background: transparent;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.6px;
  color: #ffffff;
  width: 100%;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", var(--font-sans);
  margin-bottom: 16px;
  line-height: 1.2;
}

.note-title-input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

/* Quick Formatting Toolbar */
.note-format-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.format-btn {
  padding: 3px 8px;
  border-radius: 4px;
  background: transparent;
  border: none;
  color: var(--label-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.12s ease;
}

.format-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.format-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}

/* Note Body Textarea */
.note-body-textarea {
  width: 100%;
  min-height: 480px;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  line-height: 1.8;
  color: #f4f4f5;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", var(--font-sans);
  resize: none;
  box-sizing: border-box;
}

.note-body-textarea::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

/* Empty State */
.notes-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 40px;
  color: var(--label-tertiary);
  gap: 12px;
}

.notes-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 214, 10, 0.15);
  color: #ffd60a;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   MARK: - Apple macOS Clock Native Timer UI (1:1 CleanShot Replica)
   ========================================================================== */

.sprint-dashboard-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
}

.sprint-duration-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.duration-pill {
  height: 28px;
  padding: 0 14px;
  border-radius: var(--radius-capsule);
  background: var(--bg-control);
  border: none;
  color: var(--label-secondary);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.duration-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--label-primary);
}

.duration-pill.active {
  background: rgba(10, 132, 255, 0.22);
  border: none;
  color: #64d2ff;
}

/* Apple Timer Container (Responsive Circle) */
.apple-timer-container {
  position: relative;
  width: 250px;
  height: 250px;
  max-width: 100%;
  margin: 0 auto 16px auto;
  user-select: none;
}

.apple-timer-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}

.apple-timer-bg {
  fill: none;
  stroke: #333336;
  stroke-width: 5;
}

.apple-timer-fill {
  fill: none;
  stroke: var(--system-blue);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 917.345;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 0.95s linear;
}

.apple-timer-fill.no-anim {
  transition: none !important;
}

.apple-timer-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Bell & Target End Time (🔔 11:32 PM) */
.apple-timer-bell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 2px;
}

.apple-timer-bell svg, .apple-timer-bell i {
  width: 13px !important;
  height: 13px !important;
  color: rgba(255, 255, 255, 0.65);
}

/* Huge Light-Weight Digits (SF Pro Display font-weight 300) */
.apple-timer-time {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, sans-serif;
  font-size: 64px;
  font-weight: 300;
  letter-spacing: -2px;
  font-feature-settings: "tnum";
  color: #ffffff;
  line-height: 1;
  margin: 4px 0;
}

/* Actions Row: Cancel & Start/Pause */
.apple-timer-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 16px;
}

.apple-timer-btn {
  min-width: 90px;
  height: 34px;
  border-radius: 17px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.apple-timer-btn-cancel {
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
}

.apple-timer-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.apple-timer-btn-start {
  background: rgba(10, 132, 255, 0.22);
  color: #64d2ff;
}

.apple-timer-btn-start:hover {
  background: rgba(10, 132, 255, 0.32);
  color: #ffffff;
}

.apple-timer-btn-start.running {
  background: rgba(10, 132, 255, 0.28);
  color: #64d2ff;
}

.sprint-divider {
  width: 100%;
  height: 1px;
  background: var(--separator);
  margin-bottom: 14px;
}

.sprint-scratchpad-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 2px;
}

.scratchpad-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.scratchpad-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--label-primary);
}

.mac-textarea {
  width: 100%;
  min-height: 96px;
  max-height: 220px;
  resize: vertical;
  background: var(--bg-input);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--label-primary);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  box-sizing: border-box;
  display: block;
}

.mac-textarea::placeholder {
  color: var(--label-tertiary);
  opacity: 0.65;
}

.mac-textarea:hover {
  background: var(--card-hover-fill);
  border-color: var(--separator-strong);
}

.mac-textarea:focus {
  border-color: var(--system-blue);
  background: var(--bg-input);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.3);
}

.sprint-brief-shell {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.sprint-brief-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}

.sprint-brief-footer {
  padding: 12px 16px 16px;
  border-top: 1px solid var(--separator);
  background: color-mix(in srgb, var(--bg-window) 92%, transparent);
}

.sprint-complete-upload-btn {
  width: 100%;
  min-height: 32px;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.sprint-complete-upload-btn.is-completed {
  cursor: default;
  opacity: 0.86;
}

.forum-view {
  flex: 1;
  overflow-y: auto;
  padding: 24px 44px 64px 0;
}

.forum-shell {
  width: 100%;
  margin: 0;
}

.forum-layout {
  display: block;
  width: 100%;
}

.forum-channel-tabs {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 24px;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--fill-muted);
  box-sizing: border-box;
}

.forum-channel-list {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  gap: 6px;
  padding: 0;
}

.forum-channel-btn {
  position: relative;
  width: auto;
  max-width: none;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--label-secondary);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 0 10px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.forum-channel-btn:hover {
  color: var(--label-primary);
  background: var(--fill-muted-strong);
}

.forum-channel-btn:active {
  transform: scale(0.98);
}

.forum-channel-btn.is-active {
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.14);
}

.forum-channel-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
}

.forum-channel-icon svg,
.forum-channel-icon i {
  width: 14px;
  height: 14px;
}

.forum-channel-label {
  min-width: 0;
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

.forum-channel-count {
  position: static;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-capsule);
  background: rgba(255, 255, 255, 0.07);
  color: currentColor;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
}

.forum-main-feed {
  width: min(920px, 100%);
  margin: 0 auto;
  min-width: 0;
}

.forum-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  margin-bottom: 24px;
}

.forum-header h1 {
  margin: 0;
  color: var(--label-primary);
  font-family: var(--font-brand);
  font-size: 36px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
}

.forum-header p {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--label-secondary);
  font-size: 13px;
  line-height: 1.45;
}

.forum-question-open-btn {
  flex: 0 0 auto;
  margin-left: auto;
  height: 32px;
  padding: 0 12px;
  white-space: nowrap;
}

.forum-question-open-btn svg,
.forum-question-open-btn i {
  width: 14px;
  height: 14px;
}

.forum-question-sheet {
  width: min(430px, calc(100vw - 32px));
  max-width: 430px;
  padding: 12px;
  gap: 0;
  border-radius: 16px;
}

.forum-question-titlebar {
  min-height: 32px;
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  margin-bottom: 10px;
}

.forum-question-titlebar h2 {
  margin: 0;
  color: var(--label-primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.forum-question-titlebar .apple-icon-btn {
  justify-self: end;
}

.forum-question-modal .forum-question-composer {
  display: grid;
  gap: 10px;
}

.forum-question-group {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.forum-question-field-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}

.forum-question-field-row + .forum-question-field-row {
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.forum-question-field-row > span {
  color: var(--label-secondary);
  font-size: 11px;
  font-weight: 700;
}

.forum-question-field-row-stack {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px 12px;
}

.forum-question-photo-row {
  min-height: 60px;
}

.forum-question-photo-picker {
  min-width: 0;
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--label-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.forum-question-photo-picker:hover {
  color: var(--label-primary);
}

.forum-question-photo-preview {
  width: 54px;
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgba(10, 132, 255, 0.12);
  color: var(--system-blue);
}

.forum-question-photo-preview svg,
.forum-question-photo-preview i {
  width: 17px;
  height: 17px;
}

.forum-question-photo-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.forum-question-title,
.forum-question-body {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--label-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.forum-question-title {
  height: 34px;
  padding: 0 12px;
}

.forum-question-body {
  min-height: 72px;
  resize: vertical;
  padding: 10px 12px;
  line-height: 1.45;
}

.forum-question-title:focus,
.forum-question-body:focus {
  border-color: rgba(10, 132, 255, 0.74);
  background: rgba(255, 255, 255, 0.045);
}

.forum-question-modal .forum-question-title,
.forum-question-modal .forum-question-body {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.forum-question-modal .forum-question-title {
  padding: 0;
}

.forum-question-modal .forum-question-body {
  padding: 0;
}

.forum-question-modal .forum-question-title:focus,
.forum-question-modal .forum-question-body:focus {
  background: transparent;
}

.forum-question-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.forum-question-submit {
  height: 32px;
  padding: 0 12px;
}

.forum-question-submit svg,
.forum-question-submit i {
  width: 14px;
  height: 14px;
}

.forum-thread-list {
  display: flex;
  flex-direction: column;
  overflow: visible;
  border: 0;
  background: transparent;
}

.forum-thread-list.is-empty {
  min-height: 420px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
}

.forum-empty-state {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: var(--label-secondary);
}

.forum-empty-state > svg,
.forum-empty-state > i {
  width: 32px !important;
  height: 32px !important;
  margin-bottom: 14px;
  color: var(--system-blue);
}

.forum-empty-state h2 {
  margin: 0 0 6px;
  color: var(--label-primary);
  font-size: 18px;
}

.forum-empty-state p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.forum-thread {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 14px 16px 16px 0;
  border-radius: var(--radius-card);
  border-bottom: 0;
  background: transparent;
  transition: background 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.forum-thread:last-child {
  border-bottom: 0;
}

.forum-thread-preview:hover,
.forum-thread-preview:focus-visible {
  background: var(--card-hover-fill);
}

.forum-thread-preview {
  margin: 0 -12px;
  padding: 14px 28px 16px 12px;
  cursor: pointer;
}

.forum-thread-preview:active {
  transform: scale(0.995);
}

.forum-thread-preview:focus-visible {
  outline: 2px solid rgba(10, 132, 255, 0.55);
  outline-offset: -2px;
}

.forum-thread-detail:hover {
  background: transparent;
}

.forum-thread-detail {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  padding-left: 10px;
}

.forum-thread-side-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 1px;
}

.forum-side-back-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(10, 132, 255, 0.18);
  border: 0;
  color: var(--system-blue);
  box-shadow: none;
  cursor: pointer;
  transition: background 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.forum-side-back-btn:hover {
  background: rgba(10, 132, 255, 0.24);
}

.forum-side-back-btn:active {
  transform: scale(0.94);
}

.forum-side-back-btn svg,
.forum-side-back-btn i {
  width: 17px;
  height: 17px;
}

.forum-review-rail {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.forum-review-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--fill-muted);
  color: var(--label-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.forum-review-btn:hover {
  background: rgba(10, 132, 255, 0.14);
  color: var(--system-blue);
}

.forum-review-btn:active {
  transform: scale(0.94);
}

.forum-review-btn svg,
.forum-review-btn i {
  width: 16px;
  height: 16px;
}

.forum-review-approve-btn {
  color: var(--system-green);
  background: rgba(48, 209, 88, 0.12);
}

.forum-review-tips-btn {
  color: var(--system-orange);
  background: rgba(255, 159, 10, 0.12);
}

.forum-review-tips-sheet {
  position: relative;
  width: min(430px, calc(100vw - 32px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
}

.forum-review-tips-group {
  display: grid;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
}

.forum-review-tips-input {
  min-height: 92px;
  resize: vertical;
  padding: 8px 0;
  background: transparent;
  border: 0;
  color: var(--label-primary);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  outline: none;
}

.forum-discussion-view {
  min-width: 0;
}

.forum-discussion-back-btn {
  margin-bottom: 14px;
  color: var(--system-blue);
  font-size: 12px;
  font-weight: 700;
}

.forum-vote-rail {
  display: none !important;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding-top: 2px;
  color: var(--label-tertiary);
}

.forum-vote-btn {
  min-width: 34px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 0;
  border-radius: var(--radius-capsule);
  background: transparent;
  color: var(--label-tertiary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.forum-vote-btn:hover {
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.12);
}

.forum-vote-btn:active {
  transform: scale(0.94);
}

.forum-like-btn:hover {
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.12);
}

.forum-dislike-btn:hover {
  color: var(--system-red);
  background: rgba(255, 69, 58, 0.1);
}

.forum-like-btn.is-active {
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.14);
}

.forum-dislike-btn.is-active {
  color: var(--system-red);
  background: rgba(255, 69, 58, 0.12);
}

.forum-vote-btn svg,
.forum-vote-btn i {
  width: 13px;
  height: 13px;
}

.forum-vote-btn span {
  line-height: 1;
}

.forum-approval-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-capsule);
  background: var(--fill-muted);
  color: var(--label-secondary);
  font-size: 11px;
  font-weight: 800;
}

.forum-approval-badge svg,
.forum-approval-badge i {
  width: 12px;
  height: 12px;
}

.forum-approval-approved {
  color: var(--system-green);
  background: rgba(48, 209, 88, 0.12);
}

.forum-approval-pending {
  color: var(--system-orange);
  background: rgba(255, 159, 10, 0.12);
}

.forum-approval-needs-work {
  color: var(--system-red);
  background: rgba(255, 69, 58, 0.1);
}

.forum-approval-tips {
  margin-top: 7px !important;
  color: var(--label-secondary) !important;
  font-size: 12px !important;
}

.forum-thread-main {
  min-width: 0;
}

.forum-thread-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--label-tertiary);
  font-size: 11px;
  font-weight: 600;
}

.forum-thread-meta > :not(:last-child)::after {
  content: "";
  width: 3px;
  height: 3px;
  margin-left: 8px;
  display: inline-block;
  vertical-align: middle;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.forum-thread-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.forum-author-avatar {
  width: 18px;
  height: 18px;
  min-width: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(10, 132, 255, 0.18);
  color: var(--system-blue);
  font-family: var(--font-sans);
  font-size: 7px;
  font-weight: 800;
  line-height: 1;
}

.forum-author-avatar-img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: cover;
}

.forum-author-chip {
  color: var(--label-primary);
  font-weight: 700;
}

.forum-thread-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 152px;
  gap: 14px;
  align-items: start;
}

.forum-thread-content.no-attachment {
  grid-template-columns: minmax(0, 1fr);
}

.forum-thread-copy {
  min-width: 0;
}

.forum-thread h2 {
  margin: 0;
  color: var(--label-primary);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.forum-thread-subtitle {
  margin: 5px 0 0;
  color: var(--label-tertiary);
  font-size: 12px;
  line-height: 1.35;
}

.forum-thread-caption {
  margin: 10px 0 0;
  color: var(--label-secondary);
  font-size: 13px;
  line-height: 1.5;
}

.forum-link {
  color: var(--system-blue);
  font-weight: 700;
  text-decoration: none;
}

.forum-link:hover {
  text-decoration: underline;
}

.forum-thread-attachment-btn {
  width: 152px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--bg-control);
  border: 1px solid rgba(255, 255, 255, 0.075);
  padding: 0;
  cursor: zoom-in;
  transition: border-color 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1), filter 0.14s ease;
}

.forum-thread-attachment-btn:hover {
  border-color: rgba(10, 132, 255, 0.45);
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.forum-thread-attachment-btn img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.forum-thread-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 13px;
}

.forum-thread-preview .forum-thread-actions {
  opacity: 0;
  pointer-events: none;
  transform: translateX(4px);
  transition: opacity 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.forum-thread-preview:hover .forum-thread-actions,
.forum-thread-preview:focus-visible .forum-thread-actions,
.forum-thread-preview:focus-within .forum-thread-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.forum-credit-row {
  display: none !important;
}

.forum-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--label-secondary) !important;
  cursor: pointer;
}

.forum-action-btn:hover {
  color: var(--label-primary) !important;
}

.forum-action-btn.mac-btn {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.forum-action-btn svg,
.forum-action-btn i {
  width: 15px;
  height: 15px;
}

.forum-footer-vote-btn {
  min-width: 0;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--label-secondary);
  font-family: var(--font-mono);
  font-size: 13px;
}

.forum-footer-vote-btn:hover,
.forum-footer-vote-btn.is-active {
  background: transparent;
}

.forum-footer-vote-btn svg,
.forum-footer-vote-btn i {
  width: 15px;
  height: 15px;
}

.forum-replies {
  width: 100%;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 0;
}

.forum-replies-empty {
  color: var(--label-secondary);
  font-size: 12px;
  line-height: 1.4;
  margin-top: 10px;
}

.forum-reply {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  position: relative;
  padding-top: 12px;
}

.forum-reply-depth-1 {
  margin-left: 0;
}

.forum-reply-depth-2 {
  margin-left: 0;
}

.forum-reply-avatar-wrap {
  width: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  justify-self: center;
}

.forum-reply-collapsed > .forum-reply-body > .forum-reply-children {
  display: none;
}

.forum-reply-children {
  margin: 10px 0 0;
  padding-top: 2px;
  padding-left: 12px;
  border-left: 1px solid var(--separator);
}

.forum-reply-avatar {
  width: 20px;
  height: 20px;
  min-width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(10, 132, 255, 0.18);
  color: var(--system-blue);
  font-family: var(--font-sans);
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1;
}

.forum-reply-avatar-img {
  width: 20px;
  height: 20px;
  display: block;
  object-fit: cover;
}

.forum-reply-body {
  min-width: 0;
  padding-top: 1px;
}

.forum-reply-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--label-tertiary);
  font-size: 11px;
  line-height: 1.2;
}

.forum-reply-author {
  color: var(--label-primary);
  font-size: 12px;
}

.forum-reply p {
  margin: 4px 0 0;
  color: var(--label-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.forum-reply-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  color: var(--label-tertiary);
}

.forum-reply-vote-btn {
  width: auto;
  min-width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 2px;
  border: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--label-tertiary);
  cursor: pointer;
  transition: color 0.14s ease, background 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.forum-reply-vote-btn:hover {
  color: var(--label-primary);
  background: var(--fill-muted);
}

.forum-reply-vote-btn:active {
  transform: scale(0.94);
}

.forum-reply-like-btn.is-active {
  color: var(--system-blue);
}

.forum-reply-dislike-btn.is-active {
  color: var(--system-red);
}

.forum-reply-vote-btn svg,
.forum-reply-vote-btn i {
  width: 13px;
  height: 13px;
}

.forum-reply-vote-btn span {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.forum-reply-action {
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--label-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.forum-reply-action:hover {
  color: var(--label-primary);
}

.forum-reply-delete-btn {
  color: var(--system-red);
}

.forum-reply-delete-btn:hover {
  color: var(--system-red);
}

.forum-reply-action svg,
.forum-reply-action i {
  width: 15px;
  height: 15px;
}

.forum-reply-toggle {
  height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--label-tertiary);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.forum-reply-toggle:hover {
  color: var(--label-secondary);
}

.forum-reply-toggle svg,
.forum-reply-toggle i {
  width: 13px;
  height: 13px;
}

.forum-comment-compose {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.forum-reply-compose {
  margin: 8px 0 0;
  padding-right: 4px;
}

.forum-comment-input {
  flex: 1;
  height: 30px;
  min-width: 0;
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--label-primary);
  padding: 0 10px;
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

.forum-comment-input:focus {
  border-color: rgba(10, 132, 255, 0.55);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.16);
}

.forum-comment-send {
  flex-shrink: 0;
}

.forum-image-viewer-sheet {
  position: relative;
  width: min(1120px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.forum-image-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(30, 30, 36, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#forum-image-full {
  width: 100%;
  max-height: calc(100vh - 130px);
  display: block;
  object-fit: contain;
  border-radius: var(--radius-card);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

.forum-image-viewer-caption {
  align-self: center;
  max-width: min(720px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--label-secondary);
  font-size: 12px;
}

.forum-image-viewer-caption strong {
  color: var(--label-primary);
  font-weight: 700;
}

@media (max-width: 900px) {
  .forum-view {
    padding: 24px 20px 56px;
  }

  .forum-layout {
    display: block;
  }

  .forum-channel-list {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .forum-channel-btn {
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .forum-channel-tabs {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  .forum-channel-list {
    min-width: 0;
  }

  .forum-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .forum-question-open-btn {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .forum-thread {
    grid-template-columns: 34px minmax(0, 1fr);
    padding-right: 0;
  }

  .forum-thread-content {
    grid-template-columns: 1fr;
  }

  .forum-thread-attachment-btn {
    width: min(180px, 100%);
  }
}

@media (max-width: 560px) {
  .mac-window {
    height: 100dvh;
  }

  .mac-layout {
    flex-direction: column;
    min-width: 0;
  }

  .mac-canvas {
    width: 100%;
    height: 100%;
  }

  .mac-sidebar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: calc(100vw - 16px) !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 56px;
    padding: 6px !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    border-right: 0;
    border-top: 1px solid var(--separator);
    border-radius: 18px;
    background: var(--floating-surface-bg);
    z-index: 120;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .sidebar-collapsed .mac-sidebar {
    width: calc(100vw - 16px) !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 6px !important;
  }

  .mac-sidebar > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
  }

  .sidebar-top-header,
  .sidebar-version-tag,
  .sidebar-row-label,
  .user-info-text {
    display: none !important;
  }

  .sidebar-list {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 2px;
    scrollbar-width: none !important;
  }

  .sidebar-list::-webkit-scrollbar {
    display: none;
  }

  .sidebar-row,
  .sidebar-collapsed .sidebar-row {
    width: 40px;
    min-width: 40px;
    max-width: 40px;
    height: 40px;
    flex: 0 0 40px;
    justify-content: center;
    padding: 0;
    margin: 0;
    border-radius: 12px;
  }

  .sidebar-icon-box,
  .sidebar-collapsed .sidebar-icon-box {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .sidebar-user-footer {
    display: none !important;
  }

  .dashboard-view,
  .admin-view,
  .users-view,
  .forum-view,
  .leaderboard-view {
    padding: 24px 18px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .dashboard-shell,
  .forum-main-feed,
  .leaderboard-shell,
  .admin-shell,
  .users-shell {
    width: 100%;
    margin: 0;
  }

  .dashboard-hero-lockup {
    gap: 12px;
  }

  .dashboard-progress-ring {
    width: 64px;
    height: 64px;
    padding: 4px;
  }

  .dashboard-hero h1 {
    font-size: 22px;
    line-height: 1.02;
  }

  .dashboard-gold-pill {
    height: 22px;
    padding: 0 8px;
    font-size: 10.5px;
  }

  .mac-split-view {
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .split-left-pane {
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: 42dvh;
    border-right: 0;
    border-bottom: 1px solid var(--separator);
  }

  .split-right-pane {
    min-height: 0;
    padding: 18px;
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  #mastery-detail-mount {
    padding-top: 18px;
  }

  .notes-toolbar,
  .sprint-duration-pills {
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none !important;
  }
}

.completion-upload-sheet {
  width: min(430px, calc(100vw - 32px));
  max-width: 430px;
  padding: 12px;
  gap: 0;
  border-radius: 16px;
}

.completion-upload-titlebar {
  min-height: 32px;
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  margin-bottom: 10px;
}

.completion-upload-titlebar h2 {
  margin: 0;
  color: var(--label-primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.completion-upload-titlebar .apple-icon-btn {
  justify-self: end;
}

.completion-upload-group {
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}

.completion-upload-field-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 12px;
}

.completion-upload-field-row + .completion-upload-field-row {
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.completion-upload-field-row > span {
  color: var(--label-secondary);
  font-size: 11px;
  font-weight: 700;
}

.completion-upload-field-row-stack {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px 12px;
}

.completion-upload-preview {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--label-secondary);
  background: rgba(10, 132, 255, 0.1);
  cursor: pointer;
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.14s ease, color 0.14s ease;
}

.completion-upload-preview:hover,
.completion-upload-preview.is-dragging {
  color: var(--label-primary);
  background: rgba(10, 132, 255, 0.16);
}

.completion-upload-preview svg,
.completion-upload-preview i {
  width: 20px;
  height: 20px;
  color: var(--system-blue);
}

.completion-upload-preview.has-image {
  display: block;
  min-height: 180px;
  background: transparent;
}

.completion-upload-preview img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: block;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.completion-upload-input,
.completion-upload-textarea {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 0;
  text-align: left;
  color: var(--label-primary);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  outline: none;
}

.completion-upload-input {
  height: 34px;
}

.completion-upload-textarea {
  min-height: 72px;
  max-height: 160px;
  padding: 0;
  resize: vertical;
  line-height: 1.45;
}

.completion-upload-input:focus,
.completion-upload-textarea:focus {
  background: transparent;
  box-shadow: none;
}

.completion-upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* Toast */
.toast-overlay {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 100;
}

.mac-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(30, 30, 38, 0.95);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-sm);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  animation: toastFadeIn 0.15s ease;
}

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

/* ==========================================================================
   MARK: - Apple Notes UI System & Control Hierarchy
   ========================================================================== */
.notes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 32px 0 32px;
  flex-shrink: 0;
  user-select: none;
}

.notes-toolbar-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Primary Action: Elevated compose button with Apple Blue style */
.notes-btn-primary {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: var(--radius-sm);
  background: var(--system-blue);
  color: #ffffff !important;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.notes-btn-primary:hover {
  background: #0a84ff;
  transform: translateY(-0.5px);
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.28);
}

.notes-btn-primary:active {
  transform: translateY(0.5px) scale(0.96);
  filter: brightness(0.92);
}

.notes-btn-primary svg.lucide, .notes-btn-primary i[data-lucide] {
  width: 15px !important;
  height: 15px !important;
  stroke-width: 1.8px !important;
  color: #ffffff !important;
}

/* Secondary Action: Borderless Apple dark glass tool button */
.notes-btn-secondary {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-control);
  color: var(--label-secondary);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 0;
}

.notes-btn-secondary:hover {
  background: var(--bg-control-hover);
  color: var(--label-primary);
  transform: translateY(-0.5px);
}

.notes-btn-secondary:active {
  transform: translateY(0.5px) scale(0.96);
}

.notes-btn-secondary.active {
  background: rgba(10, 132, 255, 0.18);
  color: var(--system-blue);
}

.notes-btn-secondary svg.lucide, .notes-btn-secondary i[data-lucide] {
  width: 15px !important;
  height: 15px !important;
  stroke-width: 1.6px !important;
}

/* Destructive / Ghost Action: Muted icon button with subtle red hover */
.notes-btn-ghost {
  width: 30px;
  height: 30px;
  min-width: 30px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--label-tertiary);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
  padding: 0;
}

.notes-btn-ghost:hover {
  background: rgba(255, 69, 58, 0.12);
  color: var(--system-red);
}

.notes-btn-ghost:active {
  transform: scale(0.94);
}

.notes-btn-ghost svg.lucide, .notes-btn-ghost i[data-lucide] {
  width: 15px !important;
  height: 15px !important;
  stroke-width: 1.5px !important;
}

/* Metadata timestamp inside editor */
.notes-timestamp {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--label-tertiary);
  margin-bottom: 6px;
  user-select: none;
  letter-spacing: 0.1px;
}

/* Light Motion Interactions for Notes Editor & List */
.notes-editor-inner {
  transition: opacity 0.14s ease, transform 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.note-enter-anim {
  animation: noteEditorEnter 0.16s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes noteEditorEnter {
  from { opacity: 0.4; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

.note-row-enter {
  animation: noteRowSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes noteRowSlideIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes checklistPulse {
  0% { transform: scale(0.92); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   MARK: - Apple Notes Header Compose & Empty State (Pure Apple HIG)
   ========================================================================== */

.notes-compose-btn {
  color: var(--label-primary);
}

.notes-compose-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--label-primary);
}

/* Apple Notes Empty State Canvas (1:1 macOS HIG) */
.apple-notes-empty-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px 24px;
  user-select: none;
  background: var(--bg-window);
  animation: noteEditorEnter 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-empty-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 320px;
  gap: 8px;
}

.apple-notes-icon-symbol {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 214, 10, 0.12);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-notes-icon-symbol:hover {
  transform: scale(1.04);
}

.apple-notes-icon-symbol svg.lucide, .apple-notes-icon-symbol i[data-lucide] {
  width: 26px !important;
  height: 26px !important;
  stroke-width: 1.6px !important;
  color: var(--system-yellow) !important;
}

.apple-empty-title {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: var(--label-primary);
  margin: 0;
}

.apple-empty-subtitle {
  font-family: var(--font-sans);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--label-tertiary);
  margin: 0 0 8px 0;
}

.apple-notes-create-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-capsule);
  background: var(--bg-control);
  border: none;
  color: var(--label-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-notes-create-pill-btn:hover {
  background: var(--bg-control-hover);
  color: var(--label-primary);
  transform: translateY(-1px);
}

.apple-notes-create-pill-btn:active {
  transform: translateY(0) scale(0.97);
}

.apple-notes-create-pill-btn svg.lucide, .apple-notes-create-pill-btn i[data-lucide] {
  width: 13px !important;
  height: 13px !important;
  color: var(--system-yellow);
}

.apple-notes-kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.1);
  color: var(--label-secondary);
  letter-spacing: 0.5px;
  margin-left: 2px;
}

.notes-timestamp-header {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--label-tertiary);
  text-align: center;
  margin-bottom: 4px;
  user-select: none;
  letter-spacing: 0.1px;
}

/* ==========================================================================
   MARK: - Notion Quotes & Interactive Apple Checklists
   ========================================================================== */

/* Note editable body surface */
.notes-body-editor {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 420px;
  padding: 8px 0;
  border: none;
  background: transparent;
  color: var(--label-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  outline: none;
  word-break: break-word;
}

.notes-body-editor.is-empty::before {
  content: attr(data-placeholder);
  color: var(--label-tertiary);
  pointer-events: none;
  position: absolute;
  top: 10px;
  left: 0;
  font-style: normal;
  line-height: 1.7;
  opacity: 0.7;
}

.notes-body-editor p {
  margin: 4px 0;
  min-height: 1.5em;
  outline: none;
}

.notes-body-editor.rich-note-full-selected > * {
  background: rgba(10, 132, 255, 0.24);
  border-radius: 5px;
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.18);
}

/* Notion-style Quote / Special Note Block */
.notion-quote {
  margin: 12px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--system-indigo);
  background: rgba(94, 92, 230, 0.08);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--label-primary);
  font-size: 14.5px;
  font-style: italic;
  line-height: 1.6;
  transition: background 0.12s ease;
}

.notion-quote:focus {
  outline: none;
  background: rgba(94, 92, 230, 0.14);
}

/* Interactive Apple Checklist Item */
.note-todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0;
  line-height: 1.6;
}

.note-checkbox {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--separator-strong);
  background: var(--bg-control);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  user-select: none;
  transition: all 0.14s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}

.note-checkbox:hover {
  border-color: var(--system-blue);
  background: var(--bg-control-hover);
  transform: scale(1.06);
}

.note-checkbox.checked {
  background: var(--system-blue);
  border-color: var(--system-blue);
  box-shadow: 0 1px 4px rgba(10, 132, 255, 0.35);
}

.note-checkbox svg {
  width: 11px !important;
  height: 11px !important;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  stroke-width: 3;
}

.note-checkbox i {
  width: 11px !important;
  height: 11px !important;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.note-checkbox.checked svg {
  opacity: 1;
}

.note-checkbox.checked i {
  opacity: 1;
}

.note-todo-text {
  flex: 1;
  outline: none;
  transition: opacity 0.14s ease, color 0.14s ease, text-decoration 0.14s ease;
}

.note-todo-item.completed .note-todo-text {
  text-decoration: line-through;
  text-decoration-color: var(--label-tertiary);
  color: var(--label-tertiary);
  opacity: 0.65;
}

.note-todo-text.completed {
  text-decoration: line-through;
  text-decoration-color: var(--label-tertiary);
  color: var(--label-tertiary);
  opacity: 0.65;
}

/* ==========================================================================
   MARK: - Notion Code Blocks & Clickable Link Chips
   ========================================================================== */

/* Clickable Link */
.note-link {
  color: var(--system-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  transition: color 0.12s ease;
}

.note-link:hover {
  color: #409cff;
}

/* Standalone Clickable Link Chip / Card */
.note-link-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  margin: 6px 0;
  background: var(--bg-control);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-sm);
  color: var(--system-blue) !important;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none !important;
  cursor: pointer;
  user-select: none;
  transition: all 0.14s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  max-width: 100%;
}

.note-link-chip:hover {
  background: var(--bg-control-hover);
  border-color: var(--system-blue);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(10, 132, 255, 0.25);
}

.note-link-chip:active {
  transform: translateY(0.5px) scale(0.98);
}

.note-link-chip svg.lucide, .note-link-chip i[data-lucide] {
  width: 13px !important;
  height: 13px !important;
  color: var(--system-blue) !important;
  flex-shrink: 0;
}

.note-link-chip-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Notion-style Code Block */
.notion-code-block {
  position: relative;
  margin: 12px 0;
  padding: 14px 16px;
  background: #13131a;
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #f1f1f4;
  overflow-x: auto;
  tab-size: 2;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.notion-code-block:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.28);
}

.notion-code-tag {
  position: absolute;
  top: 7px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--system-blue);
  background: rgba(10, 132, 255, 0.12);
  border: 1px solid rgba(10, 132, 255, 0.22);
  padding: 1px 6px;
  border-radius: 3px;
  pointer-events: none;
  user-select: none;
}

/* ==========================================================================
   MARK: - Notion Notes Tools, Blocks & Slash Command Menu
   ========================================================================== */

/* Toolbar Helpers */
.notes-toolbar-divider {
  width: 1px;
  height: 16px;
  background: var(--separator-strong);
  margin: 0 4px;
}

.notion-add-block-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--label-primary) !important;
}

.notion-add-block-btn:hover {
  background: rgba(255, 255, 255, 0.14) !important;
}

.slash-kbd-hint {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--label-secondary);
}

.toolbar-text-icon {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

/* Notion Slash Command Menu Popover */
.notion-slash-popover {
  position: absolute;
  top: 100px;
  left: 24px;
  z-index: 600;
  width: 300px;
  max-height: 380px;
  overflow-y: auto;
  background: #1f1f23;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 6px 0;
  animation: popoverFadeIn 0.14s ease-out;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.notion-menu-section-header {
  font-size: 10.5px;
  font-weight: 700;
  color: #787882;
  padding: 6px 14px 4px 14px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.notion-menu-list {
  display: flex;
  flex-direction: column;
}

.notion-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  margin: 1px 4px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #e1e1e6;
  text-align: left;
  cursor: pointer;
  transition: all 0.1s ease;
  width: calc(100% - 8px);
}

.notion-menu-item:hover,
.notion-menu-item.selected {
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
}

.notion-item-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #c4c4cc;
  flex-shrink: 0;
}

.notion-item-icon .icon-letter {
  font-size: 11.5px;
  font-weight: 800;
  font-family: var(--font-sans);
}

.notion-item-icon svg,
.notion-item-icon i {
  width: 14px;
  height: 14px;
}

.notion-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.notion-item-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: #f0f0f5;
}

.notion-item-desc {
  font-size: 10.5px;
  color: #888892;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.notion-item-shortcut {
  font-size: 10.5px;
  color: #6e6e78;
  font-family: var(--font-mono);
  margin-left: 6px;
  font-weight: 600;
}

/* Notion Content Blocks in Editor Canvas */
.notion-h1 {
  font-size: 24px;
  font-weight: 700;
  color: var(--label-primary);
  margin: 18px 0 6px 0;
  line-height: 1.25;
  letter-spacing: -0.4px;
}

.notion-h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--label-primary);
  margin: 14px 0 4px 0;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.notion-h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--label-primary);
  margin: 12px 0 4px 0;
  line-height: 1.35;
}

.notion-h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--label-primary);
  margin: 10px 0 2px 0;
}

.notion-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 3px 0;
  padding-left: 4px;
  color: var(--label-primary);
  line-height: 1.5;
}

.notion-bullet-dot {
  font-size: 14px;
  line-height: 1.3;
  color: var(--label-tertiary);
  user-select: none;
}

.notion-bullet-text {
  flex: 1;
  outline: none;
}

.notion-numbered-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 3px 0;
  padding-left: 4px;
  color: var(--label-primary);
  line-height: 1.5;
}

.notion-numbered-prefix {
  font-size: 13px;
  font-weight: 600;
  color: var(--label-secondary);
  user-select: none;
  min-width: 16px;
}

.notion-numbered-text {
  flex: 1;
  outline: none;
}

/* Notion Toggle List */
.notion-toggle {
  margin: 6px 0;
  border-radius: 6px;
  transition: background 0.12s ease;
}

.notion-toggle-header {
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--label-primary);
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: start;
  column-gap: 6px;
  list-style: none;
  outline: none;
  user-select: none;
  padding: 3px 4px;
}

.notion-toggle-header:hover {
  background: rgba(255, 255, 255, 0.04);
}

.notion-toggle-arrow {
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease;
  color: var(--label-tertiary);
  cursor: pointer;
  flex: 0 0 14px;
  user-select: none;
  margin-top: 2px;
}

.notion-toggle[open] .notion-toggle-arrow {
  transform: rotate(90deg);
  color: var(--system-blue);
}

.notion-toggle-title {
  flex: 1;
  outline: none;
  min-height: 20px;
  min-width: 0;
  white-space: pre-wrap;
  user-select: text;
}

.notion-toggle-body {
  padding-left: 20px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--label-secondary);
  line-height: 1.5;
  outline: none;
  min-height: 20px;
  white-space: pre-wrap;
  user-select: text;
}

/* Notion Callout Box */
.notion-callout {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  margin: 12px 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  line-height: 1.5;
  color: var(--label-primary);
}

.notion-callout-icon {
  font-size: 18px;
  line-height: 1.2;
  flex-shrink: 0;
  user-select: none;
}

.notion-callout-text {
  flex: 1;
  outline: none;
}

/* Apple Notes Table */
.apple-notes-table-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 14px 0 18px;
  padding-top: 20px;
  padding-bottom: 14px;
}

.apple-notes-table-handle-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  pointer-events: none;
}

.apple-notes-table-handle {
  position: absolute;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-control-hover);
  color: var(--label-tertiary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.apple-notes-table-wrapper:hover .apple-notes-table-handle,
.apple-notes-table-wrapper:focus-within .apple-notes-table-handle,
.apple-notes-table-handle.active {
  opacity: 1;
  pointer-events: auto;
}

.apple-notes-table-handle:hover,
.apple-notes-table-handle.active {
  background: var(--bg-card);
  border-color: var(--separator-strong);
  color: var(--label-secondary);
}

.apple-notes-table-column-handle {
  top: 0;
  left: var(--apple-table-column-handle-left, 50%);
  width: 28px;
  height: 14px;
  transform: translateX(-50%);
}

.apple-notes-table-row-handle {
  left: -22px;
  top: var(--apple-table-row-handle-top, 50%);
  width: 14px;
  height: 28px;
  transform: translateY(-50%);
}

.apple-notes-table-plus-handle {
  width: 18px;
  height: 18px;
  color: var(--label-secondary);
}

.apple-notes-table-plus-handle:hover,
.apple-notes-table-plus-handle.active {
  color: var(--label-primary);
}

.apple-notes-table-add-column-handle {
  top: var(--apple-table-add-column-top, 20px);
  left: var(--apple-table-add-column-left, 100%);
  transform: translate(-50%, -50%);
}

.apple-notes-table-add-row-handle {
  left: var(--apple-table-add-row-left, 0px);
  top: var(--apple-table-add-row-top, calc(100% - 14px));
  transform: translate(-50%, -50%);
}

.apple-notes-table-plus-handle svg,
.apple-notes-table-plus-handle i {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
}

.apple-notes-table-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
}

.apple-notes-table-dots-vertical {
  flex-direction: column;
  gap: 2.5px;
}

.apple-notes-table-dots span {
  display: block;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: currentColor;
}

.apple-notes-table-menu {
  position: absolute;
  z-index: 4;
  min-width: 126px;
  padding: 5px;
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  background: var(--bg-control);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  pointer-events: auto;
}

.apple-notes-table-menu[hidden] {
  display: none !important;
}

.apple-notes-table-menu[data-table-menu="column"] {
  top: 20px;
  left: var(--apple-table-menu-column-left, 50%);
  transform: translateX(-50%);
}

.apple-notes-table-menu[data-table-menu="row"] {
  left: -8px;
  top: var(--apple-table-menu-row-top, 50%);
  transform: translate(-100%, -50%);
}

.apple-notes-table-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 26px;
  padding: 0 8px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--label-primary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.apple-notes-table-menu-item:hover:not(:disabled) {
  background: var(--bg-active-row);
}

.apple-notes-table-menu-danger:hover:not(:disabled) {
  color: var(--system-red);
}

.apple-notes-table-menu-item:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.apple-notes-table-menu-item svg,
.apple-notes-table-menu-item i {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}

.apple-notes-table-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--separator);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.apple-notes-table {
  width: 100%;
  min-width: 460px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 13px;
  line-height: 1.45;
}

.apple-notes-table th,
.apple-notes-table td {
  min-width: 124px;
  padding: 9px 12px;
  border-right: 1px solid var(--separator);
  border-bottom: 1px solid var(--separator);
  vertical-align: top;
  outline: none;
  word-break: break-word;
  transition: background 0.12s ease, box-shadow 0.12s ease, color 0.12s ease;
}

.apple-notes-table th:last-child,
.apple-notes-table td:last-child {
  border-right: none;
}

.apple-notes-table tr:last-child td {
  border-bottom: none;
}

.apple-notes-table th {
  background: rgba(255, 255, 255, 0.045);
  color: var(--label-primary);
  font-weight: 600;
  text-align: left;
}

.apple-notes-table td {
  background: rgba(255, 255, 255, 0.01);
  color: var(--label-secondary);
}

.apple-notes-table tr:hover td {
  background: rgba(255, 255, 255, 0.028);
}

.apple-notes-table [data-table-cell="true"]:focus,
.apple-notes-table .apple-notes-table-cell-active {
  background: rgba(10, 132, 255, 0.1);
  box-shadow: inset 0 0 0 1px var(--system-blue);
  color: var(--label-primary);
}

.apple-notes-table [data-table-cell="true"] a {
  color: var(--system-blue);
}

@media (max-width: 700px) {
  .apple-notes-table-wrapper {
    padding-top: 26px;
  }

  .apple-notes-table-handle {
    opacity: 1;
    pointer-events: auto;
  }

  .apple-notes-table-menu[data-table-menu="row"] {
    left: 0;
    transform: translateY(-50%);
  }
}

/* Notion Divider */
.notion-divider {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: 18px 0;
  width: 100%;
}

/* Notion Embedded Image */
.notion-image-wrapper {
  margin: 12px 0;
}

.notion-image {
  max-width: 100%;
  border-radius: 8px;
  display: block;
}

/* Notion 6-Dot Block Drag & Reorder Handle */
.notion-block-handle {
  position: absolute;
  left: -32px;
  top: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  z-index: 550;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
  user-select: none;
}

.notion-block-handle.visible {
  opacity: 1;
  pointer-events: auto;
}

.notion-handle-btn {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--label-tertiary);
  cursor: grab;
  transition: all 0.12s ease;
}

.notion-handle-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--label-primary);
}

.notion-handle-btn:active {
  cursor: grabbing;
}

.notion-handle-btn svg,
.notion-handle-btn i {
  width: 14px;
  height: 14px;
}

.notion-handle-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #25252a;
  border-radius: 5px;
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.notion-handle-action-btn {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 3px;
  color: var(--label-tertiary);
  cursor: pointer;
  transition: all 0.1s ease;
}

.notion-handle-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.notion-handle-action-btn svg,
.notion-handle-action-btn i {
  width: 12px;
  height: 12px;
}

/* Dragging & Drop Indicators */
.block-dragging {
  opacity: 0.35 !important;
  transform: scale(0.99);
}

.block-drop-top {
  box-shadow: inset 0 3px 0 0 var(--system-blue) !important;
}

.block-drop-bottom {
  box-shadow: inset 0 -3px 0 0 var(--system-blue) !important;
}

/* Note Domain, Challenge & Industry Metadata Badges */
.note-metadata-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 6px 0;
  animation: popoverFadeIn 0.12s ease-out;
}

.note-meta-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.1px;
  line-height: 1.2;
}

.note-meta-pill.domain-pill {
  background: rgba(0, 122, 255, 0.14);
  color: #5ac8fa;
}

.note-meta-pill.challenge-pill {
  background: rgba(255, 149, 0, 0.14);
  color: #ff9f0a;
}

.note-meta-pill.complexity-pill {
  background: rgba(175, 82, 222, 0.14);
  color: #bf5af2;
}

.note-meta-pill.topic-pill {
  background: rgba(52, 199, 89, 0.14);
  color: #34c759;
}

.note-meta-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--label-primary);
  cursor: pointer;
  transition: all 0.12s ease;
  margin-left: auto;
}

.note-meta-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  transform: translateY(-1px);
}

.note-row-domain-tag {
  display: inline-flex;
  align-items: center;
  font-size: 9.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--label-secondary);
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.note-row-domain-tag.sprint {
  background: rgba(255, 149, 0, 0.15);
  color: #ff9f0a;
}

.note-row-domain-tag.custom {
  background: rgba(0, 122, 255, 0.15);
  color: #5ac8fa;
}

/* Optional Note Label Selector Popover (Apple HIG & Design System Compliant) */
.apple-label-popover {
  position: absolute;
  top: 32px;
  left: 0;
  z-index: 650;
  width: 260px;
  background: #1f1f24;
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: popoverFadeIn 0.14s ease-out;
}

.apple-label-popover-header {
  font-size: 11px;
  font-weight: 700;
  color: #787882;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 2px;
}

.apple-label-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #15151c;
  border-radius: 8px;
  padding: 7px 10px;
  border: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.apple-label-input-wrapper .label-input-icon {
  width: 13px;
  height: 13px;
  color: var(--label-tertiary);
  flex-shrink: 0;
}

.apple-label-input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 12px;
  font-family: var(--font-sans);
  outline: none;
  width: 100%;
  padding: 0;
}

.apple-label-input::placeholder {
  color: #55555e;
}

.apple-label-color-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.apple-label-subheading {
  font-size: 10.5px;
  font-weight: 700;
  color: #787882;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 0 2px;
}

.apple-label-color-swatches {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 2px 0;
}

.color-swatch-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  transition: all 0.12s ease;
  padding: 0;
}

.color-swatch-btn:hover {
  transform: scale(1.18);
}

.color-swatch-btn.active {
  transform: scale(1.22);
  box-shadow: 0 0 0 2px #1f1f24, 0 0 0 4px var(--swatch-color, #007aff);
}

.apple-label-popover-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 130px;
  overflow-y: auto;
  padding-right: 2px;
}

.apple-label-option-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: #e1e1e6;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: all 0.1s ease;
}

.apple-label-option-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.apple-label-popover-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.apple-label-dialog-btn {
  height: 28px;
  border-radius: 6px;
  border: none;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.apple-label-dialog-btn.btn-remove {
  flex: 1;
  background: rgba(255, 69, 58, 0.12);
  color: #ff453a;
}

.apple-label-dialog-btn.btn-remove:hover {
  background: rgba(255, 69, 58, 0.22);
}

.apple-label-dialog-btn.btn-apply {
  flex: 1.5;
  background: #007aff;
  color: #ffffff;
}

.apple-label-dialog-btn.btn-apply:hover {
  background: #0a84ff;
  transform: translateY(-1px);
}

.note-add-label-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  color: var(--label-tertiary);
  cursor: pointer;
  transition: all 0.12s ease;
}

.note-add-label-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: var(--label-primary);
  border-color: rgba(255, 255, 255, 0.28);
}

.note-clickable-label-pill {
  cursor: pointer;
  transition: all 0.12s ease;
}

.note-clickable-label-pill:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* ==========================================================================
   MARK: - Apple macOS Sequoia Native Settings Sheet (1:1 HIG Inset Grouped)
   ========================================================================== */

.mac-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  animation: modalBackdropFadeIn 0.16s ease-out;
  box-sizing: border-box;
}

@keyframes modalBackdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.apple-settings-window {
  width: 100%;
  max-width: 440px;
  background: #252528;
  border: none;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto;
  box-sizing: border-box;
  animation: modalScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-settings-window.forum-question-sheet,
.apple-settings-window.completion-upload-sheet {
  width: min(430px, calc(100vw - 32px));
  max-width: 430px;
  padding: 12px;
  border-radius: 16px;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.apple-settings-content {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100dvh - 30px);
  overflow-y: auto;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
}

/* Apple Account Hero Card & Avatar Upload (Stacked & Centered) */
.apple-account-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  user-select: none;
  box-sizing: border-box;
}

.apple-account-avatar-wrapper {
  position: relative;
  width: 74px;
  height: 74px;
  min-width: 74px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease;
}

.apple-account-avatar-wrapper:hover {
  transform: scale(1.03);
}

.apple-account-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, #0a84ff, #5e5ce6);
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.apple-account-avatar-wrapper:hover .avatar-hover-overlay {
  opacity: 1;
}

.avatar-hover-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  opacity: 0;
  transition: opacity 0.15s ease;
  border-radius: 50%;
}

.avatar-hover-overlay svg, .avatar-hover-overlay i {
  width: 22px !important;
  height: 22px !important;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.apple-account-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
}

.apple-account-name {
  font-size: 16.5px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.2;
}

.apple-account-subtitle {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.2;
}

.apple-account-email {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  font-family: var(--font-mono);
}

.apple-avatar-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.apple-avatar-action-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--label-primary);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.12s ease;
}

.apple-avatar-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.apple-avatar-action-btn.btn-remove {
  background: transparent;
  color: var(--system-red);
}

.apple-avatar-action-btn.btn-remove:hover {
  background: rgba(255, 69, 58, 0.12);
}

.apple-avatar-action-btn svg, .apple-avatar-action-btn i {
  width: 12px !important;
  height: 12px !important;
}

/* Section Title */
.apple-settings-section-title {
  font-size: 10.5px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.5px;
  margin-top: 10px;
  margin-bottom: 2px;
  margin-left: 6px;
}

/* Inset Grouped Settings Card */
.apple-settings-card {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.apple-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  min-height: 38px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.12s ease;
  gap: 10px;
  box-sizing: border-box;
}

.apple-settings-row:last-child {
  border-bottom: none;
}

.apple-clickable-row {
  cursor: pointer;
}

.apple-clickable-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.apple-row-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.apple-row-icon {
  width: 15px !important;
  height: 15px !important;
  color: var(--label-secondary);
  flex-shrink: 0;
  stroke-width: 1.7;
}

.apple-row-icon.text-red {
  color: var(--system-red);
}

.apple-row-label {
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
}

.apple-inline-input {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
  background: transparent;
  border: none;
  outline: none;
  max-width: 200px;
  transition: color 0.12s ease;
}

.apple-inline-input:focus {
  color: #ffffff;
}

.apple-settings-inline-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--system-blue);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.apple-settings-inline-btn:hover {
  background: rgba(10, 132, 255, 0.18);
  color: #ffffff;
}

/* ==========================================================================
   MARK: - Apple macOS Native Security / Password Dialog Sheet
   ========================================================================== */

.apple-dialog-window {
  width: 100%;
  max-width: 360px;
  background: #252528;
  border: none;
  border-radius: 12px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 10px;
  margin: auto;
  box-sizing: border-box;
  animation: modalScaleIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-dialog-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 8px;
}

.apple-dialog-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 159, 10, 0.16);
  color: #ff9f0a;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.apple-dialog-icon svg, .apple-dialog-icon i {
  width: 18px !important;
  height: 18px !important;
}

.apple-dialog-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 3px;
}

.apple-dialog-subtitle {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.35;
  max-width: 290px;
}

.apple-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.apple-dialog-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.apple-dialog-field label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
}

.apple-dialog-input {
  width: 100%;
  height: 32px;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 6px;
  color: #ffffff;
  font-size: 12.5px;
  padding: 0 10px;
  outline: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  transition: all 0.12s ease;
  box-sizing: border-box;
}

.apple-dialog-input:focus {
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.4);
}

.apple-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.apple-dialog-btn {
  height: 28px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.apple-dialog-btn.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.apple-dialog-btn.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
}

.apple-dialog-btn.btn-primary {
  background: #0a84ff;
  color: #ffffff;
}

.apple-dialog-btn.btn-primary:hover {
  background: #0071e3;
}

.apple-row-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.apple-row-value {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

.apple-row-chevron {
  width: 14px !important;
  height: 14px !important;
  color: rgba(255, 255, 255, 0.3);
}

.text-red {
  color: #ff453a !important;
  font-weight: 600;
}

/* Apple Switch (iOS/macOS authentic) */
.apple-switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
  flex-shrink: 0;
}

.apple-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.apple-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.16);
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 22px;
}

.apple-switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.apple-switch input:checked + .apple-switch-slider {
  background-color: #30d158;
}

.apple-switch input:checked + .apple-switch-slider:before {
  transform: translateX(16px);
}

/* ==========================================================================
   MARK: - System Light Appearance
   ========================================================================== */

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;

    --bg-window: #f5f5f7;
    --bg-sidebar: #f2f2f7;
    --bg-card: #ffffff;
    --bg-control: #e9e9ef;
    --bg-control-hover: #dedee6;
    --bg-input: #ffffff;
    --bg-active-row: rgba(0, 122, 255, 0.12);
    --material-sidebar: rgba(242, 242, 247, 0.82);

    --separator: rgba(0, 0, 0, 0.1);
    --separator-strong: rgba(0, 0, 0, 0.18);

    --label-primary: #1d1d1f;
    --label-secondary: rgba(29, 29, 31, 0.68);
    --label-tertiary: rgba(29, 29, 31, 0.45);

    --system-blue: #007aff;
    --system-indigo: #5856d6;
    --system-purple: #af52de;
    --system-pink: #ff2d55;
    --system-green: #34c759;
    --system-orange: #ff9500;
    --system-yellow: #ffcc00;
    --system-teal: #30b0c7;
    --system-red: #ff3b30;

    --fill-hover: rgba(0, 0, 0, 0.055);
    --fill-muted: rgba(0, 0, 0, 0.04);
    --fill-muted-strong: rgba(0, 0, 0, 0.07);
    --fill-muted-hover: rgba(0, 0, 0, 0.085);
    --card-hover-fill: rgba(0, 0, 0, 0.035);
    --progress-track-fill: rgba(0, 0, 0, 0.08);
    --ring-track-fill: rgba(0, 0, 0, 0.08);
    --ring-shell-fill: rgba(0, 0, 0, 0.035);
    --ring-border-fill: rgba(0, 0, 0, 0.07);
    --ring-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
    --activity-grid-line: rgba(0, 0, 0, 0.055);
    --activity-muted-bar: rgba(0, 0, 0, 0.09);
    --activity-empty-bar: rgba(0, 0, 0, 0.09);
    --activity-muted-solved: rgba(0, 0, 0, 0.09);
    --secondary-btn-bg: rgba(255, 255, 255, 0.78);
    --secondary-btn-border: rgba(0, 0, 0, 0.13);
    --secondary-btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72);
    --secondary-btn-hover-shadow: 0 2px 6px rgba(0, 0, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    --tertiary-btn-bg: rgba(0, 0, 0, 0.045);
    --tertiary-btn-hover-bg: rgba(0, 0, 0, 0.075);
    --tertiary-btn-disabled-bg: rgba(0, 0, 0, 0.035);
    --tertiary-btn-border: rgba(0, 0, 0, 0.08);
    --tertiary-btn-hover-border: rgba(0, 0, 0, 0.12);
    --tertiary-btn-disabled-border: rgba(0, 0, 0, 0.08);
    --primary-btn-border: rgba(0, 0, 0, 0.08);
    --primary-btn-shadow: 0 1px 2px rgba(0, 122, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.24);
    --primary-btn-hover-shadow: 0 2px 7px rgba(0, 122, 255, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.32);
    --theme-toggle-bg: rgba(0, 122, 255, 0.10);
    --theme-toggle-hover-bg: rgba(0, 122, 255, 0.16);
    --floating-surface-bg: rgba(255, 255, 255, 0.96);
    --floating-surface-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
    --modal-backdrop-fill: rgba(0, 0, 0, 0.22);
    --placeholder-label: rgba(29, 29, 31, 0.28);
    --timer-ring-muted: rgba(0, 0, 0, 0.12);
    --popover-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  }

  .mac-sidebar,
  .notes-list-pane,
  .notes-editor-toolbar {
    background: var(--material-sidebar);
  }

  .sidebar-row:hover,
  .sidebar-user-card:hover,
  .sidebar-collapsed #sound-toggle-btn:hover,
  .sidebar-collapsed #theme-toggle-btn:hover,
  .sidebar-icon-btn:hover,
  .mac-tool-btn:hover,
  .apple-icon-btn:hover,
  .notes-compose-btn:hover,
  .forum-channel-btn:hover,
  .duration-pill:hover,
  .notion-handle-btn:hover {
    background: var(--fill-hover);
  }

  .sidebar-row.active,
  .sidebar-collapsed .sidebar-row.active,
  .mastery-row.selected {
    background: rgba(0, 122, 255, 0.12);
  }

  .dashboard-progress-ring {
    background:
      conic-gradient(from 0deg, var(--system-blue) 0deg, var(--system-green) var(--progress), var(--ring-track-fill) var(--progress) 360deg),
      var(--ring-shell-fill);
    box-shadow:
      inset 0 0 0 1px var(--ring-border-fill),
      var(--ring-shadow);
  }

  .dashboard-progress-track,
  .apple-switch-slider {
    background: var(--progress-track-fill);
  }

  .dashboard-stat-strip {
    border-top-color: var(--separator);
    border-bottom-color: var(--separator);
  }

  .dashboard-summary-badge,
  .dashboard-challenge-index,
  .forum-channel-tabs,
  .forum-channel-count,
  .forum-question-group,
  .completion-upload-group,
  .note-format-toolbar,
  .apple-account-hero,
  .apple-settings-card {
    background: var(--fill-muted);
  }

  .dashboard-activity-plot::before {
    background-image: linear-gradient(to bottom, var(--activity-grid-line) 1px, transparent 1px);
  }

  .dashboard-activity-plot.is-empty .dashboard-activity-day:not(.is-active) .dashboard-activity-bar,
  .dashboard-activity-day:not(.is-active) .dashboard-activity-bar,
  .dashboard-activity-day:not(.has-solved) .dashboard-activity-solved-bar {
    background: var(--activity-muted-bar);
  }

  .dashboard-challenge-card:hover,
  .leaderboard-row:hover,
  .forum-thread-preview:hover,
  .forum-thread-preview:focus-visible,
  .apple-notes-table tr:hover td {
    background: var(--card-hover-fill);
  }

  .leaderboard-row:hover {
    background: var(--card-hover-fill);
  }

  .dashboard-industry-badge,
  .apple-industry-badge,
  .note-category-tag,
  .note-row-domain-tag {
    background: var(--fill-muted-strong);
  }

  .dashboard-challenge-action,
  .mac-btn-tertiary,
  .notes-new-btn,
  .note-filter-pill,
  .notes-search-box,
  .notes-category-select,
  .apple-avatar-action-btn,
  .apple-settings-inline-btn,
  .note-add-label-btn {
    background: var(--fill-muted-strong);
    border-color: var(--separator);
  }

  .dashboard-challenge-action:hover,
  .mac-btn-tertiary:hover,
  .note-filter-pill:hover,
  .notes-search-box:focus-within,
  .apple-note-card:hover,
  .note-action-icon-btn:hover,
  .format-btn:hover,
  .forum-reply-vote-btn:hover,
  .apple-clickable-row:hover,
  .apple-avatar-action-btn:hover,
  .note-add-label-btn:hover {
    background: var(--fill-muted-hover);
    color: var(--label-primary);
  }

  .mac-btn-secondary {
    background: var(--secondary-btn-bg);
    border-color: var(--secondary-btn-border);
    box-shadow: var(--secondary-btn-shadow);
  }

  .mac-btn-tertiary,
  .mac-btn-tertiary:disabled,
  .mac-btn-tertiary:disabled:hover {
    border-color: var(--tertiary-btn-border);
  }

  .mac-textarea:hover {
    background: var(--card-hover-fill);
    border-color: var(--separator-strong);
  }

  .forum-question-field-row + .forum-question-field-row,
  .completion-upload-field-row + .completion-upload-field-row,
  .forum-reply-children,
  .apple-settings-row,
  .apple-label-popover-footer,
  .notion-divider {
    border-color: var(--separator);
  }

  .forum-thread-meta > :not(:last-child)::after {
    background: var(--label-tertiary);
  }

  .forum-thread-attachment-btn {
    border-color: var(--separator);
  }

  .mac-toast,
  .apple-settings-window,
  .apple-dialog-window,
  .apple-label-popover {
    background: var(--floating-surface-bg);
    color: var(--label-primary);
    box-shadow: var(--floating-surface-shadow);
  }

  .mac-modal-backdrop {
    background: var(--modal-backdrop-fill);
  }

  .notes-pane-title,
  .note-card-title,
  .notes-search-box input,
  .notes-editor-pane,
  .note-title-input,
  .note-body-textarea,
  .apple-account-name,
  .apple-row-label,
  .apple-dialog-title,
  .apple-inline-input:focus,
  .apple-label-input,
  .apple-label-option-btn {
    color: var(--label-primary);
  }

  .notes-editor-pane,
  .apple-label-input-wrapper {
    background: var(--bg-window);
  }

  .note-title-input::placeholder,
  .note-body-textarea::placeholder {
    color: var(--placeholder-label);
  }

  .notes-editor-toolbar,
  .note-format-toolbar,
  .notes-category-select,
  .apple-label-input-wrapper {
    border-color: var(--separator);
  }

  .apple-row-value,
  .apple-row-chevron,
  .apple-account-subtitle,
  .apple-account-email,
  .apple-dialog-subtitle,
  .apple-settings-section-title,
  .apple-label-popover-header,
  .apple-label-subheading {
    color: var(--label-tertiary);
  }

  .apple-timer-bg {
    stroke: var(--timer-ring-muted);
  }

  .apple-timer-bell,
  .apple-timer-bell svg,
  .apple-timer-bell i {
    color: var(--label-secondary);
  }

  .apple-timer-time {
    color: var(--label-primary);
  }

  .notion-handle-actions {
    background: var(--floating-surface-bg);
    border-color: var(--separator);
    box-shadow: var(--popover-shadow);
  }

  .notion-handle-action-btn:hover {
    background: var(--fill-hover);
    color: var(--label-primary);
  }

  .color-swatch-btn.active {
    box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px var(--swatch-color, #007aff);
  }
}

:root[data-theme="light"] {
  color-scheme: light;

  --bg-window: #f5f5f7;
  --bg-sidebar: #f2f2f7;
  --bg-card: #ffffff;
  --bg-control: #e9e9ef;
  --bg-control-hover: #dedee6;
  --bg-input: #ffffff;
  --bg-active-row: rgba(0, 122, 255, 0.12);
  --material-sidebar: rgba(242, 242, 247, 0.82);

  --separator: rgba(0, 0, 0, 0.1);
  --separator-strong: rgba(0, 0, 0, 0.18);

  --label-primary: #1d1d1f;
  --label-secondary: rgba(29, 29, 31, 0.68);
  --label-tertiary: rgba(29, 29, 31, 0.45);

  --system-blue: #007aff;
  --system-indigo: #5856d6;
  --system-purple: #af52de;
  --system-pink: #ff2d55;
  --system-green: #34c759;
  --system-orange: #ff9500;
  --system-yellow: #ffcc00;
  --system-teal: #30b0c7;
  --system-red: #ff3b30;

  --fill-hover: rgba(0, 0, 0, 0.055);
  --fill-muted: rgba(0, 0, 0, 0.04);
  --fill-muted-strong: rgba(0, 0, 0, 0.07);
  --fill-muted-hover: rgba(0, 0, 0, 0.085);
  --card-hover-fill: rgba(0, 0, 0, 0.035);
  --progress-track-fill: rgba(0, 0, 0, 0.08);
  --ring-track-fill: rgba(0, 0, 0, 0.08);
  --ring-shell-fill: rgba(0, 0, 0, 0.035);
  --ring-border-fill: rgba(0, 0, 0, 0.07);
  --ring-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
  --activity-grid-line: rgba(0, 0, 0, 0.055);
  --activity-muted-bar: rgba(0, 0, 0, 0.09);
  --activity-empty-bar: rgba(0, 0, 0, 0.09);
  --activity-muted-solved: rgba(0, 0, 0, 0.09);
  --secondary-btn-bg: rgba(255, 255, 255, 0.78);
  --secondary-btn-border: rgba(0, 0, 0, 0.13);
  --secondary-btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --secondary-btn-hover-shadow: 0 2px 6px rgba(0, 0, 0, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --tertiary-btn-bg: rgba(0, 0, 0, 0.045);
  --tertiary-btn-hover-bg: rgba(0, 0, 0, 0.075);
  --tertiary-btn-disabled-bg: rgba(0, 0, 0, 0.035);
  --tertiary-btn-border: rgba(0, 0, 0, 0.08);
  --tertiary-btn-hover-border: rgba(0, 0, 0, 0.12);
  --tertiary-btn-disabled-border: rgba(0, 0, 0, 0.08);
  --primary-btn-border: rgba(0, 0, 0, 0.08);
  --primary-btn-shadow: 0 1px 2px rgba(0, 122, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  --primary-btn-hover-shadow: 0 2px 7px rgba(0, 122, 255, 0.20), inset 0 1px 0 rgba(255, 255, 255, 0.32);
  --theme-toggle-bg: rgba(0, 122, 255, 0.10);
  --theme-toggle-hover-bg: rgba(0, 122, 255, 0.16);
  --floating-surface-bg: rgba(255, 255, 255, 0.96);
  --floating-surface-shadow: 0 24px 70px rgba(0, 0, 0, 0.18);
  --modal-backdrop-fill: rgba(0, 0, 0, 0.22);
  --placeholder-label: rgba(29, 29, 31, 0.28);
  --timer-ring-muted: rgba(0, 0, 0, 0.12);
  --popover-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg-window: #1b1724;
  --bg-sidebar: #15121d;
  --bg-card: #241f2e;
  --bg-control: #2b2536;
  --bg-control-hover: #382f46;
  --bg-input: #121018;
  --bg-active-row: rgba(191, 90, 242, 0.14);
  --material-sidebar: rgba(21, 18, 29, 0.9);

  --separator: rgba(232, 222, 255, 0.08);
  --separator-strong: rgba(232, 222, 255, 0.16);

  --label-primary: #ffffff;
  --label-secondary: rgba(255, 255, 255, 0.68);
  --label-tertiary: rgba(255, 255, 255, 0.42);

  --system-blue: #0a84ff;
  --system-indigo: #5e5ce6;
  --system-purple: #bf5af2;
  --system-pink: #ff375f;
  --system-green: #30d158;
  --system-orange: #ff9f0a;
  --system-yellow: #ffd60a;
  --system-teal: #40cbe0;
  --system-red: #ff453a;

  --fill-hover: rgba(232, 222, 255, 0.08);
  --fill-muted: rgba(232, 222, 255, 0.04);
  --fill-muted-strong: rgba(232, 222, 255, 0.055);
  --fill-muted-hover: rgba(232, 222, 255, 0.085);
  --card-hover-fill: rgba(232, 222, 255, 0.035);
  --progress-track-fill: rgba(232, 222, 255, 0.08);
  --ring-track-fill: rgba(232, 222, 255, 0.075);
  --ring-shell-fill: rgba(232, 222, 255, 0.04);
  --ring-border-fill: rgba(232, 222, 255, 0.08);
  --ring-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  --activity-grid-line: rgba(232, 222, 255, 0.052);
  --activity-muted-bar: rgba(232, 222, 255, 0.08);
  --activity-empty-bar: rgba(232, 222, 255, 0.105);
  --activity-muted-solved: rgba(232, 222, 255, 0.09);
  --secondary-btn-bg: rgba(232, 222, 255, 0.06);
  --secondary-btn-border: rgba(232, 222, 255, 0.14);
  --secondary-btn-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --secondary-btn-hover-shadow: 0 2px 5px rgba(0, 0, 0, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --tertiary-btn-bg: rgba(232, 222, 255, 0.035);
  --tertiary-btn-hover-bg: rgba(232, 222, 255, 0.055);
  --tertiary-btn-disabled-bg: rgba(232, 222, 255, 0.03);
  --tertiary-btn-border: rgba(232, 222, 255, 0.08);
  --tertiary-btn-hover-border: rgba(232, 222, 255, 0.12);
  --tertiary-btn-disabled-border: rgba(232, 222, 255, 0.075);
  --primary-btn-border: rgba(232, 222, 255, 0.18);
  --primary-btn-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  --primary-btn-hover-shadow: 0 2px 6px rgba(191, 90, 242, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  --theme-toggle-bg: rgba(191, 90, 242, 0.12);
  --theme-toggle-hover-bg: rgba(191, 90, 242, 0.18);
  --floating-surface-bg: rgba(36, 31, 46, 0.96);
  --floating-surface-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --modal-backdrop-fill: rgba(8, 6, 14, 0.62);
  --placeholder-label: rgba(255, 255, 255, 0.28);
  --timer-ring-muted: rgba(255, 255, 255, 0.12);
  --popover-shadow: 0 8px 24px rgba(10, 7, 18, 0.38);
}

/* ==========================================================================
   MARK: - Responsive Media Queries
   ========================================================================== */

@media (max-width: 640px) {
  .mac-modal-backdrop {
    padding: 8px;
  }

  .apple-settings-window {
    max-width: 100%;
    border-radius: 12px;
  }

  .apple-dialog-window {
    max-width: 100%;
    border-radius: 12px;
    padding: 12px;
  }

  .apple-settings-content {
    padding: 8px;
    gap: 8px;
    max-height: calc(100dvh - 20px);
  }

  .apple-account-hero {
    padding: 12px 8px;
    gap: 8px;
  }

  .apple-account-avatar-wrapper {
    width: 66px;
    height: 66px;
    min-width: 66px;
  }

  .apple-account-avatar {
    font-size: 22px;
  }

  .apple-account-name {
    font-size: 15.5px;
  }

  .apple-settings-row {
    padding: 8px 10px;
    min-height: 38px;
  }

  .apple-inline-input {
    max-width: 135px;
    font-size: 12px;
  }

  .apple-row-label {
    font-size: 12px;
  }
}

/* Accessibility: Respect Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ==========================================================================
   MARK: - Hidden Scrollbars (Perfect Margin Symmetry & Smooth Scrolling)
   ========================================================================== */

* {
  scrollbar-width: none !important; /* Firefox */
  -ms-overflow-style: none !important; /* IE & Edge */
}

*::-webkit-scrollbar,
::-webkit-scrollbar,
::-webkit-scrollbar-track,
::-webkit-scrollbar-thumb {
  display: none !important; /* Chrome, Safari, WebKit */
  width: 0 !important;
  height: 0 !important;
  background: transparent !important;
}
