/* ==========================================================================
   VoiceIQ — My Models page layout (loaded last, after voiceiq-minimal.css).
   Two full-screen views switched by a body class:
     • Models view  (body:not(.studio-open)) — header, stat strip, filter bar, card gallery
     • Studio view  (body.studio-open)       — top bar + writing surface + settings rail
   Tokens only (no hex outside of mask shapes). Every id / script hook of the
   original page is preserved; this sheet only arranges and restyles them.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */
body[data-page="my-models"] > main.models-main { margin-top: 0; }
body[data-page="my-models"] .models-shell { width: min(1240px, calc(100% - 64px)); min-width: 0; margin: 28px auto 0; padding-bottom: 56px; }
body[data-page="my-models"] .studio-view { display: none; }
body[data-page="my-models"].studio-open .models-view { display: none; }
body[data-page="my-models"].studio-open .studio-view { display: block; animation: fade-in .24s var(--ease) both; }
body[data-page="my-models"] .ph.models-head { padding-bottom: 20px; }
body[data-page="my-models"] .ph-actions .button { gap: 7px; }
body[data-page="my-models"] .ph-actions .button svg { flex: 0 0 auto; }
body[data-page="my-models"] .ph-actions .button-ghost { background: var(--surface); }

/* --------------------------------------------------------------------------
   Stat strip — one card, three cells separated by hairlines
   -------------------------------------------------------------------------- */
body[data-page="my-models"] .stat-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0; overflow: hidden; }
body[data-page="my-models"] .stat-cell { display: flex; align-items: center; gap: 14px; min-width: 0; padding: 16px 20px; }
body[data-page="my-models"] .stat-cell + .stat-cell { border-left: 1px solid var(--line); }
body[data-page="my-models"] .stat-cell .stat-icon svg { display: block; }
body[data-page="my-models"] .stat-copy { min-width: 0; }
body[data-page="my-models"] .stat-copy .stat-label { display: block; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-page="my-models"] .stat-copy .library-count {
  display: block; min-width: 0; min-height: 0; margin-top: 3px; padding: 0; border: 0; border-radius: 0; background: transparent;
  color: var(--text); font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -.035em; line-height: 1; font-variant-numeric: tabular-nums;
}
body[data-page="my-models"] .stat-copy .stat-meta { display: block; margin-top: 5px; font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --------------------------------------------------------------------------
   Filter bar — segmented library filters + one search field for every list
   -------------------------------------------------------------------------- */
body[data-page="my-models"] .filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 20px 0 18px; }
body[data-page="my-models"] .library-tabs { display: inline-flex; flex-wrap: nowrap; margin: 0; }
body[data-page="my-models"] .library-tabs button { flex: 0 0 auto; min-height: 32px; padding: 0 12px; font-size: 13px; white-space: nowrap; }
body[data-page="my-models"] .models-view.show-all .library-tabs button:not(#allLibraryTab)[aria-pressed="true"] { background: transparent; border-color: transparent; box-shadow: none; color: var(--muted); }
body[data-page="my-models"] .filter-search { position: relative; display: flex; align-items: center; flex: 0 1 340px; min-width: 0; }
body[data-page="my-models"] .filter-search svg { position: absolute; left: 12px; color: var(--faint); pointer-events: none; }
body[data-page="my-models"] .filter-search input {
  width: 100%; min-height: 38px; padding: 0 44px 0 36px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; outline: none; transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
body[data-page="my-models"] .filter-search input::placeholder { color: var(--faint); }
body[data-page="my-models"] .filter-search input:focus { border-color: var(--text); box-shadow: var(--ring); }
body[data-page="my-models"] .filter-search input:focus-visible { outline: none; }
body[data-page="my-models"] .filter-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; cursor: pointer; background: var(--faint); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat; }
body[data-page="my-models"] .filter-search kbd { position: absolute; right: 10px; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); color: var(--faint); font-family: var(--font-body); font-size: 11px; font-weight: 500; pointer-events: none; }
body[data-page="my-models"] .filter-search input:focus ~ kbd { display: none; }

/* --------------------------------------------------------------------------
   Gallery sections (the three library panels)
   -------------------------------------------------------------------------- */
