/* =========================================================
   IceCream Tones – ONE stylesheet for all pages
   Mobile first: the basic rules are for phones (app screens).
   "@media (min-width: 900px)" blocks change things for web.
   ========================================================= */

/* ---------- Colours and sizes (change them here) ---------- */
:root {
  --night: #00002b;      /* page background (from your SVG) */
  --navy: #0a0a5c;       /* panels */
  --navy-2: #14147a;     /* rows, inputs on dark */
  --royal: #000080;      /* buttons on light pages */
  --blue: #3434ff;       /* active / selected */
  --lilac: #d5d5ff;      /* soft text on dark */
  --grey: #9393ac;       /* meta text */
  --paper: #e3e3ec;      /* light panels (profile) */
  --sun: #ffee1f;        /* main "save" buttons */
  --rose: #b57272;       /* account / identity / subscription zone */
  --rose-light: #d9a7a7;
  --danger: #ffb3b3;
  --radius: 12px;
  --row: 64px;           /* one track row: ~9 rows fit on a phone screen */
  --font: "Poppins", "Ubuntu", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: #fff;
  background: var(--night);
  /* room for the bottom tab bar on phones */
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--sun); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Header + navigation ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top, 0px));
  background: var(--night);
  border-bottom: 1px solid #1e1e6e;
}
.brand { display: flex; align-items: center; flex: none; text-decoration: none; }
.brand img { height: 64px; width: auto; }   /* final mushroom logo (Nov 2026) */
@media (min-width: 900px) { .brand img { height: 76px; margin: 4px 0; } }
.brand-scoop { width: 18px; height: 22px; border-radius: 9px 9px 3px 3px; background: linear-gradient(#ff8fb8 0 55%, #ffd36b 55%); }

/* phones: the nav becomes a bottom tab bar, like an app */
.app-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--navy);
  border-top: 1px solid #23238a;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.nav-link {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 9px; font-size: 11.5px; color: var(--lilac); text-decoration: none;
}
.nav-link svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-link.active { color: #fff; }
.nav-link.active svg { stroke: var(--sun); }
.cart-count {
  position: absolute; top: 4px; left: calc(50% + 6px);
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--sun); color: var(--night); font-size: 11px; line-height: 18px; text-align: center;
}

