:root {
  --bg-page: #0b0c0e;
  --bg-surface: #131519;
  --bg-elevated: #1b1e24;
  --bg-hover: #22262e;
  --bg-nav: rgba(11, 12, 14, 0.88);

  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.16);

  --text-primary: #f4f5f7;
  --text-secondary: #8e95a2;
  --text-muted: #5c6270;

  --accent: #ff5a36;
  --accent-soft: rgba(255, 90, 54, 0.14);
  --accent-text: #ffffff;

  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, 0.15);
  --amber: #f59e0b;
  --red: #ef4444;

  --hm-0: rgba(255, 255, 255, 0.045);
  --hm-1: rgba(34, 197, 94, 0.22);
  --hm-2: rgba(34, 197, 94, 0.44);
  --hm-3: rgba(34, 197, 94, 0.70);
  --hm-4: #22c55e;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html[data-theme="light"] {
  --bg-page: #f5f5f3;
  --bg-surface: #ffffff;
  --bg-elevated: #efefec;
  --bg-hover: #e5e5e1;
  --bg-nav: rgba(255, 255, 255, 0.90);

  --border: rgba(17, 19, 23, 0.08);
  --border-strong: rgba(17, 19, 23, 0.18);

  --text-primary: #111317;
  --text-secondary: #5f6672;
  --text-muted: #8b929e;

  --accent: #ea4c28;
  --accent-soft: rgba(234, 76, 40, 0.11);
  --accent-text: #ffffff;

  --hm-0: rgba(17, 19, 23, 0.05);
  --hm-1: rgba(22, 163, 74, 0.22);
  --hm-2: rgba(22, 163, 74, 0.45);
  --hm-3: rgba(22, 163, 74, 0.72);
  --hm-4: #16a34a;
}

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

html, body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

button, input, select {
  font-family: inherit;
  color: inherit;
}

.hidden {
  display: none !important;
}

.app-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(76px + var(--safe-bottom));
}

/* TOP BAR */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: calc(12px + var(--safe-top)) 18px 11px;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.025em;
  background: none;
  border: none;
  padding: 3px 8px 3px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.16s ease;
}

.brand-title:active {
  transform: scale(0.93);
}

.brand-title.home-pop .logo-dot {
  animation: logoDotPop 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes logoDotPop {
  0% { transform: scale(0.75) rotate(0deg); }
  55% { transform: scale(1.42) rotate(45deg); box-shadow: 0 0 12px var(--accent); }
  100% { transform: scale(1) rotate(0deg); }
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}

.header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-pill {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.flame-pill {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease;
}

.flame-pill:active {
  transform: scale(0.94);
}

.flame-pill.is-lit .mini-flame-svg {
  animation: miniFlameDance 1.8s infinite ease-in-out;
  transform-origin: 50% 85%;
}

@keyframes miniFlameDance {
  0%, 100% { transform: scaleY(1) rotate(-2deg); }
  50% { transform: scaleY(1.12) scaleX(0.95) rotate(2deg); }
}

.stat-pill.muted-pill {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

/* REST STOPWATCH BANNER */
.rest-banner {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
}

.rest-banner.state-warn {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(245, 158, 11, 0.10);
}

.rest-banner.state-urgent {
  border-color: rgba(239, 68, 68, 0.75);
  background: rgba(239, 68, 68, 0.14);
  animation: subtlePulse 1.4s infinite ease-in-out;
}

@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.25); }
  50% { box-shadow: 0 0 14px 1px rgba(239, 68, 68, 0.28); }
}

.rest-left {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1;
  min-width: 0;
}

.rest-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.rest-banner.state-warn .rest-dot { background: var(--amber); }
.rest-banner.state-urgent .rest-dot { background: var(--red); }

.rest-text-wrap {
  min-width: 0;
  overflow: hidden;
}

.rest-label {
  font-size: 0.78rem;
  font-weight: 700;
}

.rest-sub {
  font-size: 0.71rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.rest-timer-val {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.05rem;
  font-weight: 700;
}

.btn-icon-mini {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
}

/* MAIN LAYOUT */
.main-content {
  flex: 1;
  padding: 16px 18px 28px;
}

.tab-view {
  display: none;
  animation: fadeIn 0.16s ease-out;
}

.tab-view.active {
  display: block;
}

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

/* CALENDAR HEADER */
.calendar-header-block {
  margin-bottom: 16px;
}

.date-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.icon-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 1.15rem;
  cursor: pointer;
}

.date-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.selected-date-title {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.015em;
}

.jump-today-chip {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: none;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
}

.week-dots-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.wday-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 7px 2px;
  text-align: center;
  cursor: pointer;
  transition: all 0.14s ease;
}

.wday-pill .wl {
  display: block;
  font-size: 0.64rem;
  color: var(--text-muted);
  font-weight: 600;
}

.wday-pill .wn {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 2px;
}

.wday-pill.is-done {
  background: var(--green-soft);
  border-color: rgba(34, 197, 94, 0.42);
  color: var(--green);
}

.wday-pill.is-done .wl { color: var(--green); }
.wday-pill.is-due { border-color: rgba(255, 90, 54, 0.45); }
.wday-pill.is-selected { border-color: var(--text-primary); }

.next-due-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.next-due-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

.text-action-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

/* SUBTLE BACKUP BANNER */
.ctx-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 11px;
  margin-bottom: 12px;
  font-size: 0.76rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
}

.ctx-banner button {
  padding: 4px 10px;
  border-radius: 7px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.73rem;
  cursor: pointer;
}

/* SEGMENTED CONTROLS */
.seg-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}

.seg-bar.compact-seg {
  margin-bottom: 8px;
}

.seg-item {
  flex: 1;
  padding: 7px 6px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.14s ease;
}

.seg-item.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.horizontal-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.horizontal-pills::-webkit-scrollbar { display: none; }

.ex-pill {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.ex-pill.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-page);
}

.sub-pills {
  margin-top: -4px;
  margin-bottom: 10px;
}

/* CLEAN POST-IT CARDS + TACTILE DOPAMINE PEN STRIKE-THROUGH */
.postit-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.postit-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  transition: border-color 0.2s ease, background 0.25s ease, transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.postit-card.is-expanded {
  border-color: var(--border-strong);
}

.postit-card.just-checked {
  animation: cardSatisfactionPop 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-color: rgba(34, 197, 94, 0.55);
}

@keyframes cardSatisfactionPop {
  0% { transform: scale(0.985); }
  45% { transform: scale(1.018); }
  100% { transform: scale(1); }
}