body[data-page="my-models"] .library-section { margin: 0; padding: 0; border: 0; min-width: 0; }
body[data-page="my-models"] .library-section + .library-section { margin-top: 36px; padding-top: 0; border-top: 0; }
body[data-page="my-models"] .models-view.show-all .library-section[hidden] { display: block !important; }
body[data-page="my-models"] .library-section-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 10px; margin: 0 0 14px; }
body[data-page="my-models"] .library-section-head > div { display: contents; }
body[data-page="my-models"] .library-section-head .kicker { grid-column: 1 / -1; grid-row: 1; display: block; margin: 0; font-size: 12.5px; font-weight: 450; letter-spacing: 0; text-transform: lowercase; color: var(--muted); }
body[data-page="my-models"] .library-section-head .kicker::first-letter { text-transform: uppercase; }
body[data-page="my-models"] .library-section-head h3 { grid-column: 1; grid-row: 2; margin: 3px 0 0; font-size: 18px; letter-spacing: -.025em; }
body[data-page="my-models"] .library-section-copy { grid-column: 1 / -1; grid-row: 3; margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
body[data-page="my-models"] .section-count { grid-column: 2; grid-row: 2; justify-self: start; display: inline-flex; align-items: center; min-height: 22px; margin-top: 3px; padding: 0 8px; border-radius: 6px; background: var(--surface-2); color: var(--text); font-size: 12.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
body[data-page="my-models"] #ownedSearch, body[data-page="my-models"] .public-search-row { display: none; }
body[data-page="my-models"] #restoreMessage { margin: -4px 0 12px; font-size: 13px; }
body[data-page="my-models"] #restoreMessage:empty { display: none; }

/* Card grid — scrolls with the page (no fixed-height lists) */
body[data-page="my-models"] .owned-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; height: auto; max-height: none; margin: 0; padding: 0; overflow: visible; }
body[data-page="my-models"] .favorite-model-row { position: relative; display: block; min-width: 0; }
body[data-page="my-models"] .favorite-model-row .owned-card { flex: none; }

/* Model card */
body[data-page="my-models"] .owned-list .owned-card {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 100%; height: 100%; min-height: 178px;
  padding: 16px 16px 14px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; overflow: hidden;
  transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease), transform var(--t) var(--ease), background var(--t) var(--ease);
}
body[data-page="my-models"] :is(#ownedList, #presetList, #publicList, #favoriteModelList) .owned-card { border-radius: 12px !important; }
body[data-page="my-models"] .owned-list .owned-card:hover { background: var(--surface); border-color: var(--line-strong); box-shadow: var(--shadow-1); transform: translateY(-1px); }
body[data-page="my-models"] .owned-list .owned-card:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
body[data-page="my-models"] .owned-list .owned-card.active { background: var(--surface); border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
body[data-page="my-models"] .owned-list .owned-card.active .model-avatar { background: var(--ink); color: var(--ink-text); box-shadow: none; }
body[data-page="my-models"] .owned-list .owned-card.plus-pinned { background: var(--surface-2); border-color: var(--line-strong); }
body[data-page="my-models"] .model-avatar {
  display: grid; place-items: center; flex: 0 0 auto; width: 44px; height: 44px; border-radius: 999px; background: var(--surface-2); color: var(--text);
  font-size: 15px; font-weight: 600; letter-spacing: -.02em; box-shadow: inset 0 0 0 1px var(--line); transition: background var(--t) var(--ease), color var(--t) var(--ease);
}
body[data-page="my-models"] .owned-card-head { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; width: 100%; height: auto; margin-top: 2px; }
body[data-page="my-models"] .owned-list .owned-card strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 100%; font-size: 14.5px; font-weight: 500; letter-spacing: -.01em; line-height: 1.3; overflow-wrap: anywhere; }
body[data-page="my-models"] .owned-list .owned-badge {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-height: 22px; padding: 0 8px; border: 0; border-radius: 6px; background: var(--surface-2);
  color: var(--muted); font-family: var(--font-body); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; line-height: 1;
}
body[data-page="my-models"] .owned-list .owned-badge > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-page="my-models"] .owned-list .owned-badge .pin-icon { width: 12px; height: 12px; flex: 0 0 12px; margin: 0; }
body[data-page="my-models"] .owned-list .plus-pinned .owned-badge { background: var(--ink); color: var(--ink-text); }
body[data-page="my-models"] .owned-list .owned-card small { display: block; width: 100%; margin-top: auto; padding-top: 6px; font-size: 12px; font-weight: 450; line-height: 1.4; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Hover affordance: a bar slides up from the bottom of the card */
body[data-page="my-models"] .owned-list .owned-card::after {
  content: "Open in studio"; position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; height: 34px; padding: 0 16px;
  background: var(--ink); color: var(--ink-text); font-size: 12.5px; font-weight: 500; letter-spacing: 0; transform: translateY(100%); pointer-events: none;
  transition: transform var(--t) var(--ease);
}
body[data-page="my-models"] .owned-list .owned-card::before {
  content: ""; position: absolute; right: 14px; bottom: 9px; z-index: 1; width: 16px; height: 16px; background: var(--ink-text); transform: translateY(34px); pointer-events: none;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--t) var(--ease);
}
body[data-page="my-models"] .owned-list .owned-card:hover::after, body[data-page="my-models"] .owned-list .owned-card:focus-visible::after,
body[data-page="my-models"] .owned-list .owned-card:hover::before, body[data-page="my-models"] .owned-list .owned-card:focus-visible::before { transform: none; }
body[data-page="my-models"] .owned-list .owned-card.active::after { content: "Open in studio · selected"; }

