/* Apps/Today/frontend/style.css
   OLED Minimalist Stealth Theme for Justin's Today App */

:root {
  color-scheme: only dark;
  interpolate-size: allow-keywords;
  --in-oklab: ;
  --bg-primary: #07080b;
  --bg-card: #0f1117;
  --bg-card-hover: #151821;
  --bg-input: #12141c;
  --border-subtle: rgba(148, 163, 184, 0.12);
  --border-focus: #3b82f6;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-green: #10b981;
  --accent-purple: #8b5cf6;
  --accent-orange: #f59e0b;

  --font-sans: 'Inter', 'Inter Fallback', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

@supports (background: linear-gradient(in oklab, white, black)) {
  :root {
    --in-oklab: in oklab;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 140ms;
}

button,
a,
[role="button"],
input,
select,
textarea {
  touch-action: manipulation;
}

body {
  background-color: #07080b;
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Local-Only Badge (Visible only on localhost / 127.0.0.1 when html.is-local is active) */
.dev-only-badge {
  display: none !important;
}

html.is-local .dev-only-badge,
html.is-dev .dev-only-badge {
  display: inline-block !important;
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 7px;
  border-radius: 6px;
  vertical-align: middle;
  margin-left: 6px;
  letter-spacing: 0.05em;
}

/* Top Edge Refresh Beam & Synchronized Horizon Canvas live in /core-base.css */

/* Mobile Header Divider & Top Seam Suppression */
html, body {
  border-top: none !important;
  outline: none !important;
}

.app-header::before,
.app-header::after,
.header-left {
  border-top: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
}

.app-container {
  width: 100%;
  max-inline-size: 720px;
  max-width: 720px;
  min-width: 0;
  min-inline-size: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 10px 12px 44px;
  position: relative;
  z-index: 2;
}

@media (min-width: 640px) {
  body:not(.force-mobile-view) .app-container {
    padding: 18px 20px 64px;
  }
}

/* Immediate Flash Suppression for Authenticated / Unauthenticated states */
.hidden,
[hidden],
.pin-overlay.hidden,
.reader-overlay.hidden,
.import-modal-overlay.hidden,
.vault-edge-popover:not(:popover-open) {
  display: none !important;
}

html.authenticated .pin-overlay {
  display: none !important;
}

html.unauthenticated .pin-overlay,
html.unauthenticated .pin-overlay.hidden {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

html.unauthenticated .app-container {
  display: none !important;
}

/* PIN Lock Screen Overlay */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 8, 11, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.pin-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.pin-card .hidden {
  display: none !important;
}

.public-auth-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.google-signin-btn {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #f8fafc;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-sizing: border-box;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.google-signin-btn:hover {
  opacity: 0.94;
}

.google-signin-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.invite-optional-wrap {
  margin-top: 10px;
}

.invite-code-input {
  text-transform: uppercase;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.pending-account-pill {
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--text-primary);
  font-size: 0.82rem;
  word-break: break-word;
}

.auth-secondary-link {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.84rem;
  min-height: 36px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.pin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 32px 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
}

.pin-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.pin-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pin-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.pin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.sr-only {
  position: absolute;
  inset-inline-start: 0;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.pin-passphrase-input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 1.1rem;
  text-align: center;
  outline: none;
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pin-passphrase-input::placeholder {
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, sans-serif);
  letter-spacing: normal;
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
}

.pin-passphrase-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.pin-submit-btn {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: var(--accent-blue, #38bdf8);
  color: #04121c;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.pin-submit-btn:hover {
  opacity: 0.92;
}

.pin-submit-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.pin-error {
  color: #ef4444;
  font-size: 0.85rem;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(56, 189, 248, 0.22);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: pinSpin 0.65s linear infinite;
}

@keyframes pinSpin {
  to { transform: rotate(360deg); }
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 6px 10px;
  margin-bottom: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-solar-badge {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.09);
  border: 1px solid rgba(245, 158, 11, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-solar-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.header-solar-badge:active {
  transform: scale(0.95);
}

.header-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 1px;
}

.header-subtitle.cleared {
  color: var(--accent-green);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
  transition: color 0.5s ease, text-shadow 0.5s ease;
}

/* Horizon Card */
.horizon-card {
  background: linear-gradient(135deg, rgba(15, 17, 23, 0.95), rgba(22, 27, 38, 0.6));
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
}

.horizon-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 12px;
}

.horizon-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 0;
}

.horizon-header-actions .horizon-compact-pill {
  margin: 0;
  min-height: 22px;
  padding: 2.5px 8.5px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 7px;
  line-height: 1.2;
  flex-shrink: 0;
}

.telemetry-tag-flat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.32);
  padding: 3px 8px;
  border-radius: 4px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.02em;
  cursor: default;
  user-select: none;
}

/* Unified iOS Squircle App Icon Launcher Tile */
.horizon-app-tile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 52px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.horizon-app-tile .app-squircle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.18s ease, filter 0.18s ease;
}

/* Top specular glass rim like iOS icons */
.horizon-app-tile .app-squircle::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 70%);
  pointer-events: none;
}

/* Unified Dark Slate Solar-Badge Squircle Aesthetic (Duotone HUD Icon Set) */
.horizon-app-tile .app-squircle,
.horizon-app-tile.is-sheet-tile .app-squircle,
.horizon-app-tile.is-app-tile .app-squircle {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid color-mix(in srgb, var(--tile-accent, #f59e0b) 38%, transparent);
  box-shadow: 0 0 16px color-mix(in srgb, var(--tile-accent, #f59e0b) 16%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.horizon-app-tile .app-glyph {
  font-size: 22px;
  line-height: 1;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.28));
}

.horizon-app-tile .app-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.1;
  text-align: center;
  transition: color 0.15s ease;
}

.horizon-app-tile.is-sheet-tile .app-label {
  color: #e9d5ff;
}

.horizon-app-tile.is-app-tile .app-label {
  color: #bae6fd;
}

.horizon-app-tile:hover .app-squircle {
  transform: translateY(-2px);
  filter: brightness(1.12);
}

.horizon-app-tile:hover .app-label {
  color: #ffffff;
}

.horizon-app-tile:active .app-squircle {
  transform: scale(0.94);
}

/* Dark Slate Solar-Badge Squircle Aesthetic (Duotone HUD Icon Set) */
html[data-icon-aesthetic="C"] .horizon-app-tile .app-squircle {
  background: rgba(15, 23, 42, 0.75) !important;
  border: 1px solid color-mix(in srgb, var(--tile-accent, #f59e0b) 38%, transparent) !important;
  box-shadow: 0 0 16px color-mix(in srgb, var(--tile-accent, #f59e0b) 16%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

html[data-icon-aesthetic="C"] .horizon-app-tile .app-squircle::before {
  background: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.12), transparent 70%);
}

.horizon-app-tile .app-glyph svg {
  width: 24px;
  height: 24px;
  display: block;
}

.hud-mini-squircle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid color-mix(in srgb, var(--badge-accent, #f59e0b) 38%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--badge-accent, #f59e0b) 15%, transparent), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  vertical-align: middle;
  margin-right: 4px;
  flex-shrink: 0;
}

.hud-mini-squircle svg {
  width: 17px;
  height: 17px;
  display: block;
}

.hud-inline-svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 15px;
  height: 15px;
  margin-right: 2px;
}

.hud-inline-svg svg {
  width: 15px;
  height: 15px;
  display: block;
}

/* Split Key-Value Tactical HUD Chip (Horizon Orange Theme) */
#neuro-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #f8fafc;
  font-family: var(--font-mono, monospace);
  font-size: 11.5px;
  font-weight: 700;
  padding: 0 11px 0 0;
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#neuro-pill .neuro-key-prefix {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 9px;
  margin-right: 4px;
  border-right: 1px solid rgba(254, 215, 170, 0.45);
}

#neuro-pill #neuro-protocol {
  color: #fed7aa;
  padding: 0 2px;
}

.horizon-progress-wrap {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.horizon-solo-row {
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.horizon-solo-end {
  color: #64748b;
  font-weight: 400;
}

.horizon-solo-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #2dd4bf;
  font-weight: 600;
}

.horizon-solo-fill {
  height: 100%;
  width: 2%;
  background: linear-gradient(90deg, #14b8a6 0%, #38bdf8 100%);
  border-radius: 0 3px 3px 0;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 10px rgba(20, 184, 166, 0.4);
}

.horizon-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 7px;
}

.horizon-progress-label {
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.horizon-progress-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-green);
  font-weight: 600;
}

/* Progress Track & Fill */
.progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  border-radius: 999px;
  container-type: inline-size;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 25%, #ec4899 50%, #f59e0b 75%, #10b981 100%);
  background-size: 100cqw 100%;
  background-position: left center;
  border-radius: 0 3px 3px 0;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.6s ease;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.5);
}

/* Tasks Container */
.tasks-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: gap 0.4s ease;
}

.tasks-container.cleared {
  gap: 0;
  margin: 0;
}

.task-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
}

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
  min-width: 0;
}

.section-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 7px;
  border-radius: 10px;
}

.task-list {
  list-style: none;
  padding: 4px 0;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  position: relative;
  transition: background-color 0.15s ease, opacity 0.2s ease;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-touch-input) body:not(.force-mobile-view) .task-item:hover {
    background-color: var(--bg-card-hover);
  }
}

.task-item.completed {
  opacity: 0.35;
  text-decoration: line-through;
}

.task-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 26px;
  height: 26px;
  margin: -3px -4px -4px -4px;
  border: none;
  border-radius: 50%;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  box-sizing: border-box;
  position: relative;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.task-checkbox::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1.5px solid rgba(16, 185, 129, 0.68);
  background: rgba(16, 185, 129, 0.08);
  box-sizing: border-box;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  pointer-events: none;
}

.task-checkbox:not(:checked)::after {
  content: '';
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #10b981;
  transform: scale(0);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.task-checkbox:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 0;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-touch-input) .task-checkbox:not(:checked):hover::before {
    border-color: #10b981;
    background-color: rgba(16, 185, 129, 0.16);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.28);
  }
}

.task-checkbox:not(:checked):active::before {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.22);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
}

.task-checkbox:not(:checked):active::after {
  transform: scale(1);
}

.task-checkbox:checked::before {
  background-color: var(--accent-green, #10b981);
  border-color: var(--accent-green, #10b981);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.task-checkbox:checked::after {
  content: '✓';
  position: relative;
  z-index: 1;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  display: block;
  line-height: 1;
}

.task-text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-primary);
  flex-grow: 1;
  word-break: break-word;
}

.task-text a {
  color: var(--accent-cyan);
  text-decoration: none;
}

/* ==========================================================================
   COMPACT SECTION STANDARDS
   ========================================================================== */

/* 1-Item Section Header Layout (Gym, Yoga, Zone 2, Wind Down) */
.single-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.16s ease;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-touch-input) body:not(.force-mobile-view) .single-item-header:hover {
    background: rgba(255, 255, 255, 0.025);
  }
}

.single-item-header:active {
  background: rgba(16, 185, 129, 0.08);
}

.single-item-header:focus:not(:focus-visible) {
  outline: none;
}

.single-item-header:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: -2px;
}

.single-item-left {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  flex: 1;
  overflow: hidden;
  min-width: 0;
  padding: 4px 0;
}

.single-item-left strong {
  white-space: nowrap;
  flex-shrink: 0;
}

.single-dot-btn {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(16, 185, 129, 0.72);
  background: rgba(16, 185, 129, 0.1);
  box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.12), 0 0 6px rgba(16, 185, 129, 0.18);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
  color: transparent;
  font-size: 12px;
  font-weight: 800;
  padding: 0;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-touch-input) .single-dot-btn:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.24);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.55), inset 0 0 6px rgba(16, 185, 129, 0.3);
    color: transparent;
  }
}

