/* =========================================================
   WORKOUT TRACKER — 500K SYSTEM
   - Stronger checkboxes for PDF
   - Clear hierarchy
   - Category select-all support
   - Details + print-details support
   - Time summary styling
========================================================= */

/* ---------- Layout helpers ---------- */

.wb-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}

@media (max-width: 980px) {
  .wb-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Cards ---------- */

.wb-card {
  border-radius: 18px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(10,25,47,.95), rgba(6,18,36,.95));
  border: 1px solid rgba(148,163,184,.18);
  box-shadow: 0 18px 40px rgba(2,6,23,.65);
}

.wb-card h3 {
  margin-top: 0;
  margin-bottom: 6px;
  font-weight: 900;
  letter-spacing: .01em;
}

.micro-note {
  font-size: .78rem;
  opacity: .82;
  line-height: 1.45;
}

/* ---------- Accordion Sections ---------- */

.wb-accordion {
  display: grid;
  gap: 12px;
}

.wb-section {
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.22);
  overflow: hidden;
  background: rgba(6,18,36,.75);
}

.wb-section summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.wb-section summary::-webkit-details-marker {
  display: none;
}

/* Section header layout */
.wb-sec-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wb-sec-title {
  font-weight: 900;
}

.wb-sec-meta {
  font-size: .75rem;
  opacity: .75;
  font-weight: 600;
}

.wb-sec-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Select-all button */
.wb-sec-toggle {
  font-size: .7rem;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(94,234,212,.55);
  background: rgba(2,6,23,.7);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

/* Badge */
.wb-sec-badge {
  font-size: .7rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148,163,184,.18);
  font-weight: 700;
}

/* ---------- Section Body ---------- */

.wb-sec-body {
  padding: 14px 16px 16px;
  display: grid;
  gap: 12px;
  border-top: 1px solid rgba(148,163,184,.12);
}

/* ---------- Checklist Items ---------- */

.checkitem {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(2,6,23,.55);
}

/* Main checkbox — darker + thicker */
.checkitem input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: #0ea5e9; /* screen */
}

/* Text */
.wb-item-main {
  font-weight: 700;
  line-height: 1.4;
}

/* Right-side actions */
.wb-item-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

/* Info button */
.wb-item-info {
  font-size: .65rem;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.35);
  background: transparent;
  color: #cbd5f5;
  cursor: pointer;
  font-weight: 700;
}

/* Print detail mini toggle */
.wb-item-print {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .65rem;
  opacity: .85;
}

/* ---------- Details box ---------- */

.wb-item-info-box {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(2,6,23,.8);
  border: 1px dashed rgba(148,163,184,.25);
  font-size: .78rem;
  line-height: 1.45;
}

/* ---------- Preview / Printable ---------- */

.wb-preview {
  position: sticky;
  top: 14px;
}

@media (max-width: 980px) {
  .wb-preview {
    position: static;
  }
}

.wb-preview-item {
  display: grid;
  gap: 6px;
}

/* Fake checkbox for print */
.wb-box {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2.5px solid #000; /* PRINT SAFE */
  flex-shrink: 0;
}

.wb-preview-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.wb-preview-label {
  font-weight: 700;
}

/* Details in preview */
.wb-preview-details {
  font-size: .75rem;
  line-height: 1.45;
  padding-left: 32px;
  opacity: .85;
}

/* ---------- Time Summary ---------- */

.wb-timebox {
  margin: 12px 0 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(2,6,23,.85);
  border: 1px solid rgba(94,234,212,.55);
}

.wb-time-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.wb-time-label {
  font-weight: 900;
  letter-spacing: .03em;
}

.wb-time-value {
  font-weight: 900;
  font-size: 1.1rem;
}

/* ---------- Log button ---------- */

.wb-log-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 14px;
  border-radius: 16px;
  border: 2px solid rgba(0,0,0,.9);
  background: #fff;
  color: #000;
  font-weight: 900;
  letter-spacing: .05em;
  text-decoration: none;
}

/* ---------- Log page ---------- */

