  .tree-section-label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) 0;
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-primary);
    margin-bottom: var(--space-2);
  }
  .tree-node {
    border: 0.5px solid transparent;
    border-radius: 12px;
    margin-bottom: 0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06), 0 1px 6px rgba(0,0,0,0.03);
    transition: box-shadow 150ms ease, border-color 150ms ease;
  }
  .tree-node:hover {
    box-shadow: 0 8px 30px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04);
    border-color: var(--black);
  }
  .tree-node-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    cursor: pointer;
    user-select: none;
  }
  .tree-node-header:hover { background: var(--gray-light); }
  .tree-toggle {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-tertiary);
    transition: transform 0.2s;
  }
  .tree-toggle.expanded { transform: rotate(90deg); }
  .tree-node-info { flex: 1; min-width: 0; }
  .tree-node-title {
    font-size: var(--text-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--black);
    line-height: 1.3;
  }
  .tree-node-meta {
    font-size: var(--text-xs);
    color: var(--text-tertiary);
    margin-top: 1px;
  }
  .tree-node-progress {
    font-size: var(--text-xs);
    color: var(--gray-dark);
    font-weight: var(--font-weight-medium);
    white-space: nowrap;
  }
  .tree-children {
    display: none;
    border-top: 1px solid var(--border-primary);
  }
  .tree-children.open { display: block; }
  .tree-kit {
    padding: var(--space-2) var(--space-4) var(--space-2) var(--space-8);
    border-bottom: 1px solid var(--border-primary);
  }
  .tree-kit:last-child { border-bottom: none; }
  .tree-kit-header {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    cursor: pointer;
    user-select: none;
  }
  .tree-kit-header:hover .tree-kit-title { color: var(--text-brand); }
  .tree-kit-title {
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--black);
    flex: 1;
    transition: color 0.15s;
  }
  .tree-kit-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    white-space: nowrap;
  }
  .tree-products {
    display: none;
    padding: var(--space-1) 0 var(--space-2) var(--space-5);
  }
  .tree-products.open { display: block; }
  .tree-product {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
  }
  .tree-product a {
    text-decoration: none;
    transition: color 0.15s;
  }
  .tree-product a:hover { text-decoration: underline; }
  .product-completed a { color: var(--text-success, #0f5132); }
  .product-in-progress a, .product-in_progress a { color: var(--fuchsia); font-weight: var(--font-weight-medium); }
  .product-not-started a, .product-not_started a { color: var(--black); }

  .tree-step-check {
    color: var(--text-success, #0f5132);
    flex-shrink: 0;
    margin-top: 1px;
  }
  .tree-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    font-size: var(--text-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
  }
  .tree-step-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-primary);
    flex-shrink: 0;
    margin-top: 6px;
  }
  .tree-step-content {
    flex: 1;
    min-width: 0;
  }
  .tree-step-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }
  .tree-step-row > a:first-child {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .tree-step-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-shrink: 0;
  }
  .tree-step-start {
    font-size: var(--text-sm);
    color: var(--fuchsia) !important;
    text-decoration: underline !important;
    white-space: nowrap;
  }
  .tree-step-start:hover {
    color: var(--fuchsia) !important;
  }
  .tree-step-menu-wrap {
    position: relative;
  }
  .tree-step-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    padding: 0;
  }
  .tree-step-menu-btn:hover {
    background: var(--bg-secondary);
  }
  .tree-step-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--white);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    min-width: 150px;
    z-index: 100;
    padding: var(--space-1) 0;
  }
  .tree-step-menu-wrap.open .tree-step-dropdown {
    display: block;
  }
  .tree-step-dropdown-item {
    display: block;
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-sm);
    color: var(--black) !important;
    text-decoration: none !important;
    white-space: nowrap;
  }
  .tree-step-dropdown-item:hover {
    background: var(--bg-secondary);
  }
  .tree-step-date {
    font-size: var(--text-xs);
    color: var(--text-secondary);
    margin-top: 2px;
  }
  .tree-step-locked {
    opacity: 0.45;
  }
  .tree-step-label-locked {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
  }

  .home-activity-page .activity-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .home-activity-page .tree-node-header {
    height: 80px;
    box-sizing: border-box;
  }

/* ============================================================
   My Work page chrome — shared by Files (work.html) and
   Projects (work_projects.html) tabs. Tokenized for theming.
   ============================================================ */

.mw-page {
  max-width: 1390px;
  margin: 0 auto;
  padding: 0 var(--space-6) 60px;
}

/* My Work pages now sit on a plain white surface (gradient removed
   per design). Kept as a single rule so /free + /explore (which also
   carry .mw-page) inherit the same clean backdrop; their own page
   overrides still apply if needed. */
body:has(.mw-page) {
  background: var(--white);
  min-height: 100vh;
}
.mw-page--detail { padding: 0 0 60px; }

.mw-h1-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--space-20) 0 0;
  gap: var(--space-4);
  min-height: 42px;
}
.mw-page--detail .mw-h1-row {
  margin: 20px 0 0;
  padding: 0 0 10px;
}

.mw-page-h1 {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--black);
  letter-spacing: -0.01em;
  margin: 0;
}

.mw-newchat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-lg);
  background: var(--black);
  color: var(--white);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 150ms ease;
}
.mw-newchat-btn:hover { opacity: 0.85; color: var(--white); }
.mw-newchat-btn .plus { font-size: var(--text-base); line-height: 1; }