/* Favourite star — SVG glyph via mask, sits over the card corner */
body[data-page="my-models"] .favorite-model-row > .model-star {
  position: absolute; top: 10px; right: 10px; z-index: 2; display: grid; place-items: center; align-content: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--faint); font-size: 0; line-height: 0; cursor: pointer; transition: color var(--t) var(--ease), background var(--t) var(--ease), transform var(--t) var(--ease);
}
body[data-page="my-models"] .favorite-model-row > .model-star::before {
  content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}
body[data-page="my-models"] .favorite-model-row > .model-star:hover { color: var(--text); background: var(--surface-2); transform: scale(1.06); }
body[data-page="my-models"] .favorite-model-row > .model-star[aria-pressed="true"] { color: var(--text); }
body[data-page="my-models"] .favorite-model-row > .model-star[aria-pressed="true"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E");
}
body[data-page="my-models"] .favorite-model-row > .model-star:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; color: var(--text); }

/* --------------------------------------------------------------------------
   Preset voices — their own group above the community voices (Public panel)
   -------------------------------------------------------------------------- */
body[data-page="my-models"] .preset-group { min-width: 0; }
body[data-page="my-models"] .preset-group + .preset-group, body[data-page="my-models"] .preset-empty + .preset-group { margin-top: 28px; }
body[data-page="my-models"] #presetGroup[hidden] ~ #communityGroup { margin-top: 0; }
body[data-page="my-models"] .preset-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 12px; }
body[data-page="my-models"] .preset-group-head h4 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.015em; line-height: 1.3; color: var(--text); }
body[data-page="my-models"] .preset-group-head .section-count { margin-top: 0; }
body[data-page="my-models"] .preset-group-head p { flex: 0 0 100%; margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); text-wrap: balance; }

/* Preset card: ink "Preset" badge, neutral language chip, description, origin line */
body[data-page="my-models"] .preset-badges { display: flex; flex-wrap: wrap; gap: 6px; max-width: 100%; }
body[data-page="my-models"] .owned-list .owned-badge.preset-badge { background: var(--ink); color: var(--ink-text); }
body[data-page="my-models"] .owned-list .owned-badge.preset-lang { border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); }
body[data-page="my-models"] .preset-desc { display: block; width: 100%; font-size: 12.5px; line-height: 1.45; color: var(--muted); text-align: left; }
/* This line is the only place the card states origin (designed / licensed) and gender, so it uses --muted (AA), not --faint. */
body[data-page="my-models"] .owned-list .preset-card small { white-space: normal; color: var(--muted); }

