/* ============================================================
   MeshMAX Dashboard UI kit — shell + screen layout.
   Product-specific layout only; all controls come from the
   design-system components. Dark theme is primary here.
   ============================================================ */

/* Minimal, theme-matched scrollbars across the dashboard (and mirrored in the page
   preview renderer) — tidier than the chunky OS default. */
* { scrollbar-width: thin; scrollbar-color: var(--border-default) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 10px;
  border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); border: 2px solid transparent; background-clip: content-box; }

.mmd-app {
  display: grid;
  grid-template-columns: 264px 1fr;
  height: 100%;
  min-height: 100vh;
  background: var(--surface-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
}
.mmd-app--rail { grid-template-columns: 66px 1fr; }
.mmd-app--mobile { grid-template-columns: 1fr; }
@media (max-width: 480px) { .mmd-app--rail { grid-template-columns: 58px 1fr; } }

/* ---------- Sidebar ---------- */
.mmd-sidebar {
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border-subtle);
  background: var(--surface-card);
  padding: 20px 16px 16px;
  min-height: 0;
}
.mmd-sidebar__brand {
  display: flex; flex-direction: column; align-items: flex-start; gap: 5px;
  padding: 4px 8px 20px;
}
.mmd-sidebar__brand img { height: 24px; width: auto; }
.mmd-logo--ondark { display: none; }
[data-theme="dark"] .mmd-logo--onlight { display: none; }
[data-theme="dark"] .mmd-logo--ondark { display: inline; }
.mmd-app--rail .mmd-sidebar { padding: 18px 8px 14px; align-items: stretch; }
.mmd-app--rail .mmd-sidebar__brand { align-items: center; padding: 4px 0 18px; }
.mmd-app--rail .mmd-sidebar__brand img { height: 22px; }
.mmd-sidebar__nav { flex: 1; min-height: 0; overflow-y: auto; }
.mmd-sidebar__foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }

/* user card */
.mmd-usercard {
  display: flex; align-items: center; gap: 11px; padding: 8px;
  border-radius: var(--radius-md); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.mmd-usercard:hover { background: var(--surface-hover); }
.mmd-usercard__meta { min-width: 0; flex: 1; }
.mmd-usercard__name { font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmd-usercard__sub { font-size: var(--text-2xs); color: var(--text-tertiary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmd-app--rail .mmd-usercard { flex-direction: column; gap: 6px; padding: 8px 0; }
.mmd-app--rail .mmd-usercard__meta { display: none; }
/* Narrow icon rail: pin the sidebar to the viewport so the profile/sign-out are always
   reachable without scrolling the page, and stack the sign-out under the avatar. */
.mmd-app--rail .mmd-sidebar { position: sticky; top: 0; height: 100vh; align-self: start; }

/* ---------- Main column ---------- */
.mmd-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.mmd-topbar {
  display: flex; align-items: center; gap: 16px;
  height: 68px; flex: none; padding: 0 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: color-mix(in srgb, var(--surface-page) 80%, transparent);
  backdrop-filter: blur(var(--blur-md));
  position: sticky; top: 0; z-index: 20;
}
.mmd-topbar__titles { min-width: 0; }   /* let the title/sub truncate instead of wrapping + growing the bar */
.mmd-topbar__title { font-size: var(--text-h2); font-weight: var(--weight-semibold);
  letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmd-topbar__sub { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmd-topbar__spacer { flex: 1; }
.mmd-topbar__search {
  display: flex; align-items: center; gap: 8px; width: 280px; height: 38px;
  padding: 0 13px; border-radius: var(--radius-pill);
  background: var(--surface-sunken); border: 1px solid transparent;
  color: var(--text-tertiary); font-size: var(--text-sm);
}
.mmd-topbar__search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0;
  font-family: var(--font-sans); font-size: var(--text-sm); color: var(--text-primary); }
.mmd-topbar__search svg { width: 17px; height: 17px; }

.mmd-content { flex: 1; min-height: 0; overflow-y: auto; padding: 28px; }
.mmd-content__inner { max-width: 1120px; margin: 0 auto; }
@media (min-width: 1600px) {
  .mmd-content { padding: 32px 40px; }
  .mmd-content__inner { max-width: 1320px; }
}
@media (min-width: 1920px) {
  .mmd-content { padding: 40px 56px; }
  .mmd-content__inner { max-width: 1560px; }
  .mmd-app:not(.mmd-app--rail):not(.mmd-app--mobile) { grid-template-columns: 300px 1fr; }
}
@media (min-width: 2560px) {
  .mmd-content { padding: 52px 80px; }
  .mmd-content__inner { max-width: 2040px; }
  .mmd-app:not(.mmd-app--rail):not(.mmd-app--mobile) { grid-template-columns: 340px 1fr; }
}
/* 4K+ — scale the whole UI up (rem-based tokens grow with root font-size) */
@media (min-width: 3200px) {
  html { font-size: 20px; }
  .mmd-topbar { height: 88px; padding: 0 40px; }
  .mmd-content { padding: 64px 96px; }
  .mmd-content__inner { max-width: 2560px; }
  .mmd-grid { gap: 26px; }
  .mmd-app:not(.mmd-app--rail):not(.mmd-app--mobile) { grid-template-columns: 380px 1fr; }
}
@media (min-width: 3800px) {
  html { font-size: 24px; }
  .mmd-topbar { height: 104px; padding: 0 56px; }
  .mmd-content { padding: 88px 128px; }
  .mmd-content__inner { max-width: 3040px; }
  .mmd-grid { gap: 32px; }
  .mmd-app:not(.mmd-app--rail):not(.mmd-app--mobile) { grid-template-columns: 440px 1fr; }
}

/* ---------- Section primitives ---------- */
.mmd-grid { display: grid; gap: 18px; }
.mmd-grid--stats { grid-template-columns: repeat(4, 1fr); }
.mmd-grid--2 { grid-template-columns: 1.5fr 1fr; }
.mmd-section { display: flex; flex-direction: column; gap: 18px; }
.mmd-section + .mmd-section { margin-top: 24px; }
.mmd-rowhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.mmd-rowhead__title { font-size: var(--text-h3); font-weight: var(--weight-semibold); letter-spacing: -.01em; }
/* Asset library grid: fixed-width tiles on desktop, two-up on phones (mobile query below).
   The grid sizes the cards, so the inner tile just fills its cell. */
.mmd-assetgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.mmd-asset { width: auto; }

/* hero banner (overview top) */
.mmd-hero {
  position: relative; overflow: hidden;
  border-radius: var(--radius-xl); padding: 28px 30px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-card);
}
.mmd-hero__bg { position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(ellipse 46% 80% at 14% 18%, var(--accent-subtle), transparent 72%),
    radial-gradient(ellipse 48% 80% at 88% 98%, var(--accent-2-subtle), transparent 72%); }
.mmd-hero > * { position: relative; z-index: 1; }
.mmd-hero__eyebrow { color: var(--accent-text); }
.mmd-hero__title { color: var(--text-primary); font-size: var(--text-display-sm); font-weight: var(--weight-bold);
  letter-spacing: -.025em; line-height: 1.08; margin: 10px 0 6px; }
.mmd-hero__sub { color: var(--text-secondary); font-size: var(--text-base); max-width: 520px; }
.mmd-hero__actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* list rows */
.mmd-list { display: flex; flex-direction: column; }
.mmd-row { display: flex; align-items: center; gap: 14px; padding: 13px 6px;
  border-bottom: 1px solid var(--border-subtle); }
.mmd-row:last-child { border-bottom: 0; }
.mmd-thumb { width: 42px; height: 42px; border-radius: var(--radius-md); flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff; }
.mmd-thumb svg { width: 20px; height: 20px; opacity: .9; }
.mmd-row__main { flex: 1; min-width: 0; }
.mmd-row__name { font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmd-row__meta { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }
.mmd-row__num { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-secondary); }

/* activity */
.mmd-act { display: flex; gap: 12px; padding: 11px 4px; }
.mmd-act__dot { width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-subtle); color: var(--accent-text); }
.mmd-act__dot svg { width: 15px; height: 15px; }
.mmd-act__txt { font-size: var(--text-sm); color: var(--text-secondary); line-height: 1.4; }
.mmd-act__txt b { color: var(--text-primary); font-weight: var(--weight-semibold); }
.mmd-act__when { font-size: var(--text-2xs); color: var(--text-tertiary); margin-top: 2px; }

/* ---------- Products table ---------- */
.mmd-table { width: 100%; }
.mmd-thead, .mmd-trow {
  display: grid; grid-template-columns: 2.4fr 1fr 0.8fr 1fr 0.9fr 40px;
  align-items: center; gap: 14px;
}
.mmd-thead { padding: 0 14px 12px; border-bottom: 1px solid var(--border-subtle); }
.mmd-th { font-size: var(--text-2xs); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--text-tertiary); }
.mmd-th--r, .mmd-td--r { text-align: right; justify-self: end; }
.mmd-trow { padding: 12px 14px; border-bottom: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); transition: background var(--dur-fast) var(--ease-out); }
.mmd-trow:hover { background: var(--surface-hover); }
.mmd-prod { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mmd-prod__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mmd-prod__sku { font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--text-tertiary); }
.mmd-td { font-size: var(--text-sm); color: var(--text-secondary); min-width: 0; }
.mmd-td--price { font-weight: var(--weight-semibold); color: var(--text-primary); }
.mmd-card-list { display: none; }

/* account */
.mmd-fieldgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mmd-planrow { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px; border-radius: var(--radius-md); border: 1px solid var(--border-subtle);
  background: var(--surface-sunken); }
.mmd-planrow--active { border-color: var(--accent); background: var(--accent-subtle-2); }
.mmd-plan__name { font-size: var(--text-base); font-weight: var(--weight-semibold); }
.mmd-plan__price { font-size: var(--text-xs); color: var(--text-tertiary); }

/* ---------- Mobile drawer ---------- */
.mmd-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 90;
  backdrop-filter: blur(2px); }
.mmd-drawer { position: fixed; top: 0; left: 0; bottom: 0; width: 268px; z-index: 100;
  background: var(--surface-card); border-right: 1px solid var(--border-default);
  box-shadow: var(--shadow-xl); display: flex; flex-direction: column; padding: 20px 16px 16px;
  animation: mmd-slidein var(--dur-base) var(--ease-out); }
@keyframes mmd-slidein { from { transform: translateX(-100%); } to { transform: translateX(0); } }
.mmd-hamburger { display: none; }
.mmd-app--mobile .mmd-hamburger { display: inline-flex; }

/* ---------- One row that swipes (v0.91.19) ----------
   Pills and chips that pick what is shown (Assets' kinds, Users' level chips, Analytics' filters): one row,
   swiped sideways when it does not fit — never a second row, never the page scrolling sideways. */