.single-dot-btn::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #10b981;
  transform: scale(0);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-touch-input) .single-dot-btn:hover:not(.completed)::after {
    transform: scale(1);
  }
}

.single-dot-btn.completed::after {
  display: none;
}

.single-dot-btn:active {
  background: rgba(16, 185, 129, 0.32);
  border-color: #34d399;
}

.single-dot-btn.completed {
  background: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.7);
  color: #fff;
}

/* Stepper Dots (Meals & Deep Work) - Cumulative Auto-Fill */
.stepper-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.16s ease;
}

.stepper-header .section-title-wrap {
  flex: 1;
  min-inline-size: 0;
  overflow: hidden;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-touch-input) body:not(.force-mobile-view) .stepper-header:hover {
    background: rgba(255, 255, 255, 0.025);
  }
}

.stepper-header:active {
  background: rgba(16, 185, 129, 0.06);
}

.dots-stepper-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  background: rgba(16, 185, 129, 0.08);
  border: 1.5px solid rgba(16, 185, 129, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 2px 8px rgba(0, 0, 0, 0.4);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dots-stepper-wrap:focus:not(:focus-visible) {
  outline: none;
}

.dots-stepper-wrap:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-touch-input) .dots-stepper-wrap:hover {
    background: rgba(16, 185, 129, 0.14);
    border-color: rgba(16, 185, 129, 0.65);
  }
}

.dots-stepper-wrap:active {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
}

.dots-stepper-wrap:active .step-dot.next-pending {
  transform: scale(0.88);
}

.step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
}

.step-dot.track {
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid rgba(52, 211, 153, 0.72);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 4px rgba(16, 185, 129, 0.22);
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-touch-input) .dots-stepper-wrap:hover .step-dot.next-pending {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.65);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
    transform: scale(1.08);
  }
}

.step-dot.active {
  background: #10b981;
  border: 1.5px solid rgba(16, 185, 129, 0.95);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.65);
  animation: dotSpringPop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dotSpringPop {
  0% { transform: scale(0.6); opacity: 0.5; }
  65% { transform: scale(1.3); }
  100% { transform: scale(1.0); opacity: 1; }
}

/* ==========================================================================
   UNIFIED 50%-WIDTH ITEM CARDS (Habits + Tasks)
   ========================================================================== */
.item-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 8px;
  padding: 10px 12px 12px;
}

@media (min-width: 541px) {
  body:not(.force-mobile-view) .item-card-grid.is-tasks-grid {
    display: block;
    column-count: 2;
    column-gap: 8px;
  }
  body:not(.force-mobile-view) .item-card-grid.is-tasks-grid:has(> .item-card:only-child) {
    column-count: 1;
  }
  body:not(.force-mobile-view) .item-card-grid.is-tasks-grid .item-card {
    break-inside: avoid;
    margin-bottom: 8px;
    width: 100%;
  }
}

@media (max-width: 540px) {
  .item-card-grid.is-tasks-grid {
    grid-template-columns: 1fr;
  }
}

body.force-mobile-view .item-card-grid.is-tasks-grid {
  grid-template-columns: 1fr;
}

.item-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px 0 0;
  background: rgba(6, 182, 212, 0.04);
  border: 1px solid rgba(6, 182, 212, 0.24);
  border-radius: 8px;
  box-shadow: inset 0 0 12px rgba(6, 182, 212, 0.03);
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-touch-input) body:not(.force-mobile-view) .item-card:hover {
    border-color: var(--accent-cyan, #06b6d4);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.25);
  }
}

.item-card:active {
  background: rgba(6, 182, 212, 0.12);
  border-color: #38bdf8;
  box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.18);
}

.item-card:focus:not(:focus-visible) {
  outline: none;
}

.item-card:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.item-card-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  transition: color 0.2s ease, opacity 0.2s ease;
  padding: 3px 0;
}

/* 1-Line Strict Clamp for All Task Cards */
.item-card:not(.is-expanded) .item-card-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Expanded State for Long Tasks */
.item-card.is-expanded {
  align-items: flex-start;
}
.item-card.is-expanded .item-radio {
  margin-top: 2.5px;
}
.item-card.is-expanded .item-card-text {
  display: block;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.item-radio {
  position: relative;
  width: 17px;
  height: 17px;
  margin: 12px 10px;
  cursor: pointer;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(16, 185, 129, 0.68);
  background: rgba(16, 185, 129, 0.08);
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.item-radio::before {
  content: '';
  position: absolute;
  inset: -12px -10px;
}

.item-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #10b981;
  transform: scale(0);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-touch-input) .item-radio:hover {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.22);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
  }

  html:not(.is-touch-input) .item-radio:hover::after {
    transform: scale(1);
  }
}

.item-radio:active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.22);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.45);
}

.item-radio:active::after {
  transform: scale(1);
}

.item-card.checked {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
  pointer-events: none;
}

.item-card.checked .item-radio {
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.8);
}

.item-card.checked .item-radio::after {
  transform: scale(1);
}

.item-card.checked .item-card-text {
  color: #64748b;
  text-decoration: line-through;
  opacity: 0.7;
}

.item-card.in-flight {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* Completed Tasks Reservoir Drawer */
.reservoir-card {
  margin-top: 24px;
  margin-bottom: 20px;
  background: rgba(15, 17, 23, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  overflow: hidden;
  backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.reservoir-card.equilibrium {
  border-color: rgba(16, 185, 129, 0.35);
  box-shadow: 0 4px 24px rgba(16, 185, 129, 0.12);
}

.reservoir-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
  transition: background 0.15s ease;
}

.reservoir-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.reservoir-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.reservoir-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reservoir-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}

.reservoir-count-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--accent-green);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 3px 8px;
  border-radius: 999px;
}

.reservoir-chevron {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.reservoir-chevron.expanded {
  transform: rotate(180deg);
}

.reservoir-content {
  max-height: none;
  overflow: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  opacity: 1;
  visibility: visible;
}

@supports (interpolate-size: allow-keywords) {
  .reservoir-content {
    interpolate-size: allow-keywords;
    max-height: auto;
    transition: max-height 0.32s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s ease;
  }
}

.reservoir-content.collapsed {
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  overflow: hidden;
  pointer-events: none;
}

.completed-list {
  padding: 8px 0;
}

.completed-list .task-item {
  opacity: 0.55;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.15s ease;
}

.completed-list .task-item.completed,
.completed-list .task-item.completed .task-text {
  text-decoration: line-through;
}

.completed-list .task-item:hover {
  opacity: 0.85;
  background-color: rgba(255, 255, 255, 0.04);
}

.completed-list .task-item.restoring,
.completed-list .task-item:not(.completed) {
  text-decoration: none !important;
  background-color: transparent !important;
}

.completed-list .task-item.restoring .task-text,
.completed-list .task-item:not(.completed) .task-text {
  text-decoration: none !important;
}

.reservoir-archive-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 14px 12px;
}

.reservoir-archive-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  block-size: 28px;
  padding: 0 11px;
  border-radius: 7px;
  background: rgba(30, 41, 59, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.69rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.reservoir-archive-btn:hover,
.reservoir-archive-btn:focus-visible {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.42);
  color: #f8fafc;
}

.reservoir-show-more-btn {
  margin-inline-end: auto;
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  font-weight: 600;
}

/* Toast Undo Button (`.capture-bar` & `.toast-banner` live in `/core-base.css`) */
.undo-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  min-height: 28px;
  padding: 4px 11px;
  border-radius: 6px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.undo-btn:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.38);
}

.undo-btn:active {
  background: rgba(56, 189, 248, 0.28);
  border-color: rgba(56, 189, 248, 0.55);
}

/* Spinner & Loading State */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--text-muted);
  gap: 12px;
  font-size: 13px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   Frosted Glass Obsidian Reader Modal & Interactive WikiLinks
   ========================================================================== */

.wiki-link-btn {
  background: rgba(139, 92, 246, 0.16);
  border: 1px solid rgba(139, 92, 246, 0.38);
  color: #ddd6fe;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 2px 2px;
  box-sizing: border-box;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  vertical-align: middle;
  line-height: 1.2;
}

.wiki-link-btn:hover {
  background: rgba(139, 92, 246, 0.24);
  border-color: rgba(167, 139, 250, 0.65);
  color: #ffffff;
  box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
}

.wiki-link-btn:active {
  background: rgba(139, 92, 246, 0.34);
  border-color: #c4b5fd;
}

.web-link {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  border: 1px solid rgba(125, 211, 252, 0.5);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 2px 2px;
  box-sizing: border-box;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.35);
  transition: filter 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  text-decoration: none;
  vertical-align: middle;
  line-height: 1.2;
}

/* Split Hit-Zone & Uniform Wide App Pill for Linked Habits (Letras, Tagalog) + Routines (Pull, Zone 2) */
.item-card:has(a.web-link, .wiki-link-btn),
.item-card.has-app-link {
  position: relative;
  padding: 0 6px 0 0;
  gap: 0;
  touch-action: manipulation;
}

.item-card:has(a.web-link, .wiki-link-btn) .item-radio,
.item-card.has-app-link .item-radio {
  margin: 12px 10px;
  cursor: pointer;
}

.item-card:has(a.web-link, .wiki-link-btn) .item-radio::before,
.item-card.has-app-link .item-radio::before {
  content: '';
  position: absolute;
  inset: -12px -10px;
}

.is-habits-grid .item-card:has(a.web-link, .wiki-link-btn) .item-card-text,
.is-habits-grid .item-card.has-app-link .item-card-text {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 5px 0;
}

.is-tasks-grid .item-card:has(a.web-link, .wiki-link-btn) .item-card-text,
.is-tasks-grid .item-card.has-app-link .item-card-text {
  padding: 6px 0;
  line-height: 26px;
}

.item-card:has(a.web-link, .wiki-link-btn) .item-card-text a.web-link,
.item-card.has-app-link .item-card-text a.web-link,
.single-item-left a.web-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 26px;
  padding: 4px 10px;
  margin: 0;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.2;
  box-sizing: border-box;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .single-item-left {
    gap: 5px;
    font-size: 13px;
  }
  .single-item-left .wiki-link-btn,
  .section-title-wrap .web-link,
  .section-title-wrap .wiki-link-btn,
  .item-card .wiki-link-btn {
    font-size: 10.5px;
    min-height: 24px;
    padding: 3px 8px;
    gap: 3px;
    margin: 0 0 0 2px;
  }
  .item-card:has(a.web-link, .wiki-link-btn) .item-card-text a.web-link,
  .item-card.has-app-link .item-card-text a.web-link,
  .single-item-left a.web-link {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    min-height: 24px;
    padding: 3px 8px;
    font-size: 11px;
    margin: 0;
  }
  .stepper-header {
    gap: 8px;
    padding: 10px 12px;
  }
  .stepper-header .section-title-wrap {
    gap: 5px;
    overflow: hidden;
  }
  .stepper-header .dots-stepper-wrap {
    padding: 6px 10px;
    gap: 6px;
  }
}

body.force-mobile-view .single-item-left {
  gap: 5px;
  font-size: 13px;
}

body.force-mobile-view .stepper-header {
  gap: 8px;
  padding: 10px 12px;
}

body.force-mobile-view .stepper-header .section-title-wrap {
  gap: 5px;
  overflow: hidden;
}

body.force-mobile-view .stepper-header .dots-stepper-wrap {
  padding: 6px 10px;
  gap: 6px;
}

