/* Release polish (2026-10-31), loaded after every other stylesheet. Each rule
   answers a finding of the responsive test (.claude/skills/responsive-test):
   tap targets under 24px (WCAG 2.5.8), text under 11px, the Studio's tool row
   on phones and tablets, and a few phone layouts. Kept in one file so the
   release fixes read together; fold them into their own sheets when touched. */

/* ── Tap targets: a finger needs 24px at the least ── */
/* (Phones hide Sign in from the header: it lives in the menu there.) */
@media (min-width: 521px) {
  .kz-signin { display: inline-flex; align-items: center; min-height: 36px; padding: 0 6px; }
  button.kz-signin { padding: 0 6px; }
}
.kz-dots button, .kz-points-dots button {
  width: 24px; height: 24px; padding: 0; background: none;
  display: inline-grid; place-items: center;
}
.kz-dots button::after, .kz-points-dots button::after {
  content: ''; width: 7px; height: 7px; border-radius: 99px;
  background: rgba(244, 233, 228, 0.28); transition: width 0.3s, background 0.3s;
}
.kz-dots button.on, .kz-points-dots button.on { width: 24px; background: none; }
.kz-dots button.on::after, .kz-points-dots button.on::after { width: 22px; background: var(--candle); }
.kz-tier-all { display: inline-block; padding: 6px 0; }
.lic-faq summary { padding: 6px 0; }
.im-sg-copy { padding: 7px; margin: -7px; }
.im-ins-more { display: inline-flex; align-items: center; min-height: 28px; }
.ah-block-head a { display: inline-flex; align-items: center; min-height: 32px; }
.kz-foot a { display: inline-block; padding: 4px 0; }
.im-buy-link { min-width: 28px; min-height: 28px; }
.kz-link { display: inline-flex; align-items: center; min-height: 28px; }   /* the sign-in window's "Forgot password?", "Create account" */

/* ── Text: nothing under 11px ── */
.im-gal-view-sub, .im-section-label.im-gal-date { font-size: max(11px, 0.72rem); }
.im-ro-label, .im-sg-members-tag { font-size: max(11px, 0.68rem); }
.ph-lamp-labels span { font-size: max(11px, 0.5rem); }
.tr-intent-k, .tr-intent-parts span, .tr-intent-parts b, .tr-out, .tr-trick .tt-tag { font-size: max(11px, 0.6rem); }

/* ── Studio: the composer's tool row on phones and tablets ──
   One row of icons left the coin count lying on top of them. Below 690px the
   composer is two rows: the tools, then coins, style and Paint. */