.wb-logrow {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.wb-logdetails {
  padding-left: 32px;
}

.wb-detailbox summary {
  font-size: .75rem;
  font-weight: 700;
  cursor: pointer;
}

.wb-detailtext {
  font-size: .78rem;
  line-height: 1.45;
  margin-top: 6px;
}

/* ---------- PRINT OVERRIDES (checkbox clarity) ---------- */

@media print {

  .checkitem input[type="checkbox"] {
    accent-color: #000;
    width: 22px;
    height: 22px;
  }

  .wb-preview,
  .wb-preview * {
    color: #000 !important;
  }

  .wb-card {
    background: #fff !important;
    box-shadow: none !important;
    border: 2px solid #000 !important;
  }

}
/* --- PATCH: stop preview from taking over on long checklists --- */
.workout-builder .wb-preview{
  position: static;
}

@media (min-width: 981px){
  .workout-builder .wb-preview{
    position: sticky;
    top: 14px;
    max-height: calc(100vh - 28px);
    overflow: auto;
  }
}


/* =========================================================
   WEEKLY UI (STEP 1) — Day tabs, modal, focus mode
========================================================= */

.wb-daytabs{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin: 14px 0 10px;
}

.wb-daytab{
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .78rem;
  font-weight: 800;
  border: 1px solid rgba(148,163,184,.25);
  background: rgba(2,6,23,.55);
  color: #e5e7eb;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}

.wb-daytab:hover{ transform: translateY(-1px); border-color: rgba(94,234,212,.55); }

.wb-daytab.is-active{
  background: rgba(14,165,233,.16);
  border-color: rgba(14,165,233,.65);
  box-shadow: 0 10px 22px rgba(14,165,233,.14);
}

.wb-preview-controls{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin: 2px 0 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(2,6,23,.45);
}

.wb-editing-label{
  font-weight: 900;
  letter-spacing: .01em;
}

.wb-mini-toggle{
  display:flex;
  align-items:center;
  gap:8px;
  font-size: .78rem;
  font-weight: 800;
  opacity: .92;
}

.wb-mini-toggle input{ accent-color:#0ea5e9; width:18px; height:18px; }

/* Focus mode highlight */
.wb-item.is-selected{
  border-color: rgba(94,234,212,.5) !important;
  box-shadow: 0 10px 22px rgba(94,234,212,.12);
}

/* Extras */
.wb-extras{
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px dashed rgba(148,163,184,.28);
  background: rgba(2,6,23,.35);
}

.wb-extras-title{
  font-weight: 900;
  margin: 0 0 8px;
}

.wb-extras-grid{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 720px){
  .wb-extras-grid{ grid-template-columns: 1fr 1fr; }
}

/* Preview grouping */
.wb-preview-group{
  margin: 10px 0 14px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.35);
}

.wb-preview-grouphead{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:12px;
  margin-bottom: 8px;
}

.wb-preview-grouptitle{ font-weight: 900; }
.wb-preview-grouptime{ font-weight: 900; opacity:.9; }

.wb-preview-items{ display:grid; gap:10px; }

.wb-preview-line{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.wb-preview-label{ font-weight: 800; line-height:1.35; }
.wb-preview-mins{ margin-left:auto; white-space:nowrap; }

.wb-preview-link a{
  font-size: .72rem;
  word-break: break-all;
}

.wb-preview-details{
  font-size: .78rem;
  line-height: 1.45;
  opacity: .9;
  padding-left: 30px;
}

/* Modal */
.wb-modal-backdrop{
  position: fixed;
  inset: 0;
  display: none;              /* IMPORTANT */
  background: rgba(2,6,23,.65);
  backdrop-filter: blur(6px);
  z-index: 9998;
}

.wb-modal-backdrop.is-open{
  display: block;
}

.wb-modal{
  position: fixed;
  inset: 0;
  display: none;              /* IMPORTANT */
  place-items: center;
  z-index: 9999;
}

.wb-modal.is-open{
  display: grid;
}

.wb-modal-card{
  width: min(560px, 100%);
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.22);
  background: linear-gradient(180deg, rgba(10,25,47,.98), rgba(6,18,36,.98));
  box-shadow: 0 28px 70px rgba(2,6,23,.75);
  padding: 16px;
}

.wb-modal-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(148,163,184,.14);
}

.wb-modal-title{ font-weight: 900; }

.wb-modal-x{
  border: 1px solid rgba(148,163,184,.25);
  background: rgba(2,6,23,.35);
  color:#fff;
  border-radius: 12px;
  padding: 6px 10px;
  cursor:pointer;
  font-weight: 900;
}

.wb-modal-body{ padding: 12px 0 6px; }

.wb-modal-days{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

@media (min-width: 520px){
  .wb-modal-days{ grid-template-columns: 1fr 1fr; }
}

.wb-daypick{
  display:flex;
  align-items:center;
  gap:10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(2,6,23,.45);
  cursor:pointer;
  font-weight: 800;
}

.wb-daypick input{ width:18px; height:18px; accent-color:#0ea5e9; }
.wb-daypick input:disabled{ opacity:.5; cursor:not-allowed; }

.wb-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148,163,184,.14);
}

.ghost-btn.wb-primary{
  border-color: rgba(94,234,212,.55);
}
/* =========================================================
   STEP 2A.1 — VISUAL HIERARCHY (Category / Subcategory / Task)
   CSS-only, safe drop-in
========================================================= */

/* ---------- CATEGORY (top level) ---------- */
.wb-section.wb-category{
  border-radius: 18px;
  border: 1px solid rgba(148,163,184,.26);
  background: rgba(6,18,36,.78);
  box-shadow: 0 14px 34px rgba(2,6,23,.35);
}

.wb-section.wb-category > summary{
  position: relative;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(12,30,56,.98), rgba(8,22,42,.92));
  border-bottom: 1px solid rgba(148,163,184,.14);
}