body.force-mobile-view :is(.single-item-left, .section-title-wrap, .item-card) .wiki-link-btn,
body.force-mobile-view .section-title-wrap .web-link {
  font-size: 10.5px;
  min-height: 24px;
  padding: 3px 8px;
  gap: 3px;
  margin: 0 0 0 2px;
}

body.force-mobile-view .item-card:has(a.web-link, .wiki-link-btn) .item-card-text a.web-link,
body.force-mobile-view .item-card.has-app-link .item-card-text a.web-link,
body.force-mobile-view .single-item-left a.web-link {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
  min-height: 24px;
  padding: 3px 8px;
  font-size: 11px;
  margin: 0;
}

.web-link:hover {
  filter: brightness(1.12);
  border-color: #7dd3fc;
  color: #ffffff;
  box-shadow: 0 5px 15px rgba(2, 132, 199, 0.5);
}

.web-link:active {
  filter: brightness(0.95);
  border-color: #bae6fd;
}

.web-link.is-external-link {
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(34, 211, 238, 0.46);
  color: #a5f3fc;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.22);
}

.web-link.is-external-link:hover {
  background: rgba(6, 182, 212, 0.26);
  border-color: #67e8f9;
  color: #ffffff;
}

/* Reader Modal Drawer Overlay */
.reader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  box-sizing: border-box;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.reader-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.reader-drawer {
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  height: auto;
  background: rgba(15, 17, 24, 0.96);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 32px rgba(139, 92, 246, 0.15);
  transform: scale(1) translateY(0);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  overflow: hidden;
}

@media (max-width: 640px) {
  .reader-overlay {
    padding: 20px 12px;
  }
  .reader-drawer {
    max-height: calc(100vh - 44px);
    max-height: calc(100dvh - 44px);
    border-radius: 18px;
  }
}

.reader-overlay.hidden .reader-drawer {
  transform: scale(0.96) translateY(16px);
}

.reader-drag-handle {
  width: 44px;
  height: 4px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  margin: 10px auto 4px auto;
  flex-shrink: 0;
}

.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  gap: 10px;
}

.reader-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.reader-back-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #e2e8f0;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.reader-back-btn:hover {
  background: rgba(51, 65, 85, 0.95);
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
}

.reader-title-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
}

.reader-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.25);
  padding: 2px 7px;
  border-radius: 6px;
  width: fit-content;
}

.reader-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.reader-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.reader-obsidian-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #7c3aed 0%, #6366f1 100%);
  color: #fff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

.reader-tracker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  color: #fff;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 20px;
  text-decoration: none;
  border: 1px solid rgba(125, 211, 252, 0.5);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
}

@media (max-width: 480px) {
  .reader-header {
    padding: 10px 14px 12px 14px;
    gap: 8px;
  }
  .reader-header-left {
    gap: 8px;
  }
  .reader-back-btn {
    height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }
  .reader-obsidian-btn,
  .reader-tracker-btn {
    padding: 5px 10px;
    font-size: 10.5px;
  }
}

body.force-mobile-view .reader-header {
  padding: 10px 14px 12px 14px;
  gap: 8px;
}
body.force-mobile-view .reader-header-left {
  gap: 8px;
}
body.force-mobile-view .reader-back-btn {
  height: 28px;
  padding: 0 9px;
  font-size: 11px;
}

.reader-obsidian-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.45);
}

.reader-tracker-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.45);
}

.workout-exercise-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
}

.workout-exercise-row:not(:last-child) {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.workout-exercise-pill {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.28);
  font-size: 11.5px;
  padding: 4px 9px;
  border-radius: 7px;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.workout-launch-btn-mobile {
  display: flex;
}

@media (max-width: 640px) {
  .reader-tracker-btn {
    display: none !important;
  }
  .workout-exercise-row {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
  }
  .workout-exercise-pill {
    align-self: center;
    margin-top: 0;
    margin-left: auto;
  }
}

@media (min-width: 641px) {
  body:not(.force-mobile-view) .workout-launch-btn-mobile {
    display: none !important;
  }
}

.reader-close-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.reader-close-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.reader-body {
  padding: 12px 14px 30px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  font-size: 13.5px;
  line-height: 1.6;
  color: #cbd5e1;
}

@media (min-width: 541px) {
  body:not(.force-mobile-view) .reader-body {
    padding: 16px 20px 36px 20px;
  }
}

.reader-body h1,
.reader-body h2,
.reader-body h3,
.reader-body h4 {
  color: #fff;
  margin: 18px 0 8px 0;
  font-weight: 600;
  line-height: 1.3;
}

.reader-body h1 { font-size: 18px; }
.reader-body h2 { font-size: 16px; }
.reader-body h3 { font-size: 14.5px; }

.reader-body p { margin: 8px 0; }

.reader-body hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 16px 0;
}

.reader-body ul,
.reader-body ol {
  padding-left: 20px;
  margin: 10px 0;
}

.reader-body li { margin: 4px 0; }

.reader-body strong {
  color: #f1f5f9;
  font-weight: 600;
}

.reader-body em {
  color: #94a3b8;
  font-style: italic;
}

.reader-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 5px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #a78bfa;
}

.reader-body td code {
  overflow-wrap: anywhere;
}

.table-scroll-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px 0 20px 0;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
}

.reader-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 0;
  table-layout: auto;
}

.reader-body th {
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 9px;
  text-align: left;
  font-weight: 600;
  color: #f1f5f9;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  white-space: normal;
}

.reader-body td {
  padding: 9px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  color: #cbd5e1;
  vertical-align: middle;
  line-height: 1.45;
  overflow-wrap: break-word;
}

@media (min-width: 541px) {
  body:not(.force-mobile-view) .reader-body table {
    font-size: 12.5px;
  }
  body:not(.force-mobile-view) .reader-body th {
    padding: 10px 12px;
    white-space: nowrap;
  }
  body:not(.force-mobile-view) .reader-body th:nth-child(2),
  body:not(.force-mobile-view) .reader-body td:nth-child(2) {
    white-space: normal;
  }
  body:not(.force-mobile-view) .reader-body td {
    padding: 11px 12px;
  }
}

.reader-body tr:last-child td { border-bottom: none; }

.reader-body tr:hover td {
  background: rgba(255, 255, 255, 0.03);
  color: #f8fafc;
}

/* ==========================================================================
   MOBILE-FIRST WEEKLY TRAINING MATRIX & WORKOUT SPLIT CARDS
   ========================================================================== */
.weekly-matrix-section {
  margin: 8px 0 22px 0;
}

.weekly-matrix-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.weekly-matrix-header h2 {
  margin: 0 !important;
  font-size: 16px;
  font-weight: 700;
  color: #f8fafc;
}

.weekly-matrix-sub {
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 500;
}

.weekly-matrix-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.weekly-matrix-card {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.14);
  overflow: hidden;
  box-sizing: border-box;
}

.weekly-day-tabs-bar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.32);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.weekly-day-tab {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 2px;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.weekly-day-tab:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.weekly-day-tab.active {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.18);
}

.weekly-day-panel {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
  min-width: 0;
}

.weekly-day-panel.active {
  display: flex;
}

.weekly-day-card {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.12);
  box-sizing: border-box;
  min-width: 0;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.weekly-day-card.is-today {
  background: rgba(56, 189, 248, 0.07);
  border-color: rgba(56, 189, 248, 0.38);
  box-shadow: 0 4px 16px rgba(2, 132, 199, 0.12);
}

.weekly-day-card.compact-cardio-row {
  align-items: center;
  justify-content: space-between;
  padding: 9px 13px;
}

.weekly-day-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 74px;
  flex-shrink: 0;
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  padding-right: 10px;
}

.weekly-day-card.compact-cardio-row .weekly-day-left {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: auto;
  border-right: none;
  padding-right: 0;
  gap: 8px;
}

.weekly-day-name {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #f8fafc;
}

.weekly-split-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.weekly-split-badge:hover {
  filter: brightness(1.15);
  transform: translateY(-1px);
}

.weekly-split-badge.tone-purple {
  background: rgba(168, 85, 247, 0.16);
  border-color: rgba(168, 85, 247, 0.42);
  color: #e9d5ff;
}

.weekly-split-badge.tone-cyan {
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(6, 182, 212, 0.42);
  color: #a5f3fc;
}

.weekly-split-badge.tone-blue {
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(59, 130, 246, 0.42);
  color: #bfdbfe;
}

.weekly-split-badge.tone-slate {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
}

.weekly-session-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.weekly-session-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.weekly-session-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.weekly-session-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #64748b;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.14);
  padding: 2px 6px;
  border-radius: 4px;
  min-width: 44px;
  text-align: center;
  flex-shrink: 0;
}

.weekly-session-items {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1;
}

.weekly-split-jump-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.weekly-split-jump-chip:hover {
  background: rgba(255, 255, 255, 0.14);
}

.weekly-plus {
  color: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.weekly-cardio-chip.tone-purple,
.weekly-cardio-pill.tone-purple {
  background: rgba(168, 85, 247, 0.14);
  border-color: rgba(168, 85, 247, 0.38);
  color: #e9d5ff;
}

.weekly-cardio-chip.tone-cyan,
.weekly-cardio-pill.tone-cyan {
  background: rgba(6, 182, 212, 0.14);
  border-color: rgba(6, 182, 212, 0.38);
  color: #bae6fd;
}

.weekly-cardio-chip.tone-blue,
.weekly-cardio-pill.tone-blue {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.38);
  color: #bfdbfe;
}

.weekly-cardio-pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  white-space: nowrap;
}

.weekly-neuro-tag {
  font-size: 11px;
  font-weight: 600;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
}

.weekly-neuro-tag.is-rest {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.1);
  border-color: rgba(148, 163, 184, 0.22);
}

/* Segmented Workout Split Filter Tabs */
.routine-split-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 12px 0 8px 0;
  padding: 5px;
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.routine-split-tab {
  flex: 1 1 auto;
  min-width: 52px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.routine-split-tab:hover {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.05);
}

.routine-split-tab.active {
  color: #f8fafc;
  font-weight: 700;
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
}

.routine-split-section {
  margin-bottom: 22px;
}

.routine-split-section h3 {
  margin: 14px 0 10px 0 !important;
  font-size: 15px;
  font-weight: 700;
  color: #f8fafc;
}

.routine-split-section > .routine-lift-deck:first-child,
.routine-split-section > .table-scroll-wrapper:first-child {
  margin-top: 0;
}

/* Zero-Overflow Lift Exercise Cards */
.routine-lift-deck {
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(0, 0, 0, 0.32);
  overflow: hidden;
  margin: 10px 0 18px 0;
}

.routine-lift-list {
  display: flex;
  flex-direction: column;
}

.routine-lift-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 13px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  min-width: 0;
}

.routine-lift-card:last-child {
  border-bottom: none;
}

.routine-lift-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.routine-lift-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  flex: 1 1 170px;
}

.routine-lift-num {
  font-size: 12.5px;
  font-weight: 700;
  color: #64748b;
}

.routine-lift-name {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
}

.routine-lift-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .weekly-day-card {
    flex-direction: column;
    gap: 8px;
    padding: 11px 12px;
  }
  .weekly-day-card.compact-cardio-row {
    flex-direction: row;
  }
  .weekly-day-left {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    padding-right: 0;
    padding-bottom: 7px;
  }
}

body.force-mobile-view .weekly-day-card {
  flex-direction: column;
  gap: 8px;
  padding: 11px 12px;
}

body.force-mobile-view .weekly-day-card.compact-cardio-row {
  flex-direction: row;
}

body.force-mobile-view .weekly-day-left {
  width: 100%;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  border-right: none;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  padding-right: 0;
  padding-bottom: 7px;
}