/* Audition button — a sibling of the card, left of the star. Free to play, never selects the voice. */
body[data-page="my-models"] .favorite-model-row > .preset-play-button {
  position: absolute; top: 10px; right: 44px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px; min-height: 0; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--text); font-size: 0; line-height: 0; cursor: pointer;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
}
body[data-page="my-models"] .favorite-model-row > .preset-play-button::before {
  content: ""; width: 12px; height: 12px; margin-left: 1px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M8 5.5v13a1 1 0 0 0 1.5.9l10-6.5a1 1 0 0 0 0-1.7l-10-6.5A1 1 0 0 0 8 5.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M8 5.5v13a1 1 0 0 0 1.5.9l10-6.5a1 1 0 0 0 0-1.7l-10-6.5A1 1 0 0 0 8 5.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
body[data-page="my-models"] .favorite-model-row > .preset-play-button:hover { background: var(--surface-2); border-color: var(--line-strong); }
body[data-page="my-models"] .favorite-model-row > .preset-play-button.is-playing { background: var(--signal-soft); border-color: var(--signal); color: var(--signal-text); }
body[data-page="my-models"] .favorite-model-row > .preset-play-button.is-playing::before {
  margin-left: 0;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='6' y='5' width='4.5' height='14' rx='1.2'/%3E%3Crect x='13.5' y='5' width='4.5' height='14' rx='1.2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='6' y='5' width='4.5' height='14' rx='1.2'/%3E%3Crect x='13.5' y='5' width='4.5' height='14' rx='1.2'/%3E%3C/svg%3E");
}
/* First play of a voice creates its clip on the server, which takes a few seconds: show a quiet spinner. */
body[data-page="my-models"] .favorite-model-row > .preset-play-button.is-loading { background: var(--surface-2); border-color: var(--line-strong); color: var(--muted); cursor: progress; }
body[data-page="my-models"] .favorite-model-row > .preset-play-button.is-loading::before {
  margin-left: 0; -webkit-mask: none; mask: none; background: transparent; border: 2px solid var(--line-strong); border-top-color: var(--text); border-radius: 50%; box-sizing: border-box; animation: previewSpin .8s linear infinite;
}
@keyframes previewSpin { to { transform: rotate(360deg); } }
body[data-page="my-models"] .favorite-model-row > .preset-play-button:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
/* Windows High Contrast: a masked background is repainted with the button colour, so draw the glyph in a system colour. */
@media (forced-colors: active) {
  body[data-page="my-models"] .favorite-model-row > .preset-play-button::before { forced-color-adjust: none; background: ButtonText; }
  body[data-page="my-models"] .favorite-model-row > .preset-play-button.is-playing { border-color: Highlight; }
  body[data-page="my-models"] .favorite-model-row > .preset-play-button.is-playing::before { background: Highlight; }
  body[data-page="my-models"] .owned-list .owned-badge.preset-badge { border: 1px solid ButtonText; }
}

/* "Presets" filter: only the preset group of the Public panel, under its own heading */
body[data-page="my-models"] .models-view.presets-only:not(.show-all) #communityGroup,
body[data-page="my-models"] .models-view.presets-only:not(.show-all) #publicLibraryPanel > .library-section-head { display: none; }
body[data-page="my-models"] .models-view.presets-only:not(.show-all) .preset-group-head h4 { font-family: var(--font-display); font-size: 18px; letter-spacing: -.025em; }
/* "No preset voices match" belongs to that filter only; everywhere else the community group carries the empty state.
   (.gallery-nomatch.preset-empty outranks the shared .gallery-nomatch { display: flex } rule below.) */
body[data-page="my-models"] .gallery-nomatch.preset-empty { display: none; }
body[data-page="my-models"] .models-view.presets-only:not(.show-all) .gallery-nomatch.preset-empty:not([hidden]) { display: flex; }

/* Empty + loading states: dashed panel with a waveform mark */
body[data-page="my-models"] .owned-list .owned-empty, body[data-page="my-models"] .gallery-nomatch, body[data-page="my-models"] #ownedList:empty, body[data-page="my-models"] #favoriteModelList:not(:has(.favorite-model-row)) {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 178px; margin: 0; padding: 28px 20px;
  border: 1px dashed var(--line-strong); border-radius: 12px; background: transparent; color: var(--muted); font-size: 13.5px; line-height: 1.55; text-align: center;
}
body[data-page="my-models"] .gallery-nomatch { margin-top: 0; }
body[data-page="my-models"] .owned-list .owned-empty::before, body[data-page="my-models"] #ownedList:empty::before, body[data-page="my-models"] #favoriteModelList:not(:has(.favorite-model-row))::before, body[data-page="my-models"] .gallery-nomatch::before {
  content: ""; width: 28px; height: 28px; margin-bottom: 2px; background: var(--faint);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 11v2M8 8v8M12 5v14M16 9v6M20 11v2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M4 11v2M8 8v8M12 5v14M16 9v6M20 11v2'/%3E%3C/svg%3E") center / contain no-repeat;
}
body[data-page="my-models"] #ownedList:empty::after { content: "Loading your models…"; }
body[data-page="my-models"] #favoriteModelList:empty::after { content: "Star a model to save it here. No limit."; }

/* --------------------------------------------------------------------------
   Studio view
   -------------------------------------------------------------------------- */
body[data-page="my-models"] .my-workspace { position: static !important; padding: 0 !important; border: 1px solid var(--line); border-radius: var(--radius-l) !important; background: var(--surface); box-shadow: none; overflow: visible; }