.postit-header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.postit-checkbox {
  position: relative;
  width: 25px;
  height: 25px;
  border-radius: 8px;
  border: 1.8px solid var(--border-strong);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: transparent;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.postit-checkbox:active {
  transform: scale(0.84);
}

.postit-card.is-checked .postit-checkbox {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

.postit-card.just-checked .postit-checkbox {
  animation: checkSpring 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes checkSpring {
  0% { transform: scale(0.75); }
  55% { transform: scale(1.24); }
  100% { transform: scale(1); }
}

.postit-main-info {
  flex: 1;
  min-width: 0;
}

.postit-name-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.postit-name {
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.25s ease;
}

.postit-card.is-checked .postit-name {
  color: var(--text-secondary);
}

/* Tactile Post-it Pen Strike-Through Line! */
.ink-strike {
  position: absolute;
  left: -2px;
  top: 52%;
  height: 2.2px;
  width: 0%;
  background: var(--green);
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

.postit-card.is-checked .ink-strike {
  width: calc(100% + 4px);
}

/* Micro-burst & hero celebration dopamine sparks */
.spark-particle {
  position: fixed;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 140;
  box-shadow: 0 0 6px currentColor;
  animation: sparkFly var(--dur, 0.62s) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.spark-particle.is-diamond {
  border-radius: 2px;
  transform: rotate(45deg);
}

.check-ring-wave {
  position: fixed;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  border: 2px solid #4ade80;
  pointer-events: none;
  z-index: 139;
  transform: translate(-50%, -50%) scale(0.85);
  animation: checkRingExpand 0.52s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes checkRingExpand {
  0% { transform: translate(-50%, -50%) scale(0.85); opacity: 0.95; }
  100% { transform: translate(-50%, -50%) scale(2.35); opacity: 0; }
}

@keyframes sparkFly {
  0% { transform: translate(-50%, -50%) scale(1.25) rotate(var(--rot, 0deg)); opacity: 1; }
  75% { opacity: 0.92; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0) rotate(calc(var(--rot, 0deg) + 95deg)); opacity: 0; }
}

.set-chip.just-saved {
  animation: chipSavedPop 0.36s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-color: var(--accent);
}

@keyframes chipSavedPop {
  0% { transform: scale(0.76); }
  55% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

.postit-Quick-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.beat-tag {
  color: var(--green);
  font-weight: 700;
  font-size: 0.71rem;
}

.postit-right-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tot-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  line-height: 1;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chevron-ico {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: transform 0.16s ease;
}

.postit-card.is-expanded .chevron-ico {
  transform: rotate(90deg);
}

/* EXPANDED CARD BODY */
.postit-expanded-body {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--border);
}

.expanded-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.card-options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mini-opt-chip {
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
}

.mini-opt-chip.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-3d-link {
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
}

.sets-chips-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.set-chip {
  position: relative;
  min-width: 36px;
  height: 33px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.set-band-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.btn-add-set {
  height: 33px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

/* INLINE SET STEPPER */
.set-editor-drawer {
  margin-top: 10px;
  padding: 10px;
  border-radius: 10px;
  background: var(--bg-page);
  border: 1px solid var(--border-strong);
}

.stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.step-btn {
  height: 35px;
  min-width: 38px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.step-input {
  width: 68px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--bg-surface);
  text-align: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 700;
}

.drawer-band-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.drawer-actions {
  display: flex;
  gap: 7px;
  margin-top: 9px;
}

.btn-confirm-set {
  flex: 1;
  height: 34px;
  border-radius: 8px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-delete-set {
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
  font-weight: 600;
  font-size: 0.78rem;
  cursor: pointer;
}

.btn-cancel-set {
  height: 34px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  cursor: pointer;
}

/* RUNNING INPUTS */
.run-inputs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.run-field {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
}

.run-field input {
  width: 58px;
  border: none;
  background: transparent;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 16px;
  outline: none;
}

.run-field span {
  font-size: 0.73rem;
  color: var(--text-secondary);
}

.pace-badge {
  margin-left: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* SESSION FOOTER */
.session-footer-card {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clean-note-input {
  width: 100%;
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  font-size: 16px;
  outline: none;
}

.clean-note-input:focus { border-color: var(--border-strong); }

.btn-primary-cta {
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: none;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.14s ease;
}

.btn-primary-cta:active { transform: scale(0.98); }

.btn-primary-cta.is-completed {
  background: var(--green-soft);
  border: 1px solid rgba(34, 197, 94, 0.45);
  color: var(--green);
}

/* TAB 2: 3D ANATOMIA */
.holo-stage-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #14161b;
  margin-bottom: 6px;
}

.holo-canvas-wrap {
  width: 100%;
  height: 400px;
  cursor: grab;
  overflow: hidden;
  position: relative;
}

.holo-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.holo-loading-pill {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(19, 21, 25, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 600;
}

.holo-overlay-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  pointer-events: none;
}

.legend-chip, .picked-muscle-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 17, 21, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #f4f5f7;
  font-size: 0.7rem;
  font-weight: 600;
}

.rep-pill {
  margin-left: auto;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: #cbd5e1;
}

.rep-pill.is-grinding {
  border-color: rgba(255, 90, 54, 0.65);
  color: #ff8c70;
}

.picked-muscle-pill {
  border-color: var(--accent);
  color: #ffb4a2;
  pointer-events: auto;
  cursor: pointer;
}

.dot-prim, .dot-sec {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot-prim { background: #ff5232; }
.dot-sec { background: #f59e0b; }

.holo-zoom-stack {
  position: absolute;
  right: 10px;
  bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: rgba(15, 17, 21, 0.84);
  backdrop-filter: blur(8px);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.holo-zoom-btn {
  width: 30px;
  height: 28px;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem !important;
  color: #e2e8f0 !important;
}

.holo-zoom-btn:active {
  background: rgba(255, 255, 255, 0.18);
  transform: scale(0.92);
}

.holo-controls-bar {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.cam-group, .speed-group {
  display: flex;
  gap: 3px;
  background: rgba(15, 17, 21, 0.82);
  backdrop-filter: blur(8px);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.holo-ctrl-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #9ca3af;
  font-size: 0.71rem;
  font-weight: 600;
  cursor: pointer;
}

.holo-ctrl-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.tiny-caption-center {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* SURFACE CARDS */
.surface-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 15px;
  margin-bottom: 12px;
}

.surface-card h3 {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.card-micro-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* INVISIBLE WORK & QUOTE CARD */
.invisible-work-card {
  border-color: rgba(255, 90, 54, 0.24);
  background: linear-gradient(160deg, var(--bg-surface) 0%, rgba(255, 90, 54, 0.05) 100%);
}

.iw-stats-row {
  display: flex;
  gap: 14px;
  margin-bottom: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
}

.iw-stat strong {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.15rem;
  color: var(--accent);
}

.iw-stat span {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.iw-quote-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.iw-quote-text {
  font-size: 0.81rem;
  font-style: italic;
  color: var(--text-primary);
  line-height: 1.45;
}

.iw-quote-author {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 700;
  color: var(--text-secondary);
}

.btn-refresh-quote {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.muscle-bars-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.mbar-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  margin: 0 -8px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.mbar-row:hover {
  background: var(--bg-elevated);
}

.mbar-row.is-focused {
  background: var(--accent-soft);
  border-color: rgba(255, 90, 54, 0.45);
}

.mbar-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 500;
}

.mbar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.mbar-fill { height: 100%; border-radius: 999px; }
.mbar-fill.prim { background: var(--accent); }
.mbar-fill.sec { background: var(--amber); }

.cues-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cues-list li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  padding-left: 14px;
  position: relative;
}

.cues-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* TAB 3: PROGRESSI & HEATMAP */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px 13px;
}

.kpi-val {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 1.28rem;
  font-weight: 700;
}

.kpi-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-top: 2px;
}

.kpi-sub {
  font-size: 0.69rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.panel-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.panel-header-row h3 { margin-bottom: 0; }

.mini-seg-group {
  display: flex;
  gap: 2px;
  background: var(--bg-elevated);
  padding: 3px;
  border-radius: 8px;
}

.mini-seg {
  padding: 3px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
}

.mini-seg.active {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.heatmap-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  text-align: center;
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 5px;
}

.hm-calendar-rows { display: flex; flex-direction: column; gap: 5px; }
.hm-cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }

.hm-cell {
  height: 33px;
  border-radius: 7px;
  background: var(--hm-0);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.hm-cell.lv-1, .hm-lv.lv-1 { background: var(--hm-1); color: var(--text-primary); }
.hm-cell.lv-2, .hm-lv.lv-2 { background: var(--hm-2); color: var(--text-primary); }
.hm-cell.lv-3, .hm-lv.lv-3 { background: var(--hm-3); color: #ffffff; }
.hm-cell.lv-4, .hm-lv.lv-4 { background: var(--hm-4); color: #052e16; font-weight: 700; }
.hm-lv.lv-0 { background: var(--hm-0); }

.hm-cell.is-today { border-color: var(--text-secondary); }
.hm-cell.is-due { border: 1px dashed var(--accent); color: var(--accent); }
.hm-cell.is-selected { box-shadow: 0 0 0 2px var(--accent); }
.hm-cell.is-future { opacity: 0.35; }

.anki-scroll-wrap { overflow-x: auto; padding-bottom: 4px; }
.anki-matrix { display: inline-flex; gap: 4px; min-width: 100%; }
.anki-col { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 14px; }
.anki-month-lbl { font-size: 0.62rem; color: var(--text-muted); height: 13px; white-space: nowrap; }

.anki-sq {
  width: 100%;
  aspect-ratio: 1;
  min-height: 13px;
  border-radius: 3.5px;
  background: var(--hm-0);
  cursor: pointer;
}

.anki-sq.lv-1 { background: var(--hm-1); }
.anki-sq.lv-2 { background: var(--hm-2); }
.anki-sq.lv-3 { background: var(--hm-3); }
.anki-sq.lv-4 { background: var(--hm-4); }
.anki-sq.is-selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.anki-sq.is-future { opacity: 0.25; }

.hm-scale-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  margin-top: 10px;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.hm-lv { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

.day-inspector-box {
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  font-size: 0.79rem;
}

.di-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.di-body { color: var(--text-secondary); line-height: 1.5; }
.di-note { margin-top: 5px; font-size: 0.74rem; color: var(--text-primary); font-style: italic; }

.metric-helper-line { font-size: 0.73rem; color: var(--text-secondary); margin-bottom: 10px; }

.point-inspector-strip {
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--bg-elevated);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
}

.pi-left { min-width: 0; }
.pi-date { font-size: 0.74rem; font-weight: 700; color: var(--text-secondary); }
.pi-detail { font-size: 0.8rem; font-weight: 600; color: var(--text-primary); }
.pi-right { text-align: right; flex-shrink: 0; }
.pi-val { font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 1rem; font-weight: 700; color: var(--accent); }
.pi-delta { font-size: 0.7rem; font-weight: 600; }
.pi-delta.up { color: var(--green); }
.pi-delta.down { color: var(--text-muted); }

.chart-canvas-box { width: 100%; height: 210px; touch-action: pan-y; }
.chart-canvas-box canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }

.assist-legend-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: 0.7rem; color: var(--text-secondary); }
.assist-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }

.pr-summary-strip {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.pr-summary-strip strong {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--text-primary);
}

.history-feed { display: flex; flex-direction: column; gap: 8px; }
.history-item { padding: 10px 12px; border-radius: 11px; background: var(--bg-elevated); cursor: pointer; }
.history-item-head { display: flex; justify-content: space-between; font-size: 0.8rem; font-weight: 700; margin-bottom: 4px; }
.history-lines { font-size: 0.76rem; color: var(--text-secondary); line-height: 1.45; }
.history-note { margin-top: 4px; font-size: 0.73rem; color: var(--text-muted); font-style: italic; }

/* SETTINGS */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.setting-row:first-of-type { border-top: none; }
.setting-label { font-size: 0.84rem; font-weight: 600; }
.setting-hint { font-size: 0.73rem; color: var(--text-secondary); }

.clean-select {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-size: 0.8rem;
  font-weight: 600;
}

.clean-checkbox { width: 20px; height: 20px; accent-color: var(--accent); cursor: pointer; }
.fixed-days-picker { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }

.fday-btn {
  padding: 8px 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.fday-btn.active { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.manage-ex-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }

.manage-ex-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--bg-elevated);
  font-size: 0.8rem;
}

.add-ex-details summary { list-style: none; }

.btn-outline-block {
  display: block;
  width: 100%;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.add-ex-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.ok-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green);
}

.backup-meta { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 10px; }
.vault-actions { display: flex; flex-direction: column; gap: 8px; }

/* DUOLINGO-STYLE STREAK FIRE CELEBRATION MODAL */
.streak-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(6, 7, 10, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.streak-modal-card {
  width: 100%;
  max-width: 368px;
  background: radial-gradient(circle at 50% 18%, rgba(255, 107, 43, 0.11) 0%, rgba(20, 22, 28, 0) 58%), #14161c;
  border: 1px solid rgba(255, 107, 43, 0.34);
  border-radius: 24px;
  padding: 20px 24px 24px;
  text-align: center;
  color: #f4f5f7;
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.68);
  animation: modalPopIn 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPopIn {
  0% { transform: scale(0.84) translateY(16px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.roaring-fire-stage {
  position: relative;
  width: 240px;
  height: 176px;
  margin: -20px auto -24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
}

#fire-canvas {
  width: 240px;
  height: 220px;
  display: block;
  -webkit-mask-image: radial-gradient(ellipse 49% 49% at 50% 50%, #000 68%, rgba(0, 0, 0, 0) 100%);
  mask-image: radial-gradient(ellipse 49% 49% at 50% 50%, #000 68%, rgba(0, 0, 0, 0) 100%);
}

.modal-streak-count {
  position: relative;
  z-index: 2;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 2.85rem;
  font-weight: 800;
  color: #ff6b2b;
  line-height: 1;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 22px rgba(255, 107, 43, 0.35);
}

.modal-streak-title {
  font-size: 1.06rem;
  font-weight: 800;
  margin-top: 8px;
  letter-spacing: -0.015em;
  color: #ffffff;
}

.modal-work-proof {
  font-size: 0.81rem;
  color: #9ca3af;
  margin-top: 12px;
  padding: 0 6px;
  line-height: 1.58;
}

.modal-work-proof strong { color: #f4f5f7; }

.modal-quote-box {
  margin: 18px 0 22px;
  padding: 15px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.042);
  border: 1px solid rgba(255, 255, 255, 0.085);
  text-align: left;
}

.modal-quote-text {
  font-size: 0.81rem;
  font-style: italic;
  line-height: 1.52;
  color: #e5e7eb;
}

.modal-quote-author {
  display: block;
  margin-top: 8px;
  font-size: 0.73rem;
  font-weight: 700;
  color: #ff8c66;
}

/* BOTTOM NAVIGATION */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
}

.nav-tab {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 600;
  transition: color 0.18s ease, transform 0.16s ease;
}

.nav-tab:active { transform: scale(0.91); }
.nav-tab.active { color: var(--text-primary); }
.nav-tab.active svg {
  stroke: var(--accent);
  animation: navIconSpring 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes navIconSpring {
  0% { transform: scale(0.78) translateY(3px); }
  55% { transform: scale(1.18) translateY(-2px); }
  100% { transform: scale(1) translateY(0); }
}

/* TACTILE MICRO-ANIMATIONS ACROSS PILLS, HEATMAP, CHART & MUSCLE BARS */
.ex-pill, .mini-opt-chip, .seg-item, .mini-seg, .holo-ctrl-btn, .wday-pill {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.ex-pill:active, .mini-opt-chip:active, .seg-item:active, .mini-seg:active, .holo-ctrl-btn:active, .wday-pill:active {
  transform: scale(0.92);
}

.ex-pill.active, .wday-pill.is-selected, .picked-muscle-pill:not(.hidden) {
  animation: pillSelectPop 0.30s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pillSelectPop {
  0% { transform: scale(0.90); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.hm-cell, .anki-sq {
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, background 0.2s ease;
  animation: hmCellWaveIn 0.32s cubic-bezier(0.22, 1, 0.36, 1) backwards;
  animation-delay: var(--cell-delay, 0ms);
}

.hm-cell:active, .anki-sq:active {
  transform: scale(0.84);
}

.hm-cell.is-selected, .anki-sq.is-selected {
  animation: hmCellTapPop 0.34s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 2;
}

@keyframes hmCellWaveIn {
  0% { opacity: 0; transform: scale(0.72); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes hmCellTapPop {
  0% { transform: scale(0.82); }
  55% { transform: scale(1.18); }
  100% { transform: scale(1.04); }
}

.tap-ripple-ring {
  position: fixed;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  pointer-events: none;
  z-index: 135;
  transform: translate(-50%, -50%) scale(0.6);
  animation: tapRippleExpand 0.46s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tapRippleExpand {
  0% { transform: translate(-50%, -50%) scale(0.55); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(2.2); opacity: 0; }
}

.day-inspector-box.inspector-pop {
  animation: inspectorBloomIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes inspectorBloomIn {
  0% { opacity: 0.35; transform: translateY(5px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.point-inspector-strip {
  transition: border-color 0.22s ease, background 0.22s ease;
  border: 1px solid transparent;
}

.point-inspector-strip.scrub-flash {
  border-color: rgba(255, 90, 54, 0.42);
}

.pi-val.val-pop {
  display: inline-block;
  animation: valNumberPop 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes valNumberPop {
  0% { transform: scale(0.84); }
  55% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

.mbar-row {
  position: relative;
  overflow: hidden;
}

.mbar-row:active {
  transform: scale(0.98);
}

.mbar-row.is-focused {
  animation: mbarFocusPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mbar-fill {
  position: relative;
  overflow: hidden;
  transition: width 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.mbar-row.is-focused .mbar-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.55) 50%, transparent 100%);
  animation: barShimmerSweep 0.65s ease-out forwards;
}

@keyframes mbarFocusPop {
  0% { transform: scale(0.97); }
  55% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes barShimmerSweep {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.kpi-card {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease;
}

.kpi-card:active {
  transform: scale(0.96);
}

.toast {
  position: fixed;
  bottom: calc(84px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--text-primary);
  color: var(--bg-page);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  animation: toastSlideUp 0.26s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes toastSlideUp {
  0% { transform: translate(-50%, 10px) scale(0.92); opacity: 0; }
  100% { transform: translate(-50%, 0) scale(1); opacity: 1; }
}

/* ---------------- SECONDARY TACTILE DOPAMINE & MOTION POLISH ---------------- */
.holo-overlay-top,
.holo-zoom-stack,
.holo-controls-bar {
  z-index: 4;
}

.postit-expanded-body {
  animation: expandBodyIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: top center;
}

@keyframes expandBodyIn {
  0% { opacity: 0; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}

.set-editor-drawer {
  animation: drawerPopIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: top center;
}

@keyframes drawerPopIn {
  0% { opacity: 0; transform: scale(0.97) translateY(-4px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.step-btn,
.btn-add-set,
.set-chip,
.btn-3d-link,
.icon-nav-btn,
.jump-today-chip,
.text-action-btn,
.btn-refresh-quote,
.fday-btn,
.btn-outline-block,
.history-item,
.btn-icon-mini,
.btn-confirm-set,
.btn-delete-set,
.btn-cancel-set {
  transition: transform 0.17s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.step-btn:active,
.btn-add-set:active,
.set-chip:active,
.btn-3d-link:active,
.icon-nav-btn:active,
.jump-today-chip:active,
.text-action-btn:active,
.btn-refresh-quote:active,
.fday-btn:active,
.btn-outline-block:active,
.btn-icon-mini:active,
.btn-confirm-set:active,
.btn-delete-set:active,
.btn-cancel-set:active {
  transform: scale(0.91);
}

.history-item:active {
  transform: scale(0.985);
}

.step-input.step-pop {
  animation: valNumberPop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-refresh-quote.is-spinning,
.btn-icon-mini.is-spinning {
  animation: quoteSpin360 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes quoteSpin360 {
  0% { transform: rotate(0deg) scale(0.88); }
  60% { transform: rotate(210deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}

.iw-quote-text.quote-fade {
  animation: quoteCrossfade 0.28s ease-out;
}

@keyframes quoteCrossfade {
  0% { opacity: 0.2; transform: translateY(3px); }
  100% { opacity: 1; transform: translateY(0); }
}

.beat-tag {
  background: var(--green-soft);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.28);
}

/* ---------------- CRISP PAPER & DAYLIGHT STUDIO LIGHT THEME ---------------- */
html[data-theme="light"] .surface-card,
html[data-theme="light"] .postit-card,
html[data-theme="light"] .kpi-card,
html[data-theme="light"] .rest-banner {
  box-shadow: 0 2px 10px rgba(17, 19, 23, 0.045);
}

html[data-theme="light"] .seg-bar,
html[data-theme="light"] .mini-seg-group {
  background: #e8e8e4;
  border-color: rgba(17, 19, 23, 0.07);
}

html[data-theme="light"] .seg-item.active,
html[data-theme="light"] .mini-seg.active {
  background: #ffffff;
  color: #111317;
  box-shadow: 0 1px 4px rgba(17, 19, 23, 0.10);
}

html[data-theme="light"] .set-editor-drawer {
  background: #f6f6f3;
}

html[data-theme="light"] .clean-select {
  background: #f4f4f1;
  color: #111317;
}

html[data-theme="light"] .invisible-work-card {
  border-color: rgba(234, 76, 40, 0.22);
  background: linear-gradient(160deg, #ffffff 0%, rgba(234, 76, 40, 0.055) 100%);
}

html[data-theme="light"] .hm-cell.lv-4,
html[data-theme="light"] .hm-lv.lv-4 {
  color: #ffffff;
}

/* Light Mode 3D Anatomy Studio & Frosted Daylight Glass HUD */
html[data-theme="light"] .holo-stage-card {
  background: #eceee9;
  border-color: rgba(17, 19, 23, 0.11);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 4px 16px rgba(17, 19, 23, 0.06);
}

html[data-theme="light"] .holo-loading-pill,
html[data-theme="light"] .legend-chip,
html[data-theme="light"] .picked-muscle-pill {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(17, 19, 23, 0.11);
  color: #18181b;
  box-shadow: 0 2px 8px rgba(17, 19, 23, 0.06);
}

html[data-theme="light"] .rep-pill {
  color: #475569;
}

html[data-theme="light"] .rep-pill.is-grinding {
  border-color: rgba(234, 76, 40, 0.55);
  background: rgba(255, 243, 239, 0.94);
  color: #d93818;
}

html[data-theme="light"] .picked-muscle-pill {
  border-color: var(--accent);
  background: rgba(255, 244, 240, 0.95);
  color: #c83717;
}

html[data-theme="light"] .cam-group,
html[data-theme="light"] .speed-group,
html[data-theme="light"] .holo-zoom-stack {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(17, 19, 23, 0.11);
  box-shadow: 0 2px 10px rgba(17, 19, 23, 0.07);
}

html[data-theme="light"] .holo-ctrl-btn {
  color: #525866;
}

html[data-theme="light"] .holo-ctrl-btn.active {
  background: #18181b;
  color: #ffffff;
}

html[data-theme="light"] .holo-zoom-btn {
  color: #18181b !important;
}

html[data-theme="light"] .holo-zoom-btn:active {
  background: rgba(17, 19, 23, 0.10);
}

/* Light Mode Streak Modal */
html[data-theme="light"] .streak-modal-backdrop {
  background: rgba(17, 19, 23, 0.48);
}

html[data-theme="light"] .streak-modal-card {
  background: radial-gradient(circle at 50% 18%, #fff1e8 0%, #ffffff 60%);
  border-color: rgba(234, 76, 40, 0.30);
  color: #111317;
  box-shadow: 0 24px 60px rgba(17, 19, 23, 0.22);
}

html[data-theme="light"] .modal-streak-title {
  color: #111317;
}

html[data-theme="light"] .modal-work-proof {
  color: #525866;
}

html[data-theme="light"] .modal-work-proof strong {
  color: #111317;
}

html[data-theme="light"] .modal-quote-box {
  background: #f7f6f2;
  border-color: rgba(17, 19, 23, 0.08);
}

html[data-theme="light"] .modal-quote-text {
  color: #27272a;
}

html[data-theme="light"] .modal-quote-author {
  color: #d93818;
}

/* ---------------- V23: EXACT CONCENTRIC REST RING, 3-STAGE MOTION, HERO PR, SHIELD & RANK VAULT ---------------- */

/* Header Rank & Shield Pills */
.rank-pill {
  cursor: pointer;
  padding: 3px 9px 3px 6px;
  background: var(--bg-elevated);
  border: 1px solid var(--rk-border, var(--border-strong));
  color: var(--rk-text, var(--text-primary));
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, box-shadow 0.2s ease;
}

.rank-pill:active {
  transform: scale(0.93);
}

.hdr-rank-ico,
.hdr-shield-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.shield-pill {
  cursor: pointer;
  padding: 4px 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.shield-pill:active {
  transform: scale(0.93);
}

.shield-pill.has-shields {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.42);
  color: #38bdf8;
}

html[data-theme="light"] .shield-pill.has-shields {
  background: rgba(2, 132, 199, 0.10);
  border-color: rgba(2, 132, 199, 0.35);
  color: #0284c7;
}

.shield-pill.is-military.has-shields {
  background: rgba(234, 179, 8, 0.14);
  border-color: rgba(234, 179, 8, 0.46);
  color: #facc15;
}

html[data-theme="light"] .shield-pill.is-military.has-shields {
  background: rgba(180, 83, 9, 0.11);
  border-color: rgba(180, 83, 9, 0.38);
  color: #b45309;
}

/* Exact Mathematical Concentric Rest Ring & 3-Stage Animations */
.rest-ring-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: block;
}

.rest-ring-svg {
  width: 32px;
  height: 32px;
  display: block;
  overflow: visible;
}

.rest-halo-ring {
  fill: none;
  stroke: transparent;
  stroke-width: 2;
  transform-origin: 16px 16px;
  pointer-events: none;
}

.rest-ring-track {
  fill: none;
  stroke: var(--border-strong);
  stroke-width: 3;
}

.rest-ring-prog {
  fill: none;
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 78.54;
  stroke-dashoffset: 78.54;
  transform: rotate(-90deg);
  transform-origin: 16px 16px;
  transition: stroke-dashoffset 0.35s linear, stroke 0.25s ease;
}

.rest-center-dot {
  fill: var(--green);
  transform-origin: 16px 16px;
  animation: restCalmBreath 3.2s infinite ease-in-out;
  transition: fill 0.25s ease;
}

@keyframes restCalmBreath {
  0%, 100% { transform: scale(0.88); opacity: 0.78; }
  50% { transform: scale(1.14); opacity: 1; }
}

/* Stage 2: Amber ("Ready — time to start next set") */
.rest-banner.state-warn {
  border-color: rgba(245, 158, 11, 0.72);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16) 0%, rgba(245, 158, 11, 0.07) 100%);
  animation: restAmberBannerGlow 1.5s infinite ease-in-out;
}

.rest-banner.state-warn .rest-ring-prog {
  stroke: var(--amber);
}

.rest-banner.state-warn .rest-center-dot {
  fill: var(--amber);
  animation: restAmberHeartbeat 1.3s infinite ease-in-out;
}

.rest-banner.state-warn .rest-halo-ring {
  stroke: var(--amber);
  animation: restRadarRipple 1.3s infinite cubic-bezier(0.16, 1, 0.3, 1);
}

.rest-banner.state-warn .rest-timer-val {
  color: var(--amber);
  animation: restAmberDigits 1.3s infinite ease-in-out;
}

@keyframes restAmberBannerGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.08); }
  50% { box-shadow: 0 0 14px 1px rgba(245, 158, 11, 0.26); }
}

@keyframes restAmberHeartbeat {
  0%, 100% { transform: scale(0.92); }
  25% { transform: scale(1.28); }
  45% { transform: scale(1.0); }
  65% { transform: scale(1.22); }
}

@keyframes restAmberDigits {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.05); }
}

@keyframes restRadarRipple {
  0% { transform: scale(1); opacity: 0.75; }
  100% { transform: scale(1.42); opacity: 0; }
}

/* Stage 3: Red ("Come on, move! High-attention kinetic alert") */
.rest-banner.state-urgent {
  border-color: rgba(239, 68, 68, 0.92);
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.24) 0%, rgba(239, 68, 68, 0.11) 100%);
  animation: restUrgentStrobe 0.82s infinite ease-in-out;
}

.rest-banner.state-urgent .rest-ring-wrap {
  animation: restUrgentShake 0.95s infinite ease-in-out;
}

.rest-banner.state-urgent .rest-ring-prog {
  stroke: var(--red);
}

.rest-banner.state-urgent .rest-center-dot {
  fill: var(--red);
  animation: restUrgentCore 0.55s infinite alternate ease-in-out;
}

.rest-banner.state-urgent .rest-halo-ring {
  stroke: var(--red);
  stroke-width: 2.4;
  animation: restUrgentRadar 0.82s infinite ease-out;
}

.rest-banner.state-urgent .rest-timer-val {
  color: var(--red);
  animation: restUrgentDigits 0.82s infinite ease-in-out;
}

@keyframes restUrgentStrobe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.2); transform: translateY(0); }
  50% { box-shadow: 0 0 20px 2px rgba(239, 68, 68, 0.45); transform: translateY(-1px); }
}

@keyframes restUrgentShake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  15% { transform: rotate(-11deg) scale(1.08); }
  30% { transform: rotate(11deg) scale(1.08); }
  45% { transform: rotate(-8deg) scale(1.04); }
  60% { transform: rotate(8deg) scale(1.04); }
  75% { transform: rotate(0deg) scale(1); }
}

@keyframes restUrgentCore {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.42); }
}

@keyframes restUrgentRadar {
  0% { transform: scale(1); opacity: 0.92; }
  100% { transform: scale(1.58); opacity: 0; }
}

@keyframes restUrgentDigits {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.09); }
}

/* Smart Coach Hint Strip */
.smart-coach-hint {
  margin-top: 9px;
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.73rem;
  color: var(--text-secondary);
  line-height: 1.44;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.smart-coach-hint.is-ready {
  border-color: rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.09);
  color: var(--text-primary);
}

.smart-coach-hint.is-optimal {
  border-color: rgba(34, 197, 94, 0.38);
  background: var(--green-soft);
  color: var(--text-primary);
}

.smart-coach-hint.is-pr-zone {
  border-color: rgba(251, 191, 36, 0.55);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.06));
  color: var(--text-primary);
}

.coach-try-btn {
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--amber);
  background: rgba(245, 158, 11, 0.16);
  color: var(--amber);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
}

html[data-theme="light"] .coach-try-btn {
  color: #b45309;
  border-color: #d97706;
}

.session-coach-note {
  font-size: 0.74rem;
  color: var(--green);
  text-align: center;
  padding: 6px 10px;
  border-radius: 9px;
  background: var(--green-soft);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Clean Borderless PR Typography (Zero Yellow Box Clutter!) */
.set-chip.is-pr {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}

.tot-pill.is-pr-tot {
  border: none;
  background: transparent;
  box-shadow: none;
}

.pr-star-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 3px;
  line-height: 1;
  vertical-align: middle;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  color: #fbbf24;
  letter-spacing: 0.03em;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.55);
}

html[data-theme="light"] .pr-star-tag {
  color: #d97706;
  text-shadow: 0 0 8px rgba(217, 119, 6, 0.28);
}

.pr-shockwave-ring {
  position: fixed;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid #fbbf24;
  pointer-events: none;
  z-index: 160;
  transform: translate(-50%, -50%) scale(0.4);
  animation: prShockExpand 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes prShockExpand {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0.95; }
  100% { transform: translate(-50%, -50%) scale(4.2); opacity: 0; }
}

.pr-hero-card {
  position: fixed;
  bottom: calc(82px + var(--safe-bottom));
  left: 50%;
  width: min(362px, calc(100vw - 22px));
  z-index: 170;
  padding: 14px 16px 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, #1b160c 0%, #121318 65%, #231b0b 100%);
  border: 1.5px solid #fbbf24;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 28px rgba(245, 158, 11, 0.38);
  display: flex;
  align-items: center;
  gap: 13px;
  overflow: hidden;
  cursor: pointer;
  transform: translateX(-50%);
  animation: prHeroLifecycle var(--hero-dur, 4.4s) cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.pr-hero-card.is-major-unlock {
  padding: 15px 17px 18px;
  border-width: 1.8px;
}

.pr-hero-card.is-major-unlock .pr-hero-emblem {
  width: 58px;
  height: 58px;
}

.pr-hero-close {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.68rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

html[data-theme="light"] .pr-hero-close {
  background: rgba(15, 23, 42, 0.07);
  color: #475569;
}

.pr-hero-timer-bar {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #fbbf24, #ff5a36);
  transform-origin: left center;
  animation: prHeroCountdown var(--hero-dur, 4.4s) linear forwards;
}

@keyframes prHeroCountdown {
  0% { transform: scaleX(1); }
  100% { transform: scaleX(0); }
}

html[data-theme="light"] .pr-hero-card {
  background: linear-gradient(145deg, #fffbeb 0%, #ffffff 65%, #fef3c7 100%);
  border-color: #d97706;
  box-shadow: 0 14px 36px rgba(180, 83, 9, 0.25), 0 0 22px rgba(245, 158, 11, 0.28);
}

.pr-hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(254, 240, 138, 0.28) 50%, transparent 75%);
  transform: translateX(-120%);
  animation: prHeroSheen 1.4s 0.25s ease-in-out infinite;
  pointer-events: none;
}

@keyframes prHeroSheen {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}

@keyframes prHeroLifecycle {
  0% { opacity: 0; transform: translate(-50%, 18px) scale(0.86); }
  9% { opacity: 1; transform: translate(-50%, 0) scale(1.03); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  88% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, 14px) scale(0.95); }
}

.pr-hero-emblem {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: prEmblemSpinPop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes prEmblemSpinPop {
  0% { transform: scale(0.4) rotate(-25deg); }
  70% { transform: scale(1.14) rotate(6deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.pr-hero-body {
  min-width: 0;
  flex: 1;
}

.pr-hero-kicker {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #fbbf24;
}

html[data-theme="light"] .pr-hero-kicker {
  color: #b45309;
}

.pr-hero-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #ffffff;
  margin-top: 1px;
  line-height: 1.25;
}

html[data-theme="light"] .pr-hero-title {
  color: #18181b;
}

.pr-hero-sub {
  font-size: 0.73rem;
  color: #d1d5db;
  margin-top: 2px;
}

html[data-theme="light"] .pr-hero-sub {
  color: #52525b;
}

/* Chart Point Inspector Edit Action + Collapsible Recent Sessions Dropdown */
.pi-note-preview {
  margin-top: 3px;
  font-size: 0.71rem;
  font-style: italic;
  color: var(--text-muted);
}

.pi-edit-btn {
  margin-top: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 90, 54, 0.38);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.69rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-block;
}

.pi-edit-btn:active {
  transform: scale(0.93);
}

.history-accordion-card {
  padding: 0;
  overflow: hidden;
}

.history-dropdown-toggle {
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.history-dropdown-chevron {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: transform 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.history-dropdown-toggle[aria-expanded="true"] .history-dropdown-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}

.history-feed-wrap {
  padding: 0 16px 15px;
  border-top: 1px solid var(--border);
  animation: expandBodyIn 0.22s ease-out;
}

.history-feed-wrap .history-feed {
  margin-top: 11px;
}

.btn-show-all-history {
  margin-top: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.di-body.is-clickable {
  cursor: pointer;
}

.history-item.flash-focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(255, 90, 54, 0.28);
  animation: inspectorBloomIn 0.36s ease-out;
}

.history-expanded-details {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-ex-detail-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.77rem;
}

.history-ex-detail-name {
  font-weight: 700;
  color: var(--text-primary);
}

.history-ex-detail-sets {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.73rem;
  color: var(--text-secondary);
  text-align: right;
}

.history-expanded-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.btn-history-edit {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 90, 54, 0.45);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

/* Forged Aegis Shield Modal (Mineral Icy-Azure & Military 24k Gold/Gunmetal) */
.shield-modal-card {
  padding: 16px 20px 20px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: radial-gradient(circle at 50% 18%, rgba(56, 189, 248, 0.16) 0%, rgba(18, 21, 28, 0) 62%), #12151c;
  border-color: rgba(56, 189, 248, 0.36);
}

html[data-theme="light"] .streak-modal-card.shield-modal-card {
  background: radial-gradient(circle at 50% 18%, #e0f2fe 0%, #ffffff 62%);
  border-color: rgba(2, 132, 199, 0.32);
}

.shield-modal-card.is-military {
  background: radial-gradient(circle at 50% 18%, rgba(234, 179, 8, 0.16) 0%, rgba(19, 21, 27, 0) 64%), #13151b;
  border-color: rgba(234, 179, 8, 0.42);
}

html[data-theme="light"] .streak-modal-card.shield-modal-card.is-military {
  background: radial-gradient(circle at 50% 18%, #fef3c7 0%, #ffffff 64%);
  border-color: rgba(180, 83, 9, 0.38);
}

.aegis-shield-stage {
  position: relative;
  width: 196px;
  height: 178px;
  margin: -6px auto -4px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

#shield-canvas {
  width: 196px;
  height: 178px;
  display: block;
  flex-shrink: 0;
}

.modal-shield-count {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 2.05rem;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1.05;
}

html[data-theme="light"] .modal-shield-count {
  color: #0284c7;
}

.shield-modal-card.is-military .modal-shield-count {
  color: #facc15;
}

html[data-theme="light"] .shield-modal-card.is-military .modal-shield-count {
  color: #b45309;
}

.modal-shield-owned-sub {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 2px 0 6px;
}

.shield-inspect-wrap {
  margin: 10px 0 4px;
}

.shield-inspect-caption {
  font-size: 0.69rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.shield-preview-notice {
  font-size: 0.70rem;
  font-weight: 600;
  color: #7dd3fc;
  margin-top: 2px;
}

html[data-theme="light"] .shield-preview-notice {
  color: #0369a1;
}

.shield-modal-card.is-military .shield-preview-notice {
  color: #fde047;
}

html[data-theme="light"] .shield-modal-card.is-military .shield-preview-notice {
  color: #b45309;
}

.shield-forge-box {
  margin: 12px 0 6px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

html[data-theme="light"] .shield-forge-box {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.09);
}

.shield-forge-box.is-max .shield-forge-label {
  margin-bottom: 0;
}

.shield-forge-label {
  font-size: 0.73rem;
  font-weight: 700;
  color: #bae6fd;
  margin-bottom: 8px;
  line-height: 1.35;
}

html[data-theme="light"] .shield-forge-label {
  color: #0369a1;
}

.shield-modal-card.is-military .shield-forge-label {
  color: #fde68a;
}

html[data-theme="light"] .shield-modal-card.is-military .shield-forge-label {
  color: #92400e;
}

.shield-forge-segments {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.shield-seg {
  height: 22px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  font-weight: 800;
  color: rgba(148, 163, 184, 0.75);
  transition: background 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

html[data-theme="light"] .shield-seg {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.14);
  color: #64748b;
}

.shield-seg.is-filled {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  border-color: #7dd3fc;
  color: #ffffff;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.38);
}

.shield-modal-card.is-military .shield-seg.is-filled {
  background: linear-gradient(135deg, #ca8a04, #eab308);
  border-color: #fde047;
  color: #0b0c0e;
  box-shadow: none;
}

.shield-cta-btn {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
}

.shield-modal-card.is-military .shield-cta-btn {
  background: linear-gradient(135deg, #b45309, #eab308);
  color: #0b0c0e;
  font-weight: 800;
}

/* Adventurer Rank & 45-Milestone Mastery Vault Sheet */
.rank-vault-backdrop {
  align-items: flex-end;
  padding: 0;
}

.rank-vault-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  margin: 0 auto;
  background: #131519;
  border-top: 1px solid var(--border-strong);
  border-radius: 22px 22px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -14px 44px rgba(0, 0, 0, 0.58);
  animation: vaultSheetUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="light"] .rank-vault-sheet {
  background: #ffffff;
  box-shadow: 0 -14px 44px rgba(17, 19, 23, 0.20);
}

@keyframes vaultSheetUp {
  0% { transform: translateY(32px); }
  100% { transform: translateY(0); }
}

.rank-vault-topbar {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.rank-vault-heading {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
}

.rank-vault-scroll {
  padding: 12px 16px calc(26px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.rank-hero-stage {
  position: relative;
  width: 220px;
  height: 170px;
  margin: 2px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.rank-hero-stage canvas {
  position: absolute;
  inset: 0;
  width: 220px;
  height: 170px;
  pointer-events: none;
}

.rank-hero-crest {
  position: relative;
  z-index: 2;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.45));
}

.rank-hero-stage:active .rank-hero-crest {
  transform: scale(0.91);
}

.rank-hero-name {
  text-align: center;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-top: 2px;
}

.rank-hero-sub {
  text-align: center;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.rank-xp-wrap {
  margin: 12px 0 14px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.rank-xp-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.rank-xp-track {
  height: 7px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.rank-xp-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #fbbf24);
  transition: width 0.35s ease;
}

.rank-xp-formula {
  margin-top: 7px;
  font-size: 0.67rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.rank-ladder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.rank-ladder-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.rank-ladder-nav {
  display: flex;
  gap: 5px;
}

.rank-ladder-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin-bottom: 14px;
  scrollbar-width: none;
  cursor: grab;
  scroll-behavior: smooth;
}

.rank-ladder-strip:active {
  cursor: grabbing;
}

.rank-ladder-strip::-webkit-scrollbar {
  display: none;
}

.rank-step-btn {
  flex-shrink: 0;
  width: 78px;
  padding: 8px 4px 7px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  opacity: 0.88;
  transition: transform 0.16s ease, border-color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.rank-step-btn.is-reached {
  opacity: 1;
  border-color: var(--border-strong);
}

.rank-step-btn.is-previewed {
  opacity: 1;
  border-color: var(--rk-step-col, var(--accent));
  box-shadow: 0 0 0 1.5px var(--rk-step-col, var(--accent)), 0 4px 14px rgba(0, 0, 0, 0.28);
}

.rank-step-lbl {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62px;
}

.rank-step-xp {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.56rem;
  color: var(--text-muted);
}

.vault-cat-bar {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 8px;
  scrollbar-width: none;
}

.vault-cat-bar::-webkit-scrollbar {
  display: none;
}

/* Vector Milestones 3-Column Grid */
.ms-next-strip {
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}

.ms-next-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}

.ms-next-track {
  height: 5px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.ms-next-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #fbbf24);
  transition: width 0.35s ease;
}

.milestones-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.ms-badge {
  padding: 9px 6px 8px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  text-align: center;
  cursor: pointer;
  opacity: 0.48;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.ms-badge:active {
  transform: scale(0.93);
}

.ms-badge.is-unlocked {
  opacity: 1;
  border-color: var(--ms-col, rgba(255, 90, 54, 0.48));
  background: linear-gradient(160deg, var(--bg-surface) 0%, var(--bg-elevated) 100%);
  box-shadow: inset 0 0 16px -8px var(--ms-col, var(--accent));
}

.ms-badge.is-selected {
  box-shadow: 0 0 0 2px var(--accent);
  opacity: 1;
}

.ms-vec-wrap {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 3D Sculpted Rank, Aegis Shield & Milestone Emblem Layers (100% Gleaming at ALL Stages!) */
.mini-shield-img {
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
  transition: filter 0.2s ease, transform 0.2s ease;
}

.mini-shield-img.is-active {
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.55));
}

.mini-shield-img.is-mil.is-active {
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65));
}

.rk-emblem-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rk-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.rk-emblem-wrap.is-unlocked:not(.is-tiny) .rk-emblem-img {
  filter: drop-shadow(0 4px 10px var(--rk-glow, rgba(255, 90, 54, 0.35)));
}

.rk-emblem-wrap.is-locked-step .rk-emblem-img {
  filter: brightness(0) saturate(0) opacity(0.86)
    drop-shadow(0 0 1.1px rgba(148, 163, 184, 0.55));
}

.rk-emblem-wrap.is-locked-hero .rk-emblem-img {
  filter: brightness(0) saturate(0) opacity(0.93)
    drop-shadow(0 0 1.6px rgba(203, 213, 225, 0.48))
    drop-shadow(0 8px 20px rgba(0, 0, 0, 0.78));
}

html[data-theme="light"] .rk-emblem-wrap.is-locked-step .rk-emblem-img,
html[data-theme="light"] .rk-emblem-wrap.is-locked-hero .rk-emblem-img {
  filter: brightness(0) saturate(0) opacity(0.78)
    drop-shadow(0 2px 6px rgba(15, 23, 42, 0.22));
}

/* 4-Stage CS:GO / Valorant Sub-Rank Evolution Selector & Shield Charge Pills */
.rank-subtier-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 9px auto 2px;
  flex-wrap: wrap;
}

.rk-subtier-pill {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.67rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.rk-subtier-pill.is-climax {
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  letter-spacing: 0.02em;
}

.rk-subtier-pill.active {
  border-color: var(--rk-p, var(--accent));
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--rk-p, var(--accent)), 0 3px 10px rgba(0, 0, 0, 0.25);
}

html[data-theme="light"] .rk-subtier-pill.active {
  background: #ffffff;
}

.rk-subtier-pill:active {
  transform: scale(0.93);
}

.shield-charge-selector {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 5px;
  margin: 2px auto 6px;
}

.sh-stage-pill {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.04);
  color: #94a3b8;
  font-family: "Plus Jakarta Sans", -apple-system, sans-serif;
  font-size: 0.67rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}

.sh-stage-pill.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.16);
  color: #e0f2fe;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.32);
}

.shield-modal-card.is-military .sh-stage-pill.active {
  border-color: #eab308;
  background: rgba(234, 179, 8, 0.17);
  color: #fef08a;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.26);
}

html[data-theme="light"] .sh-stage-pill {
  background: #f1f5f9;
  color: #475569;
}

html[data-theme="light"] .sh-stage-pill.active {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #0284c7;
}

html[data-theme="light"] .shield-modal-card.is-military .sh-stage-pill.active {
  background: #fef3c7;
  color: #92400e;
  border-color: #d97706;
}

.mini-shield-img.is-off {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.42));
}

.ms-evo-frame {
  position: absolute;
  width: 128%;
  height: 128%;
  left: -14%;
  top: -14%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}

.ms-emblem-img {
  position: relative;
  z-index: 1;
}

.ms-center-engraving,
.ms-plate-tag {
  z-index: 2;
}

.ms-badge.evo-card-3.is-unlocked {
  border-width: 1.4px;
}

.ms-badge.evo-card-4.is-unlocked {
  border-width: 1.6px;
  box-shadow: inset 0 0 20px -7px var(--ms-col, var(--accent)), 0 2px 10px -4px var(--ms-col, var(--accent));
}

.rk-lock-seal {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #0c0f16;
  border: 1.5px solid var(--rk-c, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65);
}

.rk-lock-seal.is-hero {
  bottom: 0;
  width: 24px;
  height: 24px;
  border-width: 2px;
}

.ms-emblem-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ms-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.ms-emblem-wrap.is-unlocked .ms-emblem-img {
  filter: drop-shadow(0 3px 8px var(--ms-aura, rgba(255, 90, 54, 0.35)));
}

.ms-emblem-wrap.is-locked .ms-emblem-img {
  filter: grayscale(0.88) brightness(0.52) contrast(1.08);
}

.ms-plate-tag {
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 4.5px;
  border-radius: 5px;
  background: rgba(10, 13, 20, 0.94);
  border: 1px solid var(--ms-plate-c, #94a3b8);
  color: #f8fafc;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.52rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.65);
}

.ms-emblem-wrap.is-hero .ms-plate-tag {
  bottom: 2px;
  padding: 2.5px 9px;
  border-radius: 8px;
  border-width: 1.6px;
  font-size: 0.82rem;
}

.ms-center-engraving {
  position: absolute;
  top: 62.5%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.56rem;
  font-weight: 800;
  color: #fde047;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
  letter-spacing: -0.03em;
  white-space: nowrap;
  pointer-events: none;
}

.ms-center-engraving.is-compact {
  font-size: 0.48rem;
}

.ms-emblem-wrap.is-locked .ms-center-engraving {
  color: #cbd5e1;
  opacity: 0.72;
}

.ms-emblem-wrap.is-hero .ms-center-engraving {
  font-size: 1.22rem;
}

.ms-emblem-wrap.is-hero .ms-center-engraving.is-compact {
  font-size: 1.02rem;
}

/* Milestone Dedicated Spotlight Modal */
.milestone-modal-backdrop {
  z-index: 155;
}

.milestone-modal-card {
  background: radial-gradient(circle at 50% 18%, var(--ms-glow, rgba(255, 90, 54, 0.18)) 0%, rgba(19, 22, 30, 0) 64%), #13161e;
  border-color: var(--ms-border, rgba(255, 90, 54, 0.42));
}

html[data-theme="light"] .streak-modal-card.milestone-modal-card {
  background: radial-gradient(circle at 50% 18%, #f8fafc 0%, #ffffff 65%);
  border-color: var(--ms-border, rgba(17, 19, 23, 0.22));
}

.milestone-2d-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: -6px auto 2px;
}

.milestone-2d-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px 10px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.milestone-2d-stage:hover {
  transform: translateY(-2px) scale(1.025);
}

.milestone-2d-stage:active {
  transform: scale(0.95);
}

.milestone-2d-fx-canvas {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 230px;
  height: 190px;
  pointer-events: none;
  z-index: 0;
}

.milestone-modal-art {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.52));
}

.ms-open-3d-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4.5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--ms-border, rgba(251, 191, 36, 0.42));
  color: #f8fafc;
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
}

html[data-theme="light"] .ms-open-3d-pill {
  background: #f1f5f9;
  color: #1e293b;
  border-color: rgba(15, 23, 42, 0.16);
}

.milestone-3d-wrap {
  animation: expandBodyIn 0.22s ease-out;
}

.milestone-3d-stage-wrap {
  position: relative;
  width: 100%;
  height: 244px;
  margin: -8px auto 2px;
  border-radius: 14px;
  background: radial-gradient(circle at 50% 45%, var(--ms-glow, rgba(251, 191, 36, 0.22)) 0%, rgba(9, 11, 16, 0.55) 72%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  touch-action: none;
}

html[data-theme="light"] .milestone-3d-stage-wrap {
  background: radial-gradient(circle at 50% 45%, rgba(251, 191, 36, 0.16) 0%, #eef1f6 78%);
  border-color: rgba(15, 23, 42, 0.10);
}

.milestone-2d-wrap.hidden,
.milestone-3d-wrap.hidden {
  display: none !important;
}

.milestone-3d-mount {
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.milestone-3d-mount:active {
  cursor: grabbing;
}

.milestone-3d-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  margin: 7px auto 4px;
}

.ms3d-tool-btn {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 0.71rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.ms3d-tool-btn.is-icon {
  padding: 5px 10px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 800;
}

.ms3d-tool-btn:active {
  transform: scale(0.93);
}

html[data-theme="light"] .ms3d-tool-btn {
  background: #f1f5f9;
  color: #1e293b;
  border-color: rgba(15, 23, 42, 0.15);
}

.milestone-3d-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-bottom: 9px;
  line-height: 1.3;
}

.milestone-status-pill {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--ms-border, var(--border-strong));
  color: var(--ms-col-txt, #fbbf24);
}

html[data-theme="light"] .milestone-status-pill {
  background: #f1f5f9;
  color: #1e293b;
}

.ms-modal-prog-wrap {
  margin-top: 14px;
  padding: 0 8px;
}

.ms-name {
  display: block;
  width: 100%;
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ms-prog {
  display: block;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.ms-badge.is-unlocked .ms-prog {
  color: var(--ms-col, var(--accent));
  font-weight: 700;
}

.ms-inspector-line {
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.42;
}

.ms-inspector-line strong {
  color: var(--text-primary);
}

.modal-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btn-share-workout {
  width: 100%;
  padding: 10px 14px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.83rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.btn-share-workout:active {
  transform: scale(0.98);
}

html[data-theme="light"] .btn-share-workout {
  border-color: rgba(17, 19, 23, 0.14);
  background: #f4f4f1;
  color: #18181b;
}

.shield-inline-tag {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.71rem;
  font-weight: 700;
  color: #38bdf8;
}

html[data-theme="light"] .shield-inline-tag {
  color: #0284c7;
}

/* Prevent iPhone iOS Safari / Home-Screen PWA viewport auto-zoom on form controls (<16px) */
@supports (-webkit-touch-callout: none) {
  input,
  textarea,
  select {
    font-size: max(16px, 1em) !important;
  }
}

/* =========================================================================
   v47 CLEAN QOL & 3D BODY RECOVERY MAP EXTENSIONS (MINIMAL, ZERO BLOAT)
   ========================================================================= */

/* 1-Tap Clone Set Pill */
.btn-clone-set {
  height: 33px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}

.btn-clone-set:hover {
  border-color: var(--accent);
}

.btn-clone-set:active {
  transform: scale(0.94);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Scrollable Split Filter Bar on Today */
.split-seg-bar {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  justify-content: flex-start;
}

.split-seg-bar::-webkit-scrollbar {
  display: none;
}

.split-seg-bar .seg-item {
  flex: 1 0 auto;
  white-space: nowrap;
  padding: 6px 10px;
  font-size: 0.76rem;
}

/* Session Footer CTA Row + Subtle Share Card Button */
.session-cta-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.session-cta-row .btn-primary-cta {
  flex: 1;
}

.btn-quick-share {
  height: 44px;
  padding: 0 13px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.btn-quick-share:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

.btn-quick-share:active {
  transform: scale(0.96);
}

/* Wake Lock Sun Indicator in Rest Banner */
.rest-wake-pill {
  font-size: 0.72rem;
  color: #fbbf24;
  opacity: 0.85;
  margin-right: 2px;
  user-select: none;
}

/* Settings Compact Number Input */
.clean-num-input {
  width: 74px;
  padding: 6px 9px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}

/* 3D Mode Switch & Body Load Recovery Cards */
.holo-mode-bar {
  margin-bottom: 8px;
}

.dot-primed {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.75);
}

.body-load-group {
  margin-bottom: 14px;
}

.body-load-group:last-child {
  margin-bottom: 0;
}

.body-load-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.79rem;
  font-weight: 800;
  margin-bottom: 7px;
  color: var(--text-primary);
}

.body-load-head.is-recov {
  color: #ff5a36;
}

.body-load-head.is-primed {
  color: #10b981;
}

html[data-theme="light"] .body-load-head.is-primed {
  color: #059669;
}

.body-load-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.body-muscle-chip {
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.12s ease, border-color 0.14s ease;
}

.body-muscle-chip:active {
  transform: scale(0.96);
}

.body-muscle-chip.is-focused {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.body-muscle-chip .bm-meta {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  color: var(--text-muted);
}

.body-empty-note {
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Safe Import Preview Modal */
.import-modal-card {
  padding: 22px 20px;
}

.btn-cancel-modal {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

/* Interactive CTA hint inside Celebration Hero Card */
.pr-hero-cta {
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #fde047;
}

html[data-theme="light"] .pr-hero-cta {
  color: #b45309;
}

/* v49 Rank XP Breakdown, Unified Mastery Bar, Live Hold Stopwatch, Body Coach & Progress Split/PR Cards */
.rank-xp-breakdown {
  margin-top: 5px;
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.38;
  text-align: center;
}

.rank-xp-breakdown strong {
  color: var(--text-primary);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.ms-closest-link {
  margin-top: 7px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.72rem;
  cursor: pointer;
  text-align: left;
  display: inline-block;
}

.ms-closest-link strong {
  color: var(--accent);
}

.cat-pills {
  margin-bottom: 6px;
}

.cat-pills .mini-opt-chip {
  flex-shrink: 0;
}

.btn-hold-timer {
  height: 33px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

html[data-theme="light"] .btn-hold-timer {
  color: #047857;
}

.btn-hold-timer.is-running {
  border-color: #ff5a36;
  background: rgba(255, 90, 54, 0.18);
  color: #ff5a36;
  animation: pulseHoldBtn 1.1s ease-in-out infinite alternate;
}

@keyframes pulseHoldBtn {
  0% { box-shadow: 0 0 0 0 rgba(255, 90, 54, 0.35); }
  100% { box-shadow: 0 0 0 4px rgba(255, 90, 54, 0); }
}

.body-coach-banner {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.08);
  font-size: 0.75rem;
  line-height: 1.44;
  color: var(--text-primary);
}

.body-coach-banner.is-warn {
  border-color: rgba(255, 90, 54, 0.38);
  background: rgba(255, 90, 54, 0.09);
}

.body-model-note {
  margin-top: 12px;
  padding-top: 9px;
  border-top: 1px solid var(--border);
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.38;
}

.split-bar-track {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-elevated);
  margin: 10px 0 11px;
  gap: 2px;
}

.split-seg-fill {
  height: 100%;
  transition: width 0.3s ease;
}

.split-legend-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  margin-bottom: 9px;
}

.split-leg-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.split-leg-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.split-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.split-leg-val {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 700;
  color: var(--text-primary);
}

.pr-board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.pr-board-item {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pr-board-name {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pr-board-val {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
}

.pr-board-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* v50: Top-Center Rank Promotion Banner, Military Plaques, Sleek Streak Modal, Today Readiness & Body Comp */
.rk-emblem-wrap.is-mil-plaque .rk-emblem-img {
  object-fit: contain;
}

.pr-hero-card.is-rank-promotion {
  top: calc(env(safe-area-inset-top, 0px) + 56px);
  bottom: auto;
  max-width: 394px;
  padding: 13px 34px 16px 14px;
  border-color: rgba(251, 191, 36, 0.72);
  background: linear-gradient(135deg, rgba(28, 24, 18, 0.97), rgba(16, 18, 25, 0.98));
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.68), 0 0 28px rgba(251, 191, 36, 0.22);
}

html[data-theme="light"] .pr-hero-card.is-rank-promotion {
  background: linear-gradient(135deg, rgba(255, 251, 238, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18), 0 0 22px rgba(245, 158, 11, 0.18);
}

.streak-modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin-bottom: 4px;
}

.sm-brand-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.sm-brand-txt {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-primary);
}

.sm-date-txt {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.sm-rank-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sm-rank-lbl {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.sm-rank-ico {
  display: inline-flex;
  align-items: center;
}

#streak-modal .roaring-fire-stage {
  width: 212px;
  height: 190px;
  margin: -4px auto -10px;
}

#streak-modal #fire-canvas {
  width: 212px;
  height: 190px;
}

#streak-modal .modal-streak-count {
  font-size: 3.15rem;
  line-height: 1.04;
  margin-bottom: 4px;
}

#streak-modal .modal-streak-title {
  font-size: 1.12rem;
  margin-bottom: 6px;
}

#streak-modal .modal-work-proof {
  font-size: 0.80rem;
  line-height: 1.45;
  margin-bottom: 13px;
}

#streak-modal .modal-quote-box {
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}

#streak-modal .modal-quote-text {
  font-size: 0.83rem;
  line-height: 1.48;
  text-align: center;
  margin: 0;
}

#streak-modal .modal-quote-author {
  text-align: center;
  display: block;
  margin-top: 1px;
}

.today-readiness-strip {
  width: 100%;
  margin: -2px 0 10px;
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid rgba(255, 90, 54, 0.28);
  background: rgba(255, 90, 54, 0.07);
  color: var(--text-secondary);
  font-size: 0.73rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.today-readiness-strip strong {
  color: var(--text-primary);
}

.today-readiness-strip:active {
  transform: scale(0.985);
}

.body-comp-summary {
  margin-top: 6px;
  padding: 8px 11px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 0.73rem;
  color: var(--text-secondary);
}

.body-comp-summary strong {
  color: var(--text-primary);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}

.manage-ex-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn-del-custom-ex {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-del-custom-ex:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.5);
}

/* v51 Past-Date Quick Picker & Error Recovery Bar */
.date-picker-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.16s ease, color 0.16s ease, transform 0.14s ease;
}

.date-picker-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.date-picker-chip:active {
  transform: scale(0.93);
}

.sr-date-input {
  position: fixed;
  left: 50%;
  top: 120px;
  width: 1px;
  height: 1px;
  opacity: 0;
  border: 0;
  padding: 0;
  pointer-events: none;
}

.past-day-edit-bar {
  margin: 0 0 10px;
  padding: 9px 11px;
  border-radius: 11px;
  border: 1px solid rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.09);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.past-day-edit-msg {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.past-day-edit-msg strong {
  color: var(--text-primary);
}

.past-day-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.past-day-act-btn {
  position: relative;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.71rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: border-color 0.16s ease, transform 0.14s ease;
}

.past-day-act-btn:active {
  transform: scale(0.95);
}

.past-day-act-btn svg {
  flex-shrink: 0;
  opacity: 0.88;
}

.past-day-act-btn.is-danger {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.4);
}

/* v51 Smart Deload & Rank Decay Banners */
.smart-deload-banner,
.decay-alert-banner {
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 0.74rem;
  line-height: 1.38;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.smart-deload-banner {
  border: 1px solid rgba(16, 185, 129, 0.38);
  background: rgba(16, 185, 129, 0.08);
  color: var(--text-secondary);
}

.smart-deload-banner strong {
  color: var(--text-primary);
}

.decay-alert-banner {
  border: 1px solid rgba(239, 68, 68, 0.42);
  background: rgba(239, 68, 68, 0.09);
  color: var(--text-secondary);
}

.decay-alert-banner strong {
  color: #f87171;
}

.banner-cta-mini {
  flex-shrink: 0;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(16, 185, 129, 0.55);
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  font-size: 0.70rem;
  font-weight: 700;
  cursor: pointer;
}

html[data-theme="light"] .banner-cta-mini {
  color: #047857;
}

/* v51 Isometric Hold Target Presets */
.hold-target-row {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 7px;
}

.hold-target-lbl {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-right: 2px;
}

.hold-target-pill {
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.67rem;
  font-weight: 600;
  cursor: pointer;
}

.hold-target-pill.active {
  border-color: var(--accent);
  background: rgba(255, 90, 54, 0.15);
  color: var(--text-primary);
}

/* v51 Plain XP & De-Rank Collapsible Guide */
.xp-plain-guide {
  margin-top: 8px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  padding: 6px 10px;
  text-align: left;
}

.xp-plain-guide summary {
  font-size: 0.71rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
}

.xp-plain-guide summary::-webkit-details-marker {
  display: none;
}

.xp-plain-guide-body {
  margin-top: 7px;
  font-size: 0.69rem;
  line-height: 1.48;
  color: var(--text-secondary);
}

.xp-plain-guide-body code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--text-primary);
}

/* v51 Body Recomposition Chart & Weigh-In History */
.body-comp-chart-box {
  width: 100%;
  height: 168px;
  margin-top: 8px;
}

.body-comp-chart-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.weigh-in-history-mini {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 7px;
}

.weigh-in-mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 8px;
  border-radius: 7px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 0.71rem;
  color: var(--text-secondary);
}

.weigh-in-mini-row strong {
  color: var(--text-primary);
  font-family: "JetBrains Mono", ui-monospace, monospace;
}