.hud-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 4px;
}

.hud-stretch-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.09);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.hud-stretch-chip:hover {
  background: rgba(6, 182, 212, 0.12);
  border-color: rgba(6, 182, 212, 0.35);
  color: #ffffff;
}

.reader-callout {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  border-left: 3px solid var(--accent-purple);
  background: rgba(139, 92, 246, 0.08);
  font-size: 12.5px;
  color: #e2e8f0;
}

.reader-callout.tip {
  border-left-color: var(--accent-orange);
  background: rgba(255, 255, 255, 0.03);
}

.reader-callout.info {
  border-left-color: var(--accent-blue);
  background: rgba(59, 130, 246, 0.08);
}

.reader-callout.note {
  border-left-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.reader-callout-title {
  font-weight: 600;
  margin-bottom: 6px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   CALLOUT STEP FLOW (TOP OF READER NOTE)
   ========================================================================== */
.callout-flow-steps {
  display: flex;
  align-items: stretch;
  gap: 5px;
  margin: 10px 0 10px 0;
  flex-wrap: nowrap;
}
.callout-step-card {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 7px !important;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.callout-step-card.active {
  border-color: rgba(6, 182, 212, 0.45);
  background: rgba(6, 182, 212, 0.08);
}
.callout-step-title {
  font-size: 9.5px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.callout-step-sub {
  font-size: 9.5px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.callout-flow-arrow {
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.reader-pill-strip {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.reader-inline-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 7px;
  border-radius: 7px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  box-sizing: border-box;
}

.reader-mini-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 2px 5px;
  font-size: 10px;
  color: #cbd5e1;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-item-slot-line {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.reader-item-slot-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 541px) {
  body:not(.force-mobile-view) .callout-flow-steps {
    gap: 8px;
  }
  body:not(.force-mobile-view) .callout-step-card {
    padding: 8px 10px !important;
  }
  body:not(.force-mobile-view) .callout-step-title {
    font-size: 10.5px;
    letter-spacing: 0.03em;
  }
  body:not(.force-mobile-view) .callout-step-sub {
    font-size: 11px;
  }
  body:not(.force-mobile-view) .callout-flow-arrow {
    font-size: 13px;
  }
  body:not(.force-mobile-view) .reader-pill-strip {
    gap: 6px;
  }
  body:not(.force-mobile-view) .reader-inline-pill {
    font-size: 11.5px;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: normal;
  }
  body:not(.force-mobile-view) .reader-mini-chip {
    font-size: 11px;
    padding: 2px 8px;
  }
  body:not(.force-mobile-view) .reader-item-slot-line {
    font-size: 13px;
    gap: 5px;
  }
}

/* ==========================================================================
   GOOGLE CALENDAR INTEGRATION: HORIZON STRIP & MODAL
   ========================================================================== */
.gcal-horizon-strip {
  margin: 0 0 12px 0;
  border-radius: 10px;
  user-select: none;
}

.gcal-opt-b-list {
  background: rgba(0, 0, 0, 0.44);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.gcal-horizon-strip:hover .gcal-opt-b-list {
  border-color: rgba(56, 189, 248, 0.35);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.gcal-opt-b-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6.5px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.15s ease;
}
.gcal-opt-b-row:last-child {
  border-bottom: none;
}
.gcal-opt-b-row:hover {
  background: rgba(56, 189, 248, 0.08);
}

.gcal-opt-b-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.gcal-opt-b-when {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--evt-color, #38bdf8);
  min-width: 38px;
  flex-shrink: 0;
}

.hz-when-compact {
  display: flex;
  flex-direction: column;
}

.hz-when-num-date {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.hz-when-num-time {
  font-size: 9.5px;
  opacity: 0.86;
  letter-spacing: -0.02em;
}

.hz-when-wide {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.gcal-when-sep {
  display: none;
}

.gcal-when-time {
  font-size: 9.5px;
  opacity: 0.88;
}

@media (min-width: 560px) {
  body:not(.force-mobile-view) .gcal-opt-b-when {
    display: inline-block;
    line-height: normal;
    min-width: 150px;
  }
  body:not(.force-mobile-view) .hz-when-compact {
    display: none;
  }
  body:not(.force-mobile-view) .hz-when-wide {
    position: static;
    inline-size: auto;
    block-size: auto;
    overflow: visible;
    clip-path: none;
  }
  body:not(.force-mobile-view) .gcal-when-sep {
    display: inline;
  }
  body:not(.force-mobile-view) .gcal-when-time {
    font-size: inherit;
    opacity: 1;
  }
}

.hz-title-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.gcal-opt-b-title {
  font-size: 12px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gcal-unfold-details {
  display: none;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gcal-unfold-loc {
  font-size: 10.5px;
  line-height: 1.4;
  color: #cbd5e1;
  white-space: normal;
  overflow-wrap: anywhere;
}

.gcal-loc-link {
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
  color: #a5f3fc;
  background: rgba(6, 182, 212, 0.14);
  border: 1px solid rgba(34, 211, 238, 0.42);
  border-radius: 6px;
  padding: 1.5px 6px;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  vertical-align: baseline;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.gcal-loc-link:hover,
.gcal-loc-link:focus-visible {
  background: rgba(6, 182, 212, 0.26);
  border-color: #67e8f9;
  color: #ffffff;
}

.gcal-unfold-time {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 600;
  color: #7dd3fc;
}

.gcal-unfold-desc {
  display: flex;
  flex-direction: column;
  gap: 2.5px;
  font-size: 10.5px;
  line-height: 1.4;
  color: #94a3b8;
  white-space: normal;
  overflow-wrap: anywhere;
}

.gcal-unfold-desc-line {
  line-height: 1.38;
}

.gcal-desc-link {
  font-size: 10px !important;
  padding: 0.5px 5px !important;
  margin-left: 2px;
}

.gcal-opt-b-row.is-unfolded {
  align-items: flex-start;
  background: rgba(56, 189, 248, 0.09);
}
.gcal-opt-b-row.is-unfolded .gcal-opt-b-left {
  align-items: flex-start;
}
.gcal-opt-b-row.is-unfolded .gcal-opt-b-when,
.gcal-opt-b-row.is-unfolded .gcal-opt-b-badge {
  margin-top: 1px;
}
.gcal-opt-b-row.is-unfolded .gcal-opt-b-title {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.gcal-opt-b-row.is-unfolded .gcal-unfold-details {
  display: flex;
}

.gcal-opt-b-badge {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 1.5px 6px;
  border-radius: 999px;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.gcal-opt-b-badge:hover,
.gcal-opt-b-badge:focus-visible {
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(56, 189, 248, 0.42);
  color: #e0f2fe;
}

.gcal-opt-b-row .gcal-ext-pill {
  margin: 0;
  min-height: 22px;
  padding: 2.5px 8.5px;
  font-size: 11px;
  border-radius: 7px;
  flex-shrink: 0;
}

.toast-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.toast-edit-btn {
  border-color: rgba(56, 189, 248, 0.45) !important;
  color: #7dd3fc !important;
  background: rgba(56, 189, 248, 0.14) !important;
}
.toast-edit-btn:hover {
  background: rgba(56, 189, 248, 0.28) !important;
  color: #ffffff !important;
}

/* Calendar Sheet Action Controls & Agenda */
.cal-add-btn {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.25), rgba(16, 185, 129, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #f0fdf4;
  border-radius: 7px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.cal-add-btn:hover {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

/* Selected Day Events Panel & All Upcoming Agenda */
.cal-agenda-section {
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-agenda-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--evt-color, #38bdf8);
  border-radius: 8px;
  padding: 9px 12px;
  transition: background 0.15s ease;
}
.cal-agenda-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

.cal-evt-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.cal-evt-action-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cal-evt-action-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #fff;
  border-color: #38bdf8;
}
.cal-evt-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.22);
  color: #fca5a5;
  border-color: #ef4444;
}

/* Quick Add / Edit Inline Drawer inside Sheet */
.cal-form-card {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cal-input {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 7px 9px;
  color: #f8fafc;
  font-size: 12px;
  font-family: inherit;
}
.cal-input:focus {
  outline: none;
  border-color: #38bdf8;
}


/* ============================================================================
   SYSTEM ATLAS TAGALOG-STYLE SEGMENTED SWITCHER & 2-WAY AI QUEUE WIDGET
   ============================================================================ */
.atlas-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.atlas-mode-bar {
  position: sticky;
  top: -12px;
  z-index: 35;
  width: 100%;
  min-width: 0;
}

.atlas-mode-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  padding: 4px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
  box-sizing: border-box;
}

.atlas-mode-tabs[data-tab-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.atlas-mode-tabs[data-tab-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.atlas-mode-tabs[data-tab-count="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.atlas-mode-tabs[data-tab-count="5"],
.atlas-mode-tabs[data-tab-count="6"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.atlas-mode-tab {
  appearance: none;
  height: 34px;
  width: 100%;
  min-width: 0;
  padding: 0 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.atlas-mode-tab:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
}

.atlas-mode-tab.active {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(56, 189, 248, 0.42);
  color: #f8fafc;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
}

@media (min-width: 680px) {
  body:not(.force-mobile-view) .atlas-mode-bar {
    top: -16px;
  }
  body:not(.force-mobile-view) .atlas-mode-tabs {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
  body:not(.force-mobile-view) .atlas-mode-tabs[data-tab-count="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body:not(.force-mobile-view) .atlas-mode-tabs[data-tab-count="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  body:not(.force-mobile-view) .atlas-mode-tabs[data-tab-count="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body:not(.force-mobile-view) .atlas-mode-tabs[data-tab-count="5"] {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  body:not(.force-mobile-view) .atlas-mode-tabs[data-tab-count="6"] {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  body:not(.force-mobile-view) .atlas-mode-tabs[data-tab-count="7"] {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  body:not(.force-mobile-view) .atlas-mode-tab {
    height: 36px;
    font-size: 12px;
    padding: 0 6px;
  }
}

/* Keep display/padding off [hidden="until-found"] outer wrapper per modern-web-guidance */
.atlas-tab-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.atlas-tab-panel-inner > ul:first-child,
.atlas-tab-panel-inner > p:first-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px 0;
  padding-left: 0;
  list-style: none;
}

.atlas-tab-panel-inner > p:first-child .wiki-link-btn {
  margin: 0;
}

.atlas-tab-panel-inner > h3 {
  margin: 6px 0 2px 0;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.sheet-check-row > div:first-child,
.sheet-item-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (prefers-reduced-motion: reduce) {
  .task-section,
  .item-card,
  .reservoir-content,
  .step-dot {
    animation: none !important;
    transition: none !important;
  }
}

/* ============================================================================
   MOBILE PREVIEW PARITY (`body.force-mobile-view`) FOR READER DRAWER
   ============================================================================ */
body.force-mobile-view .reader-overlay {
  padding: 46px 8px 16px 8px;
}

body.force-mobile-view .reader-drawer {
  width: 100%;
  max-width: calc(var(--mobile-frame-w, 360px) - 16px);
  max-height: min(calc(100dvh - 62px), calc(var(--mobile-frame-h, 800px) - 24px));
  border-radius: 18px;
}

body.force-mobile-view .reader-title {
  font-size: 14px;
}

body.force-mobile-view .reader-obsidian-btn,
body.force-mobile-view .reader-tracker-btn {
  padding: 5px 10px;
  font-size: 10.5px;
}

body.force-mobile-view .reader-tracker-btn {
  display: none !important;
}

body.force-mobile-view .reader-body {
  padding: 12px 14px 28px 14px;
}

/* ============================================================================
   DAILY STRATEGIC BRIEFING — MOBILE-FIRST (`360×800`) STRUCTURED STAGE
   ============================================================================ */
.briefing-stage {
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
}

.briefing-fallback-pill {
  font-size: 11px;
  font-weight: 600;
  color: #bae6fd;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  border-radius: 9px;
  padding: 6px 10px;
}

.briefing-tabs {
  position: sticky;
  top: -12px;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 11px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
}

.briefing-tabs[data-tab-count="4"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.briefing-tabs[data-tab-count="5"] {
  display: flex;
  align-items: stretch;
  gap: 2px;
  padding: 3px;
}

.briefing-tabs[data-tab-count="5"] .briefing-tab {
  flex: 1 1 auto;
  font-size: 10.5px;
  padding: 5px 4px;
}

/* 3×2 mobile tab grid per DESIGN_GUIDE §1.3 (<=4 tabs/row on 360px) */
.briefing-tabs[data-tab-count="6"] {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
}

.briefing-tabs[data-tab-count="6"] .briefing-tab {
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 6px;
  letter-spacing: normal;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Briefing Final Stage: Yesterday Ledger Check-In */
.bci-stage {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-inline-size: 0;
}

.bci-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.bci-kicker {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.bci-status-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #cbd5e1;
}

.bci-status-pill.is-done {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
  color: #6ee7b7;
}

.bci-btn-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 6px;
}

.bci-btn-row.is-compact {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}

.bci-ans-btn {
  appearance: none;
  min-block-size: 34px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.78);
  color: #cbd5e1;
  font: 700 11.5px/1 inherit;
  cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.bci-btn-row.is-compact .bci-ans-btn {
  min-block-size: 30px;
  padding: 5px 7px;
  font-size: 10.5px;
}

.bci-ans-btn.is-full.active { background: rgba(16, 185, 129, 0.22); border-color: #10b981; color: #ecfdf5; }
.bci-ans-btn.is-half.active { background: rgba(245, 158, 11, 0.22); border-color: #f59e0b; color: #fffbeb; }
.bci-ans-btn.is-skip.active { background: rgba(56, 189, 248, 0.2); border-color: #38bdf8; color: #f0f9ff; }
.bci-ans-btn.is-miss.active { background: rgba(244, 63, 94, 0.22); border-color: #f43f5e; color: #fff1f2; }

.bci-ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-block: 8px;
  border-block-start: 1px solid rgba(148, 163, 184, 0.12);
}

.bci-ledger-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 0;
}

.bci-ledger-name { font-size: 12.5px; font-weight: 700; color: #f8fafc; }
.bci-ledger-desc { font-size: 10.5px; color: #94a3b8; white-space: nowrap; overflow: clip; text-overflow: ellipsis; }

.solo-bci-banner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 11px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.14), rgba(14, 165, 233, 0.10));
  border: 1px solid rgba(20, 184, 166, 0.36);
  margin-block-top: 6px;
}

.solo-bci-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.solo-bci-title {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}

.solo-bci-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.22);
  border: 1px solid rgba(45, 212, 191, 0.45);
  color: #ccfbf1;
  white-space: nowrap;
}

.solo-bci-sub {
  font-size: 10.5px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.solo-bci-bar {
  block-size: 5px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  overflow: hidden;
}

.solo-bci-bar-fill {
  display: block;
  block-size: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #14b8a6, #38bdf8);
}

.briefing-tab {
  appearance: none;
  min-block-size: 34px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 4px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.briefing-tab:hover {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.04);
}

.briefing-tab.active {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(56, 189, 248, 0.42);
  color: #f8fafc;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
}

/* Keep display/padding off [hidden="until-found"] outer wrapper per modern-web-guidance */
.briefing-panel-inner {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.briefing-card {
  background: rgba(30, 41, 59, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 13px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.briefing-card-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.briefing-card-head.is-spark-head {
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.briefing-spark-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.briefing-num-pill {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  flex-shrink: 0;
  line-height: 1.3;
  margin-top: 1px;
}

.briefing-num-pill.is-violet {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(167, 139, 250, 0.34);
  color: #c4b5fd;
}

.briefing-domain-chip {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.32);
  color: #fcd34d;
  flex-shrink: 0;
  line-height: 1.3;
}

.reader-body .briefing-card-title {
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.32;
  color: #f8fafc;
  min-width: 0;
  overflow-wrap: break-word;
}

.reader-body .briefing-card-body {
  margin: 0;
  font-size: 12.8px;
  line-height: 1.48;
  color: #cbd5e1;
  overflow-wrap: break-word;
}

.reader-body .briefing-sublist {
  margin: 0;
  padding-left: 16px;
  font-size: 12.2px;
  line-height: 1.44;
  color: #94a3b8;
}

.briefing-kv-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.1);
  min-width: 0;
}

.briefing-kv-row.is-apply {
  background: rgba(14, 165, 233, 0.09);
  border-color: rgba(56, 189, 248, 0.24);
}

.briefing-kv-label {
  min-width: 44px;
  text-align: center;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 5px;
  flex-shrink: 0;
  line-height: 1.35;
  margin-top: 1px;
}

.briefing-kv-label.is-principle {
  background: rgba(139, 92, 246, 0.14);
  border: 1px solid rgba(167, 139, 250, 0.28);
  color: #ddd6fe;
}

.briefing-kv-label.is-apply {
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.34);
  color: #bae6fd;
}

.reader-body .briefing-kv-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #e2e8f0;
  min-width: 0;
  overflow-wrap: break-word;
}

.reader-body .briefing-why-strip {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 12.2px;
  line-height: 1.46;
  color: #94a3b8;
  min-width: 0;
  overflow-wrap: break-word;
}

.briefing-why-lead {
  font-weight: 700;
  color: #fbbf24;
  margin-right: 4px;
}

.briefing-card.is-voted-act {
  border-color: rgba(52, 211, 153, 0.32);
}

.briefing-card.is-voted-defer {
  opacity: 0.78;
  border-color: rgba(251, 191, 36, 0.22);
}

.briefing-card.is-voted-reject,
.briefing-card.is-voted-stale {
  opacity: 0.58;
  border-color: rgba(148, 163, 184, 0.08);
}

.briefing-card-feedback {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding-top: 6px;
  margin-top: 2px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.briefing-fb-btn {
  appearance: none;
  min-block-size: 26px;
  padding: 0 9px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

@media (pointer: coarse) {
  .briefing-fb-btn {
    min-block-size: 30px;
    padding: 0 11px;
  }
}

.briefing-fb-btn:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(148, 163, 184, 0.34);
  color: #e2e8f0;
}

.briefing-fb-btn:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.briefing-fb-btn.is-act[aria-pressed="true"] {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.44);
  color: #a7f3d0;
}

.briefing-fb-btn.is-defer[aria-pressed="true"] {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.42);
  color: #fde68a;
}

.briefing-fb-btn.is-reject[aria-pressed="true"] {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(251, 113, 133, 0.4);
  color: #fecdd3;
}

.briefing-step-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}

.briefing-step-btn {
  appearance: none;
  min-block-size: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.briefing-step-btn[hidden] {
  display: none !important;
}

.briefing-step-btn.is-prev {
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #cbd5e1;
}

.briefing-step-btn.is-prev:hover {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(148, 163, 184, 0.4);
  color: #f8fafc;
}

.briefing-step-btn.is-next {
  margin-inline-start: auto;
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.44);
  color: #e0f2fe;
}

.briefing-step-btn.is-next:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: rgba(125, 211, 252, 0.65);
  color: #ffffff;
}

.briefing-step-btn.is-next.is-complete {
  background: rgba(16, 185, 129, 0.2);
  border-color: rgba(52, 211, 153, 0.48);
  color: #d1fae5;
}

.briefing-step-btn.is-next.is-complete:hover {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(110, 231, 183, 0.68);
  color: #ffffff;
}

.briefing-step-btn:active {
  transform: scale(0.97);
}

.briefing-resume-chip {
  background: linear-gradient(135deg var(--in-oklab), rgba(14, 116, 144, 0.44), rgba(15, 23, 42, 0.92));
  border-color: rgba(56, 189, 248, 0.38);
}

.briefing-resume-chip .winddown-checkin-kicker {
  color: #7dd3fc;
}

/* Scoped live Health & Readiness card inside Briefing Step 1 (`360×800` mobile-first) */
.briefing-health-mount {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.briefing-health-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.briefing-health-status-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.briefing-readiness-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.briefing-readiness-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.34);
  color: #e0f2fe;
}

.briefing-readiness-pill[data-tone="emerald"] {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.38);
  color: #d1fae5;
}

.briefing-readiness-pill[data-tone="amber"] {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(251, 191, 36, 0.38);
  color: #fef3c7;
}

.briefing-readiness-pill[data-tone="rose"] {
  background: rgba(244, 63, 94, 0.15);
  border-color: rgba(251, 113, 133, 0.38);
  color: #ffe4e6;
}

.briefing-health-meta {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.3;
  min-width: 0;
  overflow-wrap: break-word;
}

.briefing-health-btn {
  appearance: none;
  min-block-size: 30px;
  padding: 0 11px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.26);
  color: #e2e8f0;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.briefing-health-btn:hover:not(:disabled) {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.44);
}

.briefing-health-btn.is-connect {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.44);
  color: #e0f2fe;
}

.briefing-health-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.briefing-health-banner {
  padding: 7px 9px;
  border-radius: 9px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.24);
}

.reader-body .briefing-health-banner-text {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #bae6fd;
}

.briefing-health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.briefing-metric-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.12);
  min-width: 0;
}

.briefing-metric-label {
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.briefing-metric-value {
  font-family: var(--font-mono, monospace);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: #f8fafc;
  min-width: 0;
  overflow-wrap: break-word;
}

.briefing-metric-value.is-sky { color: #7dd3fc; }
.briefing-metric-value.is-emerald { color: #6ee7b7; }
.briefing-metric-value.is-violet { color: #c4b5fd; }
.briefing-metric-value.is-amber { color: #fcd34d; }

.briefing-metric-sub {
  font-size: 10.5px;
  line-height: 1.32;
  color: #94a3b8;
  min-width: 0;
  overflow-wrap: break-word;
}

/* Scoped live AIQ workspace inside Briefing Step 5 (`360×800` mobile-first) */
.briefing-aiq-mount {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.briefing-aiq-mount .q-empty {
  padding: 16px 12px;
  text-align: center;
  font-size: 12.5px;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 11px;
}

.briefing-aiq-mount .q-app-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.briefing-aiq-mount .q-app-group:not(:first-child) {
  padding-top: 8px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.briefing-aiq-mount .q-app-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px;
  min-width: 0;
}

.briefing-aiq-mount .q-app-group-meta,
.briefing-aiq-mount .q-app-group-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.briefing-aiq-mount .q-subgroup-count {
  font-family: var(--font-mono, monospace);
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
}

.briefing-aiq-mount .q-group-action-btn {
  appearance: none;
  min-block-size: 26px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.24);
  color: #cbd5e1;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.briefing-aiq-mount .q-group-action-btn.is-primary {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(251, 191, 36, 0.38);
  color: #fde68a;
}

.briefing-aiq-mount .q-group-action-btn.is-resume {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(56, 189, 248, 0.38);
  color: #bae6fd;
}

.briefing-aiq-mount .q-group-action-btn.is-copied {
  background: rgba(16, 185, 129, 0.18);
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}

.briefing-aiq-mount .q-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.briefing-aiq-mount .q-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(30, 41, 59, 0.44);
  border: 1px solid rgba(148, 163, 184, 0.12);
  min-width: 0;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

@media (hover: hover) and (pointer: fine) {
  html:not(.is-touch-input) body:not(.force-mobile-view) .briefing-aiq-mount .q-row:hover {
    background: rgba(30, 41, 59, 0.64);
    border-color: rgba(6, 182, 212, 0.42);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.14);
  }
}

.briefing-aiq-mount .q-row:active:not(:has(a:active, .wiki-link-btn:active, button:active, .q-row-actions:active)) {
  background: rgba(6, 182, 212, 0.12);
  border-color: #38bdf8;
  box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.18);
}

.briefing-aiq-mount .q-row.is-completed {
  opacity: 0.58;
}

.briefing-aiq-mount .q-row-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.briefing-aiq-mount .q-row-main .task-checkbox {
  margin: -3px -4px -4px -4px;
  flex-shrink: 0;
}

.briefing-aiq-mount .q-row-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12.8px;
  font-weight: 600;
  line-height: 1.35;
  color: #f8fafc;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  overflow-wrap: break-word;
}

.briefing-aiq-mount .q-row.is-completed .q-row-title {
  text-decoration: line-through;
  color: #94a3b8;
  font-weight: 500;
}

.briefing-aiq-mount .briefing-aiq-completed {
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 11px;
  overflow: hidden;
  min-width: 0;
  margin-top: 2px;
}

.briefing-aiq-mount .q-archive-summary {
  padding: 9px 11px;
}

.briefing-aiq-mount .q-archive-body {
  padding: 8px 9px 9px;
}

@media (min-width: 541px) {
  body:not(.force-mobile-view) .briefing-stage {
    gap: 13px;
  }
  body:not(.force-mobile-view) .briefing-tabs,
  body:not(.force-mobile-view) .briefing-tabs[data-tab-count="6"] {
    top: -16px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 4px;
    gap: 6px;
  }
  body:not(.force-mobile-view) .briefing-tabs[data-tab-count="5"] {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  body:not(.force-mobile-view) .briefing-tabs[data-tab-count="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  body:not(.force-mobile-view) .briefing-tabs[data-tab-count="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  body:not(.force-mobile-view) .briefing-tab,
  body:not(.force-mobile-view) .briefing-tabs[data-tab-count="5"] .briefing-tab,
  body:not(.force-mobile-view) .briefing-tabs[data-tab-count="6"] .briefing-tab {
    font-size: 12px;
    padding: 7px 9px;
    letter-spacing: normal;
  }
  body:not(.force-mobile-view) .briefing-health-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
  }
  body:not(.force-mobile-view) .briefing-panel-inner {
    gap: 11px;
  }
  body:not(.force-mobile-view) .briefing-card {
    padding: 13px 15px;
    gap: 9px;
  }
  body:not(.force-mobile-view) .reader-body .briefing-card-title {
    font-size: 14px;
  }
  body:not(.force-mobile-view) .reader-body .briefing-card-body,
  body:not(.force-mobile-view) .reader-body .briefing-kv-text {
    font-size: 13.3px;
  }
}


/* ============================================================================
   HABIT TRACKER (`Today | Habits`) & CLEAN-SCREEN SKIP (`360×800` MOBILE-FIRST)
   ============================================================================ */

.today-mode-bar {
  margin-block: 0 12px;
  inline-size: 100%;
  min-inline-size: 0;
}

.today-mode-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-sizing: border-box;
}

.today-mode-tab {
  appearance: none;
  block-size: 34px;
  min-inline-size: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #94a3b8;
  font: 700 12.5px/1 inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: safe center;
  justify-content: safe center;
  gap: 6px;
}

.today-mode-tab.active {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(56, 189, 248, 0.44);
  color: #f8fafc;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.38);
}

.today-mode-pill-pct {
  font-size: 10.5px;
  font-weight: 700;
  padding-block: 2px;
  padding-inline: 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.38);
  color: #6ee7b7;
}

.winddown-checkin-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: safe center;
  justify-content: space-between;
  gap: 7px 8px;
  padding-block: 9px;
  padding-inline: 11px;
  margin-block-end: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg var(--in-oklab), rgba(49, 46, 129, 0.52), rgba(15, 23, 42, 0.92));
  border: 1px solid rgba(129, 140, 248, 0.38);
  box-sizing: border-box;
}

.winddown-checkin-chip[hidden],
#time-sensitive-shell[hidden],
#pass-sheet-half[hidden],
#pass-sheet-alt[hidden],
#pass-preset-recent[hidden],
.habits-view-shell[hidden],
#horizon-section[hidden],
#tasks-container[hidden],
#reservoir-card[hidden] {
  display: none !important;
}

/* Dedicated Time-Sensitive Bar (Above Horizon / Neuro Protocol) */
.time-sensitive-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-block-end: 12px;
  min-inline-size: 0;
}

.ts-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-inline-size: 0;
  box-sizing: border-box;
  cursor: default;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.16s ease;
}

.ts-done-btn:active {
  transform: scale(0.96);
}

.ts-bar .card-pass-group {
  margin-inline-start: 0;
}

.ts-done-btn {
  appearance: none;
  border-radius: 7px;
  padding: 5px 9px;
  font: 700 11px/1 inherit;
  cursor: pointer;
  border: 1px solid rgba(251, 191, 36, 0.48);
  background: rgba(245, 158, 11, 0.22);
  color: #fef3c7;
  flex-shrink: 0;
}

.ts-done-btn:hover {
  background: rgba(245, 158, 11, 0.34);
}

.ts-bar.ts-style-2 {
  padding: 9px 11px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.48), rgba(15, 23, 42, 0.94));
  border: 1px solid rgba(251, 191, 36, 0.42);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.ts-style-2 .ts-copy-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-inline-size: 0;
  flex: 1;
}

.ts-style-2 .ts-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fcd34d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-style-2 .ts-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ts-style-2 .ts-right-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.ts-style-2 .ts-doc-btn {
  margin: 0;
}

.winddown-checkin-copy {
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.winddown-checkin-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a5b4fc;
}

.winddown-checkin-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #f8fafc;
}

.winddown-checkin-actions,
.pass-sheet-actions {
  display: inline-flex;
  align-items: safe center;
  gap: 5px;
  flex-shrink: 0;
}

.wd-chip-btn {
  appearance: none;
  border-radius: 7px;
  padding-block: 5px;
  padding-inline: 9px;
  font: 700 11px/1 inherit;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.78);
  color: #cbd5e1;
}