.wb-section.wb-category > summary::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width: 6px;
  background: rgba(94,234,212,.65);
}

.wb-section.wb-category > summary .wb-sec-title{
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: .90rem;
  font-weight: 950;
}

.wb-section.wb-category > summary .wb-sec-badge{
  background: rgba(94,234,212,.14);
  border: 1px solid rgba(94,234,212,.35);
  font-weight: 900;
}

.wb-section.wb-category > summary .wb-sec-meta{
  opacity: .82;
  font-weight: 800;
}

/* Slightly “opened” glow */
.wb-section.wb-category[open] > summary{
  box-shadow: 0 12px 28px rgba(94,234,212,.10);
}

/* Category body spacing */
.wb-section.wb-category .wb-cat-body{
  padding: 14px 14px 16px;
  display: grid;
  gap: 12px;
}

/* ---------- SUBCATEGORY (nested) ---------- */
.wb-section[data-section]{
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.45);
}

.wb-section[data-section] > summary{
  position: relative;
  padding: 12px 14px;
  background: rgba(2,6,23,.40);
}

.wb-section[data-section] > summary::before{
  content:"";
  position:absolute;
  left:0;
  top:0;
  bottom:0;
  width: 4px;
  background: rgba(14,165,233,.55);
}

.wb-section[data-section] > summary .wb-sec-title{
  font-size: .86rem;
  font-weight: 950;
  letter-spacing: .02em;
}

/* Make subcategory meta/badge slightly quieter than category */
.wb-section[data-section] > summary .wb-sec-badge{
  background: rgba(148,163,184,.12);
  border: 1px solid rgba(148,163,184,.18);
}

.wb-section[data-section] > summary .wb-sec-meta{
  font-weight: 800;
  opacity: .72;
}

/* Subcategory actions look like a compact toolbar */
.wb-section[data-section] .wb-sec-actions{
  padding: 10px 14px 0;
  gap: 8px;
}

.wb-section[data-section] .wb-sec-toggle{
  border: 1px solid rgba(148,163,184,.22);
  background: rgba(2,6,23,.55);
}

.wb-section[data-section] .wb-sec-toggle:hover{
  border-color: rgba(14,165,233,.55);
}

/* ---------- TASK ROWS ---------- */
.wb-item-wrap{
  padding: 0;
}

.checkitem.wb-item,
.wb-item.checkitem{
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,.14);
  background: rgba(2,6,23,.52);
  transition: transform .10s ease, border-color .10s ease, background .10s ease;
}

.checkitem.wb-item:hover,
.wb-item.checkitem:hover{
  transform: translateY(-1px);
  border-color: rgba(148,163,184,.28);
  background: rgba(2,6,23,.62);
}

/* stronger label rhythm */
.wb-item-main{
  font-weight: 850;
  letter-spacing: .01em;
}

/* Print flag pill feel (still your control, just easier to scan) */
.wb-item-printflag{
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,.18);
  background: rgba(2,6,23,.45);
}

/* Your existing “focus mode” class, upgraded slightly */
.wb-item.is-selected{
  border-color: rgba(94,234,212,.55) !important;
  background: rgba(6,18,36,.62) !important;
  box-shadow: 0 12px 24px rgba(94,234,212,.10);
}

/* ---------- PREVIEW GROUPS (right panel hierarchy) ---------- */
.wb-preview-group{
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,.16);
  background: rgba(2,6,23,.45);
  padding: 12px 12px 10px;
  margin-bottom: 12px;
}

.wb-preview-grouphead{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(148,163,184,.12);
  margin-bottom: 10px;
}