/* Search bar — uses home-page classes (activity-search-bar + home-search-bar--hero
   + home-search-btn-pill). Local rules below only set the wrapping form element
   and a leading search icon; everything else inherits from the home tokens. */
.mw-search-form { margin: 24px 0 8px; }
.mw-search-form .activity-search-bar { width: 100%; max-width: none; }
.mw-pd .mw-search-form .activity-search-bar {
  min-height: 150px;
  border-color: var(--gray-light);
  background: var(--white);
  align-items: flex-start;
  padding-top: calc(var(--space-4) + 10px);
  position: relative;
}
.mw-attach-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--black);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.mw-attach-status {
  margin-left: 10px;
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 300;
}
.mw-attach-status.ok { color: var(--black); }
.mw-attach-status.err { color: #d00; }
.mw-pd .mw-search-form .activity-search-input {
  color: var(--black);
  font-weight: 400;
}
.mw-pd .mw-search-form .activity-search-input::placeholder {
  color: var(--gray-dark);
  font-weight: 400;
}
.mw-chat { margin: 40px 0; }
.mw-chat-card {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--gray-light);
  border-radius: 16px;
  padding: var(--space-4) var(--space-5);
  gap: var(--space-3);
  min-height: 150px;
}
.mw-chat-messages {
  display: flex; flex-direction: column; gap: var(--space-3);
  max-height: 480px; overflow-y: auto;
}
.mw-chat-messages:empty { display: none; }
.mw-chat-msg {
  font-size: 15px;
  line-height: 1.5;
  color: var(--black);
  font-weight: 400;
  word-wrap: break-word;
  max-width: 90%;
}
.mw-chat-msg--user {
  align-self: flex-end;
  background: var(--gray-background);
  padding: 12px 20px;
  border-radius: 20px;
  width: fit-content;
}
.mw-chat-msg--assistant {
  align-self: flex-start;
  background: transparent;
  padding: 8px 0;
  line-height: 1.6;
}
.mw-chat-msg.pending { color: var(--gray-mid); font-style: italic; }
.mw-chat-msg.err { color: #d00; }
.mw-chat-msg a { color: var(--black); text-decoration: underline; }
.mw-chat-textarea {
  resize: none;
  overflow-y: auto;
  min-height: 24px;
  max-height: 280px;
  line-height: 1.4;
  font-size: 15px;
  font-family: inherit;
  font-weight: 400;
  color: var(--black);
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  padding: 6px 8px;
  display: block;
}
.mw-chat-textarea::placeholder { color: var(--gray-mid); font-weight: 400; }
.mw-chat-bar {
  position: relative;
  display: flex; align-items: center; justify-content: flex-end;
  min-height: 32px;
  margin-top: auto;
}
.mw-search-form .mw-search-icon {
  display: flex;
  align-items: center;
  color: var(--gray-mid);
  flex-shrink: 0;
  padding-right: var(--space-1);
}
.mw-search-form .mw-search-icon svg {
  width: 19px; height: 19px;
  stroke: currentColor; fill: none; stroke-width: 1.8;
}

/* Tabs row: home-page mega-trigger style (uppercase, transparent, left-aligned).
   Everything (H1, FILES tab, info row) aligns to the page left edge. */
.mw-page .home-pills-row {
  margin: var(--space-1) auto var(--space-2);
  padding: 0;
  width: 1310px;
  max-width: 1310px;
}
.mw-page .home-pills-row .home-search-row-inner {
  padding: 0;
  width: 100%;
  max-width: 1310px;
  margin: 0;
}
.mw-page .home-mega-bar { gap: var(--space-1); max-width: 1310px; }
.mw-page .home-filter-bar--hero .home-mega-trigger {
  position: relative;
  text-decoration: none;
  border: none;
  border-radius: 0;
  padding-left: 10px;
  padding-right: 10px;
  padding-bottom: 5px;
}
.mw-page .home-filter-bar--hero .home-mega-trigger::after {
  content: "";
  position: absolute;
  left: 10px; right: 10px; bottom: 0;
  height: 2px;
  background: transparent;
}
.mw-page .home-filter-bar--hero .home-mega-trigger.active { color: var(--black); }
.mw-page .home-filter-bar--hero .home-mega-trigger.active::after { background: var(--black); }

/* ============================================================
   Projects tab — grid of project cards (work_projects.html).
   ============================================================ */

.mw-projbar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  width: 1360px;
  max-width: 1360px;
  margin-left: calc((100% - 1400px) / 2 + 10px);
  margin-right: auto;
  padding: 0 var(--space-6) var(--space-3) 47px;
  box-sizing: border-box;
  font-size: var(--text-sm);
  color: var(--gray-mid);
}

/* Right-aligned actions on the tabs row (Show archived + Sort by) */
.mw-pills-row--with-actions {
  display: flex;
  align-items: center;
}
.mw-pills-row--with-actions .home-search-row-inner {
  flex: 1 1 auto;
  min-width: 0;
}
.mw-pills-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-right: 8px;
  flex-shrink: 0;
  margin-left: auto;
}
.mw-projbar-left { flex: 1 1 auto; min-width: 0; }

