/* ============================================================================
   Maestro Creative — Projects hub (B2C home + project hub)
   Uses tokens.css + studio primitives (.mc-btn, .mc-chip, …)
   ============================================================================ */

.mc-hub-body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
}

html,
body.mc-hub-body {
  height: auto;
  min-height: 100%;
  overflow-y: auto;
}

.mc-hub-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mc-hub-page .mc-hub-app {
  flex: 1;
  min-height: 0;
}

#mc-hub-header-slot {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}

#mc-hub-header-slot .mc-hub-header {
  position: static;
  z-index: 20;
}

.mc-studio-page #mc-hub-header-slot .mc-hub-header {
  border-bottom: 1px solid var(--line-1);
}

.mc-hub-app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mc-hub-boot {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: grid;
  place-content: center;
  background: var(--bg-0);
  transition: opacity var(--t-mid), visibility var(--t-mid);
}
.mc-hub-boot.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---- Global header ------------------------------------------------------ */
.mc-hub-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  height: var(--topbar-h);
  background: var(--topbar-gradient);
  border-bottom: 1px solid var(--line-1);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.mc-hub-header__nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.mc-hub-header__nav::-webkit-scrollbar { display: none; }

.mc-brand-mark {
  flex-shrink: 0;
}

.mc-hub-navlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: var(--r-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.mc-hub-navlink:hover { color: var(--text-0); background: var(--bg-3); }
.mc-hub-navlink.is-active {
  color: var(--text-0);
  background: color-mix(in srgb, var(--brand-2) 14%, transparent);
  border-color: color-mix(in srgb, var(--brand-2) 30%, transparent);
}
.mc-hub-navlink.is-soon { opacity: .45; pointer-events: none; }

.mc-hub-navsep {
  width: 1px;
  height: 22px;
  background: var(--line-2);
  margin: 0 6px;
  flex-shrink: 0;
}

.mc-hub-header__spacer { flex: 1; min-width: 12px; }

.mc-hub-search {
  position: relative;
  width: min(320px, 28vw);
  display: none;
}
.mc-hub-search.is-visible { display: block; }
.mc-hub-search input {
  width: 100%;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text-1);
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  border-radius: 999px;
  padding: 8px 12px 8px 36px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.mc-hub-search input:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 22%, transparent);
}
.mc-hub-search .mc-i {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.mc-theme-switch {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 132px;
  flex: 0 0 132px;
  height: 34px;
  padding: 3px;
  border: 1px solid var(--line-1);
  border-radius: 999px;
  appearance: none;
  background: color-mix(in srgb, var(--bg-2) 88%, transparent);
  color: var(--text-3);
  font: inherit;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 8%, transparent), var(--shadow-1);
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.mc-theme-switch::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 2);
  border-radius: 999px;
  background: var(--bg-1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18), inset 0 1px 0 color-mix(in srgb, #fff 12%, transparent);
  transition: transform var(--t-mid), background var(--t-fast), box-shadow var(--t-fast);
}

.mc-theme-switch.is-dark::before {
  transform: translateX(100%);
  background: color-mix(in srgb, var(--brand-2) 20%, var(--bg-1));
}

.mc-theme-switch:hover {
  border-color: var(--line-strong);
  background: var(--bg-3);
}

.mc-theme-switch:focus-visible {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 24%, transparent), var(--shadow-1);
}

.mc-theme-switch__option {
  min-width: 0;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: color var(--t-fast);
}

.mc-theme-switch__icon {
  width: 14px;
  height: 14px;
  display: grid;
  place-content: center;
  flex: none;
}

.mc-theme-switch .mc-svg {
  width: 14px;
  height: 14px;
}

.mc-theme-switch.is-light .mc-theme-switch__option--light,
.mc-theme-switch.is-dark .mc-theme-switch__option--dark {
  color: var(--text-0);
}

.mc-theme-switch.is-light .mc-theme-switch__option--light .mc-svg {
  color: var(--brand-warn);
}

.mc-theme-switch.is-dark .mc-theme-switch__option--dark .mc-svg {
  color: var(--brand-2);
}

.mc-hub-avatar {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-content: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--on-accent);
  border: 2px solid var(--line-1);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.mc-hub-avatar.is-initials {
  /* background set inline from colorFromString */
}
.mc-hub-avatar .mc-user-avatar__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}
.mc-hub-avatar:hover { transform: scale(1.04); box-shadow: var(--shadow-1); }

/* ---- Main content ------------------------------------------------------- */
.mc-hub-main {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  animation: mc-hub-in var(--t-mid);
}
@keyframes mc-hub-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mc-hub-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.mc-hub-hero__title {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, var(--fs-3xl));
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -.02em;
}
.mc-hub-hero__sub {
  margin: 6px 0 0;
  font-size: var(--fs-md);
  color: var(--text-2);
  max-width: 520px;
  line-height: 1.5;
}

.mc-hub-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.mc-hub-filter {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--line-1);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}
.mc-hub-filter:hover { color: var(--text-0); border-color: var(--line-strong); }
.mc-hub-filter.is-active {
  color: var(--brand-1);
  background: color-mix(in srgb, var(--brand-1) 12%, transparent);
  border-color: color-mix(in srgb, var(--brand-1) 35%, transparent);
}
.mc-hub-filter:active { transform: scale(.97); }

/* ---- Projects command surface ------------------------------------------ */
.mc-project-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: -6px 0 18px;
}

.mc-project-metric {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  background: color-mix(in srgb, var(--bg-1) 88%, transparent);
  box-shadow: var(--shadow-1);
}