.wb-preview-grouptitle{
  font-weight: 950;
  letter-spacing: .02em;
}

.wb-preview-grouptime{
  font-size: .78rem;
  font-weight: 900;
  opacity: .82;
}

.wb-preview-item{
  padding: 8px 8px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,.10);
  background: rgba(2,6,23,.35);
}

.wb-preview-item + .wb-preview-item{
  margin-top: 8px;
}



/* =========================================================
   STEP 2A.1 — Visual hierarchy + scanability (500k)
   - Category vs Subcategory vs Task separation
   - Task row chips + icons
   - Better focus/selected styling
========================================================= */

/* Category summary stronger */
.wb-category > summary.wb-cat-summary {
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 900;
  font-size: .82rem;
  opacity: .95;
  border-left: 3px solid rgba(120, 220, 255, .65);
  padding-left: 12px;
}

/* Subcategory summary */
.wb-section[data-section] > summary.wb-summary {
  font-weight: 800;
  font-size: .95rem;
  opacity: .98;
  border-left: 2px solid rgba(180, 255, 210, .45);
  padding-left: 12px;
}

/* Indent subcategory bodies */
.wb-sec-body {
  padding-left: 8px;
}

/* Task rows */
.wb-item-wrap {
  margin: 6px 0;
}
.wb-item {
  border: 1px solid rgba(255,255,255,.06);
  background: rgba(0,0,0,.16);
  border-radius: 10px;
  padding: 10px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wb-item:hover {
  border-color: rgba(120,220,255,.22);
  background: rgba(0,0,0,.22);
}
.wb-item.is-selected {
  border-color: rgba(120,220,255,.55);
  box-shadow: 0 0 0 1px rgba(120,220,255,.25);
}

/* Print chip */
.wb-item-printflag {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  padding: 4px 8px;
  border-radius: 999px;
}
.wb-item-printflag span{
  font-weight: 900;
  letter-spacing: .02em;
}

/* Preview weekly cards */
.wb-weekly {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.10);
}
.wb-weekly-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
.wb-weekly-title{
  margin: 0;
  font-size: 1rem;
  font-weight: 900;
}
.wb-weekly-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 980px){
  .wb-weekly-grid{ grid-template-columns: 1fr; }
}
.wb-week-daycard{
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
  background: rgba(0,0,0,.12);
  overflow:hidden;
}
.wb-week-dayhead{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 10px 12px;
  background: rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.wb-week-dayname{ font-weight: 900; }
.wb-week-daytime{ font-weight: 900; opacity:.9; }
.wb-week-daybody{ padding: 10px 12px; }
.wb-week-task{ margin-bottom: 10px; }
.wb-week-taskline{
  display:flex;
  align-items:center;
  gap:8px;
}
.wb-week-box{
  width: 12px;
  height: 12px;
  border: 2px solid rgba(255,255,255,.55);
  border-radius: 3px;
  flex: 0 0 auto;
}
.wb-week-taskname{ font-weight: 800; }
.wb-week-mins{ margin-left:auto; opacity:.85; font-weight: 800; }
.wb-week-link a{ font-size:.78rem; word-break: break-all; }
.wb-week-details{
  margin-top: 4px;
  font-size: .82rem;
  opacity: .95;
  line-height: 1.35;
}

/* Tiny icon spacing */
.wb-ic{ margin-left: 6px; opacity:.95; }

/* Modernize hero buttons slightly (keeps your theme) */
.wb-hero-actions .ghost-btn,
.wb-hero-toggles .ghost-btn{
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 900;
  letter-spacing: .01em;
}

.wb-print-header{display:none;}


/* ================================
   STEP 2A.1 — VISUAL HIERARCHY + ICONS
================================ */

.wb-summary.wb-cat-summary{
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.wb-section[data-section] .wb-summary{
  font-weight: 800;
}

.wb-item{
  align-items: center;
}

.wb-item-flag{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:22px;
  height:22px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.06);
  font-size: 12px;
  line-height: 1;
  margin-right: 8px;
}

.wb-flag-link{ }
.wb-flag-details{ }

/* Make hero buttons feel less 1994 */
.ghost-btn{
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.92);
  font-weight: 800;
  letter-spacing: .01em;
  padding: 8px 14px;
}
.ghost-btn:hover{ background: rgba(255,255,255,.10); }
.ghost-btn:active{ transform: translateY(1px); }

/* Keep preview card readable on wide screens */
.wb-grid{
  align-items: start;
}