.mw-projarch-toggle {
  background: none;
  border: 0;
  padding: 4px 6px;
  margin: 0;
  font-family: inherit;
  font-size: var(--text-xs);
  color: var(--gray-mid);
  cursor: pointer;
  border-radius: var(--radius-sm, 6px);
  transition: color 120ms ease;
}
.mw-projarch-toggle:hover { color: var(--black); }
.mw-projarch-toggle[aria-pressed="true"] { color: var(--black); font-weight: var(--font-weight-medium); }

.mw-projsort {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-8) 0 var(--space-4);
  min-height: 40px;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-dark);
  font-size: var(--text-sm);
  font-family: inherit;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}
.mw-projsort:hover { border-color: var(--black); color: var(--black); }
.mw-projsort-label { color: var(--gray-mid); }
/* Native select sits invisibly over the label so only "Sort by" + caret show,
   while the full control remains clickable to open the system menu. */
.mw-projsort-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: transparent;
  cursor: pointer;
  outline: none;
  opacity: 0;
}
.mw-projsort-caret {
  position: absolute;
  right: 10px;
  top: 50%;
  width: 14px;
  height: 14px;
  transform: translateY(-50%);
  pointer-events: none;
  color: currentColor;
}

.mw-projgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  margin-top: 60px;
  padding-left: var(--space-6);
  padding-right: var(--space-6);
  box-sizing: border-box;
}
.mw-projcard {
  position: relative;
  background: var(--white);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  height: 160px;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.mw-projcard:hover {
  border-color: var(--black);
  box-shadow: var(--shadow-sm);
}
.mw-projcard-link {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  padding: 18px var(--space-5);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.mw-projcard-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-right: var(--space-8);
}
.mw-projcard-name {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  color: var(--black);
}
.mw-projcard-badge {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px var(--space-2);
  border-radius: var(--radius-full, 999px);
  font-weight: var(--font-weight-semibold);
}
.mw-projcard-badge.kit { background: var(--bg-info, #e8f4ff); color: var(--text-info, #0066cc); }
.mw-projcard-badge.program { background: var(--bg-warning, #fff3e0); color: var(--text-warning, #b8651a); }
.mw-projcard-badge.manual { background: var(--gray-light); color: var(--gray-dark); }
.mw-projcard-meta {
  font-size: var(--text-xs);
  color: var(--gray-mid);
  display: flex;
  gap: var(--space-3);
}

/* Per-card pin toggle: hover-revealed; always visible when pinned (mirrors .mw-frow-star) */
.mw-projcard-pin {
  position: absolute;
  top: var(--space-3);
  right: 44px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0;
  border-radius: var(--radius-sm);
  color: var(--gray-mid);
  cursor: pointer;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease, color 120ms ease;
}
.mw-projcard-pin svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}
.mw-projcard:hover .mw-projcard-pin {
  opacity: 1;
  visibility: visible;
}
.mw-projcard-pin:hover { color: var(--black); }
.mw-projcard-pin.is-pinned {
  opacity: 1;
  visibility: visible;
  color: var(--black);
}
.mw-projcard-pin.is-pinned svg { fill: var(--black); }

/* 3-dot menu button */
.mw-projcard-menu-btn {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--gray-mid);
  cursor: pointer;
  padding: 0;
  z-index: 2;
}
.mw-projcard-menu-btn:hover {
  background: var(--bg-hover);
  color: var(--black);
}

/* Dropdown menu (one per card, absolutely positioned in card) */
.mw-projmenu {
  position: absolute;
  top: 44px;
  right: var(--space-3);
  z-index: 9000;
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
  display: none;
}
.mw-projmenu.open { display: block; }
.mw-projmenu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--black);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.mw-projmenu-item:hover { background: var(--bg-hover); }
.mw-projmenu-item svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--gray-mid); }
.mw-projmenu-item.is-danger { color: var(--negative); }
.mw-projmenu-item.is-danger svg { color: var(--negative); }
.mw-projmenu-divider {
  height: 1px;
  background: var(--gray-light);
  margin: var(--space-2) var(--space-2);
}

/* Edit-details modal */
.mw-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 9100;
  display: none;
  align-items: center;
  justify-content: center;
}
.mw-modal-overlay.open { display: flex; }
.mw-modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  width: 560px;
  max-width: 92vw;
  box-shadow: var(--shadow-xl);
}
.mw-modal-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--space-5) 0;
  color: var(--black);
}
.mw-modal-field { margin-bottom: var(--space-4); }
.mw-modal-label {
  display: block;
  font-size: var(--text-sm);
  color: var(--gray-dark);
  margin-bottom: var(--space-2);
}
.mw-modal-required { color: var(--negative); }
.mw-modal-input,
.mw-modal-textarea {
  width: 100%;
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  font-family: inherit;
  color: var(--black);
  background: var(--white);
  box-sizing: border-box;
}
.mw-modal-input:focus,
.mw-modal-textarea:focus {
  outline: none;
  border-color: var(--gray-dark);
}
.mw-modal-textarea { min-height: 180px; resize: vertical; }
.mw-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}
.mw-modal-btn {
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  font-family: inherit;
  min-height: 40px;
}
.mw-modal-btn--cancel {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--border-primary);
}
.mw-modal-btn--cancel:hover { border-color: var(--black); }
.mw-modal-btn--save {
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
}
.mw-modal-btn--save:hover { opacity: 0.9; }