.mc-project-metric__label,
.mc-project-field__label {
  display: block;
  margin-bottom: 7px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.mc-project-metric__value {
  display: block;
  font-size: var(--fs-2xl);
  line-height: 1;
  color: var(--text-0);
}

.mc-project-metric__hint {
  display: block;
  margin-top: 7px;
  color: var(--text-2);
  font-size: var(--fs-xs);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mc-project-toolbar {
  position: sticky;
  top: calc(var(--topbar-h) + 8px);
  z-index: 20;
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  background: color-mix(in srgb, var(--bg-0) 84%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-1);
}

.mc-project-toolbar__row {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, .7fr) minmax(140px, .65fr) minmax(280px, 1fr) minmax(180px, .8fr);
  gap: 10px;
  align-items: end;
}

.mc-project-toolbar__row--filters-only {
  grid-template-columns: minmax(150px, .7fr) minmax(140px, .65fr) minmax(280px, 1fr) minmax(180px, .8fr);
}

.mc-project-toolbar__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mc-project-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mc-project-count {
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.mc-project-field {
  min-width: 0;
}

.mc-project-searchbox,
.mc-project-select,
.mc-project-date-input {
  position: relative;
  display: flex;
  align-items: center;
}

.mc-project-searchbox input,
.mc-project-select select,
.mc-project-date-input input {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  background: var(--bg-2);
  color: var(--text-0);
  font: inherit;
  font-size: var(--fs-sm);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.mc-project-searchbox input {
  padding: 8px 12px 8px 36px;
}

.mc-project-select select {
  appearance: none;
  padding: 8px 34px 8px 12px;
  cursor: pointer;
  color-scheme: inherit;
}
.mc-project-select select option {
  background-color: var(--bg-2);
  color: var(--text-1);
}

.mc-project-date-input input {
  padding: 8px 10px 8px 32px;
}

.mc-project-searchbox input:focus,
.mc-project-select select:focus,
.mc-project-date-input input:focus {
  border-color: var(--brand-2);
  background: var(--bg-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 20%, transparent);
}

.mc-project-searchbox__icon,
.mc-project-select__icon,
.mc-project-date-input__icon {
  position: absolute;
  z-index: 1;
  display: grid;
  place-content: center;
  color: var(--text-3);
  pointer-events: none;
}

.mc-project-searchbox__icon,
.mc-project-date-input__icon {
  left: 10px;
}

.mc-project-select__icon {
  right: 10px;
}

.mc-project-date-range {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.mc-project-date-range__sep {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.mc-project-view {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-2);
  background: var(--bg-2);
}

.mc-project-view__btn {
  width: 34px;
  height: 32px;
  display: grid;
  place-content: center;
  border: 0;
  border-radius: var(--r-1);
  background: transparent;
  color: var(--text-3);
}

.mc-project-view__btn:hover {
  color: var(--text-0);
  background: var(--bg-3);
}

.mc-project-view__btn.is-active {
  color: var(--text-0);
  background: color-mix(in srgb, var(--brand-2) 18%, var(--bg-3));
}

.mc-project-reset {
  min-height: 38px;
}

.mc-project-results {
  min-height: 360px;
}

/* ---- Project cards grid ------------------------------------------------- */
.mc-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
}

.mc-projcard {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-3);
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-mid), box-shadow var(--t-mid), border-color var(--t-fast);
  animation: mc-card-in var(--t-mid) backwards;
}
.mc-projcard:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-3);
  border-color: color-mix(in srgb, var(--pc-accent, var(--brand-2)) 40%, var(--line-1));
}
.mc-projcard:active { transform: translateY(-1px); }

@keyframes mc-card-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mc-projcard__thumb.has-cover .mc-projcard__thumb-icon {
  display: none;
}

.mc-projcard__cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mc-projcard__cover-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: var(--r-2);
  background: rgba(0, 0, 0, .52);
  color: #fff;
  display: grid;
  place-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast), background var(--t-fast);
}

.mc-projcard:hover .mc-projcard__cover-btn,
.mc-projcard:focus-within .mc-projcard__cover-btn {
  opacity: 1;
}

.mc-projcard__cover-btn:hover {
  background: rgba(0, 0, 0, .72);
}

.mc-projcard__thumb {
  aspect-ratio: 16 / 10;
  background: var(--pc-gradient, var(--gradient-hero));
  position: relative;
  overflow: hidden;
}
.mc-projcard__thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg-0) 55%, transparent), transparent 50%);
}
.mc-projcard__thumb-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  color: rgba(255, 255, 255, .92);
  opacity: .85;
}
.mc-projcard__thumb-icon svg { width: 40px; height: 40px; filter: drop-shadow(0 4px 12px rgba(0,0,0,.25)); }

.mc-projcard__quick-actions {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.mc-projcard__quick-action {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--r-2);
  border: 1px solid color-mix(in srgb, #fff 18%, transparent);
  background: color-mix(in srgb, var(--bg-0) 68%, transparent);
  color: var(--text-0);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}

.mc-projcard__quick-action > span {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.mc-projcard__quick-action svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.mc-projcard__quick-action:hover,
.mc-projcard__quick-action:focus-visible {
  transform: translateY(-1px);
  background: var(--bg-3);
  border-color: color-mix(in srgb, var(--brand-2) 45%, transparent);
  outline: none;
}

.mc-projcard__quick-action--primary {
  background: color-mix(in srgb, var(--brand-2) 82%, var(--bg-0));
  border-color: color-mix(in srgb, #fff 22%, transparent);
  color: var(--on-accent);
}

.mc-projcard__quick-action--primary:hover,
.mc-projcard__quick-action--primary:focus-visible {
  background: var(--brand-2);
  border-color: color-mix(in srgb, #fff 30%, transparent);
}

.mc-projcard__menu {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border-radius: var(--r-2);
  display: grid;
  place-content: center;
  background: var(--bg-overlay);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-1);
  color: var(--text-0);
  cursor: pointer;
  opacity: 0;
  transition: opacity var(--t-fast);
}
.mc-projcard:hover .mc-projcard__menu { opacity: 1; }
.mc-projcard__menu:hover { background: var(--bg-3); }

.mc-projcard__body { padding: 14px 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.mc-projcard__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-0);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mc-projcard__sub { margin: 0; font-size: var(--fs-sm); color: var(--text-3); }
.mc-projcard__desc {
  min-height: 40px;
  margin: 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mc-projcard__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

.mc-chip--ok { color: var(--brand-3); background: color-mix(in srgb, var(--brand-3) 14%, transparent); border-color: transparent; }
.mc-chip--busy { color: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 14%, transparent); border-color: transparent; }
.mc-chip--warn { color: var(--brand-warn); background: color-mix(in srgb, var(--brand-warn) 16%, transparent); border-color: transparent; }
.mc-chip--muted { color: var(--text-2); background: var(--bg-3); border-color: transparent; }

/* ---- Project table ------------------------------------------------------ */
.mc-project-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  background: var(--bg-1);
  box-shadow: var(--shadow-1);
}

.mc-project-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.mc-project-table th,
.mc-project-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-1);
  text-align: left;
  vertical-align: middle;
  font-size: var(--fs-sm);
}

