/* ============================================================
   My Cards - flagship card design system
   Shared by /my-cards (page + review) and the in-exam tray so
   the card look/motion is identical everywhere.
   Palette: blue/white/black with teal accent.
   ============================================================ */

:root {
    --mc-teal: #2A9EA6;
    --mc-teal-dark: #26808C;
    --mc-ink: #0f172a;
    --mc-slate: #475569;
    --mc-muted: #64748b;
    --mc-line: #e6ebf1;
    /* source / category accents */
    --mc-explanation: #2A9EA6;
    --mc-tip: #f59e0b;
    --mc-personal: #6366f1;
    --mc-rule: #2A9EA6;
    --mc-trap: #f59e0b;
    --mc-formula: #6366f1;
    --mc-watch: #ec4899;
}

/* ---------- Page shell ---------- */
.mc-page { min-height: 100vh; background: radial-gradient(1200px 400px at 50% -80px, #eef7f8 0%, #f8fafc 55%) , #f8fafc; padding: 0 20px 80px; }
.mc-wrap { max-width: 1080px; margin: 0 auto; }

/* ---------- Hero ---------- */
.mc-hero { padding: 40px 0 20px; }
.mc-hero__eyebrow { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mc-teal); }
.mc-hero__title { font-size: clamp(1.6rem, 3vw, 2.25rem); font-weight: 800; color: var(--mc-ink); margin: 6px 0 18px; letter-spacing: -0.02em; }
.mc-stats { display: flex; flex-wrap: wrap; gap: 12px; }
.mc-stat { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--mc-line); border-radius: 16px; padding: 12px 16px; box-shadow: 0 2px 10px rgba(15,23,42,0.04); }
.mc-stat__icon { width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.mc-stat__icon--total { background: #eef2ff; color: var(--mc-personal); }
.mc-stat__icon--mastered { background: #ecfdf5; color: #10b981; }
.mc-stat__icon--due { background: #fff7ed; color: var(--mc-tip); }
.mc-stat__icon--streak { background: #fef2f8; color: var(--mc-watch); }
.mc-stat__num { font-size: 1.35rem; font-weight: 800; color: var(--mc-ink); line-height: 1; }
.mc-stat__label { font-size: 0.75rem; color: var(--mc-muted); font-weight: 600; margin-top: 3px; }
.mc-hero__cta {
    margin-top: 18px; display: inline-flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, var(--mc-teal) 0%, var(--mc-teal-dark) 100%);
    color: #fff; border: none; font-weight: 700; font-size: 1rem; padding: 13px 22px; border-radius: 14px; cursor: pointer;
    box-shadow: 0 10px 26px rgba(42,158,166,0.32); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.mc-hero__cta:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(42,158,166,0.42); color: #fff; }
.mc-hero__cta:disabled { opacity: 0.5; cursor: default; box-shadow: none; transform: none; }
.mc-hero__cta .mc-hero__cta-badge { background: rgba(255,255,255,0.22); border-radius: 999px; padding: 2px 9px; font-size: 0.8125rem; }

/* ---------- Deck covers ---------- */
.mc-decks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; }
.mc-deck {
    position: relative; text-align: left; border: none; cursor: pointer; padding: 0; background: transparent;
    perspective: 900px;
}
.mc-deck__stack { position: relative; height: 168px; }
.mc-deck__sheet {
    position: absolute; inset: 0; border-radius: 20px; background: #fff; border: 1px solid var(--mc-line);
    box-shadow: 0 10px 30px rgba(15,23,42,0.08);
    transition: transform 0.28s cubic-bezier(0.22,1,0.36,1);
}
.mc-deck__sheet--3 { transform: translateY(16px) scale(0.92); opacity: 0.55; }
.mc-deck__sheet--2 { transform: translateY(8px) scale(0.96); opacity: 0.8; }
.mc-deck__sheet--1 { display: flex; flex-direction: column; justify-content: space-between; padding: 18px; overflow: hidden; }
.mc-deck:hover .mc-deck__sheet--1 { transform: translateY(-4px); box-shadow: 0 20px 44px rgba(15,23,42,0.14); }
.mc-deck:hover .mc-deck__sheet--2 { transform: translateY(4px) scale(0.965) rotate(-1.5deg); }
.mc-deck:hover .mc-deck__sheet--3 { transform: translateY(10px) scale(0.925) rotate(2deg); }
.mc-deck__top { display: flex; align-items: center; justify-content: space-between; }
.mc-deck__icon { width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; color: #fff; }
.mc-deck--exam .mc-deck__icon { background: linear-gradient(135deg, #2A9EA6, #26808C); }
.mc-deck--study .mc-deck__icon { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.mc-deck--personal .mc-deck__icon { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.mc-deck__count { font-size: 1.9rem; font-weight: 800; color: var(--mc-ink); line-height: 1; }
.mc-deck__count small { font-size: 0.8125rem; font-weight: 600; color: var(--mc-muted); }
.mc-deck__name { font-size: 1.05rem; font-weight: 800; color: var(--mc-ink); }
.mc-deck__meta { font-size: 0.8125rem; color: var(--mc-muted); }
.mc-deck__due { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 0.75rem; font-weight: 700; color: var(--mc-tip); }

/* ---------- Open-deck grid ---------- */
.mc-open { margin-top: 28px; animation: mc-fade-up 0.3s ease-out; }
.mc-open__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.mc-open__title { display: inline-flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 800; color: var(--mc-ink); }
.mc-open__back { background: #fff; border: 1px solid var(--mc-line); border-radius: 10px; padding: 8px 12px; color: var(--mc-slate); cursor: pointer; font-weight: 600; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 6px; }
.mc-open__back:hover { background: #f1f5f9; }
.mc-open__actions { display: inline-flex; gap: 8px; }
.mc-open__study { background: linear-gradient(135deg, var(--mc-teal), var(--mc-teal-dark)); color: #fff; border: none; border-radius: 10px; padding: 9px 15px; font-weight: 700; font-size: 0.875rem; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.mc-open__study:hover { box-shadow: 0 6px 16px rgba(42,158,166,0.3); }
.mc-open__new { background: #eef2ff; color: var(--mc-personal); border: none; border-radius: 10px; padding: 9px 15px; font-weight: 700; font-size: 0.875rem; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.mc-open__new:hover { background: #e0e7ff; }

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

/* per-exam grouping inside a deck */
.mc-cardgroup { margin-bottom: 28px; animation: mc-fade-up 0.3s ease-out; }
.mc-cardgroup__title { display: flex; align-items: center; gap: 9px; font-size: 1.1rem; font-weight: 800; color: var(--mc-ink); margin: 0 0 14px; }
.mc-cardgroup__title i { color: var(--mc-teal); }
.mc-cardgroup__count { font-size: 0.75rem; font-weight: 800; color: var(--mc-muted); background: #eef2f6; padding: 3px 10px; border-radius: 999px; }

/* ---------- Flip card ---------- */
.mc-card { perspective: 1200px; height: 200px; animation: mc-card-in 0.3s ease-out backwards; }
.mc-card__inner { position: relative; width: 100%; height: 100%; transition: transform 0.55s cubic-bezier(0.22,1,0.36,1); transform-style: preserve-3d; }
.mc-card.is-flipped .mc-card__inner { transform: rotateY(180deg); }
.mc-card__face {
    position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
    border-radius: 18px; background: var(--card-tint, #fff); border: 1px solid var(--mc-line); box-shadow: 0 6px 20px rgba(15,23,42,0.07);
    padding: 15px; display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
}
.mc-card__face--back { transform: rotateY(180deg); }

/* Accent + tint come from CSS vars: the source kind sets the default, a
   user-chosen colour overrides it, and Material shapes reshape both faces. */
.mc-card--explanation { --card-accent: var(--mc-explanation); }
.mc-card--tip { --card-accent: var(--mc-tip); }
.mc-card--personal { --card-accent: var(--mc-personal); }
.mc-card__face::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--card-accent); z-index: 1; }
.mc-card__badge { display: inline-flex; align-items: center; gap: 6px; font-size: 0.6875rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mc-muted); }
.mc-card__badge i { color: var(--card-accent); }

/* user colour overrides (2 classes beat the 1-class source default) */
.mc-card.mc-color-teal    { --card-accent: #2A9EA6; --card-tint: #f0fdfa; }
.mc-card.mc-color-blue    { --card-accent: #3b82f6; --card-tint: #eff6ff; }
.mc-card.mc-color-indigo  { --card-accent: #6366f1; --card-tint: #eef2ff; }
.mc-card.mc-color-violet  { --card-accent: #8b5cf6; --card-tint: #f5f3ff; }
.mc-card.mc-color-pink    { --card-accent: #ec4899; --card-tint: #fdf2f8; }
.mc-card.mc-color-amber   { --card-accent: #f59e0b; --card-tint: #fffbeb; }
.mc-card.mc-color-emerald { --card-accent: #10b981; --card-tint: #ecfdf5; }
.mc-card.mc-color-slate   { --card-accent: #64748b; --card-tint: #f8fafc; }
.mc-card.mc-color-rose    { --card-accent: #f43f5e; --card-tint: #fff1f2; }

/* Material-style shapes (both faces). border-radius works inside the 3D flip;
   the "cut" shape needs the -webkit- prefix so it renders in Safari/WebKit. */
.mc-card.mc-shape-rounded .mc-card__face { border-radius: 18px; }
.mc-card.mc-shape-sharp   .mc-card__face { border-radius: 0; }
.mc-card.mc-shape-soft    .mc-card__face { border-radius: 34px; }
.mc-card.mc-shape-asym    .mc-card__face { border-radius: 26px 4px 26px 4px; }
.mc-card.mc-shape-cut     .mc-card__face {
    border-radius: 0; box-shadow: none; border-color: transparent;
    -webkit-clip-path: polygon(15px 0, calc(100% - 15px) 0, 100% 15px, 100% calc(100% - 15px), calc(100% - 15px) 100%, 15px 100%, 0 calc(100% - 15px), 0 15px);
    clip-path: polygon(15px 0, calc(100% - 15px) 0, 100% 15px, 100% calc(100% - 15px), calc(100% - 15px) 100%, 15px 100%, 0 calc(100% - 15px), 0 15px);
}
.mc-card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mc-card__body { flex: 1; overflow: hidden; font-size: 0.9rem; line-height: 1.5; color: #1e293b; }
.mc-card__body--clamp { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; }
.mc-card__meta { font-size: 0.75rem; color: var(--mc-muted); }
.mc-card__hint { position: absolute; right: 12px; bottom: 10px; font-size: 0.7rem; color: #cbd5e1; display: inline-flex; align-items: center; gap: 4px; }
.mc-card__mastertag { color: #10b981; font-size: 0.9rem; }
.mc-card__acts { display: flex; gap: 4px; }
.mc-card__act { background: transparent; border: none; color: #cbd5e1; cursor: pointer; padding: 3px 5px; border-radius: 7px; font-size: 0.8125rem; }
.mc-card__act:hover { background: #f1f5f9; color: var(--mc-slate); }
.mc-card__act--master:hover { color: #10b981; background: #ecfdf5; }
.mc-card__act--del:hover { color: #ef4444; background: #fef2f2; }
.mc-card__act--on { color: #10b981; }
.mc-card__act--cz:hover { color: var(--card-accent); background: rgba(15,23,42,0.04); }

/* Comment shown on the card */
.mc-card__note { margin-top: 6px; padding-top: 8px; border-top: 1px dashed rgba(15,23,42,0.1); font-size: 0.75rem; color: var(--mc-slate); display: flex; align-items: flex-start; gap: 6px; }
.mc-card__note i { color: var(--card-accent); margin-top: 2px; flex-shrink: 0; }

/* Customize bottom-sheet */
.mc-cz-scrim { position: fixed; inset: 0; z-index: 1100; background: rgba(15,23,42,0.5); backdrop-filter: blur(2px); display: flex; align-items: flex-end; justify-content: center; animation: mc-fade 0.16s ease-out; }
@keyframes mc-fade { from { opacity: 0; } to { opacity: 1; } }
.mc-cz { width: 100%; max-width: 480px; background: #fff; border-radius: 26px 26px 0 0; padding: 16px 20px 24px; box-shadow: 0 -14px 44px rgba(0,0,0,0.22); animation: mc-sheet 0.26s cubic-bezier(0.22,1,0.36,1); max-height: 90vh; overflow-y: auto; }
@keyframes mc-sheet { from { transform: translateY(100%); } to { transform: translateY(0); } }
.mc-cz__handle { width: 42px; height: 4px; border-radius: 999px; background: #e2e8f0; margin: 0 auto 14px; }
.mc-cz__head { display: flex; align-items: center; justify-content: space-between; }
.mc-cz__title { font-weight: 800; color: var(--mc-ink); font-size: 1.1rem; }
.mc-cz__close { background: #f1f5f9; border: none; width: 34px; height: 34px; border-radius: 10px; color: var(--mc-slate); cursor: pointer; }
.mc-cz__preview { margin: 16px auto 2px; max-width: 300px; }
.mc-cz__preview .mc-card { height: 148px; }
.mc-cz__label { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mc-muted); margin: 18px 0 10px; }
.mc-cz__swatches { display: flex; flex-wrap: wrap; gap: 12px; }
.mc-cz__swatch { width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer; position: relative; box-shadow: 0 0 0 1px rgba(15,23,42,0.12); transition: transform 0.12s ease; }
.mc-cz__swatch:hover { transform: scale(1.12); }
.mc-cz__swatch.is-sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--mc-ink); }
.mc-cz__swatch i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 0.9rem; text-shadow: 0 1px 2px rgba(0,0,0,0.3); }
.mc-cz__swatch--default { background: #fff; box-shadow: 0 0 0 1.5px #cbd5e1; color: #94a3b8; }
.mc-cz__swatch--default i { color: #94a3b8; text-shadow: none; }
.mc-cz__shapes { display: flex; flex-wrap: wrap; gap: 12px; }
.mc-cz__shape { width: 50px; height: 50px; background: #e2e8f0; border: none; cursor: pointer; transition: background 0.12s ease, transform 0.12s ease; }
.mc-cz__shape:hover { transform: translateY(-2px); }
.mc-cz__shape.is-sel { background: var(--mc-teal); }
.mc-cz__shape--rounded { border-radius: 14px; }
.mc-cz__shape--sharp { border-radius: 3px; }
.mc-cz__shape--soft { border-radius: 22px; }
.mc-cz__shape--asym { border-radius: 18px 5px 18px 5px; }
.mc-cz__shape--cut { -webkit-clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 11px, 100% calc(100% - 11px), calc(100% - 11px) 100%, 11px 100%, 0 calc(100% - 11px), 0 11px); clip-path: polygon(11px 0, calc(100% - 11px) 0, 100% 11px, 100% calc(100% - 11px), calc(100% - 11px) 100%, 11px 100%, 0 calc(100% - 11px), 0 11px); }
.mc-cz__comment { width: 100%; border: 1.5px solid var(--mc-line); border-radius: 12px; padding: 11px 13px; font-size: 0.9375rem; color: var(--mc-ink); resize: vertical; font-family: inherit; }
.mc-cz__comment:focus { outline: none; border-color: var(--mc-teal); box-shadow: 0 0 0 3px rgba(42,158,166,0.15); }
.mc-cz__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.mc-card__note span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc-card__emptynote { color: var(--mc-muted); font-size: 0.8125rem; font-style: italic; display: flex; align-items: flex-start; gap: 6px; }
.mc-card__emptynote i { color: #cbd5e1; margin-top: 2px; flex-shrink: 0; }
/* review card picks up the card's chosen colour on its badge accent */
.mc-review__card .mc-review__badge i { color: var(--card-accent, #94a3b8); }

/* ---------- Empty / new-card form ---------- */
.mc-empty { text-align: center; padding: 48px 20px; color: var(--mc-muted); background: #fff; border: 1px dashed #cbd5e1; border-radius: 20px; }
.mc-empty i { font-size: 2rem; color: #cbd5e1; }
.mc-empty__title { margin: 12px 0 4px; font-weight: 800; color: var(--mc-slate); font-size: 1.05rem; }

.mc-form { background: #fff; border: 1px solid var(--mc-line); border-radius: 18px; padding: 18px; margin-bottom: 16px; box-shadow: 0 6px 20px rgba(15,23,42,0.06); }
.mc-form__label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--mc-muted); margin: 10px 0 4px; }
.mc-form__input { width: 100%; border: 1.5px solid var(--mc-line); border-radius: 10px; padding: 10px 12px; font-size: 0.9375rem; color: var(--mc-ink); resize: vertical; }
.mc-form__input:focus { outline: none; border-color: var(--mc-teal); box-shadow: 0 0 0 3px rgba(42,158,166,0.15); }
.mc-form__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.mc-btn { border: none; border-radius: 10px; padding: 9px 16px; font-weight: 700; font-size: 0.875rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.mc-btn--ghost { background: #f1f5f9; color: var(--mc-slate); }
.mc-btn--ghost:hover { background: #e2e8f0; }
.mc-btn--primary { background: linear-gradient(135deg, var(--mc-teal), var(--mc-teal-dark)); color: #fff; }
.mc-btn--primary:hover { box-shadow: 0 6px 16px rgba(42,158,166,0.3); }
.mc-btn--primary:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

/* ============================================================
   Review mode (full-screen swipe deck)
   ============================================================ */
.mc-review { position: fixed; inset: 0; z-index: 1200; background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%); display: flex; flex-direction: column; align-items: center; }
.mc-review__top { width: 100%; max-width: 560px; display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 8px; color: #cbd5e1; }
.mc-review__close { background: rgba(255,255,255,0.1); border: none; color: #fff; width: 38px; height: 38px; border-radius: 11px; cursor: pointer; }
.mc-review__close:hover { background: rgba(255,255,255,0.2); }
.mc-review__progress { flex: 1; margin: 0 16px; height: 6px; background: rgba(255,255,255,0.15); border-radius: 999px; overflow: hidden; }
.mc-review__progress-fill { height: 100%; background: linear-gradient(90deg, var(--mc-teal), #34d399); border-radius: 999px; transition: width 0.3s ease; }
.mc-review__count { font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.mc-review__stage { flex: 1; width: 100%; max-width: 560px; display: flex; align-items: center; justify-content: center; padding: 12px 20px; position: relative; }
.mc-review__deck { position: relative; width: 100%; max-width: 460px; height: 60vh; max-height: 460px; }
.mc-review__ghost { position: absolute; inset: 0; border-radius: 24px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.08); }
.mc-review__ghost--2 { transform: translateY(14px) scale(0.94); }
.mc-review__ghost--1 { transform: translateY(7px) scale(0.97); }
.mc-review__card { position: absolute; inset: 0; perspective: 1400px; touch-action: none; cursor: grab; }
.mc-review__card:active { cursor: grabbing; }
.mc-review__inner { position: relative; width: 100%; height: 100%; transition: transform 0.5s cubic-bezier(0.22,1,0.36,1); transform-style: preserve-3d; }
.mc-review__card.is-flipped .mc-review__inner { transform: rotateY(180deg); }
.mc-review__face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 24px; background: #fff; box-shadow: 0 30px 70px rgba(0,0,0,0.4); padding: 28px; display: flex; flex-direction: column; }
.mc-review__face--back { transform: rotateY(180deg); background: linear-gradient(180deg,#ffffff,#f1f5f9); }
.mc-review__badge { display: inline-flex; align-items: center; gap: 7px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--mc-muted); }
.mc-review__text { flex: 1; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 1.2rem; line-height: 1.55; color: var(--mc-ink); font-weight: 600; overflow-y: auto; }
.mc-review__fliphint { text-align: center; font-size: 0.8125rem; color: #94a3b8; }
.mc-review__swiptag { position: absolute; top: 24px; padding: 6px 14px; border-radius: 999px; font-weight: 800; font-size: 0.9rem; opacity: 0; transition: opacity 0.1s; border: 2px solid; text-transform: uppercase; letter-spacing: 0.04em; }
.mc-review__swiptag--good { right: 24px; color: #10b981; border-color: #10b981; transform: rotate(12deg); }
.mc-review__swiptag--again { left: 24px; color: #f59e0b; border-color: #f59e0b; transform: rotate(-12deg); }

.mc-review__rate { width: 100%; max-width: 460px; display: flex; gap: 14px; padding: 16px 20px 28px; }
.mc-rate { flex: 1; border: none; border-radius: 16px; padding: 15px; font-weight: 800; font-size: 1rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; transition: transform 0.12s ease; }
.mc-rate:active { transform: scale(0.96); }
.mc-rate--again { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1.5px solid rgba(245,158,11,0.4); }
.mc-rate--good { background: rgba(16,185,129,0.15); color: #34d399; border: 1.5px solid rgba(16,185,129,0.4); }
.mc-review__done { color: #fff; text-align: center; padding: 40px; }
.mc-review__done-icon { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%; background: linear-gradient(135deg, var(--mc-teal), #34d399); display: flex; align-items: center; justify-content: center; font-size: 2.4rem; box-shadow: 0 16px 40px rgba(52,211,153,0.4); }
.mc-review__done h2 { font-size: 1.6rem; font-weight: 800; margin: 0 0 8px; }
.mc-review__done p { color: #cbd5e1; margin: 0 0 22px; }

/* ---------- keyframes ---------- */
@keyframes mc-fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes mc-card-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ---------- Freeform board (Klaxoon-style) ---------- */
.mc-viewtoggle { display: inline-flex; gap: 4px; background: #eef2f6; padding: 4px; border-radius: 12px; margin-top: 22px; }
.mc-viewtoggle button { border: none; background: transparent; padding: 8px 16px; border-radius: 9px; font-weight: 700; font-size: 0.875rem; color: var(--mc-muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: all 0.12s ease; }
.mc-viewtoggle button.is-on { background: #fff; color: var(--mc-ink); box-shadow: 0 2px 8px rgba(15,23,42,0.1); }

.mc-board { position: relative; width: 100%; height: 74vh; min-height: 480px; margin-top: 20px; border-radius: 22px; overflow: hidden; border: 1px solid var(--mc-line); touch-action: none; cursor: grab; user-select: none; background-color: #eef3f7; background-image: radial-gradient(circle at 1px 1px, rgba(15,23,42,0.07) 1px, transparent 0); background-size: 24px 24px; }
.mc-board.is-panning { cursor: grabbing; }
.mc-board__canvas { position: absolute; top: 0; left: 0; width: 3720px; height: 1720px; transform-origin: 0 0; }

/* user zones (drag via bar, resize via corner, editable label) */
.mc-zone { position: absolute; top: 0; left: 0; border-radius: 20px; border: 2px dashed; pointer-events: none; }
.mc-zone__bar { position: absolute; top: 0; left: 0; right: 0; height: 42px; display: flex; align-items: center; gap: 3px; padding: 0 6px 0 4px; pointer-events: auto; cursor: grab; }
.mc-zone__grip { color: rgba(15,23,42,0.25); font-size: 1.15rem; flex-shrink: 0; }
.mc-zone__label { flex: 1; min-width: 0; background: transparent; border: none; font-weight: 800; font-size: 1.05rem; color: inherit; padding: 4px 6px; border-radius: 8px; }
.mc-zone__label:hover { background: rgba(255,255,255,0.5); }
.mc-zone__label:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px rgba(15,23,42,0.12); }
.mc-zone__cbtn { pointer-events: auto; background: rgba(255,255,255,0.6); border: none; width: 26px; height: 26px; border-radius: 8px; color: #475569; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 0.8rem; flex-shrink: 0; }
.mc-zone__cbtn:hover { background: #fff; }
.mc-zone__cbtn--del:hover { color: #ef4444; }

.mc-zcolor-slate   { background: rgba(100,116,139,0.08); border-color: rgba(100,116,139,0.4); color: #475569; }
.mc-zcolor-teal    { background: rgba(42,158,166,0.08); border-color: rgba(42,158,166,0.42); color: #26808C; }
.mc-zcolor-blue    { background: rgba(59,130,246,0.08); border-color: rgba(59,130,246,0.42); color: #2563eb; }
.mc-zcolor-indigo  { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.42); color: #4f46e5; }
.mc-zcolor-violet  { background: rgba(139,92,246,0.08); border-color: rgba(139,92,246,0.42); color: #7c3aed; }
.mc-zcolor-pink    { background: rgba(236,72,153,0.08); border-color: rgba(236,72,153,0.42); color: #db2777; }
.mc-zcolor-amber   { background: rgba(245,158,11,0.09); border-color: rgba(245,158,11,0.45); color: #b45309; }
.mc-zcolor-emerald { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.42); color: #059669; }
.mc-zcolor-rose    { background: rgba(244,63,94,0.08); border-color: rgba(244,63,94,0.42); color: #e11d48; }

/* board cards (positioned + sized inline; resize handle) */
.mc-bcard { position: absolute; top: 0; left: 0; cursor: grab; touch-action: none; will-change: transform; }
.mc-bcard.is-dragging { z-index: 50; cursor: grabbing; }
.mc-bcard.is-dragging .mc-card__face, .mc-bcard.is-resizing .mc-card__face { box-shadow: 0 22px 44px rgba(15,23,42,0.32); }
.mc-board .mc-card { height: 100%; width: 100%; animation: none; }
/* on the board a taller card shows more text (face clips the overflow) */
.mc-board .mc-card__body--clamp { display: block; -webkit-line-clamp: unset; }

.mc-resize { position: absolute; width: 20px; height: 20px; cursor: nwse-resize; z-index: 6; pointer-events: auto; }
.mc-bcard__resize { right: -2px; bottom: -2px; }
.mc-bcard__resize::after { content: ""; position: absolute; right: 6px; bottom: 6px; width: 9px; height: 9px; border-right: 2px solid #94a3b8; border-bottom: 2px solid #94a3b8; opacity: 0; transition: opacity 0.12s; }
.mc-bcard:hover .mc-bcard__resize::after { opacity: 0.75; }
.mc-zone__resize { right: 3px; bottom: 3px; }
.mc-zone__resize::after { content: ""; position: absolute; right: 4px; bottom: 4px; width: 11px; height: 11px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; opacity: 0.5; }

/* board toolbar + fullscreen + hint close */
.mc-board__toolbar { position: absolute; top: 14px; left: 14px; z-index: 60; display: flex; gap: 8px; }
.mc-board__tbtn { background: #fff; border: 1px solid var(--mc-line); border-radius: 12px; padding: 9px 14px; font-weight: 700; font-size: 0.8125rem; color: var(--mc-ink); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; box-shadow: 0 4px 12px rgba(15,23,42,0.1); }
.mc-board__tbtn:hover { background: #f1f5f9; }
.mc-board__tbtn i { color: var(--mc-teal); }
.mc-board--full { position: fixed; left: 0; right: 0; top: 64px; bottom: 0; height: auto; min-height: 0; z-index: 1050; border-radius: 0; margin: 0; border: none; }
.mc-board__hint-x { pointer-events: auto; background: transparent; border: none; color: #94a3b8; cursor: pointer; padding: 2px 5px; margin-left: 2px; font-size: 0.7rem; border-radius: 6px; }
.mc-board__hint-x:hover { color: var(--mc-slate); background: rgba(148,163,184,0.2); }

/* card body text size + colour (customizable, numeric px) */
.mc-card__body { color: var(--card-text, #1e293b); font-size: var(--card-font, 0.9rem); }

/* customize sheet: numeric text-size stepper */
.mc-cz__stepper { display: inline-flex; align-items: center; gap: 4px; background: #f1f5f9; border-radius: 12px; padding: 4px; }
.mc-cz__step { width: 40px; height: 40px; border: none; background: #fff; border-radius: 9px; color: var(--mc-slate); cursor: pointer; font-size: 1rem; box-shadow: 0 1px 3px rgba(15,23,42,0.08); display: inline-flex; align-items: center; justify-content: center; }
.mc-cz__step:hover:not(:disabled) { color: var(--mc-teal); }
.mc-cz__step:disabled { opacity: 0.4; cursor: default; }
.mc-cz__stepval { min-width: 74px; text-align: center; font-weight: 800; color: var(--mc-ink); font-variant-numeric: tabular-nums; }

/* ---------- Discovery: capture coachmark + nav "New" dot ---------- */
.cc-coach { position: fixed; z-index: 1048; left: 50%; bottom: 24px; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--mc-line); border-radius: 18px; box-shadow: 0 18px 50px rgba(15,23,42,0.22); padding: 16px 18px 16px 16px; display: flex; gap: 14px; align-items: flex-start; animation: cc-pop 0.3s cubic-bezier(0.22,1,0.36,1); }
@keyframes cc-pop { from { opacity: 0; transform: translate(-50%, 14px); } to { opacity: 1; transform: translate(-50%, 0); } }
.cc-coach__x { position: absolute; top: 8px; right: 8px; background: transparent; border: none; color: #cbd5e1; cursor: pointer; padding: 4px 6px; border-radius: 8px; font-size: 0.75rem; }
.cc-coach__x:hover { color: var(--mc-slate); background: #f1f5f9; }
.cc-coach__icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 13px; background: linear-gradient(135deg, var(--mc-teal), var(--mc-teal-dark)); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 1.3rem; box-shadow: 0 6px 16px rgba(42,158,166,0.35); }
.cc-coach__title { font-weight: 800; color: var(--mc-ink); font-size: 0.95rem; margin-bottom: 3px; }
.cc-coach__text { font-size: 0.85rem; line-height: 1.5; color: var(--mc-slate); margin: 0 0 12px; }
.cc-coach__acts { display: flex; gap: 8px; }
.cc-coach__show { background: linear-gradient(135deg, var(--mc-teal), var(--mc-teal-dark)); color: #fff; border: none; border-radius: 10px; padding: 8px 14px; font-weight: 700; font-size: 0.8125rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.cc-coach__show:hover { box-shadow: 0 6px 16px rgba(42,158,166,0.3); }
.cc-coach__got { background: transparent; border: none; color: var(--mc-muted); font-weight: 700; font-size: 0.8125rem; cursor: pointer; padding: 8px 10px; border-radius: 10px; }
.cc-coach__got:hover { background: #f1f5f9; color: var(--mc-slate); }
@media (max-width: 640px) { .cc-coach { bottom: 84px; } }

.mc-board__controls { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.mc-board__controls button { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--mc-line); background: #fff; color: var(--mc-slate); cursor: pointer; box-shadow: 0 4px 12px rgba(15,23,42,0.1); display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.mc-board__controls button:hover { background: #f1f5f9; color: var(--mc-ink); }
.mc-board__hint { position: absolute; left: 16px; bottom: 16px; z-index: 60; pointer-events: none; font-size: 0.75rem; color: var(--mc-slate); background: rgba(255,255,255,0.9); padding: 7px 13px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 2px 8px rgba(15,23,42,0.08); }
.mc-board__hint i { color: var(--mc-teal); }

@media (max-width: 720px) {
    .mc-decks { grid-template-columns: 1fr; }
    .mc-board { height: 66vh; }
    .mc-board__hint { display: none; }
}