.mw-projects-empty {
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--gray-mid);
  font-size: var(--text-sm);
  border: 1px dashed var(--border-primary);
  border-radius: var(--radius-lg);
  margin-top: var(--space-3);
}
.mw-projects-empty a {
  color: var(--text-brand);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}



/* ============================================================
   Files tab (work.html) — moved from inline <style> so styles
   persist across AJAX tab swaps. Tokenized.
   ============================================================ */

/* Container fitments for the home-cards used by My Work */
.mw-page .home-cards-container {
  max-width: 100%;
  padding: var(--space-3) 0;
  box-shadow: none;
  max-height: none;
}
.mw-page .home-search-section {
  width: 1310px;
  max-width: 1310px;
  margin-left: auto;
  margin-right: auto;
  padding-right: 0;
  box-sizing: border-box;
}

/* File rows: flush, no per-side borders, single 0.75px hairline divider */
.mw-page .home-popular-list {
  padding-left: 0;
  margin-left: 0;
  gap: 0;
  row-gap: 0;
}
.mw-page #mwFileList { gap: 0; row-gap: 0; }
.mw-page .home-popular-list .activity-item {
  position: relative;
  padding-left: 20px;
  margin-top: 0;
  margin-bottom: 0;
  border-left: none;
  border-right: none;
  border-bottom: none;
}
.mw-page .home-popular-list .activity-item::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 0;
  bottom: 0;
  height: 0.75px;
  background: var(--gray-light);
}
.mw-page .home-popular-list .activity-item:first-child { border-top: none; }
.mw-page .home-popular-list .activity-item:first-child::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 0;
  top: 0;
  height: 0.75px;
  background: var(--gray-light);
}

.mw-page .home-list-col .home-popular-list,
.mw-page .home-list-col .home-search-results {
  height: auto;
  max-height: none;
  overflow: visible;
}
.mw-page .home-activity-page .activity-columns {
  grid-template-columns: minmax(0, 1fr) 524px;
}
.mw-page .home-right-col .activity-preview-panel {
  height: 300px;
  max-height: 300px;
  border-bottom: 0.75px solid var(--gray-light);
}
.mw-page .home-right-col {
  align-self: start;
  position: sticky;
  top: calc(var(--navbar-height) + var(--space-4));
  z-index: 5;
}
.mw-page .home-right-row1 { position: static; }

/* Info row under the tabs (Claude-style "Your Renatus files Select" / "# selected …") */
.mw-info-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 0 20px;
  width: 1310px;
  max-width: 1310px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  min-height: 36px;
  font-size: var(--text-sm);
  color: var(--gray-mid);
}
.mw-info-row .mw-info-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--space-6);
}
.mw-info-row .mw-info-left > *,
.mw-info-row .mw-info-actions > * {
  line-height: var(--space-6);
  display: inline-flex;
  align-items: center;
}
.mw-info-row .mw-info-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.mw-info-row #mwBulkCount { margin-right: 4px; }
.mw-page.is-selecting .mw-info-default { display: none; }
.mw-page:not(.is-selecting) .mw-info-selecting { display: none; }

.mw-select-link {
  background: none;
  border: 0;
  padding: 0;
  margin-left: 6px;
  color: var(--fuchsia);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-light);
  cursor: pointer;
  text-decoration: none;
}
.mw-select-link:hover { text-decoration: underline; }

.mw-select-all-box {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--space-4);
  height: var(--space-4);
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease;
}
/* Custom checkbox: outlined box, black tick, no fill on check */
.mw-select-all-box,
.mw-frow-check {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: 1.5px solid var(--gray-mid);
  border-radius: 3px;
}
.mw-frow-check { position: absolute; }
.mw-select-all-box:checked,
.mw-frow-check:checked {
  background: transparent;
  border-color: var(--black);
}
.mw-select-all-box:checked::after,
.mw-frow-check:checked::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--space-1);
  height: var(--space-2);
  border: solid var(--black);
  border-width: 0 2px 2px 0;
  transform: translate(-50%, -60%) rotate(45deg);
}
.mw-info-row:hover .mw-select-all-box {
  opacity: 1;
  visibility: visible;
}

.mw-info-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: var(--space-3);
}
.mw-info-icon-btn {
  background: none;
  border: 0;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  color: var(--gray-mid);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mw-info-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--black);
}
.mw-info-icon-btn svg {
  width: var(--space-4);
  height: var(--space-4);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
}
.mw-info-icon-btn.danger:hover { color: var(--negative); }
.mw-info-close { margin-left: auto; }

.mw-empty {
  padding: var(--space-12) var(--space-6);
  text-align: center;
  color: var(--gray-mid);
  font-size: var(--text-sm);
}
.mw-empty a {
  color: var(--insights-primary);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}

/* Local card-menu dropdown for our row actions */
.mw-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-1));
  background: var(--white);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  z-index: 50;
  padding: 6px;
}
.explore-card-menu-wrap.open .mw-menu-dropdown { display: block; }
.mw-page .mw-frow .explore-card-menu-trigger {
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease;
}
.mw-page .mw-frow:hover .explore-card-menu-trigger,
.mw-page .mw-frow .explore-card-menu-wrap.open .explore-card-menu-trigger {
  opacity: 1;
  visibility: visible;
}
.mw-menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--black);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: 0;
  width: 100%;
  text-align: left;
  font-family: inherit;
  border-radius: var(--radius-md);
}
.mw-menu-item svg {
  width: var(--space-4);
  height: var(--space-4);
  flex-shrink: 0;
}
.mw-menu-item:hover { background: var(--bg-hover); }
.mw-menu-item.danger { color: var(--negative); }
.mw-menu-divider {
  height: 1px;
  background: var(--gray-light);
  margin: 6px var(--space-1);
}