.mc-project-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--bg-2);
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.mc-project-table__sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  transition: color var(--t-fast);
}

.mc-project-table__sort:hover {
  color: var(--text-1);
}

.mc-project-table__sort.is-active {
  color: var(--text-0);
}

.mc-project-table__sort-icon {
  display: inline-flex;
  opacity: .45;
  transition: opacity var(--t-fast), transform var(--t-fast);
}

.mc-project-table__sort.is-active .mc-project-table__sort-icon {
  opacity: 1;
  color: var(--brand-2);
}

.mc-project-table__sort-label {
  white-space: nowrap;
}

.mc-project-table tbody tr {
  cursor: pointer;
  transition: background var(--t-fast);
}

.mc-project-table tbody tr:hover {
  background: color-mix(in srgb, var(--brand-2) 7%, transparent);
}

.mc-project-table tbody tr:last-child td {
  border-bottom: 0;
}

.mc-project-table__project {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.mc-project-table__icon {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-content: center;
  border-radius: var(--r-2);
  color: #fff;
}

.mc-project-table__copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.mc-project-table__copy strong,
.mc-project-table__copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-project-table__copy strong {
  color: var(--text-0);
  font-size: var(--fs-sm);
}

.mc-project-table__copy small {
  color: var(--text-3);
  font-size: var(--fs-xs);
}

.mc-project-table__actions {
  width: 96px;
  text-align: right;
  white-space: nowrap;
}

.mc-project-table__actions .mc-iconbtn {
  width: 32px;
  height: 32px;
}

/* New project card */
.mc-projcard--new {
  border-style: dashed;
  border-color: var(--line-2);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  gap: 12px;
}
.mc-projcard--new:hover {
  border-color: var(--brand-1);
  background: color-mix(in srgb, var(--brand-1) 6%, transparent);
}
.mc-projcard--new .mc-projcard__plus {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  background: var(--gradient-hero);
  color: #fff;
  box-shadow: var(--shadow-2);
  transition: transform var(--t-fast);
}
.mc-projcard--new:hover .mc-projcard__plus { transform: scale(1.06); }
.mc-projcard--new span { font-weight: 600; color: var(--text-1); }

/* Empty state */
.mc-hub-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px;
  border-radius: var(--r-4);
  border: 1px dashed var(--line-2);
  background: color-mix(in srgb, var(--bg-2) 80%, transparent);
}
.mc-hub-empty__illus {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  display: grid;
  place-content: center;
  background: var(--gradient-hero);
  margin-bottom: 20px;
  animation: mc-float 2.4s ease-in-out infinite;
}
.mc-hub-empty h2 { margin: 0 0 8px; color: var(--text-0); font-size: var(--fs-xl); }
.mc-hub-empty p { margin: 0 0 20px; color: var(--text-2); max-width: 400px; line-height: 1.55; }

/* ---- Project hub page --------------------------------------------------- */
.mc-hub-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
  padding: 6px 10px 6px 6px;
  border-radius: var(--r-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.mc-hub-back:hover { color: var(--text-0); background: var(--bg-3); }

.mc-project-detail-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  margin-bottom: 22px;
  padding: 26px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-4);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bg-1) 92%, transparent), color-mix(in srgb, var(--bg-2) 76%, transparent)),
    radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--brand-2) 20%, transparent), transparent 34%);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}

.mc-project-detail-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--project-accent, var(--gradient-hero));
}

.mc-project-detail-hero__content {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.mc-project-detail-hero__eyebrow,
.mc-library-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--brand-2);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.mc-project-detail-hero__mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-content: center;
  border-radius: var(--r-2);
  background: color-mix(in srgb, var(--brand-2) 16%, var(--bg-2));
}

.mc-project-detail-hero__description {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: var(--fs-md);
  line-height: 1.55;
}

.mc-project-detail-hero__side {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  justify-items: end;
}

.mc-project-detail-hero__art {
  position: relative;
  width: 148px;
  height: 118px;
  display: grid;
  place-content: center;
}

.mc-project-detail-hero__tile {
  position: relative;
  z-index: 1;
  width: 94px;
  height: 94px;
  display: grid;
  place-content: center;
  border-radius: 24px;
  color: #fff;
  background: var(--project-accent, var(--gradient-hero));
  box-shadow: var(--shadow-3);
}

.mc-project-detail-hero__pulse {
  position: absolute;
  inset: 18px;
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--brand-2) 28%, transparent);
  transform: rotate(-8deg);
}

.mc-project-detail-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.mc-hub-projhead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.mc-hub-projhead__name {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -.02em;
}
.mc-hub-projhead__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.mc-hub-projhead__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.mc-hub-stats {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 28px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.mc-hub-stats::-webkit-scrollbar { height: 6px; }
.mc-hub-stats--project {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: visible;
}
.mc-hub-stat {
  flex: 0 0 min(220px, 78vw);
  scroll-snap-align: start;
  padding: 16px 18px;
  border-radius: var(--r-3);
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  box-shadow: var(--shadow-1);
  transition: border-color var(--t-fast), transform var(--t-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.mc-hub-stat:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.mc-hub-stat__label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-3); margin-bottom: 8px; }
.mc-hub-stat__val { font-size: var(--fs-2xl); font-weight: 700; color: var(--text-0); }
.mc-hub-stat__hint { font-size: var(--fs-sm); color: var(--text-2); margin-top: 6px; }

.mc-hub-section { margin-bottom: 32px; }
.mc-hub-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.mc-hub-section__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-0);
}
.mc-hub-section__link {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--brand-2);
  text-decoration: none;
}
.mc-hub-section__link:hover { text-decoration: underline; }