/* Top bar: ← Models · selected model · mode toggle · credits */
body[data-page="my-models"] .studio-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
body[data-page="my-models"] .studio-back { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 12px 0 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-family: var(--font-body); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; transition: background var(--t) var(--ease), border-color var(--t) var(--ease); }
body[data-page="my-models"] .studio-back:hover { background: var(--surface-2); }
body[data-page="my-models"] .studio-model-slot { display: flex; align-items: center; min-width: 0; min-height: 36px; padding-left: 14px; border-left: 1px solid var(--line); }
body[data-page="my-models"] .studio-model { display: flex; align-items: center; gap: 10px; min-width: 0; }
body[data-page="my-models"] .studio-model .owned-avatar { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 999px; background: var(--ink); color: var(--ink-text); font-family: var(--font-body); font-size: 14px; font-weight: 600; display: grid; place-items: center; }
body[data-page="my-models"] .studio-model-copy { min-width: 0; }
body[data-page="my-models"] .studio-model strong { display: block; font-family: var(--font-body); font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-page="my-models"] .studio-model small { display: block; margin-top: 2px; font-family: var(--font-body); font-size: 12px; font-weight: 450; letter-spacing: 0; text-transform: none; line-height: 1.25; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-page="my-models"] .studio-model-empty, body[data-page="my-models"] .studio-model-multi { display: none; min-height: 26px; gap: 6px; white-space: nowrap; }
body[data-page="my-models"] .my-workspace:not(.multi-active):has(#ownedWorkspace[hidden]) .studio-model { display: none; }
body[data-page="my-models"] .my-workspace:not(.multi-active):has(#ownedWorkspace[hidden]) .studio-model-empty { display: inline-flex; }
body[data-page="my-models"] .my-workspace.multi-active .studio-model { display: none; }
body[data-page="my-models"] .my-workspace.multi-active .studio-model-multi { display: inline-flex; color: var(--text); }
body[data-page="my-models"] .studio-bar .voice-modes { margin: 0; flex-wrap: nowrap; }
body[data-page="my-models"] .studio-bar .voice-modes button { white-space: nowrap; }
body[data-page="my-models"] .studio-bar .generation-credit-box { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; max-width: 300px; margin: 0; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); text-align: right; }
body[data-page="my-models"] .studio-bar .generation-credit-box strong { display: block; margin: 0; font-family: var(--font-body); font-size: 13px; font-weight: 600; letter-spacing: 0; color: var(--text); white-space: nowrap; }
body[data-page="my-models"] .studio-bar .generation-credit-box small { display: block; margin: 0; font-size: 11.5px; line-height: 1.35; color: var(--muted); text-align: right; }
body[data-page="my-models"] .studio-bar .generation-credit-box.admin { background: var(--surface-2); border-color: var(--line); }
body[data-page="my-models"] .studio-bar .generation-credit-box.admin strong, body[data-page="my-models"] .studio-bar .generation-credit-box.admin small { color: var(--text); }

/* Body: editor column + settings rail */
body[data-page="my-models"] .studio-body { padding: 20px; }
body[data-page="my-models"] #ownedWorkspace { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: stretch; }
body[data-page="my-models"] .studio-editor { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* Writing surface: label / textarea / footer (meta + delivery tools) inside one bordered panel.
   The panel grows with the column so the editor lines up with the settings rail. */
body[data-page="my-models"] .studio-editor .owned-field { position: relative; flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr) auto; margin: 0; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease); }
body[data-page="my-models"] .studio-editor .owned-field:focus-within { border-color: var(--text); box-shadow: var(--ring); }
body[data-page="my-models"] .studio-editor .owned-field > .field-label { grid-column: 1 / -1; grid-row: 1; margin: 0; padding: 12px 16px 0; font-size: 12.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; text-transform: none; }
body[data-page="my-models"] .studio-editor .owned-field > .emotion-editor, body[data-page="my-models"] .studio-editor .owned-field > textarea { grid-column: 1 / -1; grid-row: 2; width: 100%; min-height: 0; margin: 0; }
body[data-page="my-models"] .studio-editor .owned-field > .emotion-editor { display: flex; flex-direction: column; }
body[data-page="my-models"] .studio-editor .owned-field textarea {
  display: block; flex: 1 1 auto; width: 100%; min-height: 264px; margin: 0; padding: 10px 16px 16px; border: 0 !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; outline: none !important;
  font: inherit; font-size: 17px; line-height: 1.6; color: var(--text); resize: vertical;
}
body[data-page="my-models"] .studio-editor .owned-field textarea:focus, body[data-page="my-models"] .studio-editor .owned-field textarea:focus-visible { border: 0 !important; box-shadow: none !important; outline: none !important; background: transparent !important; }
body[data-page="my-models"] .studio-editor .owned-field textarea::placeholder { color: var(--faint) !important; -webkit-text-fill-color: var(--faint) !important; }
body[data-page="my-models"] .studio-editor .owned-field > .owned-meta {
  grid-column: 1; grid-row: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-width: 0; margin: 0; padding: 9px 16px; border-top: 1px solid var(--line); border-radius: 0 0 0 11px; background: var(--surface-2);
  font-family: var(--font-body); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); font-variant-numeric: tabular-nums; line-height: 1.4;
}
body[data-page="my-models"] .studio-editor .owned-meta b { color: var(--text); font-weight: 600; }
body[data-page="my-models"] .studio-editor .owned-meta .emotion-hint { color: var(--faint); font-size: 11.5px; }
body[data-page="my-models"] .studio-editor .owned-field > .delivery-tools { grid-column: 2; grid-row: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; margin: 0; padding: 7px 10px; border-top: 1px solid var(--line); border-radius: 0 0 11px 0; background: var(--surface-2); }
body[data-page="my-models"] .studio-editor .delivery-tools button { min-height: 30px; padding: 0 10px; font-size: 12.5px; }
body[data-page="my-models"] .studio-editor .delivery-feedback { flex-basis: 100%; font-size: 12.5px; }
body[data-page="my-models"] .studio-editor .owned-field:has(.delivery-tools) > .owned-meta { border-radius: 0 0 0 11px; }
body[data-page="my-models"] .studio-editor .owned-field:not(:has(.delivery-tools)) > .owned-meta { border-radius: 0 0 11px 11px; }