/* Standard centered modal */
.mw-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}
.mw-modal-overlay.open { display: flex; }
.mw-modal-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 440px;
  max-width: calc(100% - var(--space-8));
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.mw-modal-title {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--black);
  margin: 0;
}
.mw-modal-label {
  font-size: var(--text-xs);
  color: var(--gray-mid);
  margin-bottom: 6px;
  display: block;
}
.mw-modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--black);
  background: var(--white);
  border: 1px solid var(--border-primary);
  border-radius: var(--radius-md);
  font-family: inherit;
  outline: none;
}
.mw-modal-input:focus { border-color: var(--black); }
.mw-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
}

/* Confirm modal — title + body + right-aligned actions */
.mw-modal-card.mw-confirm-card {
  width: 480px;
  padding: 28px 28px 22px;
  gap: var(--space-3);
}
.mw-modal-card.mw-confirm-card .mw-modal-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
}
.mw-confirm-body {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--gray-dark);
}
.mw-modal-card.mw-confirm-card .mw-modal-actions { margin-top: var(--space-2); }

/* Description paragraph used inside .mw-modal-card. */
.mw-modal-desc {
  margin: var(--space-1) 0 var(--space-4);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}

/* Move-to-project modal (larger, search + list) */
.mw-modal-card.mw-move-card {
  width: 560px;
  padding: 28px;
  gap: 14px;
  position: relative;
}
.mw-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 0;
  padding: 0;
  color: var(--gray-mid);
  cursor: pointer;
  border-radius: 6px;
}
.mw-modal-close:hover {
  background: var(--bg-hover);
  color: var(--black);
}
.mw-modal-subtitle {
  font-size: var(--text-sm);
  color: var(--gray-mid);
  margin: 0;
  line-height: 1.45;
}
.mw-modal-subtitle b {
  color: var(--black);
  font-weight: var(--font-weight-semibold);
}
.mw-move-list-wrap {
  border: 1px solid var(--border-primary);
  border-radius: 14px;
  background: var(--white);
  overflow: hidden;
}
.mw-move-search-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) 14px;
  border-bottom: 1px solid var(--gray-light);
}
.mw-move-search-row svg {
  width: 18px;
  height: 18px;
  color: var(--gray-mid);
  flex-shrink: 0;
}
.mw-move-search {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: var(--text-sm);
  font-family: inherit;
  color: var(--black);
}
.mw-move-search::placeholder { color: var(--gray-mid); }
.mw-move-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
}
.mw-move-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: none;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-size: var(--text-sm);
  color: var(--black);
  font-family: inherit;
}
.mw-move-item:hover,
.mw-move-item.active { background: var(--bg-hover); }
.mw-move-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--gray-dark);
}
.mw-move-item.create { color: var(--fuchsia); }
.mw-move-item.create svg { color: var(--fuchsia); }
.mw-move-empty {
  padding: var(--space-6) 14px;
  text-align: center;
  font-size: var(--text-xs);
  color: var(--gray-mid);
}

.mw-inprog {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: var(--space-2);
  vertical-align: middle;
}
.mw-inprog .dot {
  width: 5px;
  height: 5px;
  border-radius: var(--radius-full);
  background: var(--fuchsia);
  animation: mwPulse 1.4s ease-in-out infinite;
}
.mw-inprog .dot:nth-child(2) { animation-delay: 0.2s; }
@keyframes mwPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

.ep-snippet-item {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--black);
}
.ep-snippet-num {
  font-weight: var(--font-weight-semibold);
  color: var(--gray-mid);
  flex-shrink: 0;
  min-width: 18px;
}
.ep-snippet-text { flex: 1; }

.mw-page .ep-bottom-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.ep-bottom-stat {
  border: 1.5px solid var(--black);
  border-radius: var(--radius-md);
  padding: var(--space-3) 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ep-bottom-stat-label {
  font-size: var(--text-xs);
  color: var(--gray-dark);
  line-height: 1.35;
}
.ep-bottom-stat-value {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-bold);
  line-height: 1.15;
  color: var(--black);
  letter-spacing: -0.01em;
}

.ep-credits { padding-top: 14px; }
.ep-credits-grid {
  display: flex;
  gap: var(--space-3);
}
.ep-credits-grid > * { flex: 1; }

/* Preview CTAs (used by JS-rendered preview content) */
.mw-preview-cta-primary,
.mw-preview-cta-secondary {
  display: block;
  text-align: center;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
}
.mw-preview-cta-primary {
  background: var(--black);
  color: var(--white);
}
.mw-preview-cta-secondary {
  background: var(--white);
  color: var(--black);
  border: 1px solid var(--border-primary);
}

/* Keep the home-page 500px fixed height so the absolutely-positioned
   ep-credits + ep-bottom-stats anchor inside the section (don't overflow). */
.home-activity-page .activity-preview-section { overflow: hidden; }