.mmd-swipe { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overflow-y: hidden; max-width: 100%;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.mmd-swipe::-webkit-scrollbar { display: none; }
.mmd-swipe > * { flex: none; }
/* A grid's columns may shrink below their content's widest word, so a card never pushes the page wider. */
.mmd-grid > * { min-width: 0; }
.mm-card { overflow-wrap: break-word; }   /* break a word only when it cannot fit at all — "anywhere" let rows squeeze a name to one letter a line (v0.91.20) */

/* ---------- Admin on a phone (v0.91.20) ---------- */
.mmd-filtertoggle { display: none; }
.mmd-filtertoggle.is-set { border-color: var(--accent); color: var(--accent-text); }
.mmd-phoneonly { display: none; }
/* Users' row: the person, then the details and tags; on a desktop side by side. */
.mmd-uline-a { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; }
.mmd-uline-b { display: flex; align-items: center; gap: 12px; flex: none; min-width: 0; }
@media (max-width: 760px) {
  .mmd-filtertoggle { display: inline-flex; flex: none; }
  .mmd-filterbox:not(.is-open) { display: none !important; }
  .mmd-filterbox, .mmd-filterbar { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px !important; }
  .mmd-filterbox select, .mmd-filterbar select { width: 100% !important; max-width: none !important; min-width: 0 !important; font-size: var(--text-xs); padding-left: 10px; padding-right: 26px; text-overflow: ellipsis; }
  .mmd-filterbar input[type="search"] { grid-column: 1 / -1; width: 100%; box-sizing: border-box; flex: none !important; min-width: 0 !important; }
  .mmd-filterbox > .mm-btn { grid-column: 1 / -1; justify-self: start; }
  .mmd-phoneonly { display: block; }
  .mmd-uhead { flex-wrap: wrap; row-gap: 6px; padding: 10px 12px !important; }
  .mmd-uhead .mmd-uline-a { flex: 1 1 calc(100% - 30px); }
  .mmd-uhead .mmd-uline-b { order: 3; flex: 1 1 100%; justify-content: space-between; flex-wrap: wrap; row-gap: 6px; }
  .mmd-uhead .mmd-uchev { order: 2; }
  .mmd-breakdown { height: auto !important; max-height: 216px; }
  .mmd-rowtools { flex: 1 1 100% !important; }
  .mmd-rowtools > :first-child { flex: 1 1 auto !important; min-width: 0 !important; }
}

/* ---------- Search + filters over a list (Projects, Pages, v0.91.19) ----------
   The header: the tabs, then the search and the New button side by side. */
.mmd-rowtools { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mmd-search { position: relative; display: flex; align-items: center; flex: 0 1 300px; min-width: 0; }
.mmd-search > svg { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--text-tertiary); pointer-events: none; }
.mmd-search input { width: 100%; box-sizing: border-box; padding: 8px 12px 8px 34px; border: 1px solid var(--border-default);
  border-radius: 10px; background: var(--surface-card); color: var(--text-primary); font: inherit; font-size: var(--text-sm); }
.mmd-search input:focus { outline: none; border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-subtle); }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .mmd-grid--stats { grid-template-columns: repeat(2, 1fr); }
  .mmd-grid--2 { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .mmd-content { padding: 18px 16px; }
  .mmd-topbar { padding: 0 16px; height: 60px; gap: 10px; }
  .mmd-topbar__search { display: none; }
  .mmd-topbar__title { font-size: var(--text-h3); }
  .mmd-grid { gap: 14px; }
  .mmd-grid--stats { grid-template-columns: repeat(2, 1fr); }
  .mmd-hero { padding: 24px 22px; }
  .mmd-hero__title { font-size: var(--text-h1); }
  .mmd-hero__sub { font-size: var(--text-sm); }
  /* products: table → cards */
  .mmd-thead { display: none; }
  .mmd-table .mmd-trow { display: none; }
  .mmd-card-list { display: flex; flex-direction: column; gap: 12px; }
  .mmd-fieldgrid { grid-template-columns: 1fr; }
  /* row header (e.g. Projects tabs + "New project"): wrap so the button drops to its own
     row instead of running off the screen. */
  .mmd-rowhead { flex-wrap: wrap; }
  .mmd-rowhead > :first-child { flex: 1 1 100%; min-width: 0; }
}
@media (max-width: 560px) {
  /* Assets: two thumbnails per row, a touch shorter. */
  .mmd-assetgrid { grid-template-columns: repeat(2, 1fr); }
  .mmd-asset > div:first-child > * { height: 100px !important; }
  /* THE NUMBER CARDS, SMALLER (v0.91.19). Sajjad: Overview's and Analytics' cards "a little large for mobile".
     Two in a row, tighter, the number a size down — the whole picture fits on one screen. */
  .mmd-grid--stats { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .mmd-grid--stats .mm-stat { padding: 12px 12px 13px; gap: 6px; border-radius: var(--radius-md); }
  .mmd-grid--stats .mm-stat__label { font-size: var(--text-2xs); letter-spacing: .03em; }
  .mmd-grid--stats .mm-stat__icon { width: 26px; height: 26px; }
  .mmd-grid--stats .mm-stat__icon svg { width: 14px; height: 14px; }
  .mmd-grid--stats .mm-stat__value { font-size: 26px; }
  .mmd-grid--stats .mm-stat__foot { font-size: var(--text-2xs); }
  /* A button never wider than the phone: a long label (a model's name in Turkish) goes onto a second line. */
  .mmd-content .mm-btn { max-width: 100%; height: auto; min-height: var(--_h); white-space: normal; text-align: center; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
  /* The header on a phone: the tabs on their row (they swipe), then the search and New side by side; a header's
     buttons a size smaller, so "Import" and "Add product" fit together. */
  .mmd-rowhead > :not(:first-child) { display: flex; flex-wrap: wrap; gap: 8px; max-width: 100%; flex: 1 1 100%; }
  .mmd-rowtools { flex-wrap: nowrap !important; }
  .mmd-rowtools .mmd-search { flex: 1 1 auto; }
  .mmd-rowhead .mm-btn { height: var(--control-sm, 32px); padding: 0 14px; font-size: var(--text-sm); flex: none; }
  /* Smaller pictures on a card, so more of the list fits on one screen. */
  .mmd-cardthumb { height: 104px !important; }
  /* Products: the cards stand on their own, without a card around them. */
  .mmd-listcard { background: transparent; border: 0; box-shadow: none; padding: 0 !important; }
}
@media (max-width: 420px) {
  .mmd-newbtn > span { display: none; }   /* only the + on a small phone; its name stays as the button's label */
  .mmd-newbtn { padding: 0 10px !important; }
}
@media (max-width: 460px) {
  .mmd-content { padding: 14px 12px; }
  .mmd-hero { padding: 20px 18px; border-radius: var(--radius-lg); }
  .mmd-hero__title { font-size: var(--text-h2); }
  .mmd-hero__actions { gap: 8px; }
  .mmd-hero__actions > * { flex: 1 1 100%; }
}

/* ---------- Analytics ---------- */
.mmd-bars { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 8px; }
.mmd-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; height: 100%; justify-content: flex-end; }
.mmd-bar__fill { width: 100%; max-width: 34px; border-radius: 7px 7px 3px 3px;
  background: var(--accent); transition: height var(--dur-slow) var(--ease-out); }
.mmd-bar:hover .mmd-bar__fill { filter: brightness(1.08); }
.mmd-bar__label { font-size: var(--text-2xs); color: var(--text-tertiary); font-family: var(--font-mono); }
.mmd-barmeter { height: 7px; border-radius: 999px; background: var(--surface-sunken); overflow: hidden; }
.mmd-barmeter__fill { height: 100%; border-radius: 999px; background: var(--brand-teal); }

/* ---------- Code snippet ---------- */
.mmd-snippet { position: relative; background: var(--surface-sunken); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); padding: 14px 16px; overflow-x: auto; }
.mmd-snippet code { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--text-secondary);
  white-space: pre; line-height: 1.6; }