.wd-chip-btn.is-yes {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.48);
  color: #a7f3d0;
}

.wd-chip-btn.is-half {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(251, 191, 36, 0.42);
  color: #fde68a;
}

.wd-chip-btn.is-no {
  background: rgba(244, 63, 94, 0.16);
  border-color: rgba(251, 113, 133, 0.38);
  color: #fda4af;
}

/* Visible ⓘ tooltip pill on all Tasks, Habits, Steppers, and Routine cards */
.card-pass-group {
  display: inline-flex;
  align-items: safe center;
  margin-inline-start: auto;
  margin-inline-end: 0;
  flex-shrink: 0;
}

:is(.single-item-header, .stepper-header) .card-pass-group {
  margin-inline-start: 8px;
  margin-inline-end: -5px;
}

.item-card .card-pass-group {
  margin-inline-end: 0;
}

.is-habits-grid .item-card:has(a.web-link, .wiki-link-btn),
.is-habits-grid .item-card.has-app-link {
  padding-inline-end: 6px;
}

@media (max-width: 540px) {
  .item-card-grid.is-habits-grid {
    gap: 6px;
    padding: 8px 8px 10px;
  }
  .is-habits-grid .item-card {
    padding: 0 5px 0 0;
    gap: 4px;
    font-size: 12px;
  }
  .is-habits-grid .item-card .item-radio {
    margin: 12px 5px 12px 6px;
  }
  .is-habits-grid .item-card .item-radio::before {
    inset: -12px -6px;
  }
  .is-habits-grid .item-card .item-card-text {
    min-width: 0;
    flex: 1;
  }
  .is-habits-grid .item-card:has(a.web-link, .wiki-link-btn) .item-card-text a.web-link,
  .is-habits-grid .item-card.has-app-link .item-card-text a.web-link {
    padding: 2px 5px;
    min-height: 22px;
    font-size: 10px;
  }
  .is-habits-grid .card-pass-group .cue-pill-btn {
    position: relative;
    min-width: 22px;
    min-height: 22px;
    width: 22px;
    height: 22px;
    padding: 0;
    font-size: 11px;
  }
  .is-habits-grid .card-pass-group .cue-pill-btn::before {
    content: '';
    position: absolute;
    inset: -7px -5px;
  }
}