.mc-project-action-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.mc-hub-forge-list {
  display: grid;
  gap: 10px;
}
.mc-hub-forge-empty {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: var(--r-3);
  border: 1px dashed var(--line-2);
  background: var(--bg-1);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.mc-hub-forge-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--r-3);
  border: 1px solid var(--line-1);
  background: var(--bg-1);
  text-decoration: none;
  color: inherit;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.mc-hub-forge-card:hover {
  border-color: color-mix(in srgb, var(--brand-2) 40%, var(--line-1));
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.mc-hub-forge-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-2);
  display: grid;
  place-content: center;
  background: color-mix(in srgb, var(--brand-1) 18%, var(--bg-2));
  color: var(--brand-1);
}
.mc-hub-forge-card__body { min-width: 0; display: grid; gap: 4px; }
.mc-hub-forge-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.mc-hub-forge-card__meta {
  font-size: var(--fs-xs);
  color: var(--text-3);
  font-weight: 500;
}
.mc-hub-forge-card__prompt {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-hub-forge-card__time {
  font-size: var(--fs-xs);
  color: var(--text-3);
}
.mc-hub-forge-card__chev {
  color: var(--text-3);
  display: grid;
  place-content: center;
}

.mc-hub-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.mc-hub-shortcut {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px;
  border-radius: var(--r-3);
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.mc-hub-shortcut[href],
button.mc-hub-shortcut {
  cursor: pointer;
}
.mc-hub-shortcut:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand-2) 35%, var(--line-1));
  box-shadow: var(--shadow-2);
}
.mc-hub-shortcut.is-disabled { opacity: .45; pointer-events: none; }
.mc-hub-shortcut__icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-2);
  display: grid;
  place-content: center;
  background: color-mix(in srgb, var(--brand-2) 14%, transparent);
  color: var(--brand-2);
}
.mc-hub-shortcut__label { font-weight: 600; font-size: var(--fs-sm); color: var(--text-0); }
.mc-hub-shortcut__sub { font-size: var(--fs-xs); color: var(--text-3); }

.mc-project-action {
  min-height: 136px;
  padding: 18px;
}

.mc-project-action .mc-hub-shortcut__icon {
  background: color-mix(in srgb, var(--action-color, var(--brand-2)) 16%, transparent);
  color: var(--action-color, var(--brand-2));
}

.mc-project-action.is-blue { --action-color: #3b9bff; }
.mc-project-action.is-warm { --action-color: #ff7a3b; }
.mc-project-action.is-green { --action-color: #00b894; }
.mc-project-action.is-violet { --action-color: #8b5cf6; }
.mc-project-action.is-slate { --action-color: #94a3b8; }

.mc-project-action__chev {
  position: absolute;
  right: 14px;
  top: 14px;
  color: var(--text-3);
  opacity: .75;
  transition: transform var(--t-fast), color var(--t-fast);
}

.mc-project-action:hover .mc-project-action__chev {
  transform: translateX(2px);
  color: var(--text-0);
}

.mc-hub-feed {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mc-hub-feed__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--r-2);
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  animation: mc-card-in var(--t-mid) backwards;
}
.mc-hub-feed__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--brand-2);
}
.mc-hub-feed__dot--ok { background: var(--brand-3); }
.mc-hub-feed__dot--warn { background: var(--brand-warn); }
.mc-hub-feed__text { flex: 1; font-size: var(--fs-sm); color: var(--text-1); }
.mc-hub-feed__time { font-size: var(--fs-xs); color: var(--text-3); white-space: nowrap; }

/* ---- Library page ------------------------------------------------------- */
.mc-library-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 320px);
  gap: 20px;
  align-items: stretch;
  margin-bottom: 18px;
  padding: 26px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-4);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--bg-1) 94%, transparent), color-mix(in srgb, var(--bg-2) 78%, transparent)),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--brand-3) 18%, transparent), transparent 32%);
  box-shadow: var(--shadow-2);
}

.mc-library-hero__copy {
  min-width: 0;
}

.mc-library-hero__context {
  margin: 10px 0 0;
  color: var(--text-3);
  font-size: var(--fs-sm);
}

.mc-library-hero__panel {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  background: color-mix(in srgb, var(--bg-0) 38%, transparent);
}

.mc-library-profile {
  margin: 0;
}

.mc-library-profile-select {
  min-width: 0;
}

.mc-library-hero__stat {
  display: grid;
  gap: 4px;
}

.mc-library-hero__stat strong {
  color: var(--text-0);
  font-size: var(--fs-3xl);
  line-height: 1;
}

.mc-library-hero__stat span {
  color: var(--text-2);
  font-size: var(--fs-sm);
}

.mc-library-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  background: var(--bg-1);
}

.mc-library-toolbar .mc-project-field {
  width: min(440px, 100%);
}

.mc-library-count {
  color: var(--text-3);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.mc-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.mc-library-card {
  position: relative;
  min-height: 132px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line-1);
  border-radius: var(--r-3);
  background: var(--bg-1);
  color: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-1);
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.mc-library-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--brand-2) 38%, var(--line-1));
  background: color-mix(in srgb, var(--brand-2) 6%, var(--bg-1));
  box-shadow: var(--shadow-2);
}

.mc-library-card:active {
  transform: translateY(0);
}

.mc-library-card__icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  border-radius: var(--r-2);
  color: var(--brand-2);
  background: color-mix(in srgb, var(--brand-2) 14%, transparent);
}

.mc-library-card__body {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.mc-library-card__label {
  color: var(--text-0);
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.25;
}

.mc-library-card__sub {
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-library-card__chev {
  color: var(--text-3);
  transition: transform var(--t-fast), color var(--t-fast);
}

.mc-library-card:hover .mc-library-card__chev {
  transform: translateX(2px);
  color: var(--text-0);
}

.mc-library-empty {
  margin-top: 20px;
}

/* ---- Wizard overlay ----------------------------------------------------- */
.mc-wizard-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--overlay-backdrop);
  animation: mc-fade var(--t-fast);
}
.mc-wizard-layer.mc-hidden { display: none; }