.mmd-snippet .tok { color: var(--accent-text); }
.mmd-snippet .str { color: var(--brand-teal); }
/* Phones: wrap the embed code so it fits instead of scrolling sideways (defined after the
   base rule above so it wins on source order). */
@media (max-width: 760px) { .mmd-snippet code { white-space: pre-wrap; word-break: break-word; } }

/* ---------- Integrations / store rows ---------- */
.mmd-storerow { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); background: var(--surface-card); }
.mmd-storerow__logo { width: 44px; height: 44px; border-radius: var(--radius-md); flex: none;
  display: flex; align-items: center; justify-content: center; color: #fff; }
.mmd-storerow__main { flex: 1; min-width: 0; }

/* ---------- Theme control ---------- */
.mmd-swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.mmd-swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; position: relative;
  box-shadow: 0 0 0 1px var(--border-default) inset; transition: transform var(--dur-fast) var(--ease-out); }
.mmd-swatch:hover { transform: scale(1.08); }
.mmd-swatch--on { box-shadow: 0 0 0 2px var(--surface-card), 0 0 0 4px var(--accent); }
.mmd-segctl { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-sunken);
  border-radius: var(--radius-md); }
.mmd-seg { padding: 6px 12px; border-radius: calc(var(--radius-md) - 3px); font-size: var(--text-xs);
  font-weight: var(--weight-semibold); color: var(--text-secondary); cursor: pointer; border: 0; background: transparent;
  font-family: var(--font-sans); transition: background var(--dur-fast) var(--ease-out); }
.mmd-seg--on { background: var(--surface-card); color: var(--text-primary); box-shadow: var(--shadow-xs); }
.mmd-preview { aspect-ratio: 4 / 3; border-radius: var(--radius-lg); border: 1px solid var(--border-subtle);
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.mmd-toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle); }
.mmd-toggle-row:last-child { border-bottom: 0; }

/* ---------- Settings ---------- */
.mmd-keyrow { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-subtle); }
.mmd-keyrow:last-child { border-bottom: 0; }
.mmd-keyrow__val { font-family: var(--font-mono); font-size: var(--text-sm); color: var(--text-secondary); }

/* ---------- Sign-in (auth gate) ---------- */
.mmd-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--surface-page); }
.mmd-auth__card { width: 100%; max-width: 400px; background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 32px 28px; }
.mmd-auth__brand { display: flex; justify-content: center; margin-bottom: 20px; }
.mmd-auth__brand img { height: 26px; width: auto; }
.mmd-auth__title { font-size: var(--text-h2); font-weight: var(--weight-bold); letter-spacing: -.02em; text-align: center; }
.mmd-auth__sub { color: var(--text-secondary); font-size: var(--text-sm); text-align: center; margin: 6px 0 22px; }
.mmd-auth__field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.mmd-auth__field > span { font-size: var(--text-xs); font-weight: var(--weight-semibold); color: var(--text-secondary); }
.mmd-auth__input { height: 44px; padding: 0 14px; border-radius: var(--radius-md); border: 1px solid var(--border-default);
  background: var(--surface-sunken); color: var(--text-primary); font-family: var(--font-sans); font-size: var(--text-sm);
  outline: none; transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.mmd-auth__input:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
/* As a TEXTAREA this control has no vertical centring to lean on, so the shared `padding: 0 14px`
   left the first line — and the placeholder — jammed against the top border. Give it real
   vertical padding and drop the fixed height so min-height/rows decide the size. */
textarea.mmd-auth__input { height: auto; padding-top: 11px; padding-bottom: 11px; line-height: 1.55; }
.mmd-auth__ts { display: flex; justify-content: center; margin-bottom: 14px; }
.mmd-auth__ts:empty { display: none; }
.mmd-auth .mm-btn { margin-bottom: 12px; }
.mmd-auth__divider { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; color: var(--text-tertiary); font-size: var(--text-xs); }
.mmd-auth__divider::before, .mmd-auth__divider::after { content: ""; flex: 1; height: 1px; background: var(--border-subtle); }
.mmd-auth__gicon { display: inline-flex; align-items: center; }
.mmd-auth__msg { font-size: var(--text-sm); text-align: center; margin-bottom: 14px; border-radius: var(--radius-md); }
.mmd-auth__msg:empty { display: none; }
.mmd-auth__msg[data-kind="error"] { color: var(--danger-text); background: var(--danger-surface); padding: 10px 12px; }
.mmd-auth__msg[data-kind="ok"] { color: var(--success-text); background: var(--success-surface); padding: 10px 12px; }
.mmd-auth__legal { font-size: var(--text-2xs); color: var(--text-tertiary); text-align: center; margin-top: 16px; line-height: 1.5; }
.mmd-auth__legal a { color: var(--text-secondary); text-decoration: underline; }

/* version text, stacked UNDER the sidebar logo (keeps the sidebar narrow) */
.mmd-version { margin-left: 0; align-self: flex-start; font-family: var(--font-mono); font-size: 10px;
  color: var(--text-tertiary); background: var(--surface-sunken); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill); padding: 1px 7px; letter-spacing: .02em; white-space: nowrap; }