/* Empty state in the preview before any hover */
.ep-empty {
  padding: var(--space-10) var(--space-6);
  text-align: center;
  color: var(--gray-mid);
  font-size: var(--text-xs);
  border: 1px dashed var(--border-primary);
  border-radius: var(--radius-lg);
}

/* Selection checkboxes — hidden by default, only shown in select mode */
.home-popular-list .activity-item.mw-frow { position: relative; }
.mw-frow-check {
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: var(--space-4);
  height: var(--space-4);
  cursor: pointer;
  opacity: 1;
  margin: 0;
  flex-shrink: 0;
  z-index: 2;
  accent-color: var(--black);
  display: none;
}
.mw-page.is-selecting .mw-frow-check { display: block; }
.home-popular-list .activity-item.mw-frow.selected { background: var(--bg-hover); }

/* Step number badge — used in kit in-project view to show sequential step order */
.mw-frow-num {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gray-light);
  color: var(--black);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  margin-right: 12px;
  user-select: none;
}
.mw-frow-num--empty {
  background: transparent;
  color: var(--gray-mid);
  font-weight: 400;
}
/* In select mode, the leading checkbox slides in over the row's left edge —
   nudge the step number right so they don't collide. */
.mw-page.is-selecting .mw-frow-num { margin-left: 24px; }

/* Tighten preview tag + title spacing */
.mw-page .activity-preview-tag { margin-bottom: 2px; }
.mw-page .activity-preview-title {
  margin-top: 0;
  margin-bottom: 14px;
  line-height: 1.25;
  min-height: 50px;
  display: flex;
  align-items: flex-start;
}
.mw-page .activity-preview-combined { gap: 0; }

/* In-progress preview state */
.mw-inprog-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-3);
  padding: 18px var(--space-5);
  box-sizing: border-box;
}
.mw-inprog-state .mw-inprog-headline {
  font-size: var(--text-sm);
  color: var(--gray-dark);
  line-height: 1.5;
  font-weight: var(--font-weight-normal);
  margin: 0;
  max-width: 340px;
}
.mw-inprog-state .mw-inprog-action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px var(--space-1);
  background: transparent;
  border: 0;
  color: var(--fuchsia);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  cursor: pointer;
}
.mw-inprog-state .mw-inprog-action .mw-inprog-label { line-height: 1; }
.mw-inprog-state .mw-inprog-dots {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}
.mw-inprog-state .mw-inprog-dots span {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--fuchsia);
  animation: mwInprogDot 1.2s infinite ease-in-out both;
}
.mw-inprog-state .mw-inprog-dots span:nth-child(2) { animation-delay: 0.15s; }
.mw-inprog-state .mw-inprog-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes mwInprogDot {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}
.mw-inprog-state .mw-inprog-action:hover .mw-inprog-label { text-decoration: underline; }

/* Truncate the preview standfirst at 7 lines */
.mw-page #ep-description {
  display: -webkit-box;
  -webkit-line-clamp: 7;
  line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Per-row star toggle: hover-revealed; always visible when starred */
.mw-frow-star {
  background: none;
  border: 0;
  padding: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-mid);
  border-radius: 6px;
  flex-shrink: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 120ms ease, color 120ms ease;
}
.mw-frow-star svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}
.mw-page .mw-frow:hover .mw-frow-star {
  opacity: 1;
  visibility: visible;
}
.mw-frow-star:hover { color: var(--black); }
.mw-frow-star.is-starred {
  opacity: 1;
  visibility: visible;
  color: var(--black);
}
.mw-frow-star.is-starred svg { fill: var(--black); }

/* ---------- Project detail page (work_project.html) ---------- */
.mw-back {
  display: inline-flex; align-items: center; gap: var(--space-1);
  color: var(--text-secondary); text-decoration: none;
  font-size: var(--text-sm); margin: var(--space-10) 0 0;
}
.mw-back:hover { color: var(--black); }
.mw-back + .mw-h1-row { margin-top: var(--space-5); }