/* Big generate button + status line */
body[data-page="my-models"] .studio-editor .owned-generate { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 46px !important; margin: 0; padding: 0 20px; font-size: 14.5px !important; font-weight: 500; }
body[data-page="my-models"] .studio-editor .owned-generate::before {
  content: ""; width: 16px; height: 16px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9zM19 16l.7 1.8 1.8.7-1.8.7L19 21l-.7-1.8-1.8-.7 1.8-.7z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9zM19 16l.7 1.8 1.8.7-1.8.7L19 21l-.7-1.8-1.8-.7 1.8-.7z'/%3E%3C/svg%3E") center / contain no-repeat;
}
body[data-page="my-models"] .studio-editor .owned-generate:disabled { opacity: .55; cursor: progress; }
body[data-page="my-models"] .studio-editor .owned-message { min-height: 0; margin: 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
body[data-page="my-models"] .studio-editor .owned-message:empty { display: none; }
body[data-page="my-models"] .studio-editor .owned-message:not(:empty) { padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
body[data-page="my-models"] .studio-editor .owned-message.error { color: var(--danger); background: var(--danger-soft); }

/* Rail */
body[data-page="my-models"] .studio-rail { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
body[data-page="my-models"] .rail-card { padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
body[data-page="my-models"] .rail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 12px; }
body[data-page="my-models"] .rail-head h4 { margin: 0; font-size: 13.5px; font-weight: 600; letter-spacing: -.01em; }
body[data-page="my-models"] .rail-head span { font-size: 12px; color: var(--faint); }
body[data-page="my-models"] .studio-rail .generation-settings { display: block; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; }
body[data-page="my-models"] .studio-rail .generation-settings label { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0; font-family: var(--font-body); font-size: 12.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
body[data-page="my-models"] .studio-rail .generation-settings output { min-width: 46px; padding: 3px 6px; border-radius: 6px; background: var(--surface-2); color: var(--text); font-family: var(--font-body); font-size: 12px; font-weight: 500; text-align: center; font-variant-numeric: tabular-nums; }
body[data-page="my-models"] .studio-rail .generation-settings input[type=range] { margin: 12px 0 8px; }
body[data-page="my-models"] .studio-rail .generation-settings .setting-ends { display: flex; justify-content: space-between; margin: 0 0 16px; font-family: var(--font-body); font-size: 11.5px; font-weight: 450; letter-spacing: 0; text-transform: none; color: var(--faint); }
body[data-page="my-models"] .studio-rail .generation-settings button { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 32px; margin: 0; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font-size: 12.5px; font-weight: 500; }
body[data-page="my-models"] .studio-rail .generation-settings button:hover { background: var(--surface-2); }
body[data-page="my-models"] .rail-result-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--muted); font-size: 12.5px; line-height: 1.5; text-align: center; }
body[data-page="my-models"] .rail-result-empty svg { color: var(--faint); }
body[data-page="my-models"] .rail-result:has(.owned-result.show) .rail-result-empty { display: none; }
body[data-page="my-models"] .rail-result .owned-result { display: none; margin: 0; padding: 0; border: 0; }
body[data-page="my-models"] .rail-result .owned-result.show { display: block; }
body[data-page="my-models"] .rail-result .speech-player { margin: 0; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--surface-2); gap: 10px; }
body[data-page="my-models"] .rail-result .owned-download { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 34px; margin-top: 10px; padding: 0 14px; font-size: 13px; }
body[data-page="my-models"] .rail-actions .owned-tools { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; border: 0; }
body[data-page="my-models"] .rail-actions .owned-tools button { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 34px; margin: 0; padding: 0 12px; font-size: 13px; }
body[data-page="my-models"] .rail-actions .owned-tools .owned-delete { margin-left: 0; }
body[data-page="my-models"] .rail-actions:not(:has(.owned-tools button:not([hidden]))) { display: none; }

/* Empty state — nothing selected yet */
body[data-page="my-models"] .studio-body .workspace-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 400px; margin: 0; padding: 48px 24px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.55; }
body[data-page="my-models"] .studio-body .workspace-placeholder::before { content: none; display: none; }
body[data-page="my-models"] .placeholder-icon { display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 12px; border-radius: 14px; background: var(--surface-2); color: var(--text); }
body[data-page="my-models"] .studio-body .workspace-placeholder b { display: block; margin: 0 0 2px; font-family: var(--font-display); font-size: 19px; font-weight: 600; letter-spacing: -.025em; color: var(--text); }
body[data-page="my-models"] .placeholder-copy { max-width: 400px; margin: 0; }
body[data-page="my-models"] .studio-body .workspace-placeholder .button { margin-top: 18px; }