.mmd-app--rail .mmd-version { display: none; }

/* mobile topbar avatar button (opens the drawer) */
.mmd-avatarbtn { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; display: inline-flex; align-items: center; }

/* mobile account dropdown (from the topbar avatar) */
.mmd-scrim--clear { background: transparent; }
.mmd-usermenu { position: fixed; top: 56px; right: 12px; z-index: 1001; width: 224px; background: var(--surface-card);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 6px; }
.mmd-usermenu__head { padding: 10px 10px 9px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 4px; }
.mmd-usermenu__email { font-size: var(--text-sm); font-weight: 600; word-break: break-all; }
.mmd-usermenu__level { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }
.mmd-usermenu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0;
  background: none; color: var(--text-secondary); font: inherit; font-size: var(--text-sm); border-radius: var(--radius-md);
  cursor: pointer; text-align: left; }
.mmd-usermenu__item:hover { background: var(--surface-hover); color: var(--text-primary); }

/* analytics — category groups, project rows, feature tags */
.mmd-alist { display: flex; flex-direction: column; }
.mmd-arow { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 2px; border-top: 1px solid var(--border-subtle); }
.mmd-arow:first-child { border-top: 0; }
.mmd-arow__main { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.mmd-arow__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary);
  text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
a.mmd-arow__name:hover { color: var(--accent-text); text-decoration: underline; }
.mmd-arow__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mmd-ftag { font-size: 11px; line-height: 1; font-weight: var(--weight-medium); padding: 4px 8px;
  border-radius: 999px; background: var(--accent-subtle); color: var(--accent-text); white-space: nowrap; }
.mmd-ftag--muted { background: var(--surface-sunken); color: var(--text-tertiary); }
.mmd-arow__metrics { display: flex; gap: 22px; flex-shrink: 0; }
.mmd-metric { text-align: right; }
.mmd-metric__k { font-size: var(--text-xs); color: var(--text-tertiary); }
.mmd-metric__v { font-size: var(--text-sm); font-family: var(--font-mono); color: var(--text-primary); margin-top: 2px; }
@media (max-width: 560px) {
  .mmd-arow { flex-direction: column; align-items: stretch; gap: 10px; }
  .mmd-arow__metrics { gap: 18px; }
  .mmd-metric { text-align: left; }
}
.mmd-cathead { display: flex; align-items: center; gap: 11px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--border-subtle); cursor: pointer; user-select: none; }
.mmd-cat__chev { display: flex; color: var(--text-tertiary); transition: transform .15s; transform: rotate(90deg); }
.is-collapsed .mmd-cat__chev { transform: rotate(0deg); }
.is-collapsed .mmd-alist { display: none; }
.is-collapsed .mmd-cathead { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }

/* projects — card overflow menu */
.mmd-cardmenu { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; display: flex;
  align-items: center; justify-content: center; border: 0; border-radius: var(--radius-md); cursor: pointer;
  color: #fff; background: rgba(10,10,16,.42); backdrop-filter: blur(4px); transition: background .15s; }
.mmd-cardmenu:hover { background: rgba(10,10,16,.62); }
.mmd-menu { position: fixed; z-index: 1001; min-width: 192px; background: var(--surface-card);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 6px; }
.mmd-menu__item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0;
  background: none; color: var(--text-secondary); font: inherit; font-size: var(--text-sm); border-radius: var(--radius-md);
  cursor: pointer; text-align: left; }
.mmd-menu__item:hover { background: var(--surface-hover); color: var(--text-primary); }
.mmd-menu__item--danger { color: var(--danger-text); }
.mmd-menu__item--danger:hover { background: var(--danger-subtle, rgba(220,60,60,.12)); color: var(--danger-text); }