.mw-h1-row .badge {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 10px; border-radius: 999px; font-weight: 600;
  background: var(--gray-background); color: var(--text-secondary);
}
.mw-h1-row .badge.kit { background: #e8f4ff; color: #0066cc; }
.mw-h1-row .badge.program { background: #fff3e0; color: #b8651a; }

.mw-h1-actions {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}
.mw-h1-actions .mw-h1-menu-trigger {
  padding: 6px;
  border-radius: var(--radius-sm);
  color: var(--gray-mid);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.mw-h1-actions .mw-h1-menu-trigger:hover {
  background: var(--gray-light);
  color: var(--black);
}
.mw-h1-actions .explore-card-menu-wrap.open .mw-h1-menu-trigger {
  background: var(--gray-light);
  color: var(--black);
}

.mw-pd {
  display: grid; grid-template-columns: 65% 35%;
  gap: var(--space-10); align-items: start;
  padding: 30px 0 var(--space-10);
}
.mw-pd > aside { padding-top: 32px; }

.mw-listhdr {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-1) 0 var(--space-2);
  border-bottom: 1px solid var(--gray-light);
}
.mw-listhdr h3 {
  font-size: var(--text-sm); font-weight: 600; margin: 0;
  color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em;
}
.mw-listhdr h3 .count { color: var(--text-tertiary); font-weight: 400; margin-left: var(--space-2); }
.mw-listhdr-actions { display: flex; gap: var(--space-2); align-items: center; }

.mw-icon-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm);
  border: 0; background: transparent; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.mw-icon-btn:hover { background: var(--gray-light); }
.mw-icon-btn svg { width: 16px; height: 16px; stroke: var(--text-secondary); fill: none; stroke-width: 1.7; }

.mw-sort-btn {
  background: none; border: 0; font-size: var(--text-xs);
  color: var(--text-secondary); cursor: pointer;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
  font-family: inherit;
}
.mw-sort-btn:hover { background: var(--gray-light); }

.mw-frow {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) 16px;
  margin: 0 calc(var(--space-3) * -1);
  border-bottom: 1px solid var(--gray-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 120ms ease;
  text-decoration: none; color: inherit;
}
.mw-frow:hover { background: #E2E2E2; }
.mw-frow-body { flex: 1; min-width: 0; }
.mw-frow-label {
  font-size: var(--text-xs); color: var(--text-tertiary);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: var(--space-1);
}
.mw-frow-sep { color: var(--gray-placeholder); margin: 0 var(--space-1); }
.mw-frow-title { font-size: var(--text-sm); color: var(--black); font-weight: 500; }
.mw-frow-meta { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }
.mw-frow-actions { display: flex; gap: var(--space-2); opacity: 0.6; align-items: center; }
.mw-frow:hover .mw-frow-actions { opacity: 1; }

.mw-inprog {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: var(--space-2); vertical-align: middle;
}
.mw-inprog .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--fuchsia); animation: mwPulse 1.4s ease-in-out infinite;
}
.mw-inprog .dot:nth-child(2) { animation-delay: 0.2s; }
@keyframes mwPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

.mw-panel {
  background: transparent; border: 1px solid var(--gray-light);
  border-radius: var(--radius-md); padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-3);
}
.mw-panel--grouped { padding: 0; }
.mw-panel--grouped .mw-panel-section { padding: var(--space-5); }
.mw-panel--grouped .mw-panel-section + .mw-panel-section {
  border-top: 1px solid var(--gray-light);
}
.mw-panel-foot--spaced { margin-top: var(--space-2); }
.mw-file-upload-hidden { display: none; }
.mw-pf-list { display: flex; flex-direction: column; }
.mw-pf-row .mw-pf-del {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: none; color: var(--gray-dark);
  cursor: pointer; padding: 0; border-radius: var(--radius-sm);
  opacity: 0; visibility: hidden; transition: opacity 120ms ease;
}
.mw-pf-row:hover .mw-pf-del { opacity: 1; visibility: visible; }
.mw-pf-row .mw-pf-del:hover { background: var(--gray-light); color: var(--black); }
.mw-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-2);
}
.mw-panel-head h4 { font-size: var(--text-sm); font-weight: 600; margin: 0; color: var(--black); }
.mw-panel-head .badge-only {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-tertiary); background: var(--gray-background);
  padding: 3px 8px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: var(--space-1);
}
.mw-panel-head .edit {
  font-size: var(--text-xs); color: var(--black); cursor: pointer;
  text-decoration: none; background: none; border: 0; padding: 0; font-family: inherit;
  display: inline-flex; align-items: center;
}
.mw-panel-body {
  font-size: var(--text-sm); color: var(--black); font-weight: 300; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word;
}
.mw-panel-body[contenteditable="true"] {
  outline: 2px solid #0066cc; padding: var(--space-2);
  border-radius: var(--radius-sm); background: #fafdff;
}
.mw-panel-body.empty { color: var(--black); font-style: normal; font-weight: 300; }
.mw-panel-foot { font-size: var(--text-xs); color: var(--gray-500); margin-top: var(--space-2); }

.mw-files-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-2);
}
.mw-files-panel-head h4 { font-size: var(--text-sm); font-weight: 600; margin: 0; color: var(--black); }
.mw-files-panel-head .add {
  font-size: var(--text-lg); color: var(--text-secondary); cursor: pointer;
  background: none; border: 0; padding: var(--space-1) var(--space-2);
}

.mw-fim-expand {
  margin-top: var(--space-3); border-top: 1px solid var(--gray-light); padding-top: var(--space-2);
}
.mw-fim-expand summary {
  list-style: none; cursor: pointer; display: flex;
  align-items: center; justify-content: space-between;
  font-size: var(--text-xs); color: #0066cc; font-weight: 500; padding: var(--space-1) 0;
}
.mw-fim-expand summary::-webkit-details-marker { display: none; }
.mw-fim-expand summary .chev { transition: transform 0.15s; font-size: 10px; }
.mw-fim-expand[open] summary .chev { transform: rotate(180deg); }
.mw-fim-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3); margin-top: var(--space-3);
}
.mw-fim-tile {
  position: relative;
  border: 1px solid var(--gray-light); border-radius: var(--radius-lg);
  background: var(--white);
  width: 100%; aspect-ratio: 1 / 1;
  padding: var(--space-3);
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  min-width: 0;
}
.mw-fim-tile-name {
  font-size: var(--text-xs); font-weight: 500; color: var(--black);
  line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; word-break: break-word;
}
.mw-fim-tile-ext {
  position: absolute; bottom: 6px; left: 6px;
  font-size: 9px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--black);
  background: var(--white);
  padding: 1px 5px; border-radius: var(--radius-xs);
  border: 1px solid var(--gray-light);
}
.mw-fim-tile-menu {
  position: absolute; top: var(--space-1); right: var(--space-1);
  z-index: 2;
}
.mw-fim-tile-menu .explore-card-menu-trigger {
  color: var(--gray-dark);
}
.mw-fim-tile-menu .explore-card-menu-trigger:hover {
  color: var(--black);
}