/* Conversation mode (#multiSpeaker) — dialogue left, speakers rail right */
body[data-page="my-models"] #multiSpeaker .studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
body[data-page="my-models"] #multiSpeaker .studio-grid > .panel.dialogue { grid-column: 1; grid-row: 1; min-width: 0; margin: 0; padding: 0; border: 0; }
body[data-page="my-models"] #multiSpeaker .studio-grid > aside.panel { grid-column: 2; grid-row: 1; min-width: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
body[data-page="my-models"] #multiSpeaker .section-heading { margin: 0 0 10px; }
body[data-page="my-models"] #multiSpeaker .muted { margin: 0 0 12px; font-size: 12.5px; }
body[data-page="my-models"] #multiSpeaker #conv-speakers { grid-template-columns: 1fr; gap: 10px; }
body[data-page="my-models"] #multiSpeaker .speaker { padding: 12px; }
body[data-page="my-models"] #multiSpeaker .generate-footer { margin-top: 16px; padding-top: 16px; }
body[data-page="my-models"] #multiSpeaker .add-turn { min-height: 42px; }

/* Recent generations (section injected by generation-history.js) */
body[data-page="my-models"] .studio-view > .generation-history { margin: 16px 0 0; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--surface); scroll-margin-top: 24px; }
body[data-page="my-models"] .generation-history .history-heading { align-items: flex-start; gap: 16px; }
body[data-page="my-models"] .generation-history .history-heading h2 { margin: 2px 0 0; font-size: 16px; }
body[data-page="my-models"] .generation-history .history-heading p { margin: 4px 0 0; font-size: 13px; }
body[data-page="my-models"] .generation-history .history-filters { margin: 14px 0 12px; }
body[data-page="my-models"] .generation-history .history-status { margin: 0 0 10px; font-size: 13px; }
body[data-page="my-models"] .generation-history .history-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
body[data-page="my-models"] .generation-history .history-card { min-width: 0; padding: 16px; border-radius: 12px; background: var(--surface); }
body[data-page="my-models"] .generation-history .history-card-heading strong { font-size: 14px; font-weight: 500; }
body[data-page="my-models"] .generation-history .history-card time { margin-top: 3px; }
body[data-page="my-models"] .generation-history .history-prompt { margin: 10px 0; max-height: 150px; font-size: 13.5px; line-height: 1.55; }
body[data-page="my-models"] .generation-history .history-settings { margin: 0 0 10px; }
body[data-page="my-models"] .generation-history .history-audio { gap: 6px; }
body[data-page="my-models"] .generation-history button { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
body[data-page="my-models"] .generation-history .history-empty { grid-column: 1 / -1; padding: 26px 20px; border: 1px dashed var(--line-strong); border-radius: 12px; font-size: 13px; text-align: center; }
body[data-page="my-models"] .generation-history .history-pagination { margin-top: 16px; gap: 10px; }
body[data-page="my-models"] .generation-history .history-star { display: grid; place-items: center; width: 30px; height: 30px; min-height: 0; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--faint); font-size: 0; line-height: 0; }
body[data-page="my-models"] .generation-history .history-star::before {
  content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E") center / contain no-repeat;
}
body[data-page="my-models"] .generation-history .history-star:hover { color: var(--text); background: var(--surface-2); }
body[data-page="my-models"] .generation-history .history-star[aria-pressed="true"] { color: var(--text); }
body[data-page="my-models"] .generation-history .history-star[aria-pressed="true"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='m12 3 2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E");
}