/* ---------- Page frame ---------- */
.page { max-width: 1180px; margin: 0 auto; padding: 14px 12px 24px; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.page-lead { color: var(--lilac); margin-bottom: 14px; max-width: 60ch; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 0 18px; border-radius: 10px; border: 0;
  font-weight: 600; text-decoration: none;
}
.btn-sun { background: var(--sun); color: #111; }
.btn-royal { background: var(--royal); color: #fff; }
.btn-ghost { background: transparent; color: inherit; border: 1.5px solid currentColor; }
.btn-danger-text { background: none; border: 0; color: #c21818; font-weight: 600; text-decoration: underline; padding: 8px 0; }

/* =========================================================
   CATALOGUE: theme folders
   ========================================================= */
.catalogue { display: grid; gap: 14px; }

.themes { min-width: 0; }
.themes h2 { font-size: 13px; color: var(--grey); font-weight: 600; margin: 0 4px 6px; }
/* phones: folders scroll sideways */
.theme-list {
  list-style: none; margin: 0; padding: 2px 2px 8px;
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
}
.theme-btn {
  scroll-snap-align: start;
  display: grid; justify-items: center; gap: 2px;
  width: 84px; padding: 10px 4px 8px; border-radius: var(--radius);
  background: var(--navy); border: 1.5px solid transparent; color: var(--lilac); text-align: center;
}
.theme-btn[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: #8a8aff; }
.folder-icon { width: 38px; height: 42px; color: var(--lilac); }
.theme-name { font-weight: 600; font-size: 13px; color: #fff; line-height: 1.2; }
.theme-count { font-size: 11px; line-height: 1.25; }


/* =========================================================
   TRACK LIST (Catalogue and My Lists use the same rows)
   ========================================================= */
.list-panel { background: var(--navy); border-radius: 16px; padding: 10px 8px 12px; min-width: 0; position: relative; }
.list-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; padding: 4px 6px 10px; }
.list-head h2 { font-size: 18px; }
.list-head .muted { color: var(--grey); font-size: 13px; }
.list-head select { background: var(--navy-2); border: 1px solid #3a3a9a; border-radius: 8px; padding: 6px 8px; font-size: 13px; }

.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.track {
  --c: var(--blue);
  display: grid; align-items: center; gap: 10px;
  grid-template-columns: 46px minmax(0, 1fr) auto auto;
  min-height: var(--row); padding: 8px 10px 8px 8px;
  border-radius: 12px; background: var(--navy-2);
  border-left: 4px solid var(--c);
}
.track.selected { background: #2323a8; }
.track-play {
  position: relative; width: 46px; height: 46px; padding: 0; border: 0; border-radius: 10px; overflow: hidden;
  background: linear-gradient(135deg, var(--c), #1d1d8f);
  display: grid; place-items: center; color: #00002b; font-weight: 700; font-size: 20px;
}
.track-play img { width: 100%; height: 100%; object-fit: cover; }
.play-mark {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,43,.35); opacity: 0; transition: opacity .15s;
}
.play-mark::before { content: ""; border-left: 12px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 3px; }
.track-play:hover .play-mark, .track-play:focus-visible .play-mark, .track.playing .play-mark { opacity: 1; }
.track.playing .play-mark::before { border: 0; width: 12px; height: 14px; margin: 0; border-left: 4px solid #fff; border-right: 4px solid #fff; }

.track-main { min-width: 0; }
.track-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-meta { font-size: 12.5px; color: var(--grey); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.track-side { display: grid; justify-items: end; gap: 3px; }
.cart-remove-size { display: grid; justify-items: center; gap: 0; line-height: 1.2; }
.cart-file-size { color: var(--grey); font-size: 11px; white-space: nowrap; }
.track-price { font-size: 13px; color: var(--lilac); }
.btn-add {
  border: 0; border-radius: 8px; padding: 4px 12px; font-size: 13px; font-weight: 600;
  background: var(--sun); color: #111; white-space: nowrap;
}
.btn-add.in-cart { background: transparent; color: var(--sun); box-shadow: inset 0 0 0 1.5px var(--sun); }
.btn-edit { border: 0; background: transparent; padding: 2px 4px; color: var(--lilac); }
.btn-edit svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; }

/* ---------- The 9-dot spectrum ----------
   Every dot has --v between 0 (quiet) and 1 (loud).
   Louder = dot higher, bigger and brighter. */
.spectrum { display: flex; align-items: center; gap: 3px; height: 34px; padding: 0 2px; }
.spectrum i {
  --v: .3;
  display: block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--c);
  opacity: calc(.3 + var(--v) * .7);
  transform: translateY(calc((.5 - var(--v)) * 24px)) scale(calc(.6 + var(--v) * .9));
  transition: transform 90ms linear, opacity 90ms linear;
}
.track.playing .spectrum i { box-shadow: 0 0 6px var(--c); }

/* ---------- Pagination ("next page" after 25 tracks) ---------- */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 14px 4px 2px; }
.pager button {
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid #3a3a9a; background: var(--navy-2); color: #fff;
}
.pager button[aria-current="page"] { background: var(--blue); border-color: #8a8aff; font-weight: 700; }
.pager button:disabled { opacity: .35; cursor: default; }
.pager-info { width: 100%; text-align: center; font-size: 12.5px; color: var(--grey); }
.empty { padding: 28px 12px; text-align: center; color: var(--lilac); }

/* =========================================================
   MY LISTS: tabs, usage bar, File Settings balloon
   ========================================================= */
/* Folder tabs: each folder has its own colour (as in the screenshot).
   --folder = the folder and its panel, --edge = thin line on the slanted edge */
.tab-files,  .folder-files  { --folder: #0a0a5c; --edge: #0a0a5c; }
.tab-upload, .folder-upload { --folder: #000088; --edge: #2c89a0; }

.tabs { display: flex; align-items: flex-end; }
.tab {
  position: relative; flex: 1; border: 0; padding: 0 30px 0 16px; min-height: 48px;
  background: var(--edge); color: #fff;
  font-size: 19px; font-weight: 700; text-align: center;
  border-radius: 12px 0 0 0;
  /* slanted right edge = folder tab */
  clip-path: polygon(0 0, calc(100% - 52px) 0, 100% 100%, 0 100%);
}
.tab::before {               /* the coloured face, 3px smaller → the edge line shows */
  content: ""; position: absolute; inset: 0;
  background: var(--folder);
  clip-path: polygon(0 0, calc(100% - 55px) 0, calc(100% - 3px) 100%, 0 100%);
}
.tab span { position: relative; }
.tab + .tab { margin-left: -40px; padding-left: 40px; }
.tab[aria-selected="true"] { z-index: 1; }
.tab[aria-selected="false"] span { opacity: .9; }

/* the panel has the same colour as its folder tab, so they look like one piece */
.folder-panel { background: var(--folder); border-top-left-radius: 0; }
.folder-head {
  color: #fff;
  margin: 0 0 10px; padding: 6px 6px 0;
}
.upload-panel .folder-head { margin: 0 0 14px; padding: 0; }
.folder-head h2 { font-size: 18px; }
.folder-head .muted { color: var(--grey); font-size: 13px; }
.folder-head .usage { padding: 8px 0 10px; color: var(--lilac); }
.folder-head .usage-bar { background: #2a2a7a; }

@media (max-width: 480px) {
  .tab { font-size: 14px; line-height: 1.15; padding: 0 38px 0 8px; }
  .tab + .tab { padding-left: 40px; }
}

.usage { padding: 8px 0 10px; color: #fff; }
.folder-head .usage-bar { background: rgba(0,0,43,.35); }

.usage { padding: 0 6px 10px; font-size: 13px; color: var(--lilac); }
.usage-bar { height: 6px; border-radius: 3px; background: #2a2a7a; margin-top: 5px; overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--sun); }

.my-tracks .track { cursor: pointer; }
.my-tracks .track:hover { background: #1c1c90; }

/* the balloon */
.balloon {
  scroll-margin: 80px 0 90px;
  position: absolute; z-index: 20; left: 8px; right: 8px;
  max-width: 440px;
  background: #fff; color: #10103a; border-radius: 22px;
  padding: 16px 16px 14px;
  box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 0 3px #00002b;
  animation: pop .16s ease-out;
}
.balloon::before {               /* the little tail pointing at the track */
  content: ""; position: absolute; left: var(--tail, 40px); width: 22px; height: 22px;
  background: #fff; transform: rotate(45deg); border-radius: 4px;
  box-shadow: -3px -3px 0 0 #00002b;
}
.balloon.below::before { top: -10px; }
.balloon.above::before { bottom: -10px; box-shadow: 3px 3px 0 0 #00002b; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .balloon { animation: none; } .spectrum i { transition: none; } }

.balloon-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.balloon-icon {
  width: 56px; height: 56px; flex: none; border-radius: 12px; overflow: hidden;
  display: grid; place-items: center; font-size: 24px; font-weight: 700; color: #00002b;
  background: linear-gradient(135deg, var(--c, #3434ff), #1d1d8f);
}
.balloon-icon img { width: 100%; height: 100%; object-fit: cover; }
.balloon h3 { font-size: 17px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--royal); font-weight: 600; font-size: 13px; text-decoration: underline; }
.balloon-close {
  margin-left: auto; align-self: flex-start; width: 34px; height: 34px; border-radius: 50%;
  border: 0; background: #ececf6; color: #10103a; font-size: 20px; line-height: 1;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0; }
.stat { background: #ececf6; border-radius: 10px; padding: 7px 8px; text-align: center; }
.stat b { display: block; font-size: 17px; }
.stat span { font-size: 11px; line-height: 1.2; display: block; color: #4a4a72; }
.balloon-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }

/* ---------- Forms (light background) ---------- */
.field { display: grid; gap: 4px; margin-bottom: 10px; }
.field label, .field .label { font-size: 13px; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 10px;
  border: 1.5px solid #8a8aa8; background: #f6f6fb; color: #10103a;
}
.field textarea { min-height: 84px; resize: vertical; }
.field .hint { font-size: 12px; color: #55557a; }
.field.error input { border-color: #c21818; }
.field .error-text { font-size: 12.5px; color: #c21818; }
.row-2 { display: grid; gap: 0 10px; grid-template-columns: 1fr 1fr; }

/* dark panel version (Upload tab) */
.on-dark .field .hint { color: var(--lilac); }
.on-dark .field input, .on-dark .field select, .on-dark .field textarea { background: var(--navy-2); color: #fff; border-color: #3a3a9a; }
.on-dark .field .error-text { color: var(--danger); }

.upload-panel { padding: 16px 14px; }
.drop {
  display: grid; justify-items: center; gap: 4px; text-align: center;
  padding: 22px 12px; margin-bottom: 12px; border-radius: 14px;
  border: 2px dashed #5a5ad0; background: #0e0e66; color: var(--lilac);
}
.drop strong { color: #fff; }
.progress { height: 10px; border-radius: 5px; background: #2a2a7a; overflow: hidden; margin: 6px 0 4px; }
.progress span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--sun), #7eea4a); transition: width .2s; }

/* =========================================================
   DASHBOARD: profile (light) + account zone (rose)
   ========================================================= */
.dash { display: grid; gap: 16px; }
.card-light { background: var(--paper); color: #10103a; border-radius: 18px; padding: 18px 16px; }
.card-light h2 { font-size: 18px; margin-bottom: 12px; }
.profile-top { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: end; margin-bottom: 6px; }
.avatar {
  width: 110px; height: 110px; border-radius: 16px; background: var(--royal); color: #c8c8ff;
  display: grid; place-items: center; text-align: center; font-weight: 700; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.zone { background: var(--rose); color: #1d0b0b; border-radius: 18px; padding: 18px 16px; }
.zone h2 { font-size: 18px; margin-bottom: 4px; }
.zone h3 { font-size: 16px; margin: 16px 0 6px; }
.zone small { font-weight: 600; opacity: .8; }
.stripe-box { background: var(--rose-light); border: 2px solid #1d0b0b; border-radius: 12px; padding: 12px 14px; }
.plans { display: grid; gap: 8px; margin-top: 8px; border: 0; padding: 0; }
.plan {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: #f1f1f1; border: 2px solid #1d0b0b; cursor: pointer;
}
.plan input { width: 20px; height: 20px; accent-color: var(--royal); margin: 0; }
.plan b { font-size: 15px; }
.plan span { font-size: 12.5px; color: #5a3a3a; margin-left: auto; text-align: right; }
.plan:has(input:checked) { background: #fff; box-shadow: 0 0 0 3px var(--royal); }
.rules { background: #fff; color: #10103a; border-radius: 14px; padding: 14px 16px; margin-top: 16px; }
.rules h3 { margin-top: 0; }
.rules ul { margin: 6px 0 0; padding-left: 20px; }
.rules li { margin: 4px 0; }
.tips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tips span { background: #fff5a0; border-radius: 20px; padding: 2px 10px; font-weight: 600; font-size: 13px; }
.terminate { margin-top: 16px; padding-top: 12px; border-top: 1.5px dashed #6a2a2a; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.terminate p { font-size: 13px; max-width: 46ch; }

dialog { border: 0; border-radius: 18px; padding: 20px; max-width: 420px; width: calc(100% - 32px); color: #10103a; }
dialog::backdrop { background: rgba(0,0,43,.7); }
dialog h2 { font-size: 18px; margin-bottom: 8px; }
dialog .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* =========================================================
   CART
   ========================================================= */
.cart-total { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 6px 4px; font-size: 17px; }
.btn-remove { border: 0; background: none; color: var(--danger); font-size: 13px; text-decoration: underline; padding: 2px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom, 0px)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: #fff; color: #10103a; padding: 10px 18px; border-radius: 22px; font-weight: 600;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); transition: .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* very small phones: hide the spectrum to keep titles readable */
@media (max-width: 340px) { .track .spectrum { display: none; } .track { grid-template-columns: 46px minmax(0,1fr) auto; } }

/* =========================================================
   TABLET (600px+)
   ========================================================= */
@media (min-width: 600px) {
  .page { padding: 20px 20px 32px; }
  .plans { grid-template-columns: repeat(3, 1fr); }
  .plan { flex-direction: column; align-items: flex-start; gap: 4px; }
  .plan span { margin-left: 0; text-align: left; }
  .balloon { left: 56px; right: auto; width: 420px; }
}

/* =========================================================
   WEB (900px+): nav moves to the top, themes become a sidebar
   ========================================================= */
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .app-header { padding: 0 24px; }
  .app-nav { position: static; display: flex; gap: 2px; background: none; border: 0; padding: 0; }
  .nav-link { flex-direction: row; gap: 8px; padding: 18px 14px; font-size: 14px; border-bottom: 3px solid transparent; }
  .nav-link svg { width: 18px; height: 18px; }
  .nav-link.active { border-bottom-color: var(--sun); }
  .cart-count { position: static; }
  .toast { bottom: 28px; }

  .catalogue { grid-template-columns: 270px minmax(0, 1fr); align-items: start; gap: 18px; }
  .themes { position: sticky; top: 76px; background: var(--navy); border-radius: 16px; padding: 12px 8px; max-height: calc(100vh - 96px); overflow-y: auto; }
  .theme-list { display: grid; gap: 4px; overflow: visible; padding: 0; }
  .theme-btn {
    width: 100%; grid-template-columns: 38px 1fr; justify-items: start; align-items: center;
    column-gap: 10px; padding: 8px 10px; text-align: left; background: transparent;
  }
  .theme-btn .folder-icon { grid-column: 1; grid-row: 1 / 3; }
  .theme-name { grid-column: 2; grid-row: 1; }
  .theme-count { grid-column: 2; grid-row: 2; }
  .theme-btn:hover:not([aria-pressed="true"]) { background: var(--navy-2); }

  .track { grid-template-columns: 50px minmax(0, 1fr) 100px 140px; }
  .track-side { grid-auto-flow: column; align-items: center; gap: 12px; }
  .spectrum { justify-content: center; }

  .my-layout { max-width: 820px; margin: 0 auto; }
  .dash { grid-template-columns: 1fr 1fr; align-items: start; }
}

/* small extras */
.hint-line { font-size: 12.5px; color: #55557a; margin: -2px 0 12px; }
.on-dark .hint-line { color: var(--lilac); }
.list-panel { scroll-margin-top: 70px; }
.zone .btn-danger-text { color: #6b0000; }
.profile-top { margin-bottom: 14px; }

/* =========================================================
   CREATORS (creator.html): directory + public profile + tips
   ========================================================= */
.creator-link { color: var(--lilac); text-decoration: underline; text-decoration-color: #5a5ad0; text-underline-offset: 2px; }
.creator-link:hover { color: #fff; }
.creator-badge {
  display: inline-flex; align-items: center; gap: 4px; vertical-align: middle;
  padding: 2px 9px 2px 3px; border-radius: 20px; background: var(--sun); color: #111;
  font-size: 12px; font-weight: 700;
}
.creator-badge svg { width: 20px; height: 20px; fill: #ff8fb8; }
img.creator-badge { height: 24px; width: auto; padding: 0; background: none; }

.creator-avatar {
  width: 96px; height: 96px; flex: none; border-radius: 22px; overflow: hidden;
  display: grid; place-items: center; font-size: 34px; font-weight: 700; color: #00002b;
  background: linear-gradient(135deg, var(--c), #1d1d8f);
}
.creator-avatar img { width: 100%; height: 100%; object-fit: cover; }

.creator-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.creator-card {
  display: grid; justify-items: center; gap: 6px; padding: 16px 10px; text-align: center;
  border-radius: 16px; background: var(--navy); color: #fff; text-decoration: none; border: 1.5px solid transparent;
}
.creator-card:hover { border-color: var(--c); }
.creator-card .creator-avatar { width: 72px; height: 72px; font-size: 26px; border-radius: 18px; }
.creator-card b { font-size: 15px; }
.creator-card small { color: var(--grey); font-size: 12px; }

.profile-hero { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; background: var(--navy); border-radius: 18px; padding: 18px 16px; margin-bottom: 14px; }
.profile-hero h1 { font-size: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.profile-hero p { color: var(--lilac); max-width: 60ch; margin-top: 4px; }
.profile-hero .muted { color: var(--grey); font-size: 13px; }
.creator-cols { display: grid; gap: 14px; }

.tip-box { background: #fff5a0; color: #10103a; border-radius: 18px; padding: 16px; }
.tip-box h2 { font-size: 18px; }
.tip-box > p { font-size: 13.5px; margin: 2px 0 10px; }
.tip-amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; border: 0; padding: 0; margin: 0 0 10px; }
.tip-amounts label { position: relative; }
.tip-amounts input { position: absolute; opacity: 0; }
.tip-amounts span {
  display: grid; place-items: center; min-height: 44px; border-radius: 12px; cursor: pointer;
  background: #fff; border: 2px solid #10103a; font-weight: 700; font-size: 14px;
}
.tip-amounts input:checked + span { background: var(--royal); color: #fff; border-color: var(--royal); }
.tip-amounts input:focus-visible + span { outline: 2px solid var(--royal); outline-offset: 2px; }
.tip-box .field input, .tip-box .field textarea { background: #fff; }
.tip-box .btn { width: 100%; }

@media (min-width: 900px) {
  .creator-cols { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .tip-box { position: sticky; top: 76px; }
}
.hero-tip { margin-top: 10px; }
.tip-box { scroll-margin-top: 70px; }
@media (min-width: 900px) { .hero-tip { display: none; } }

/* Random button (Catalogue) */
.list-tools { display: flex; align-items: center; gap: 8px; }
.btn-random {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px;
  border-radius: 8px; border: 1px solid #8a8aff; background: var(--blue); color: #fff; font-size: 13px; font-weight: 600;
}
.btn-random svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.6; }
.btn-random svg circle { fill: #fff; stroke: none; }
.btn-random:active svg { transform: rotate(90deg); transition: transform .15s; }
@media (prefers-reduced-motion: reduce) { .btn-random:active svg { transform: none; } }
.cart-total .btn { white-space: nowrap; flex: none; }

/* subscription button + status (Dashboard) */
.plan-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.plan-status { font-weight: 600; }
/* thanks page */
.thanks-list .track { grid-template-columns: 46px minmax(0, 1fr) auto; }
.btn-download { border: 0; border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; background: var(--sun); color: #111; text-decoration: none; white-space: nowrap; }

/* =========================================================
   CART: commons contribution, sum, payment methods, purchases
   ========================================================= */
.cart-page { display: grid; gap: 14px; }
.commons {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  margin: 14px 4px 0; padding: 12px 14px; border-radius: 12px;
  background: #fff5a0; color: #10103a; cursor: pointer;
}
.commons input { width: 22px; height: 22px; margin: 0; accent-color: var(--royal); }
.commons b { display: block; font-size: 15px; }
.commons small { display: block; font-size: 12.5px; color: #4a4a72; }
.commons em { font-style: normal; font-weight: 700; white-space: nowrap; }

.sum { margin: 12px 4px 0; padding: 0; }
.sum div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 4px; color: var(--lilac); font-size: 14px; }
.sum dt, .sum dd { margin: 0; }
.sum .sum-total { border-top: 1px solid #3a3a9a; margin-top: 4px; padding-top: 10px; color: #fff; font-size: 20px; font-weight: 700; }
.sum .sum-total dd { display: grid; justify-items: end; }
.sum .sum-file-size { color: #8fd8ff; font-size: 12px; font-weight: 400; }
.pay-btn { width: 100%; margin-top: 12px; font-size: 16px; min-height: 48px; }
.pay-methods { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 0; }
.pay-methods span { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 6px; background: #fff; color: #10103a; }
.pay-note { text-align: center; font-size: 12px; color: var(--grey); margin-top: 6px; }

.purchase + .purchase { margin-top: 14px; }
.purchase-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 0 6px 8px; font-size: 13px; color: var(--lilac); }
.zip-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 12px; padding: 14px 0 4px; margin: 0; }
.zip-size, .download-size { font-size: 12px; color: var(--grey); }
.download-action { display: grid; justify-items: end; gap: 3px; }

/* Cart choices: three options in one row (they wrap on small phones) */
.choices { border: 1px solid #3a3a9a; border-radius: 12px; margin: 16px 4px 0; padding: 8px 12px 12px; min-width: 0; }
.choices legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.choice-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice > span { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-weight: 600; font-size: 15px; }
.choice > span::before {             /* our own round radio */
  content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--lilac); box-sizing: border-box;
}
.choice input:checked + span::before { border-color: var(--sun); background: radial-gradient(circle, var(--sun) 0 45%, transparent 50%); }
.choice input:focus-visible + span { outline: 2px solid var(--sun); outline-offset: 2px; border-radius: 4px; }
.sum .sum-compare { font-size: 13px; color: var(--grey); padding-top: 2px; padding-bottom: 2px; }

/* Cart: choose which tones to buy now */
.pick { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--lilac); cursor: pointer; }
.pick input { width: 18px; height: 18px; margin: 0; accent-color: var(--sun); }
.pick-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 6px 0; font-size: 13px; color: var(--lilac); }
.link-light { background: none; border: 0; padding: 4px 0; color: var(--sun); font-weight: 600; text-decoration: underline; }

/* Big pay buttons */
.pay-buttons { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 16px 4px 0; }

.pay-button {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 0 14px; border-radius: 12px; border: 0;
  font-size: 17px; font-weight: 700;
}
.pay-button img { height: 26px; width: auto; max-width: 70%; }
.pay-button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.pay-apple, .pay-google { background: #000; color: #fff; box-shadow: inset 0 0 0 1px #5a5a7a; }
.pay-paypal { background: #ffc439; color: #10103a; }
.pay-card { background: var(--sun); color: #111; }
.pay-button:disabled { opacity: .35; cursor: not-allowed; }
/* PayPal waiting for approval: grey, with a small "soon" tag */
.pay-button.pay-soon { position: relative; filter: grayscale(1); opacity: .5; }
.pay-button.pay-soon::after { content: "soon"; position: absolute; top: 4px; right: 8px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.paypal-soon-note { margin: 8px 4px 0; font-size: 13.5px; color: var(--lilac, #E6E8FA); }
.pay-button.busy { opacity: .6; cursor: progress; }
.pay-button:not(:disabled):hover { filter: brightness(1.08); }
.pay-or { display: flex; align-items: center; gap: 10px; margin: 2px 0; color: var(--grey); font-size: 13px; }
.pay-or::before, .pay-or::after { content: ""; flex: 1; height: 1px; background: #3a3a9a; }
.pay-button span { white-space: nowrap; }
@media (max-width: 400px) { .pay-button { font-size: 15px; padding: 0 8px; } }

/* On wider screens, Card spans above the two wallet buttons. */
@media (min-width: 600px) {
  .pay-buttons { grid-template-columns: repeat(2, 1fr); }
  .pay-button { min-height: 46px; font-size: 15px; padding: 0 10px; }
  .pay-buttons .pay-card { grid-column: 1 / -1; }
}

/* =========================================================
   ACCOUNTS: header chip and the sign-in page
   ========================================================= */
.account-chip {
  margin-left: auto; margin-right: 10px; display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; border-radius: 20px; background: var(--navy); color: #fff;
  text-decoration: none; font-size: 13px; font-weight: 600; max-width: 45vw;
}
.account-chip:not(:has(img, .chip-initial)) { padding: 7px 14px; background: var(--sun); color: #111; }
.account-chip span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account-chip img, .chip-initial {
  width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: none;
  display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 13px;
}
@media (min-width: 900px) { .account-chip { order: 3; margin: 0 0 0 14px; } .app-nav { margin-left: auto; } }

.auth-page { max-width: 460px; }
.auth-card { background: var(--paper); color: #10103a; border-radius: 18px; padding: 18px 16px 20px; }
.auth-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-bottom: 16px; }
.auth-tabs button {
  border: 0; border-radius: 10px; padding: 10px 6px; font-weight: 600; font-size: 13.5px;
  background: #d2d2e0; color: #10103a;
}
.auth-tabs button[aria-selected="true"] { background: var(--royal); color: #fff; }
.auth-card .btn { width: 100%; margin-top: 6px; }
.auth-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 4px 0 8px; }
.auth-check input { width: 18px; height: 18px; accent-color: var(--royal); }
.auth-msg { margin-top: 12px; font-size: 14px; font-weight: 600; }
.auth-msg.bad { color: #b00020; }
.auth-msg.good { color: #1f7a3a; }
.dev-link { margin-top: 10px; font-size: 13px; word-break: break-all; background: #fff5a0; padding: 8px 10px; border-radius: 8px; }
.signed-in-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--navy); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; color: var(--lilac); }
.signed-in-bar b { color: #fff; }
.signed-in-bar .link-light { font-size: 14px; }
.need-signin { background: var(--navy); border-radius: 14px; padding: 20px; text-align: center; color: var(--lilac); }

/* Upload tab: preview of the chosen file */
.up-preview { margin: 4px 0 14px; padding: 12px; border-radius: 14px; background: rgba(0,0,43,.35); border: 1px dashed #5a5ad0; }
.up-preview-label { font-size: 12.5px; color: var(--lilac); margin: 0 0 8px; }
.up-track { grid-template-columns: 46px minmax(0, 1fr) auto auto; }
.up-picture-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.up-picture-row .btn { min-height: 36px; padding: 0 14px; font-size: 14px; color: #fff; }
.up-pic-hint { font-size: 12px; color: var(--lilac); }

/* =========================================================
   FILE SETTINGS ON SMALL PHONES
   The balloon becomes a "sheet" fixed above the bottom menu.
   It scrolls inside if the phone is short, and the buttons
   (Delete file / Save changes) always stay visible at its bottom.
   ========================================================= */
.my-tracks .track { scroll-margin-top: 76px; }
@media (max-width: 599px) {
  .balloon {
    position: fixed; z-index: 40;
    left: 8px; right: 8px; width: auto; max-width: none;
    top: auto !important;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100vh - 160px);
    max-height: calc(100dvh - 160px);
    overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: 0;
    animation: sheet-up .18s ease-out;
  }
  .balloon::before { display: none; }              /* no tail on the sheet */
  .balloon-actions {
    position: sticky; bottom: 0; z-index: 1;
    margin: 4px -16px 0; padding: 10px 16px 14px;
    background: #fff; border-top: 1px solid #e3e3ec;
  }
  .balloon-actions .btn { min-height: 44px; }
}
@keyframes sheet-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .balloon { animation: none !important; } }

/* =========================================================
   STRIPE PAYMENT FORM INSIDE OUR PAGES (cart, tips, creator plan)
   js/pay-embed.js puts Stripe's secure form into .pay-embed
   ========================================================= */
.pay-embed {
  box-sizing: border-box; max-width: 100%; min-width: 0; margin: 14px 0 4px;
  background: #fff; color: #10103a; border-radius: 16px; padding: 12px 12px 10px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25); scroll-margin-top: 80px;
}
.pay-embed[hidden] { display: none; }
.pay-embed-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 2px 8px; font-size: 15px; }
.pay-embed-close { font-size: 14px; }
.pay-embed-frame { min-height: 120px; overflow: hidden; }
.pay-embed-frame > *, .pay-embed-frame iframe { width: 100% !important; max-width: 100% !important; min-width: 0 !important; }
.pay-embed-frame .loading { margin: 40px 0; text-align: center; font-size: 14px; color: #4a4a72; }
.pay-embed-error { margin: 20px 4px; color: #b00020; font-weight: 600; font-size: 14px; }
.pay-embed-note { margin: 8px 2px 0; font-size: 12px; color: #4a4a72; }
.pay-buttons [data-pay].chosen { outline: 3px solid var(--sun); outline-offset: 2px; }
@media (max-width: 600px) {
  /* phones: the form uses the whole screen width, so Stripe's fields have room */
  .pay-embed { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); border-radius: 0; padding: 12px 10px; }
}


/* =========================================================
   MORE ROOM FOR THE TONES (29 Oct 2026)
   - the footer always sits at the very bottom of the screen
     (on phones just above the tab bar, never behind it)
   - Catalogue: no lead text, title, types and folders closer together
   ========================================================= */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; width: 100%; }
body > .legal-footer { flex: none; margin-top: auto; }

body[data-page="catalogue"] .page-title { margin-bottom: 10px; }
@media (max-width: 599px) {
  body[data-page="catalogue"] .page { padding-top: 10px; }
}

/* PHONES + TABLETS: the folders slide away when scrolling down and come
   back on top when scrolling up (js/catalogue.js adds the classes).
   The logo bar scrolls away normally on this page, so the tones get the room. */
@media (max-width: 899px) {
  body[data-page="catalogue"] .app-header { position: relative; }
  body[data-page="catalogue"] .themes {
    position: sticky; top: 0; z-index: 20;
    transition: transform .25s ease, box-shadow .25s ease;
  }
  body[data-page="catalogue"] .themes.floating {
    background: var(--night, #07081A);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .55);
  }
  body[data-page="catalogue"] .themes.slid-away { transform: translateY(calc(-100% - 16px)); box-shadow: none; }
  body[data-page="catalogue"] .list-panel { scroll-margin-top: calc(var(--themes-h, 130px) + 8px); }
}
@media (prefers-reduced-motion: reduce) {
  body[data-page="catalogue"] .themes { transition: none; }
}