.mc-wizard {
  width: min(560px, 100%);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--bg-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-4);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: mc-pop var(--t-mid);
}
.mc-wizard__head {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line-1);
}
.mc-wizard__steps {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.mc-wizard__step-dot {
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: var(--line-1);
  transition: background var(--t-fast);
}
.mc-wizard__step-dot.is-done { background: var(--brand-3); }
.mc-wizard__step-dot.is-active { background: var(--brand-1); }

.mc-wizard__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.mc-wizard__foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line-1);
  background: var(--bg-2);
}

.mc-kind-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.mc-kind-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 16px 12px;
  border-radius: var(--r-3);
  border: 2px solid var(--line-1);
  background: var(--bg-2);
  cursor: pointer;
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
.mc-kind-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.mc-kind-card.is-selected {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-1) 22%, transparent);
}
.mc-kind-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-2);
  display: grid;
  place-content: center;
  background: var(--kc-gradient, var(--gradient-hero));
  color: #fff;
}
.mc-kind-card__title { font-weight: 700; font-size: var(--fs-sm); color: var(--text-0); }
.mc-kind-card__desc { font-size: var(--fs-xs); color: var(--text-3); line-height: 1.4; }

.mc-hub-memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.mc-hub-memory-card {
  border: 1px solid var(--line-2);
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--bg-1);
}

.mc-hub-memory-card__thumb {
  aspect-ratio: 16/10;
  background: var(--line-1);
  display: grid;
  place-content: center;
}

.mc-hub-memory-card__thumb img { width: 100%; height: 100%; object-fit: cover; }