.mw-empty {
  padding: var(--space-8) var(--space-6); text-align: center;
  color: var(--text-tertiary); font-size: var(--text-sm);
  border: 1px dashed var(--gray-light); border-radius: var(--radius-md);
  margin-top: var(--space-3);
}

.mw-toast {
  position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%);
  background: var(--black); color: var(--white);
  padding: var(--space-2) var(--space-5); border-radius: var(--radius-sm);
  font-size: var(--text-sm); opacity: 0; transition: opacity 0.2s;
  pointer-events: none; z-index: 200;
}
.mw-toast.show { opacity: 1; }

body:has(.mw-page) .main-content,
body:has(.mw-page) .page-content {
  background: transparent;
}

/* Preview card: drop the white fill so the gradient shows through,
   then darken slightly on hover for visual feedback. */
.mw-page .activity-preview-section {
  background: transparent;
  box-shadow: none;
}
.mw-page .activity-preview-section:hover {
  background: #E2E2E2;
}


/* ===== Kit in-project view: numbered cards strip + preview pane ===== */

.mw-page--kit .mw-pd { /* same 2-col layout as work_project */ }

.mw-kit-progress {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: var(--space-3) 0 var(--space-4);
}
.mw-kit-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  flex-wrap: wrap;
}
.mw-kit-progress-meta strong { color: var(--black); font-weight: var(--font-weight-semibold); }
.mw-kit-progress-now { color: var(--text-tertiary); font-size: var(--text-xs); }
.mw-kit-progress-done { color: var(--success, #18794e); font-weight: var(--font-weight-semibold); }
.mw-kit-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--border-primary);
  border-radius: 999px;
  overflow: hidden;
}
.mw-kit-progress-bar > span {
  display: block;
  height: 100%;
  background: var(--black);
  transition: width 240ms ease;
}

.mw-kit-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.mw-kit-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding: var(--space-4);
  border: 1px solid var(--border-primary);
  border-radius: 14px;
  background: var(--bg-primary, #fff);
  cursor: pointer;
  transition: box-shadow 150ms ease, border-color 150ms ease, transform 150ms ease, background 150ms ease;
  outline: none;
  min-height: 132px;
}
.mw-kit-card:hover {
  border-color: var(--black);
  box-shadow: 0 6px 22px rgba(0,0,0,0.08);
}
.mw-kit-card:focus-visible {
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.1);
}

.mw-kit-card-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-light, #f3f3f0);
  color: var(--text-tertiary);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  border: 1px solid var(--border-primary);
}
.mw-kit-card-num svg { width: 18px; height: 18px; }
.mw-kit-card-body { display: flex; flex-direction: column; gap: 2px; }
.mw-kit-card-title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--black);
  line-height: 1.3;
}
.mw-kit-card-status {
  font-size: var(--text-xs);
  color: var(--text-tertiary);
  line-height: 1.3;
}

/* Active state — current step */
.mw-kit-card.is-active {
  border-color: var(--black);
  background: var(--bg-primary, #fff);
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}
.mw-kit-card.is-active .mw-kit-card-num {
  background: var(--black);
  color: #fff;
  border-color: var(--black);
}
.mw-kit-card.is-active .mw-kit-card-status {
  color: var(--black);
  font-weight: var(--font-weight-semibold);
}

/* Complete state — done, click to revisit */
.mw-kit-card.is-complete .mw-kit-card-num {
  background: var(--success, #18794e);
  color: #fff;
  border-color: var(--success, #18794e);
}
.mw-kit-card.is-complete .mw-kit-card-status { color: var(--success, #18794e); }

/* Locked state — sequential gating */
.mw-kit-card.is-locked {
  cursor: not-allowed;
  background: var(--gray-light, #f7f7f5);
  opacity: 0.65;
}
.mw-kit-card.is-locked:hover {
  border-color: var(--border-primary);
  box-shadow: none;
}
.mw-kit-card.is-locked .mw-kit-card-num {
  background: transparent;
  color: var(--text-tertiary);
}
.mw-kit-card.is-locked .mw-kit-card-title { color: var(--text-tertiary); }

/* Preview pane sits below the cards strip, full width of the left column. */
.mw-kit-preview {
  margin-top: var(--space-2);
  margin-bottom: var(--space-6);
}
.mw-kit-preview .activity-preview-panel {
  border: 1px solid var(--border-primary);
  border-radius: 14px;
  background: var(--bg-primary, #fff);
  padding: var(--space-5);
  min-height: 180px;
}
.mw-kit-preview .ep-empty {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.mw-kit-empty {
  grid-column: 1 / -1;
}

/* Preview pane lives at the top of the right aside in kit view. */
.mw-page--kit aside .mw-kit-preview {
  margin-top: 0;
  margin-bottom: var(--space-4);
  position: sticky;
  top: var(--space-4);
}
.mw-page--kit aside .mw-kit-preview .activity-preview-panel {
  padding: var(--space-4);
  min-height: 140px;
}
.mw-page--kit aside .mw-kit-preview .ep-empty { min-height: 100px; }