body.force-mobile-view .item-card-grid.is-habits-grid {
  gap: 6px;
  padding: 8px 8px 10px;
}

body.force-mobile-view .is-habits-grid .item-card {
  padding: 0 5px 0 0;
  gap: 4px;
  font-size: 12px;
}

body.force-mobile-view .is-habits-grid .item-card .item-radio {
  margin: 12px 5px 12px 6px;
}

body.force-mobile-view .is-habits-grid .item-card .item-radio::before {
  inset: -12px -6px;
}

body.force-mobile-view .is-habits-grid .item-card .item-card-text {
  min-width: 0;
  flex: 1;
}

body.force-mobile-view .is-habits-grid .item-card:has(a.web-link, .wiki-link-btn) .item-card-text a.web-link,
body.force-mobile-view .is-habits-grid .item-card.has-app-link .item-card-text a.web-link {
  padding: 2px 5px;
  min-height: 22px;
  font-size: 10px;
}

body.force-mobile-view .is-habits-grid .card-pass-group .cue-pill-btn {
  position: relative;
  min-width: 22px;
  min-height: 22px;
  width: 22px;
  height: 22px;
  padding: 0;
  font-size: 11px;
}

body.force-mobile-view .is-habits-grid .card-pass-group .cue-pill-btn::before {
  content: '';
  position: absolute;
  inset: -7px -5px;
}

.pass-context-dialog {
  inline-size: min(336px, calc(100vw - 24px));
  max-inline-size: calc(100vw - 24px);
  margin: auto;
  padding: 0;
  background: rgba(11, 15, 25, 0.97);
  color: #f8fafc;
  border: 1px solid rgba(56, 189, 248, 0.36);
  border-radius: 16px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.78);
  box-sizing: border-box;
  overscroll-behavior: contain;
}

.pass-context-dialog:modal {
  overscroll-behavior: contain;
}

.pass-context-dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(5, 8, 15, 0.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.pass-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-block: 12px;
  padding-inline: 12px;
  box-sizing: border-box;
}

.pass-dialog-head {
  display: flex;
  align-items: safe center;
  justify-content: space-between;
  gap: 8px;
  min-inline-size: 0;
}

.pass-sheet-label {
  margin: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: #f8fafc;
  min-inline-size: 0;
  overflow: clip;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pass-reason-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.pass-preset-chip {
  appearance: none;
  border-radius: 999px;
  padding-block: 4px;
  padding-inline: 9px;
  font: 600 11px/1.15 inherit;
  cursor: pointer;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(15, 23, 42, 0.85);
  color: #cbd5e1;
  max-inline-size: 100%;
  overflow: clip;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pass-preset-chip.is-recent {
  border-color: rgba(56, 189, 248, 0.36);
  color: #e0f2fe;
}

.pass-preset-chip.is-active {
  background: rgba(56, 189, 248, 0.22);
  border-color: rgba(56, 189, 248, 0.58);
  color: #f0f9ff;
}

.pass-reason-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-inline-size: 0;
}

.pass-reason-input {
  flex: 1 1 auto;
  min-inline-size: 0;
  border-radius: 8px;
  padding-block: 7px;
  padding-inline: 9px;
  background: rgba(9, 13, 22, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.26);
  color: #f8fafc;
  font: 500 12px/1.25 inherit;
  box-sizing: border-box;
}

.pass-reason-input::placeholder {
  color: #64748b;
}

.pass-reason-input:focus-visible {
  outline: 1.5px solid rgba(56, 189, 248, 0.65);
  outline-offset: 0;
  border-color: rgba(56, 189, 248, 0.65);
}

.wd-chip-btn.is-skip-submit {
  padding-inline: 12px;
  background: rgba(148, 163, 184, 0.22);
  border-color: rgba(148, 163, 184, 0.45);
  color: #f8fafc;
}

.wd-chip-btn.is-skip-submit.is-half {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(251, 191, 36, 0.52);
  color: #fef3c7;
}

.wd-chip-btn.is-skip-submit:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.reservoir-skipped-tag,
.reservoir-some-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding-block: 1.5px;
  padding-inline: 5.5px;
  margin-inline-end: 4px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.16);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #cbd5e1;
  text-decoration: none;
  vertical-align: middle;
}