.mc-hub-memory-card__body {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mc-hub-memory-card__body h3 {
  margin: 0;
  font-size: var(--fs-sm);
}

.mc-hub-form .mc-field { margin-bottom: 12px; }

@media (max-width: 720px) {
  .mc-hub-header { padding: 0 12px; gap: 8px; }
  .mc-hub-header__nav {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
  }
  .mc-hub-header__nav::-webkit-scrollbar { display: none; }
  .mc-hub-navlink { padding: 6px 8px; flex-shrink: 0; }
  .mc-hub-navlink span { display: none; }
  .mc-hub-navsep { display: none; }
  .mc-hub-search.is-visible { width: 100%; max-width: none; flex: 1; }
  .mc-theme-switch {
    width: 74px;
    flex: 0 0 74px;
  }
  .mc-theme-switch__label { display: none; }
  .mc-theme-switch__option { padding: 0; }
  .mc-hub-main { padding: 20px 14px 36px; }
  .mc-project-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mc-project-toolbar { position: static; }
  .mc-project-toolbar__row { grid-template-columns: 1fr; }
  .mc-project-toolbar__footer { align-items: flex-start; flex-direction: column; }
  .mc-project-toolbar__actions { width: 100%; justify-content: space-between; }
  .mc-project-date-range { grid-template-columns: 1fr; }
  .mc-project-date-range__sep { display: none; }
  .mc-project-detail-hero,
  .mc-library-hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .mc-project-detail-hero__side {
    justify-items: stretch;
  }
  .mc-project-detail-hero__art {
    display: none;
  }
  .mc-project-detail-hero__actions {
    justify-content: stretch;
  }
  .mc-project-detail-hero__actions .mc-btn {
    flex: 1;
  }
  .mc-hub-stats--project {
    grid-template-columns: 1fr;
  }
  .mc-library-hero__panel {
    align-content: start;
  }
  .mc-library-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .mc-library-toolbar .mc-project-field {
    width: 100%;
  }
  .mc-library-count {
    white-space: normal;
  }
  .mc-hub-grid { grid-template-columns: 1fr; }
  .mc-hub-projhead__actions { width: 100%; }
  .mc-hub-projhead__actions .mc-btn { flex: 1; }
}

/* ---- Video Projects gallery ---- */
.mc-video-thumb .mc-projcard__thumb-icon { opacity: .9; }
.mc-video-thumb__dur {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 1;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font: 600 11px/1.4 var(--mono, ui-monospace, monospace);
  letter-spacing: .02em;
}

/* ── Projects pagination (shared hub pager) ─────────────────────────────── */
.mc-pager-host {
  padding: 8px 0 24px;
}
.mc-pager {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface-2), transparent);
}
.mc-pager.is-loading .mc-pager__controls {
  pointer-events: none;
}
.mc-pager.is-loading .mc-pager__btn:not(:disabled) {
  opacity: .55;
}
.mc-pager__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}
.mc-pager__range {
  color: var(--text-2);
  font-size: var(--fs-sm, 13px);
  font-weight: 500;
}
.mc-pager__size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: var(--fs-sm, 13px);
}
.mc-pager__size-label {
  white-space: nowrap;
}
.mc-pager__size-select {
  appearance: none;
  min-width: 108px;
  padding: 7px 30px 7px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--text-1);
  font: inherit;
  cursor: pointer;
  color-scheme: inherit;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.mc-pager__size-select:focus {
  border-color: var(--brand-2);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 18%, transparent);
}
.mc-pager__size-select option {
  background-color: var(--bg-2);
  color: var(--text-1);
}
.mc-pager__controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.mc-pager__pages {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mc-pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font: 600 13px/1 var(--font, inherit);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.mc-pager__btn:hover:not(:disabled) {
  background: var(--surface-2, rgba(255, 255, 255, .06));
  border-color: var(--border, rgba(255, 255, 255, .1));
  color: var(--text-1);
}
.mc-pager__btn.is-active {
  background: color-mix(in srgb, var(--accent, #7c5cff) 18%, transparent);
  border-color: color-mix(in srgb, var(--accent, #7c5cff) 42%, transparent);
  color: var(--text-1);
}
.mc-pager__btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}
.mc-pager__summary {
  color: var(--text-3);
  font-size: 12px;
}
.mc-hub-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 220px;
  color: var(--text-2);
}
.mc-hub-loading__spinner {
  display: inline-flex;
  animation: mc-spin 1s linear infinite;
  opacity: .75;
}
@keyframes mc-spin {
  to { transform: rotate(360deg); }
}
/* ========================================================================== */
/* Print template gallery                                                     */
/* ========================================================================== */
.mp-template-hero { align-items: flex-end; }
.mp-template-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; color: var(--text-2); font-size: 13px; text-decoration: none; }
.mp-template-back:hover { color: var(--accent); }
.mp-template-filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding: 16px; margin: 0 0 22px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; }
.mp-template-search { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; min-width: 220px; height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-0); }
.mp-template-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.mp-template-search input { width: 100%; border: 0; outline: 0; color: var(--text-1); background: transparent; }
.mp-template-select { display: grid; gap: 5px; min-width: 150px; color: var(--text-2); font-size: 11px; font-weight: 650; }
.mp-template-select select { min-height: 40px; padding: 0 32px 0 10px; color: var(--text-1); background: var(--surface-0); border: 1px solid var(--border); border-radius: 10px; color-scheme: inherit; }
.mp-template-select select option { background-color: var(--bg-2); color: var(--text-1); }
.mp-template-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.mp-template-toggle input { accent-color: var(--accent); }
.mp-template-count { margin-left: auto; align-self: center; color: var(--text-3); font-size: 12px; }
.mp-template-results { min-height: 320px; }
.mp-template-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.mp-template-card { min-width: 0; overflow: hidden; background: var(--surface-1); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; cursor: pointer; }
.mp-template-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); box-shadow: var(--shadow-md); }
.mp-template-card.is-loading { height: 390px; background: linear-gradient(90deg, var(--surface-1), var(--surface-2), var(--surface-1)); background-size: 220% 100%; animation: mp-template-shimmer 1.3s infinite linear; }
@keyframes mp-template-shimmer { to { background-position: -220% 0; } }
.mp-template-card__preview { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(145deg, var(--surface-2), var(--surface-0)); }
.mp-template-card__preview > img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.mp-template-card:hover .mp-template-card__preview > img { transform: scale(1.025); }
.mp-template-placeholder { display: grid; place-content: center; justify-items: center; gap: 8px; width: 100%; height: 100%; color: var(--text-3); }
.mp-template-favorite { position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; color: var(--text-2); background: color-mix(in srgb, var(--surface-0) 88%, transparent); border: 1px solid var(--border); border-radius: 999px; backdrop-filter: blur(10px); }
.mp-template-favorite.is-active { color: #d99b12; background: #fff8dc; border-color: #f0cb65; }
.mp-template-pages-badge { position: absolute; left: 10px; bottom: 10px; padding: 4px 8px; color: #fff; background: #17202ccc; border-radius: 999px; font-size: 11px; font-weight: 700; }
.mp-template-card__body { display: grid; gap: 9px; padding: 15px; }
.mp-template-card__meta { display: flex; justify-content: space-between; gap: 8px; color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.mp-template-card__body h3 { margin: 0; color: var(--text-1); font-size: 17px; }
.mp-template-card__body > p { min-height: 38px; margin: 0; overflow: hidden; color: var(--text-2); font-size: 12px; line-height: 1.5; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.mp-template-card__badges { display: flex; gap: 6px; flex-wrap: wrap; min-height: 24px; }
.mp-template-card__badges span { padding: 4px 7px; color: var(--accent); background: color-mix(in srgb, var(--accent) 9%, var(--surface-1)); border-radius: 999px; font-size: 10px; font-weight: 650; }
.mp-template-card__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 4px; }
.mp-template-pager { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 70px; color: var(--text-2); font-size: 12px; }
.mp-template-preview-pages { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; max-height: min(58vh, 680px); overflow: auto; padding: 2px; }
.mp-template-preview-pages figure { margin: 0; }
.mp-template-preview-pages img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #e8e9eb; border: 1px solid var(--border); border-radius: 8px; }
.mp-template-preview-pages figcaption { padding: 7px 2px; color: var(--text-2); font-size: 11px; }
.mp-template-preview-info { display: grid; gap: 5px; margin-top: 14px; padding: 13px; background: var(--surface-2); border-radius: 10px; }
.mp-template-preview-info p { margin: 0; color: var(--text-2); font-size: 12px; }
.mp-template-use-field { display: grid; gap: 6px; margin-bottom: 14px; color: var(--text-2); font-size: 12px; font-weight: 650; }
.mp-template-use-status { min-height: 20px; color: var(--danger); font-size: 12px; }
.mp-template-governance { display: grid; gap: 14px; min-width: min(560px, 78vw); }
.mp-template-governance > strong { color: var(--text-1); font-size: 16px; }
.mp-template-governance > p { margin: 0; color: var(--text-2); line-height: 1.5; }
.mp-template-governance label { display: grid; gap: 7px; color: var(--text-2); font-size: 12px; font-weight: 650; }
.mp-template-governance .mc-textarea { min-height: 104px; resize: vertical; }
.mp-template-pages-badge.status-inreview { background: color-mix(in srgb, var(--warning) 82%, #111); }
.mp-wizard-source-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; padding: 5px; background: var(--surface-2); border-radius: 11px; }
.mp-wizard-source-tabs button { min-width:0; min-height:42px; padding:7px 10px; display:inline-flex; align-items:center; justify-content:center; gap:7px; color:var(--text-2); background:transparent; border:1px solid transparent; border-radius:8px; font-weight:650; line-height:1.2; cursor:pointer; }
.mp-wizard-source-tabs button .mc-svg { width:16px; height:16px; flex:0 0 16px; }
.mp-wizard-source-tabs button span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.mp-wizard-source-tabs button.is-active { color: var(--accent); background: var(--surface-0); border-color: var(--border); box-shadow: var(--shadow-sm); }
.mp-wizard-import-banner { display:grid; gap:8px; margin-bottom:16px; padding:14px 16px; border:1px solid color-mix(in srgb, var(--accent) 28%, var(--border)); border-radius:12px; background:color-mix(in srgb, var(--accent) 6%, var(--surface-1)); }
.mp-wizard-import-banner strong { font-size:14px; }
.mp-wizard-import-banner p { margin:0; color:var(--text-2); font-size:13px; line-height:1.45; }
.mp-wizard-import-banner .mc-btn { justify-self:start; }
.mp-projcard--new-split { display:grid; grid-template-columns:1fr 1fr; gap:0; padding:0; overflow:hidden; }
.mp-projcard--new-split .mp-projcard__new-action { min-height:100%; padding:18px 14px; display:grid; justify-items:center; gap:8px; border:0; background:transparent; color:var(--text-2); cursor:pointer; }
.mp-projcard--new-split .mp-projcard__new-action--primary { color:var(--accent); background:color-mix(in srgb, var(--accent) 7%, var(--surface-1)); }
.mp-projcard--new-split .mp-projcard__new-action:hover { background:color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.mp-configured-wizard {
  width: min(920px, calc(100vw - 32px));
  --border: var(--line-1);
  --border-strong: var(--line-strong);
  --surface-1: var(--bg-2);
  --surface-2: var(--bg-3);
  --accent: var(--brand-1);
  --shadow-sm: var(--shadow-1);
}
.mp-configured-wizard__definitions { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:10px; margin-bottom:16px; }
.mp-configured-wizard__definition { min-height:86px; padding:12px; display:flex; align-items:center; gap:11px; border:1px solid var(--border); border-radius:11px; color:var(--text-2); background:var(--surface-1); text-align:left; cursor:pointer; }
.mp-configured-wizard__definition:hover,.mp-configured-wizard__definition.is-selected { color:var(--accent); border-color:var(--accent); background:color-mix(in srgb,var(--accent) 7%,var(--surface-1)); }
.mp-configured-wizard__definition>span { width:42px; height:42px; flex:0 0 auto; display:grid; place-items:center; border-radius:10px; background:color-mix(in srgb,var(--accent) 10%,var(--surface-2)); }
.mp-configured-wizard__definition>div { min-width:0; display:grid; gap:4px; }
.mp-configured-wizard__definition strong { color:var(--text-0); font-size:12px; }
.mp-configured-wizard__definition small { color:var(--text-3); font-size:10px; line-height:1.4; }
.mp-configured-wizard__project-target { min-height:72px; padding:12px 14px; display:flex; align-items:center; gap:12px; border:1px solid var(--border); border-radius:10px; background:var(--surface-1); }
.mp-configured-wizard__project-target>span { width:40px; height:40px; flex:0 0 40px; display:grid; place-items:center; border-radius:9px; color:var(--accent); background:color-mix(in srgb,var(--accent) 10%,var(--surface-2)); }
.mp-configured-wizard__project-target>div { min-width:0; display:grid; gap:4px; }
.mp-configured-wizard__project-target strong { color:var(--text-0); font-size:12px; }
.mp-configured-wizard__project-target small { color:var(--text-3); font-size:10px; }
.mp-configured-wizard__description { margin:0 0 15px; color:var(--text-2); font-size:12px; line-height:1.55; }
.mp-configured-wizard__field-block { display: grid; gap: 10px; margin-bottom: 14px; }
.mp-configured-wizard__advanced-toggle {
  margin-bottom: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-3);
  background: var(--bg-2);
}
.mp-configured-wizard__advanced-link { justify-self: start; padding-inline: 0; min-height: 0; font-size: var(--fs-sm); }
.mp-configured-wizard__field-guide {
  padding: 12px 14px;
  display: grid;
  gap: 6px;
  border: 1px solid color-mix(in srgb, var(--brand-1) 22%, var(--line-1));
  border-radius: var(--r-3);
  background: color-mix(in srgb, var(--brand-1) 5%, var(--bg-2));
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.mp-configured-wizard__field-guide strong { color: var(--text-0); font-size: var(--fs-sm); }
.mp-configured-wizard__field-guide p { margin: 0; }
.mp-configured-wizard__field-guide ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.mp-configured-wizard__choices { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.mp-configured-wizard__choice { min-height: 34px; padding: 6px 10px; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line-1); border-radius: 999px; background: var(--bg-2); cursor: pointer; }
.mp-configured-wizard__choice:has(input:checked) { color: var(--brand-1); border-color: color-mix(in srgb, var(--brand-1) 45%, var(--line-1)); background: color-mix(in srgb, var(--brand-1) 8%, var(--bg-2)); }
.mp-configured-wizard__single-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.mp-configured-wizard__choice-card { min-height:88px; padding:12px; display:grid; grid-template-columns:auto 24px minmax(0,1fr); align-items:start; gap:9px; border:1px solid var(--line-1); border-radius:10px; background:var(--bg-2); cursor:pointer; }
.mp-configured-wizard__choice-card>span:last-child { display:grid; gap:4px; }
.mp-configured-wizard__choice-card strong { color:var(--text-0); font-size:var(--fs-sm); }
.mp-configured-wizard__choice-card small { color:var(--text-3); font-size:var(--fs-xs); line-height:1.45; }
.mp-configured-wizard__choice-card.is-selected,.mp-configured-wizard__choice-card:has(input:checked) { border-color:color-mix(in srgb,var(--brand-1) 55%,var(--line-1)); background:color-mix(in srgb,var(--brand-1) 8%,var(--bg-2)); }
.mp-configured-wizard__choice-card.is-disabled { opacity:.58; cursor:not-allowed; }
.mp-configured-wizard__capability { margin:0; padding:9px 11px; border:1px solid var(--line-1); border-radius:8px; color:var(--text-2); background:var(--bg-2); font-size:var(--fs-xs); line-height:1.5; }
.mp-configured-wizard__capability.is-positive { border-color:color-mix(in srgb,#2ba471 45%,var(--line-1)); background:color-mix(in srgb,#2ba471 7%,var(--bg-2)); }
.mp-configured-wizard__capability.is-flat { border-color:color-mix(in srgb,#d89b36 45%,var(--line-1)); background:color-mix(in srgb,#d89b36 7%,var(--bg-2)); }
.mp-configured-wizard__file-field { margin-bottom: 14px; display: grid; gap: 8px; }
.mp-configured-wizard__file-field > .mc-field__label { display: block; margin: 0; }
.mp-configured-wizard__drop {
  position: relative;
  width: 100%;
  min-height: 188px;
  padding: 22px 20px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-3);
  color: var(--text-3);
  background: var(--bg-2);
  text-align: center;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), color var(--t-fast);
  cursor: pointer;
  outline: none;
}
.mp-configured-wizard__drop:focus-visible {
  border-color: var(--brand-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-1) 22%, transparent);
}
.mp-configured-wizard__drop.is-over {
  color: var(--brand-1);
  border-color: var(--brand-1);
  border-style: solid;
  background: color-mix(in srgb, var(--brand-1) 8%, var(--bg-2));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-1) 18%, transparent);
}
.mp-configured-wizard__drop.is-over .mp-configured-wizard__drop-icon {
  color: var(--brand-1);
  border-color: color-mix(in srgb, var(--brand-1) 45%, var(--line-1));
  background: color-mix(in srgb, var(--brand-1) 16%, var(--bg-3));
}
.mp-configured-wizard__drop.is-uploading { cursor: progress; border-style: solid; border-color: color-mix(in srgb, var(--brand-1) 35%, var(--line-1)); }
.mp-configured-wizard__drop.is-uploading .mp-configured-wizard__drop-icon > span { animation: mc-spin .8s linear infinite; }
.mp-configured-wizard__drop-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: var(--r-3);
  color: var(--brand-1);
  background: color-mix(in srgb, var(--brand-1) 12%, var(--bg-3));
  border: 1px solid color-mix(in srgb, var(--brand-1) 22%, var(--line-1));
}
.mp-configured-wizard__drop-icon .mc-svg { width: 26px; height: 26px; }
.mp-configured-wizard__drop-title { color: var(--text-0); font-size: var(--fs-md); font-weight: 700; }
.mp-configured-wizard__drop-action { max-width: 560px; color: var(--text-2); font-size: var(--fs-sm); line-height: 1.45; }
.mp-configured-wizard__drop-accept,
.mp-configured-wizard__drop-status { max-width: 560px; font-size: var(--fs-xs); line-height: 1.45; }
.mp-configured-wizard__drop-status { color: var(--text-2); font-weight: 600; }
.mp-configured-wizard__drop .mc-btn { margin-top: 4px; pointer-events: auto; }
.mp-configured-wizard__skip-hint { margin-top:10px; display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.mp-configured-wizard__skip-updates { padding-inline:10px; min-height:30px; font-size:11px; }
.mp-configured-wizard__skip-updates.is-active { color:var(--accent); border-color:color-mix(in srgb,var(--accent) 40%,var(--border)); background:color-mix(in srgb,var(--accent) 8%,var(--surface-1)); }
.mp-configured-wizard__import-only-note { margin-top:6px; padding:8px 10px; border:1px solid color-mix(in srgb,var(--accent) 30%,var(--border)); border-radius:8px; color:var(--text-2); background:color-mix(in srgb,var(--accent) 5%,var(--surface-1)); }
.mp-configured-wizard__drop strong { color: var(--text-1); font-size: 12px; }
.mp-configured-wizard__drop small { max-width: 560px; font-size: 10px; line-height: 1.45; }
.mp-configured-wizard__drop input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mp-configured-wizard__files { display:grid; gap:5px; }
.mp-configured-wizard__files>div,.mp-configured-wizard__file { min-height:38px; padding:6px 8px; display:grid; grid-template-columns:22px minmax(0,1fr) auto; align-items:center; gap:7px; border:1px solid var(--border); border-radius:8px; background:var(--surface-1); }
.mp-configured-wizard__file:has(button) { grid-template-columns:22px minmax(0,1fr) auto 28px; }
.mp-configured-wizard__file.is-uploading { border-color:color-mix(in srgb,var(--accent) 35%,var(--border)); }
.mp-configured-wizard__file.is-uploading>span { animation:mc-spin .8s linear infinite; color:var(--accent); }
.mp-configured-wizard__file.is-error { border-color:color-mix(in srgb,#d95661 40%,var(--border)); }
.mp-configured-wizard__file.is-error>span { color:#d95661; }
.mp-configured-wizard__files strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.mp-configured-wizard__files small { color:var(--text-3); font-size:9px; }
.mp-configured-wizard__files button { width:27px; height:27px; display:grid; place-items:center; border:0; border-radius:6px; color:var(--text-3); background:transparent; cursor:pointer; }
.mp-configured-wizard__files button:hover { color:var(--danger,#d95661); background:var(--surface-2); }
.mp-configured-wizard__status { min-height:190px; padding:24px; display:grid; place-content:center; justify-items:center; gap:9px; color:var(--accent); text-align:center; }
.mp-configured-wizard__status strong { color:var(--text-0); font-size:15px; }
.mp-configured-wizard__status p { max-width:600px; margin:0; color:var(--text-3); font-size:11px; line-height:1.55; }
.mp-configured-wizard__status.is-spinning>span { animation:mc-spin .8s linear infinite; }
.mp-configured-wizard__progress { width:min(560px,100%); height:9px; margin:0 auto; overflow:hidden; border-radius:999px; background:var(--surface-2); box-shadow:inset 0 0 0 1px var(--border); }
.mp-configured-wizard__progress>span { display:block; height:100%; border-radius:inherit; background:linear-gradient(90deg,var(--accent),var(--brand-3,var(--accent))); transition:width .3s ease; }
.mp-configured-wizard__progress-label { display:block; margin-top:8px; color:var(--text-3); text-align:center; }
.mp-configured-wizard__error-meta { display:grid; gap:4px; margin-top:12px; color:var(--text-3); text-align:center; }
@media (max-width:720px) {
  .mp-wizard-source-tabs { grid-template-columns:1fr; }
  .mp-configured-wizard__definitions { grid-template-columns:1fr; }
  .mp-configured-wizard__single-choices { grid-template-columns:1fr; }
}
@media (max-width: 760px) {
  .mp-template-filters { align-items: stretch; }
  .mp-template-search, .mp-template-select { width: 100%; }
  .mp-template-count { width: 100%; margin-left: 0; }
  .mp-template-grid { grid-template-columns: minmax(0, 1fr); }
  .mp-template-card__actions .mc-btn { flex: 1; }
}