/* theme section — editor + live preview */
.mmd-theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 920px) { .mmd-theme-grid { grid-template-columns: 1fr; } }
.mmd-preview-frame { position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border-subtle); min-height: 460px; }
.mmd-bg--checker { background-color: var(--surface-card); background-image: repeating-conic-gradient(var(--surface-sunken) 0% 25%, transparent 0% 50%); background-size: 22px 22px; background-position: 50%; }
.mmd-bg--light { background: #f4f4f7; }
.mmd-bg--dark { background: #15151c; }
.mmd-preview-stage { position: relative; width: 100%; height: clamp(460px, calc(100dvh - 330px), 860px); }
.mmd-field { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 12px; padding: 7px 0; }
.mmd-field__l { font-size: var(--text-xs); color: var(--text-tertiary); }
.mmd-field__c { min-width: 0; display: flex; align-items: center; }
.mmd-seg { display: inline-flex; background: var(--surface-sunken); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 3px; gap: 3px; flex-wrap: wrap; }
.mmd-seg__b { border: 0; background: none; color: var(--text-secondary); font: inherit; font-size: var(--text-xs); font-weight: var(--weight-medium);
  padding: 6px 12px; border-radius: calc(var(--radius-md) - 3px); cursor: pointer; }
.mmd-seg__b.is-on { background: var(--surface-card); color: var(--text-primary); box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.12)); }
.mmd-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mmd-preset { text-align: left; border: 1px solid var(--border-subtle); background: var(--surface-card); border-radius: var(--radius-md); padding: 10px 12px; cursor: pointer; }
.mmd-preset:hover { border-color: var(--accent-text); }
.mmd-preset__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.mmd-preset__blurb { font-size: var(--text-xs); color: var(--text-tertiary); margin-top: 2px; }
.mmd-anchor { display: grid; grid-template-columns: repeat(3, 30px); grid-auto-rows: 30px; gap: 5px; }
.mmd-anchor__b { border: 1px solid var(--border-subtle); background: var(--surface-sunken); border-radius: 6px; cursor: pointer; }
.mmd-anchor__b.is-on { background: var(--accent-text); border-color: var(--accent-text); }
.mmd-slider { flex: 1; }
.mmd-slider__v { font-size: var(--text-xs); font-family: var(--font-mono); color: var(--text-secondary); min-width: 34px; text-align: right; }
.mmd-toggle { width: 42px; height: 24px; border-radius: 999px; border: 1px solid var(--border-subtle); background: var(--surface-sunken); position: relative; cursor: pointer; transition: background .15s; }
.mmd-toggle::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-tertiary); transition: transform .15s, background .15s; }
.mmd-toggle.is-on { background: var(--accent-text); border-color: var(--accent-text); }
.mmd-toggle.is-on::after { transform: translateX(18px); background: #fff; }
.mmd-color { width: 44px; height: 30px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: none; cursor: pointer; padding: 2px; }

/* mobile preview — in-place phone-width wrapper (no iframe) */
.mmd-phone { position: relative; width: 390px; max-width: 100%; height: min(844px, calc(100% - 20px)); margin: 10px auto; overflow: hidden; border-radius: 26px; border: 1px solid var(--border-subtle); box-shadow: 0 14px 44px rgba(0,0,0,.3); }

/* #1 per-feature tag colours — branding families: purples (motion), oranges (spatial), teal (pfx) */
.mmd-ftag--animate   { background: rgba(167, 139, 250, .16); color: #a78bfa; }
.mmd-ftag--scrollFX  { background: rgba(139, 92, 246, .16);  color: #8b5cf6; }
.mmd-ftag--sequencer { background: rgba(109, 40, 217, .20);  color: #6d28d9; }
.mmd-ftag--hotspot   { background: rgba(249, 115, 22, .16);  color: #f97316; }
.mmd-ftag--dimension { background: rgba(234, 179, 8, .20);   color: #ca8a04; }
.mmd-ftag--pfx       { background: rgba(43, 184, 166, .16);  color: #2bb8a6; }
.mmd-ftag--timeline  { background: rgba(124, 58, 237, .14);  color: #7c3aed; }
.mmd-ftag--rig       { background: rgba(236, 72, 153, .14);  color: #db2777; }
[data-theme="dark"] .mmd-ftag--sequencer { color: #9f7aea; }
[data-theme="dark"] .mmd-ftag--dimension { color: #eab308; }

/* #5 sticky preview while scrolling the controls (only in the 2-column layout) */
@media (min-width: 921px) {
  .mmd-preview-col { position: sticky; top: 16px; align-self: start; }
}

/* #6 placement grid: disabled center cell = the model, so the 8 anchors sit in true positions */
.mmd-anchor__b--mid { cursor: default; background: transparent; border-style: dashed; opacity: .6; position: relative; }
.mmd-anchor__b--mid::after { content: ''; position: absolute; inset: 0; margin: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--text-tertiary); }
.mmd-anchor__b--mid:hover { background: transparent; }

/* #8/#9 preview toolbar, backdrop + expand/fullscreen */
.mmd-preview-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mmd-preview-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mmd-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle); background: var(--surface-card); color: var(--text-secondary); cursor: pointer; }
.mmd-iconbtn:hover { color: var(--text-primary); border-color: var(--accent-text); }
.mmd-pv-close { position: absolute; top: 10px; right: 10px; z-index: 2; display: none; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 999px; border: 0; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; }
.mmd-preview-frame.is-expanded .mmd-pv-close { display: flex; }
.mmd-pv-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1000; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.mmd-preview-frame.is-expanded { position: fixed; inset: 28px; z-index: 1001; min-height: 0; box-shadow: 0 24px 64px rgba(0,0,0,.5); }
.mmd-preview-frame.is-expanded .mmd-preview-stage { height: 100%; }

/* #10 custom presets row + delete */
.mmd-preset--custom { display: flex; align-items: stretch; gap: 0; padding: 0; overflow: hidden; }
.mmd-preset__open { flex: 1; min-width: 0; text-align: left; border: 0; background: none; padding: 10px 12px; cursor: pointer; color: inherit; font: inherit; }
.mmd-preset__del { border: 0; border-left: 1px solid var(--border-subtle); background: none; color: var(--text-tertiary); cursor: pointer; padding: 0 10px; display: flex; align-items: center; }
.mmd-preset__del:hover { color: var(--danger-text); background: var(--surface-sunken); }

/* theme editor text inputs (Texts card) */
.mmd-text { width: 100%; font: inherit; font-size: var(--text-sm); color: var(--text-primary); background: var(--surface-sunken);
  border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 7px 10px; }
.mmd-text:focus { outline: none; border-color: var(--accent-text); }


/* ── AI sections: brand emphasis + responsive input ─────────────────────────── */
.mmd-card--ai.mm-card { background:
    linear-gradient(180deg, var(--accent-subtle), transparent 64%), var(--surface-card);
  border-color: var(--accent-subtle-2); }
.mmd-btn-gradient.mm-btn { background: linear-gradient(135deg, var(--accent), var(--accent-2, var(--accent)));
  color: #fff; border-color: transparent; }
.mmd-btn-gradient.mm-btn:hover { filter: brightness(1.06); }
.mmd-btn-gradient.mm-btn svg { color: #fff; }
.mmd-ai-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.mmd-ai-row__field { flex: 1 1 240px; min-width: 0; }
.mmd-ai-row__field .mmd-auth__input { width: 100%; box-sizing: border-box; }
.mmd-ai-row > .mm-btn { flex: 0 0 auto; }
@media (max-width: 560px) {
  .mmd-ai-row__field { flex-basis: 100%; }
  .mmd-ai-row > .mm-btn { width: 100%; justify-content: center; }
}

/* ---------- Embeds: the embed builder (v0.85.1) ---------- */
/* warnings in the builder are a dark orange (Sajjad, v0.86.0) — brighter on the dark theme to stay readable */
:root { --mmd-emb-warn: #c2410c; }
[data-theme="dark"] { --mmd-emb-warn: #f08a4b; }
.mmd-emb-step { display: flex; flex-direction: column; gap: 12px; }
.mmd-emb-step__h { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--text-primary); }
.mmd-emb-fact { font-size: var(--text-xs); color: var(--text-tertiary); padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border-subtle); background: var(--surface-card); }
.mmd-emb-fact--on { color: var(--brand-teal); border-color: color-mix(in srgb, var(--brand-teal) 40%, transparent); }
.mmd-emb-styles { display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); gap: 12px; }   /* auto-fit: the cards always stretch to the full content width, on a 4K screen too */
.mmd-emb-style { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 12px; cursor: pointer;
  background: var(--surface-card); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg);
  color: var(--text-primary); font-family: var(--font-sans);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.mmd-emb-style:hover { border-color: var(--border-strong); }
.mmd-emb-style:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.mmd-emb-style--on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.mmd-emb-style__name { font-size: var(--text-sm); font-weight: var(--weight-semibold); margin-top: 4px; }
.mmd-emb-style__desc { font-size: var(--text-xs); color: var(--text-tertiary); line-height: 1.45; }
.mmd-emb-style__warn { font-size: var(--text-2xs); color: var(--mmd-emb-warn); font-weight: var(--weight-semibold); }
/* the little drawn page: text lines, a box, the object */
.mmd-emb-pic { position: relative; height: 70px; border-radius: var(--radius-md); background: var(--surface-sunken);
  border: 1px solid var(--border-subtle); overflow: hidden; }
.mmd-emb-pic i { position: absolute; display: block; }
.mmd-emb-pic__txt { left: 16px; height: 5px; border-radius: 3px; background: var(--border-strong); opacity: .7; }
.mmd-emb-pic__box { border-radius: 6px; background: var(--surface-card); border: 1px solid var(--border-default); }
.mmd-emb-pic__box--frame { border-style: dashed; }
.mmd-emb-pic__obj { border-radius: 30%; background: var(--brand-gradient); transform: rotate(12deg); }
.mmd-emb-pic__rail { left: 14px; top: 9px; bottom: 9px; width: 5px; border-radius: 3px; background: var(--border-default); }
.mmd-emb-pic__rail--on { bottom: auto; height: 22px; background: var(--brand-gradient); }
.mmd-emb-note { font-size: var(--text-xs); color: var(--text-secondary); padding: 9px 12px; border-radius: var(--radius-md);
  background: var(--surface-sunken); line-height: 1.5; }
.mmd-emb-note--warn { color: var(--mmd-emb-warn); background: color-mix(in srgb, var(--mmd-emb-warn) 10%, transparent); }
.mmd-emb-pf { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mmd-emb-pf__b { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border-subtle); background: transparent;
  color: var(--text-secondary); font-size: var(--text-xs); font-family: var(--font-sans); cursor: pointer; }
.mmd-emb-pf__b:hover { border-color: var(--border-strong); }
.mmd-emb-pf__b--on { background: var(--accent-subtle); color: var(--accent-text); border-color: transparent; font-weight: var(--weight-semibold); }
.mmd-emb-pf + .mmd-emb-note { margin-bottom: 12px; }
.mmd-emb-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px;
  font-size: var(--text-sm); color: var(--text-secondary); }
.mmd-emb-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px; align-items: start; }
.mmd-emb-previewcol { position: sticky; top: 16px; min-width: 0; }
/* desktop preview: a 16:9 window (a 1280 × 720 page scaled to fit); phone: a 9:16 phone (v0.86.1) */
.mmd-emb-stage { aspect-ratio: 16 / 9; border-radius: var(--radius-md);
  overflow: hidden; border: 1px solid var(--border-subtle); background: var(--surface-sunken);
  display: flex; justify-content: flex-start; }
.mmd-emb-stage--phone { aspect-ratio: auto; padding: 14px 0; justify-content: center; }
.mmd-emb-frame { width: 100%; height: 100%; border: 0; display: block; background: #0e0e16; flex: none; transform-origin: 0 0; }
.mmd-emb-stage--phone .mmd-emb-frame { width: min(360px, 100%); height: auto; aspect-ratio: 9 / 16; border-radius: 22px; border: 6px solid #1b1b24; box-sizing: border-box; }
@media (max-width: 1100px) {
  .mmd-emb-grid { grid-template-columns: 1fr; }
  .mmd-emb-previewcol { position: static; order: -1; }
}
.mmd-emb-grid .mmd-toggle-row > .mmd-segctl, .mmd-emb-grid .mmd-toggle-row > .mm-switch { flex: none; }
.mmd-emb-grid .mmd-seg, .mmd-emb-previewcol .mmd-seg { white-space: nowrap; }
/* phones: the style cards become one row to swipe through, not five screens of stacked cards */
@media (max-width: 560px) {
  .mmd-emb-styles { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 74%;
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; }
  .mmd-emb-style { scroll-snap-align: start; }
}
/* step numbers: a purple circle, bold, so the five steps read at a glance (v0.86.0) */
.mmd-emb-num-row { display: inline-flex; align-items: center; gap: 10px; }
.mmd-emb-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; background: var(--brand-purple); color: #fff; font-size: 14px; font-weight: 800;
  font-family: var(--font-sans); line-height: 1;
}
.mmd-emb-step__h { font-size: var(--text-lg); font-weight: var(--weight-bold); }
.mm-card__title .mmd-emb-num-row { font-weight: var(--weight-bold); }
.mmd-emb-steps--dots { list-style: disc; }
/* what the project has, and the style that suits it (v0.86.0) */
.mmd-emb-facts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mmd-emb-style__rec { align-self: flex-start; margin-top: 2px; font-size: var(--text-2xs); font-weight: var(--weight-bold);
  letter-spacing: .02em; color: #fff; background: var(--brand-purple); padding: 3px 9px; border-radius: 999px; }
.mmd-emb-note--warn .mmd-emb-fact { color: var(--mmd-emb-warn); border-color: color-mix(in srgb, var(--mmd-emb-warn) 35%, transparent); background: transparent; }
/* one project / combine projects, and the layer cards (v0.86.1) */
.mmd-emb-step__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.mmd-emb-layers { display: flex; flex-direction: column; gap: 12px; }
.mmd-emb-layer { border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 14px 16px; background: var(--surface-card); }
.mmd-emb-layer__h { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: var(--text-sm); font-weight: var(--weight-bold); }
.mmd-emb-num--sm { width: 22px; height: 22px; font-size: 12px; }
.mmd-emb-layer .mmd-emb-pf { margin-bottom: 4px; }
.mmd-emb-grid .mmd-toggle-row { flex-wrap: wrap; }
.mmd-emb-grid .mmd-toggle-row > div:first-child { flex: 1 1 200px; }

/* ---------- Searchable dropdown (js/ui-select.js, v0.86.5) — looks like .mm-select, opens a list you can type into ---------- */
.mm-ssel { position: relative; min-width: 0; width: 100%; }
.mm-ssel__btn { position: relative; display: flex; align-items: center; text-align: left; }
.mm-ssel__txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-ssel__btn--empty .mm-ssel__txt { color: var(--text-tertiary); }
.mm-ssel__caret { position: absolute; right: 16px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.6px solid var(--text-tertiary); border-bottom: 1.6px solid var(--text-tertiary); transform: rotate(45deg); pointer-events: none; }
.mm-ssel__btn[aria-expanded="true"] { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-subtle); }
.mm-ssel__pop { position: fixed; z-index: 1000; display: flex; flex-direction: column; gap: 6px; padding: 6px;
  background: var(--surface-card); border: 1px solid var(--border-default); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg, 0 16px 40px rgba(0,0,0,.28)); box-sizing: border-box; }
.mm-ssel__pop[hidden] { display: none; }
.mm-ssel__find { width: 100%; box-sizing: border-box; height: var(--control-sm, 32px); font-size: var(--text-sm); flex: none; }
.mm-ssel__list { overflow-y: auto; min-height: 0; flex: 1; }
.mm-ssel__row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: calc(var(--radius-md) - 2px);
  font-size: var(--text-sm); color: var(--text-primary); cursor: pointer; }
.mm-ssel__row--act { background: var(--surface-sunken); }
.mm-ssel__row--on { color: var(--accent-text); font-weight: var(--weight-semibold); }
.mm-ssel__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-ssel__tag { flex: none; font-size: var(--text-2xs); color: var(--text-tertiary); }
.mm-ssel__none { padding: 10px; font-size: var(--text-sm); color: var(--text-tertiary); }

/* FOLDING CARDS (v0.91.35). Sajjad: Profile, Storage & projects and the AI credits' details show their main line and
   open on a click — open on a large screen, closed on a phone; each device remembers what was left open. */
.mmd-fold-head { cursor: pointer; user-select: none; transition: background .15s ease; }
.mmd-fold-head:hover { background: var(--surface-hover); }
.mmd-fold-head:focus-visible { outline: 2px solid var(--focus-ring, var(--brand-violet, #783ce6)); outline-offset: -2px; }
.mmd-fold-chev { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: 4px; border-radius: 8px;
  color: var(--text-tertiary); flex: 0 0 auto; transition: transform .2s ease, background .15s ease, color .15s ease; }
.mmd-fold-head:hover .mmd-fold-chev { background: var(--surface-active); color: var(--text-primary); }
.mmd-fold-head[aria-expanded="true"] .mmd-fold-chev { transform: rotate(180deg); }
.mmd-fold-sum { padding: 0 var(--space-6) var(--space-5); cursor: pointer; }
.mmd-fold-sum:hover { background: var(--surface-hover); }
/* The credits' summary opens its details (Plus, Max, team managers, admins). */
.mmd-credit-open { display: flex; flex-direction: column; gap: 14px; cursor: pointer; border-radius: 12px; margin: -8px; padding: 8px; transition: background .15s ease; }
.mmd-credit-open:hover { background: var(--surface-hover); }
.mmd-credit-open:focus-visible { outline: 2px solid var(--focus-ring, var(--brand-violet, #783ce6)); outline-offset: 2px; }
.mmd-credit-more { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; font-size: var(--text-xs); color: var(--text-secondary); font-weight: var(--weight-medium); }
.mmd-credit-open:hover .mmd-credit-more { color: var(--text-primary); }
.mmd-credit-more svg { transition: transform .2s ease; }
.mmd-credit-open[aria-expanded="true"] .mmd-credit-more svg { transform: rotate(180deg); }