.reservoir-some-tag {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.34);
  color: #7dd3fc;
}

.reservoir-skip-reason {
  font-size: 11.5px;
  color: #cbd5e1;
  opacity: 0.86;
}

.task-item.is-skipped-row .task-text,
.task-item.is-some-row .task-text {
  text-decoration: none;
  color: #94a3b8;
}

/* Habits Stage Card & Distinct Habit Subsection Cards */
.habits-view-shell {
  display: flex;
  flex-direction: column;
  gap: 10px;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  padding-block-end: 28px;
}

.habits-stage-card {
  background: linear-gradient(155deg var(--in-oklab), rgba(15, 23, 42, 0.94), rgba(11, 15, 26, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  padding-block: 12px;
  padding-inline: 9px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 11px;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  box-sizing: border-box;
}

.habits-stage-top {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-block-end: 10px;
  padding-inline: 2px;
  border-block-end: 1px solid rgba(148, 163, 184, 0.16);
  min-inline-size: 0;
}

/* 4-Segment Proportional Bar + Legend */
.hb2-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-inline-size: 0;
}

.hb2-prop-bar {
  display: flex;
  inline-size: 100%;
  block-size: 7px;
  border-radius: 999px;
  overflow: clip;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.2);
  gap: 1.5px;
}

.hb2-seg {
  display: block;
  block-size: 100%;
  min-inline-size: 3px;
}

.hb2-seg.is-done {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.hb2-seg.is-some {
  background: #38bdf8;
}

.hb2-seg.is-skip {
  background: repeating-linear-gradient(
    -45deg,
    rgba(148, 163, 184, 0.85) 0 2px,
    rgba(30, 41, 59, 0.95) 2px 4px
  );
}

.hb2-seg.is-miss {
  background: rgba(244, 63, 94, 0.55);
}

.hb2-legend-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.hb2-leg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  min-inline-size: 0;
}

.hb2-leg b {
  color: #f1f5f9;
  font-weight: 800;
}

.hb2-dot {
  inline-size: 7px;
  block-size: 7px;
  border-radius: 2px;
  display: inline-block;
  flex-shrink: 0;
}

.hb2-dot.is-done {
  background: #10b981;
}

.hb2-dot.is-some {
  background: #38bdf8;
}

.hb2-dot.is-skip {
  background: #64748b;
}

.hb2-dot.is-miss {
  background: #f43f5e;
}

.habits-score-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.habits-score-num {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #f8fafc;
  line-height: 1;
}

.habits-score-label {
  font-size: 12px;
  font-weight: 600;
  color: #94a3b8;
}

.habits-window-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
}

.habits-win-btn {
  appearance: none;
  min-inline-size: 28px;
  min-block-size: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font: 700 10px/1 inherit;
  padding-block: 4px;
  padding-inline: 7px;
  border-radius: 6px;
  cursor: pointer;
  touch-action: manipulation;
}

.habits-win-btn.active {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(56, 189, 248, 0.42);
  color: #f8fafc;
}

.hp-row {
  display: flex;
  flex-direction: column;
  gap: 0;
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  padding: 0;
  overflow: clip;
  border-radius: 12px;
  background: rgba(5, 8, 16, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-inline-start: 3.5px solid var(--h-color, #10b981);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.34);
  box-sizing: border-box;
}

.hp-row-top {
  display: flex;
  align-items: safe center;
  justify-content: space-between;
  gap: 8px;
  min-inline-size: 0;
  padding-block: 7.5px;
  padding-inline: 10px 9px;
  background: rgba(26, 36, 56, 0.94);
  background: linear-gradient(
    90deg var(--in-oklab),
    color-mix(in oklab, var(--h-color, #10b981) 14%, rgba(30, 41, 59, 0.96)) 0%,
    rgba(22, 31, 48, 0.92) 68%
  );
  border-block-end: 1px solid rgba(148, 163, 184, 0.2);
}

.hp-name {
  display: inline-flex;
  align-items: safe center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #ffffff;
  min-inline-size: 0;
}

.hp-name-text {
  min-inline-size: 0;
  white-space: nowrap;
  overflow: clip;
  text-overflow: ellipsis;
}

.hp-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding-block: 2.5px;
  padding-inline: 8px;
  border-radius: 999px;
  background: rgba(7, 11, 22, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.hp-stat-pct {
  font-weight: 800;
  letter-spacing: -0.01em;
}

.hp-stat-sep {
  color: #64748b;
  font-weight: 600;
}

.hp-miss {
  font-size: 10.5px;
  font-weight: 600;
  color: #cbd5e1;
}

.hp-sq-track {
  display: grid;
  grid-template-columns: repeat(var(--sq-cols, 30), minmax(0, 1fr));
  column-gap: 1.5px;
  row-gap: 3px;
  padding-block: 7px 8px;
  padding-inline: 7.5px;
  background: rgba(4, 7, 15, 0.94);
  inline-size: 100%;
  max-inline-size: 100%;
  min-inline-size: 0;
  box-sizing: border-box;
}

.hp-sq-track.is-7d {
  column-gap: 7px;
  padding-block: 8px 9px;
  padding-inline: 9px;
}

.hp-sq-cell {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  min-inline-size: 0;
  min-block-size: 0;
  inline-size: 100%;
  aspect-ratio: 1;
  font-size: 0;
  line-height: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--h-color, #10b981);
  display: block;
  cursor: pointer;
}

.hp-sq-cell .hp-ghost-rect {
  stroke: #94a3b8;
  stroke-opacity: 0.16;
  transition: stroke 0.12s ease, stroke-opacity 0.12s ease, fill 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
  .hp-sq-cell:hover .hp-ghost-rect {
    stroke: var(--h-color, #38bdf8);
    stroke-opacity: 0.85;
    fill: color-mix(in oklab, var(--h-color, #38bdf8) 16%, transparent);
  }
  .hp-sq-cell:not(.st-miss):not(.st-untracked):hover {
    filter: brightness(1.18);
  }
}

.hp-sq-cell:focus-visible .hp-ghost-rect {
  stroke: var(--h-color, #38bdf8);
  stroke-opacity: 0.9;
}

.hp-sq-cell svg {
  inline-size: 100%;
  block-size: 100%;
  display: block;
  pointer-events: none;
  transition: transform 0.1s ease;
}

.hp-sq-cell:active svg {
  transform: scale(0.86);
}

/* 7d First-Card Inline Date Strip */
.hp-card-scale.is-7d {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  column-gap: 7px;
  padding-block: 6px 0;
  padding-inline: 9px;
  inline-size: 100%;
  box-sizing: border-box;
  background: rgba(4, 7, 15, 0.94);
  font-variant-numeric: tabular-nums;
}

.hp-card-7d-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-inline-size: 0;
  text-align: center;
}

.hp-card-7d-wd {
  font-size: 9px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.1;
}

.hp-card-7d-md {
  font-size: 10px;
  font-weight: 700;
  color: #cbd5e1;
  line-height: 1.15;
}

.hp-card-7d-cell.is-today .hp-card-7d-wd,
.hp-card-7d-cell.is-today .hp-card-7d-md {
  color: #38bdf8;
}

/* 3-Segment Hero Tracker + Needs Attention Top-3 Meter Tiles */
.hp-hero-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 13px;
  background: linear-gradient(165deg var(--in-oklab), rgba(8, 15, 30, 0.96), rgba(4, 8, 18, 0.96));
  border: 1.5px solid rgba(56, 189, 248, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 8px 20px rgba(0, 0, 0, 0.38);
}

.hp-hero-Header {
  display: flex;
  align-items: safe center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.hp-hero-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #e2e8f0;
}

.hp-hero-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 600;
  color: #94a3b8;
}

.hp-leg-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.hp-leg-swatch {
  inline-size: 9px;
  block-size: 9px;
  border-radius: 2px;
  display: inline-block;
}

.hp-leg-swatch.is-done {
  background: #10b981;
}

.hp-leg-swatch.is-skip {
  background: repeating-linear-gradient(
    -45deg,
    rgba(148, 163, 184, 0.78) 0 2px,
    rgba(30, 41, 59, 0.9) 2px 4px
  );
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.hp-leg-swatch.is-miss {
  background: rgba(244, 63, 94, 0.22);
  border: 1px solid rgba(244, 63, 94, 0.48);
}

.hp-hero-grid {
  display: grid;
  grid-template-columns: repeat(var(--hero-cols, 30), minmax(0, 1fr));
  column-gap: 2px;
  row-gap: 4px;
  align-items: end;
}

.hp-hero-grid.is-7d {
  column-gap: 6px;
}

.hp-hero-day {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-inline-size: 0;
  cursor: pointer;
}

.hp-hero-day-lbl {
  font-size: 8.5px;
  font-weight: 700;
  color: #94a3b8;
  white-space: nowrap;
  letter-spacing: -0.02em;
}

.hp-hero-day.is-selected .hp-hero-day-lbl {
  color: #38bdf8;
}

.hp-hero-box {
  inline-size: 100%;
  block-size: 42px;
  border-radius: 4px;
  overflow: clip;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-sizing: border-box;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.hp-hero-grid.is-7d .hp-hero-box {
  block-size: 46px;
  border-radius: 5px;
}

.hp-hero-grid.is-30d .hp-hero-box {
  block-size: 40px;
  border-radius: 4px;
}

.hp-hero-grid.is-90d .hp-hero-box {
  block-size: 26px;
  border-radius: 2.5px;
}

.hp-hero-day.is-selected .hp-hero-box {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.55);
}

.hp-seg-miss {
  inline-size: 100%;
  background: rgba(244, 63, 94, 0.2);
}

.hp-seg-skip {
  inline-size: 100%;
  background: repeating-linear-gradient(
    -45deg,
    rgba(148, 163, 184, 0.72) 0 2.5px,
    rgba(30, 41, 59, 0.92) 2.5px 5px
  );
}

.hp-seg-done {
  inline-size: 100%;
  background: linear-gradient(180deg, #34d399, #10b981);
}

.hp-hero-day-pct {
  font-size: 9px;
  font-weight: 700;
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}

.hp-hero-day-summary {
  display: block;
  padding-block-start: 5px;
  border-block-start: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 10.5px;
  color: #94a3b8;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.hp-hero-day-summary strong {
  color: #34d399;
}

.hp-hero-day-summary strong.is-paused {
  color: #94a3b8;
}

.hp-section-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-inline-size: 0;
}

.hp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-inline: 2px;
}

.hp-section-title {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #cbd5e1;
}

.hp-mini-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(9, 14, 26, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.hp-mini-seg-btn {
  appearance: none;
  min-inline-size: 28px;
  min-block-size: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  font: 700 10px/1 inherit;
  padding-block: 4px;
  padding-inline: 7px;
  border-radius: 6px;
  cursor: pointer;
  touch-action: manipulation;
}

.hp-mini-seg-btn.active {
  background: rgba(30, 41, 59, 0.96);
  border-color: rgba(56, 189, 248, 0.45);
  color: #f8fafc;
}

/* Full-Bleed Stretched Task Switcher Pills (Top 3 Worst Habits Only) */
.hp-pills-wrap.is-top3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  inline-size: 100%;
}

.hp-compact-pill {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(10, 15, 28, 0.94);
  color: #f1f5f9;
  border-radius: 10px;
  padding-block: 7px;
  padding-inline: 10px;
  font: 600 11.5px/1.15 inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-inline-size: 0;
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.hp-pill-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  inline-size: 100%;
  min-inline-size: 0;
  text-align: center;
}

.hp-pill-label {
  white-space: nowrap;
  overflow: clip;
  text-overflow: ellipsis;
}

.hp-compact-pill.is-active {
  border-color: var(--h-color, #38bdf8);
  background: color-mix(in oklab, var(--h-color, #38bdf8) 18%, rgba(15, 23, 42, 0.96));
  box-shadow: 0 0 0 1px color-mix(in oklab, var(--h-color, #38bdf8) 45%, transparent);
}

.hp-pill-meter {
  inline-size: 100%;
  block-size: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: clip;
}

.hp-pill-meter-fill {
  display: block;
  block-size: 100%;
  border-radius: 999px;
  background: var(--h-color, #38bdf8);
}

.hp-pill-meter-fill.is-paused {
  background: repeating-linear-gradient(
    -45deg,
    rgba(148, 163, 184, 0.58) 0 2.5px,
    rgba(30, 41, 59, 0.45) 2.5px 5px
  );
}

@media (min-width: 640px) {
  body:not(.force-mobile-view) .habits-stage-card {
    padding: 18px;
  }
  body:not(.force-mobile-view) .habits-stage-card:has(.hp-sq-track.is-7d) {
    max-inline-size: 440px;
    margin-inline: auto;
  }
  body:not(.force-mobile-view) .hp-row-top {
    padding-block: 9px;
    padding-inline: 13px 12px;
  }
  body:not(.force-mobile-view) .hp-name {
    font-size: 14px;
  }
  body:not(.force-mobile-view) .hp-sq-track {
    column-gap: 2.5px;
    row-gap: 3.5px;
    padding-block: 9px 10px;
    padding-inline: 11px;
  }
  body:not(.force-mobile-view) .hp-sq-track.is-7d {
    column-gap: 10px;
    padding-block: 10px 11px;
    padding-inline: 12px;
  }
  body:not(.force-mobile-view) .hp-card-scale.is-7d {
    column-gap: 10px;
    padding-block: 7px 0;
    padding-inline: 12px;
  }
}

.pass-context-dialog :is(.wd-chip-btn, .pass-preset-chip, .pass-reason-input) {
  min-block-size: 32px;
  display: inline-flex;
  align-items: center;
}

/* ============================================================
   CoreKit Public Edition Clean Surface & Native Dialogs
   ============================================================ */
.ck-horizon-kicker,
.ck-horizon-pills {
  display: none;
}

html.public-edition #horizon-solo-row,
html.public-edition #neuro-pill,
html.public-edition #reminders-link,
html.public-edition #briefing-resume-chip,
html.public-edition #med-alarm-test-chip,
html.public-edition #agy-btn,
html.public-edition #env-badge-label,
html.public-edition #personal-agy-fab,
html.public-edition .personal-agy-fab {
  display: none !important;
}

html.public-edition .ck-horizon-kicker {
  display: inline-flex;
  align-items: center;
  color: #e2e8f0;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html.public-edition .ck-horizon-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

html.public-edition .horizon-header {
  flex-wrap: wrap;
  gap: 6px;
}

.ck-kit-trigger {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.12);
  cursor: pointer;
}

.ck-drawer-action-btn {
  width: 100%;
  text-align: left;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.16);
  color: inherit;
  cursor: pointer;
  margin-bottom: 6px;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(2, 6, 17, 0.76);
  backdrop-filter: blur(8px);
}

.ck-dialog {
  margin: auto;
  width: min(92vw, 420px);
  max-height: min(86dvh, 680px);
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 18px;
  background: rgba(12, 16, 26, 0.98);
  color: #f1f5f9;
  padding: 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}

.ck-dialog-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.ck-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ck-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #38bdf8;
  margin-bottom: 2px;
}

.ck-dialog-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.25;
  color: #f8fafc;
}

.ck-dialog-sub {
  font-size: 13px;
  line-height: 1.4;
  color: #94a3b8;
}

.ck-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.ck-choice-grid:not(.ck-more-grid) > .ck-choice-pill:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.ck-more-details {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.42);
  padding: 2px 10px;
}

.ck-more-details[open] {
  padding-bottom: 10px;
}

.ck-more-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 36px;
  font-size: 12.5px;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.ck-more-summary::-webkit-details-marker {
  display: none;
}

.ck-more-summary::after {
  content: '▸';
  font-size: 12px;
  color: #64748b;
}

.ck-more-details[open] > .ck-more-summary {
  color: #e2e8f0;
}

.ck-more-details[open] > .ck-more-summary::after {
  content: '▾';
  color: #38bdf8;
}

.ck-more-grid {
  margin-top: 6px;
}

.ck-split-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 6px;
}

.ck-choice-pill,
.ck-split-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(30, 41, 59, 0.42);
  cursor: pointer;
  min-width: 0;
}

.ck-choice-pill input,
.ck-split-pill input,
.ck-cat-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ck-choice-pill.is-selected,
.ck-split-pill.is-selected {
  border-color: rgba(56, 189, 248, 0.65);
  background: rgba(14, 165, 233, 0.16);
}

.ck-choice-title {
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.ck-choice-desc {
  font-size: 11px;
  line-height: 1.3;
  color: #94a3b8;
}

.ck-field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ck-field-label {
  font-size: 12px;
  font-weight: 600;
  color: #cbd5e1;
}

.ck-input,
.ck-textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.85);
  color: #f8fafc;
  font: inherit;
  font-size: 14px;
  padding: 9px 11px;
  box-sizing: border-box;
}

.ck-toggles-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.ck-toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #e2e8f0;
  cursor: pointer;
}

.ck-toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: #38bdf8;
}

.ck-quick-links-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.ck-install-steps,
.ck-account-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ck-install-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 12.5px;
  line-height: 1.4;
  color: #cbd5e1;
}

.ck-cat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ck-cat-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 41, 59, 0.5);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ck-cat-pill:has(input:checked) {
  border-color: #38bdf8;
  background: rgba(14, 165, 233, 0.2);
  color: #f8fafc;
}

.ck-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 2px;
}

.ck-primary-btn,
.ck-ghost-btn,
.ck-text-btn,
.ck-danger-outline-btn,
.ck-danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 10px;
  font: 600 13px/1.2 inherit;
  text-decoration: none;
  cursor: pointer;
}