@container composer (max-width: 690px) {
  .im-composer .im-comp-bar { flex-wrap: wrap; row-gap: 10px; }
  .im-composer .im-comp-tools { flex: 1 1 100%; flex-wrap: wrap; row-gap: 8px; }
  .im-composer .im-generate-bar { flex: 1 1 100%; margin-left: 0; justify-content: flex-end; }
  .im-composer .im-balance-bar { margin-right: auto; }
}
/* The chosen style's name under the fan: one line, never cut in half by the composer. */
.im-orbit .im-ins-style span { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Header on the narrowest phones, signed in: the menu button stays on screen ── */
@media (max-width: 380px) {
  .kz-nav-actions:has(.nav-user-btn) .kz-btn-sm { display: none; }
}

/* ── Pricing on phones: each plan card as tall as its own content ── */
@media (max-width: 760px) {
  .kz-tiers { align-items: flex-start; }
}

/* ── Styles on phones: filters fold behind one button (kz-styles.js) ── */
.im-sg-filters-toggle { display: none; }
@media (max-width: 600px) {
  .im-sg-searchbar { padding-left: 16px; padding-right: 16px; }   /* the page's 16px gutter, like everything under it */
  .im-sg-filters-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 36px; margin: 4px 0 10px;
    padding: 0 14px; border-radius: 999px; border: 1px solid rgba(216, 163, 94, 0.35);
    background: rgba(255, 255, 255, 0.04); color: var(--im-text, #f4e9e4);
    font: 600 0.82rem Inter, system-ui, sans-serif; cursor: pointer;
  }
  .im-sg-filters-toggle b { color: var(--im-gold, #d8a35e); font-weight: 700; }
  .im-sg-filters-toggle[aria-expanded="true"] { border-color: rgba(216, 163, 94, 0.7); }
  .im-sg-filters { display: none; }
  .im-sg-filters.is-open { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
  .im-sg-filters.is-open > * { min-width: 0; }
  .im-sg-filters.is-open > :first-child { grid-column: 1 / -1; }
  .im-sg-filters.is-open select { width: 100%; }
}

/* ── Studio on tablets (741–1023px): the sidebar becomes the phone's drawer ──
   The full desktop sidebar took a quarter of a tablet's width and wrapped its
   own labels; the composer is the point of the page. Same drawer as phones
   (imagine.css "Below 740px"), opened by the same menu button. */
@media (min-width: 741px) and (max-width: 1023px) {
  .im-layout { grid-template-columns: 1fr; }
  .im-sidebar { display: none; }
  .im-mob-menu {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 12px; left: 12px; z-index: 60;
    width: 42px; height: 42px; border-radius: 12px;
    background: rgba(21, 10, 14, 0.86); color: #f4e9e4;
    border: 1px solid rgba(216, 163, 94, 0.32);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  }
  .im-page { padding-top: 66px; }
  body.im-mob-open .im-sidebar {
    display: flex; position: fixed; top: 0; left: 0; bottom: 0; z-index: 70;
    width: 300px; height: 100%; padding: 28px 16px 20px; align-items: stretch;
    background: #150a0e; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.6);
  }
  body.im-mob-open .im-sb-toggle { display: none; }
  body.im-mob-open .im-sb-brand, body.im-mob-open .im-sb-invite, body.im-mob-open .im-sb-copy { display: block; }
  body.im-mob-open .im-sb-item { justify-content: flex-start; width: auto; padding: 11px 12px; gap: 12px; }
  body.im-mob-open .im-sb-item > span { display: inline; }
}

/* ── Buy coins: the note for payers outside India, quiet (it read as an error) ── */
.kz-intl-note-title { color: var(--silk, #f4e9e4); text-transform: none; letter-spacing: 0; font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.kz-intl-note-sub { font-size: 0.8rem; }
.kz-intl-submit { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(216, 163, 94, 0.45); color: #f4e9e4; }
.kz-intl-submit:hover { background: rgba(216, 163, 94, 0.16); }

/* ── A style's page on phones: what it looks like, first (kz-styles.js) ── */
.im-sg-hero { display: none; }
@media (max-width: 600px) {
  .im-sg-hero { display: block; margin: 4px 0 14px; }
  .im-sg-hero img { display: block; width: 100%; max-height: 62vh; object-fit: cover; border-radius: 16px; border: 1px solid rgba(216, 163, 94, 0.25); }
  .im-sg-head .im-sg-head-thumb { display: none; }
  /* Tester feedback (10 Nov 2026): the decision first. Title, tags and Use this style sit above the
     big picture, so nobody scrolls past a screenful of image to pick the style. */
  .im-sg-detail > .im-sg-back { order: -2; }
  .im-sg-detail > .im-sg-head { order: -1; }
}

/* ── A "Use" pill on every style card (kz-styles.js _quickUse): pick without opening the style ── */
/* In the 1 / N count's corner: shown, it takes the count's place (the count steps aside), so on any card width it never
   meets the Members tag or the name (design principles: nothing over the words). */
.im-sg-card .im-sg-quick { position: absolute; top: 8px; right: 8px; z-index: 4; min-height: 26px; padding: 0 12px; border-radius: 999px;
  border: 0; background: linear-gradient(135deg, #e3b877, #c9935a); color: #1d1420; font: 600 0.76rem/1 Inter, system-ui, sans-serif;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); cursor: pointer; opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; }
.im-sg-card:hover .im-sg-quick, .im-sg-card:focus-within .im-sg-quick { opacity: 1; transform: none; }
.im-sg-card .kzc-count { transition: opacity .15s; }
.im-sg-card:hover .kzc-count, .im-sg-card:focus-within .kzc-count { opacity: 0; }
.im-sg-card .im-sg-quick:hover { filter: brightness(1.08); }
@media (hover: none) { .im-sg-card .im-sg-quick { opacity: 1; transform: none; } .im-sg-card .kzc-count { opacity: 0; } }

/* ── One side margin for the whole site: the header's ──
   The header runs full width with clamp(16px, 4vw, 56px) a side; the Styles
   and Gallery pages used 22–30px and the footer a centred 1180px column, so
   no two edges met. As pages, they now take the header's margin. (Reading
   pages keep their centred measure: long text wants it.) */
:root { --kz-gutter: clamp(16px, 4vw, 56px); }
.im-gallery-page .im-gal-body,
.im-gallery-page .im-sg-searchbar,
.im-gallery-page .im-ro-topbar,
.im-gallery-page .im-gal-top { padding-left: var(--kz-gutter); padding-right: var(--kz-gutter); }
.kz-foot { padding-left: var(--kz-gutter); padding-right: var(--kz-gutter); }
.kz-foot-grid { max-width: none; }
/* Wide screens: five columns of styles, not four 450px cards. */
@media (min-width: 1700px) { .im-sg-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }

/* ── Small labels under 10.5px raised (the 0.68rem eyebrows stay: they read well) ── */
.im-ins-strip-head, .im-section-label, .im-purpose-group, .im-purpose-tier, .im-style-pick-sub { font-size: max(10.5px, 0.66rem); }
.im-sb-tag, .members-chip, .kz-pack-badge { font-size: max(10.5px, 0.62rem); }
.im-sb-copy { font-size: max(10.5px, 0.56rem); }
.kz-gift-k { font-size: max(10.5px, 0.64rem); }
.kz-tier em, .kz-tier-kicker em, .kz-plan em { font-size: max(10.5px, 0.6rem); }
.kz-pillar-chip em, .kz-soon-tag { font-size: max(10.5px, 0.6rem); }

/* ── The Gallery wall: cards sized to the screen ──
   minmax(148px, 1fr) packed as many 148px columns as fit: seven narrow ones on
   a vertical 1080px screen, a dozen on a wide one. The card's size now follows
   the screen (about 22% of its width, 150–300px): two on a phone, four on a
   vertical screen, five or six on a wide one. */
.im-gal-wall--paged { grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 14vw, 210px), 1fr)); gap: clamp(8px, 1vw, 14px); }

/* ── Studio's style picker: "None", for words that set their own look (kz-styles.js) ── */
.im-sg-none {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  margin: 6px 0 14px; padding: 12px 16px; border-radius: 12px; cursor: pointer; text-align: left;
  border: 1px dashed rgba(216, 163, 94, 0.5); background: rgba(216, 163, 94, 0.06); color: var(--im-text, #f4e9e4);
  font: 0.85rem/1.4 Inter, system-ui, sans-serif;
}
.im-sg-none b { font-size: 0.95rem; color: var(--im-gold, #d8a35e); }
.im-sg-none span { color: var(--im-muted, rgba(244, 233, 228, 0.65)); }
.im-sg-none:hover, .im-sg-none:focus-visible { border-style: solid; background: rgba(216, 163, 94, 0.12); }

/* ── My styles (kz-styles.js): a ♥ on every style card and style page ──
   On the card it sits in the name's row at the far right; the name keeps clear of it (nothing over the words).
   An empty heart shows on hover (always on touch); a kept one always shows, filled. */
.im-sg-card .im-sg-heart { position: absolute; right: 8px; bottom: 9px; z-index: 21; display: grid; place-items: center;
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  background: rgba(12, 8, 10, 0.55); color: #f4e9e4; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .15s, transform .15s, color .15s; }
.im-sg-heart svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.im-sg-heart.is-on { color: #f08aa0; }
.im-sg-heart.is-on svg { fill: currentColor; }
.im-sg-card:hover .im-sg-heart, .im-sg-card:focus-within .im-sg-heart, .im-sg-card .im-sg-heart.is-on { opacity: 1; }
.im-sg-card .im-sg-heart:hover { transform: scale(1.08); }
.im-sg-card .im-sg-heart:focus-visible { outline: 2px solid #d8a35e; outline-offset: 2px; opacity: 1; }
.im-sg-stage .im-sg-meta { padding-right: 44px; }
@media (hover: none) { .im-sg-card .im-sg-heart { opacity: 1; } }
.im-sg-heart--page { display: inline-flex; align-items: center; gap: 7px; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.04); color: #f4e9e4;
  font: 600 .86rem/1 Inter, system-ui, sans-serif; white-space: nowrap; }
.im-sg-heart--page:hover { border-color: rgba(240, 138, 160, 0.55); }
.im-sg-heart--page.is-on { border-color: rgba(240, 138, 160, 0.45); background: rgba(240, 138, 160, 0.08); }
.im-sg-nohearts .im-sg-heart { display: none !important; }
.im-sg-nohearts .im-sg-stage .im-sg-meta { padding-right: 14px; }
.im-sg-mine-label { display: flex; align-items: baseline; gap: 10px; margin: 26px 0 10px; }
.im-sg-mine-label a { font-size: 12px; color: #d8a35e; text-decoration: none; }

/* ── My Collection (kz-gallery.js): the counts are the way in, cards as small as Kama World's ──
   Tester feedback (9 Nov 2026): "92 pieces · 91 made · 1 carried home" read as text, not as a choice. */
.im-coll-views { display: flex; flex-wrap: wrap; gap: 6px; }
.im-coll-view, .im-gal-tool {
  border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.03); cursor: pointer;
  font: 600 13px/1 Inter, system-ui, sans-serif; color: rgba(244,233,228,.72);
  padding: 8px 14px; border-radius: 999px; transition: background .2s, color .2s, border-color .2s; }
.im-coll-view strong { color: inherit; font-size: 13px; font-weight: 700; }
.im-coll-view em, .im-gal-tool em { font-style: normal; font-weight: 500; font-size: 12px; opacity: .6; margin-left: 4px; }
.im-coll-view:hover, .im-gal-tool:hover { color: #f0e4d2; border-color: rgba(212,175,120,.45); }
.im-coll-view:focus-visible, .im-gal-tool:focus-visible { outline: 2px solid rgba(212,175,120,.8); outline-offset: 2px; }
.im-coll-view[aria-pressed="true"] { background: linear-gradient(135deg, #e3b877, #c9935a); border-color: transparent; color: #1d1420; }
.im-coll-view[aria-pressed="true"] em { opacity: .75; }
/* Which tool made it: a quieter second row */
.im-gal-tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.im-gal-tool { padding: 6px 12px; font-size: 12px; font-weight: 500; }
.im-gal-tool[aria-pressed="true"] { color: #f0e4d2; border-color: rgba(216,163,94,.7); background: rgba(216,163,94,.12); }
/* The private walls: the same card grid as Kama World (one shape, sized to the screen; the full frame one click away) */
.im-gal-wall--mine { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(140px, 14vw, 210px), 1fr));
  gap: clamp(8px, 1vw, 14px); columns: auto; column-gap: normal; }
.im-gal-wall--mine .im-gal-item { aspect-ratio: 398 / 512; margin-bottom: 0; overflow: hidden; }
.im-gal-wall--mine .im-gal-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.im-coll-view, .im-gal-tool { white-space: nowrap; }
.im-sanct-bar .im-coll-views { flex: 1 1 auto; min-width: 0; }
@media (max-width: 600px) { .im-coll-view { padding: 7px 11px; font-size: 12.5px; } }
.im-gal-tools-wrap { margin: 2px 0 10px; }
.im-gal-tools-wrap .im-gal-tools { margin: 8px 0 0; }
.im-gal-tools-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 0; border-radius: 999px; cursor: pointer;
  background: none; color: rgba(244,233,228,.6); font: 500 12px/1 Inter, system-ui, sans-serif; }
.im-gal-tools-toggle b { color: #f0e4d2; font-weight: 600; }
.im-gal-tools-toggle:hover { color: #f0e4d2; background: rgba(255,255,255,.04); }
.im-gal-tools-toggle svg { transition: transform .15s; }
.im-gal-tools-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
/* My Collection's room (keep_paintings): a quiet count, a note from 80%, a clear line when full */
.im-gal-room { margin-left: auto; margin-right: 10px; font: 500 12px/1 Inter, system-ui, sans-serif; color: rgba(244,233,228,.5); white-space: nowrap; }
.im-gal-room.is-near { color: #e3b877; }
.im-gal-room.is-full { color: #f08aa0; }
.im-sanct-bar .im-gal-room + .im-gal-about-wrap { margin-left: 0; }
.im-gal-room-note { margin: 4px 0 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(216,163,94,.3); background: rgba(216,163,94,.07); }
.im-gal-room-note p { margin: 0; font: 400 13px/1.5 Inter, system-ui, sans-serif; color: rgba(244,233,228,.8); }
.im-gal-room-note a { color: #e3b877; text-decoration: none; font-weight: 600; white-space: nowrap; }
.im-gal-room-note.is-full { border-color: rgba(240,138,160,.4); background: rgba(240,138,160,.08); }
@media (max-width: 600px) { .im-gal-room { display: none; } }