/* Speech player play/pause: SVG glyphs instead of text characters */
body[data-page="my-models"] .speech-play { font-size: 0 !important; line-height: 0; }
body[data-page="my-models"] .speech-play::before {
  content: ""; width: 14px; height: 14px; margin-left: 1px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M8 5.5v13a1 1 0 0 0 1.5.9l10-6.5a1 1 0 0 0 0-1.7l-10-6.5A1 1 0 0 0 8 5.5z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Cpath d='M8 5.5v13a1 1 0 0 0 1.5.9l10-6.5a1 1 0 0 0 0-1.7l-10-6.5A1 1 0 0 0 8 5.5z'/%3E%3C/svg%3E") center / contain no-repeat;
}
body[data-page="my-models"] .speech-play[aria-label^="Pause"]::before {
  margin-left: 0;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='6' y='5' width='4.5' height='14' rx='1.2'/%3E%3Crect x='13.5' y='5' width='4.5' height='14' rx='1.2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23000'%3E%3Crect x='6' y='5' width='4.5' height='14' rx='1.2'/%3E%3Crect x='13.5' y='5' width='4.5' height='14' rx='1.2'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  body[data-page="my-models"] .owned-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  body[data-page="my-models"] .models-shell { margin-top: 20px; }
}
@media (max-width: 960px) {
  body[data-page="my-models"] #ownedWorkspace { grid-template-columns: 1fr; }
  body[data-page="my-models"] #multiSpeaker .studio-grid { grid-template-columns: 1fr; }
  body[data-page="my-models"] #multiSpeaker .studio-grid > aside.panel { grid-column: 1; grid-row: 1; }
  body[data-page="my-models"] #multiSpeaker .studio-grid > .panel.dialogue { grid-column: 1; grid-row: 2; }
  body[data-page="my-models"] #multiSpeaker #conv-speakers { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
  body[data-page="my-models"] .generation-history .history-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  body[data-page="my-models"] .studio-bar { grid-template-columns: auto minmax(0, 1fr); gap: 12px; }
  body[data-page="my-models"] .studio-bar .voice-modes { grid-column: 1 / -1; }
  body[data-page="my-models"] .studio-bar .generation-credit-box { grid-column: 1 / -1; max-width: none; align-items: flex-start; text-align: left; }
  body[data-page="my-models"] .studio-bar .generation-credit-box small { text-align: left; }
}
@media (max-width: 700px) {
  body[data-page="my-models"] .owned-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body[data-page="my-models"] .owned-list .owned-card { min-height: 168px; padding: 14px 14px 12px; }
  body[data-page="my-models"] .model-avatar { width: 40px; height: 40px; font-size: 14px; }
}
@media (max-width: 640px) {
  body[data-page="my-models"] .stat-cell { gap: 0; padding: 12px 12px 12px 14px; }
  body[data-page="my-models"] .stat-cell .stat-icon, body[data-page="my-models"] .stat-copy .stat-meta { display: none; }
  body[data-page="my-models"] .stat-copy .library-count { font-size: 22px; }
  body[data-page="my-models"] .filter-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  body[data-page="my-models"] .library-tabs { display: flex; width: 100%; overflow-x: auto; scrollbar-width: none; }
  body[data-page="my-models"] .library-tabs::-webkit-scrollbar { display: none; }
  body[data-page="my-models"] .library-tabs button { flex: 1 1 auto; min-width: 0; padding: 0 6px; font-size: 12.5px; }
  body[data-page="my-models"] .filter-search { flex: 1 1 auto; }
  body[data-page="my-models"] .filter-search kbd { display: none; }
  body[data-page="my-models"] .library-section-head { align-items: flex-start; }
  body[data-page="my-models"] .studio-body { padding: 14px; }
  body[data-page="my-models"] .studio-bar { padding: 12px 14px; }
  body[data-page="my-models"] .studio-bar .voice-modes { display: flex; }
  body[data-page="my-models"] .studio-bar .voice-modes button { flex: 1 1 0; min-width: 0; padding: 0 8px; }
  body[data-page="my-models"] .studio-editor .owned-field textarea { min-height: 200px; font-size: 16px; }
  body[data-page="my-models"] .studio-editor .owned-field { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; }
  body[data-page="my-models"] .studio-editor .owned-field > .owned-meta, body[data-page="my-models"] .studio-editor .owned-field:has(.delivery-tools) > .owned-meta { grid-column: 1; grid-row: 3; border-radius: 0; }
  body[data-page="my-models"] .studio-editor .owned-field > .delivery-tools { grid-column: 1; grid-row: 4; justify-content: flex-start; border-radius: 0 0 11px 11px; }
  body[data-page="my-models"] .studio-body .workspace-placeholder { min-height: 320px; padding: 36px 18px; }
  body[data-page="my-models"] .generation-history { padding: 16px; }
}
@media (max-width: 620px) {
  body[data-page="my-models"] .models-shell { width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="my-models"] .studio-view, body[data-page="my-models"] .owned-list .owned-card, body[data-page="my-models"] .owned-list .owned-card::before, body[data-page="my-models"] .owned-list .owned-card::after,
  body[data-page="my-models"] .model-star, body[data-page="my-models"] .preset-play-button, body[data-page="my-models"] .model-avatar { animation: none !important; transition: none !important; }
  body[data-page="my-models"] .owned-list .owned-card:hover { transform: none; }
}