.ck-primary-btn {
  width: 100%;
  border: 1px solid rgba(56, 189, 248, 0.55);
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #ffffff;
}

.ck-ghost-btn {
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.65);
  color: #e2e8f0;
}

.ck-text-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  padding-inline: 6px;
}

.ck-danger-outline-btn {
  border: 1px solid rgba(248, 113, 113, 0.42);
  background: rgba(127, 29, 29, 0.22);
  color: #fca5a5;
}

.ck-danger-btn {
  border: 1px solid rgba(239, 68, 68, 0.6);
  background: #dc2626;
  color: #ffffff;
}

.ck-delete-confirm-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(127, 29, 29, 0.16);
}

.ck-danger-note {
  font-size: 12px;
  line-height: 1.4;
  color: #fecaca;
}

.ck-delete-confirm-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ck-pulse-trigger {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
  cursor: pointer;
}

.ck-fork-trigger {
  color: #a855f7;
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.12);
  cursor: pointer;
}

.ck-pulse-stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.ck-pulse-stat-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.16);
  text-align: center;
}

.ck-pulse-stat-chip strong {
  font-size: 15px;
  font-weight: 700;
  color: #38bdf8;
}

.ck-pulse-stat-chip span {
  font-size: 10.5px;
  color: #94a3b8;
}

.ck-pulse-board {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ck-pulse-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 11px;
  border-radius: 11px;
  background: rgba(30, 41, 59, 0.48);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.ck-pulse-row.is-me {
  border-color: rgba(56, 189, 248, 0.5);
  background: rgba(14, 165, 233, 0.12);
}

.ck-pulse-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #f8fafc;
}

.ck-pulse-streak {
  font-size: 11px;
  font-weight: 600;
  color: #fbbf24;
}

.ck-pulse-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.ck-pulse-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
}

.ck-pulse-empty {
  padding: 12px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px dashed rgba(148, 163, 184, 0.2);
  font-size: 12px;
  color: #94a3b8;
  text-align: center;
}

.ck-token-reveal-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  background: rgba(9, 13, 22, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.ck-token-code {
  font: 11.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #7dd3fc;
  word-break: break-all;
}

.ck-ob-fork,
.ck-ob-builder {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ck-ob-fork[hidden],
.ck-ob-builder[hidden] {
  display: none;
}

.ck-path-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ck-path-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(30, 41, 59, 0.48);
  color: #f8fafc;
  font: inherit;
  cursor: pointer;
}

.ck-path-card.is-recommended {
  border-color: rgba(56, 189, 248, 0.72);
  background: linear-gradient(155deg, rgba(14, 165, 233, 0.2), rgba(37, 99, 235, 0.14));
  box-shadow: inset 0 1px 0 rgba(125, 211, 252, 0.18);
}

.ck-path-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14.5px;
}

.ck-path-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.22);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.ck-path-badge.is-muted {
  background: rgba(15, 23, 42, 0.65);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.24);
}

.ck-path-desc {
  font-size: 12px;
  line-height: 1.42;
  color: #cbd5e1;
}

.ck-builder-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ck-back-link {
  border: none;
  background: transparent;
  padding: 4px 0;
  font: 600 12.5px/1.2 inherit;
  color: #7dd3fc;
  cursor: pointer;
}

.ck-coaching-pill {
  font-size: 11px;
  font-weight: 600;
  color: #bae6fd;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.ck-coaching-note {
  margin: 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 12px;
  line-height: 1.4;
  color: #cbd5e1;
}

.ck-tier-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ck-tier-hint {
  font-size: 11px;
  color: #64748b;
}

.ck-ob-split-wrap {
  margin-top: 2px;
  padding: 9px 10px;
  border-radius: 11px;
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.ck-custom-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ck-custom-list:empty {
  display: none;
}

.ck-custom-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 165, 233, 0.14);
  color: #f1f5f9;
  font-size: 12px;
  max-width: 100%;
}

.ck-custom-chip-title {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ck-custom-chip-meta {
  font-size: 10.5px;
  color: #7dd3fc;
  white-space: nowrap;
}

.ck-custom-chip-del {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1;
  padding: 2px 3px;
  cursor: pointer;
}

.ck-custom-builder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.56);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.ck-custom-input {
  font-size: 13px;
  padding: 8px 10px;
}

.ck-custom-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.ck-seg-group {
  display: inline-flex;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.72);
  overflow: hidden;
}

.ck-seg-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font: 600 11.5px/1 inherit;
  padding: 8px 9px;
  min-height: 32px;
  cursor: pointer;
}

.ck-seg-btn.is-active {
  background: rgba(56, 189, 248, 0.24);
  color: #f8fafc;
}

.ck-custom-add-btn {
  margin-left: auto;
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12px;
}
