/* Cantami "Cartolina": screen layouts (feed, wizard, song, mine, pay, profile).
   Tokens and shared components are in styles.css. */

.page, .feed { padding: 0 var(--gutter); }
.page { padding-top: 24px; }
.page-head > .t-kicker + * { margin-top: 4px; }
.section-head .t-h2 { margin-top: 4px; }
.section-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title-row .t-h2 { min-width: 0; }
.see-all { flex: none; gap: 2px; }
.see-all > span:has(svg) { width: 16px; height: 16px; }
.section-sub { margin-top: 4px; }
.section { margin-top: 40px; }

/* ── Feed: hero and postcard ── */
.hero { padding-top: 22px; }
.hero-note { display: inline-block; margin: 0 0 6px 2px; font-size: 22px; line-height: 1; color: var(--seal-deep); transform: rotate(-3deg); transform-origin: left bottom; }
.hero-lead { margin-top: 12px; max-width: 330px; }
.postcard { position: relative; margin-top: 20px; padding: 20px 16px 18px; transform: rotate(-.6deg); }
.postcard::before {
  content: ''; position: absolute; inset: 0 0 auto; height: 5px; border-radius: var(--r-paper) var(--r-paper) 0 0; opacity: .85;
  background: repeating-linear-gradient(-45deg, var(--seal) 0 9px, var(--card) 9px 14px, var(--sea) 14px 23px, var(--card) 23px 28px);
}
.pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.pc-kicker { color: var(--ink-3); margin-top: 6px; }
.pc-sub { margin-top: 4px; font: italic 500 13px/18px var(--serif); color: var(--ink-3); }
.pc-stamp { position: relative; width: 116px; height: 82px; flex: none; margin-right: -2px; }
.stamp-mini {
  --hole: 6px; --rad: 1.9px; --edge-in: 7px;
  position: absolute; right: 0; top: 0; width: 60px; height: 78px; padding: 5px 5px 0;
  filter: drop-shadow(0 1px 1px rgb(74 44 20 / 25%)); transform: rotate(4deg);
}
.stamp-mini .ph img { object-position: 42% 30%; }
.stamp-mini .denom { height: 17px; justify-content: center; }
.stamp-mini .denom b { font-size: 11px; }
.pc-stamp .postmark { left: -30px; top: 20px; width: 100px; transform: rotate(-9deg); }
.postcard .t-question { margin-top: 10px; }
.address {
  display: flex; align-items: baseline; gap: 10px; height: 46px; margin-top: 8px;
  border-bottom: 1.5px dotted var(--line-2); transition: border-color var(--t-tap) var(--ease);
}
.address:focus-within { border-bottom: 2px solid var(--seal); }
.address-to { font: 500 12px/1 var(--mono); letter-spacing: .12em; color: var(--seal-deep); flex: none; }
.address-input {
  flex: 1; min-width: 0; height: 44px; border: 0; padding: 0; background: transparent;
  font: 500 18px/44px var(--sans); color: var(--ink); outline: none;
}
.address-input::placeholder { font: 600 24px/44px var(--hand); color: var(--ink-3); opacity: 1; }
.address-line2 { height: 22px; border-bottom: 1.5px dotted var(--line); }
.postcard .btn { display: flex; width: 100%; margin-top: 18px; }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 12px; font: 500 13px/18px var(--sans); color: var(--ink-3); text-align: center; }
.trust > span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.trust > span > span { width: 14px; height: 14px; color: var(--olive); }
.quick { margin-top: 22px; }

/* ── Feed: stamp shelf ── */
.shelf { margin-top: 0; }
.shelf-row {
  display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter);
  margin: 0 calc(-1 * var(--gutter)); padding: 20px var(--gutter) 12px;
}
.shelf-row::-webkit-scrollbar { display: none; }
.song-card, .skeleton-card { width: 160px; flex: none; scroll-snap-align: start; }
.song-card .frame { position: relative; filter: drop-shadow(0 1px 1px rgb(74 44 20 / 18%)) drop-shadow(0 10px 14px rgb(74 44 20 / 18%)); }
.song-card:nth-child(3n+1) .frame { transform: rotate(-1.6deg); }
.song-card:nth-child(3n+2) .frame { transform: rotate(1.2deg); }
.song-card:nth-child(3n) .frame { transform: rotate(-.8deg); }
.song-card .stamp { width: 160px; height: 200px; padding: 8px 8px 0; }
.song-card .postmark { right: -14px; top: 8px; }
.card-open { position: absolute; inset: 0 0 30px; z-index: 1; border-radius: 2px; }
.song-card .player-button { position: absolute; left: 14px; bottom: 40px; z-index: 3; }
.sc-title { margin-top: 14px; }
.sc-title button {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font: inherit; text-align: left; color: var(--ink);
}
.song-card .by { margin-top: 2px; font: 500 13px/24px var(--sans); color: var(--ink-3); }
.song-card .by .t-hand { font-size: 21px; color: var(--ink-2); }
.song-card .link { margin-top: 2px; font-size: 14px; }
.sk-stamp { width: 160px; height: 200px; border-radius: 2px; }
.sk-line { height: 14px; width: 70%; margin-top: 14px; border-radius: 7px; }
.sk-short { height: 12px; width: 45%; margin-top: 8px; }
.shelf-empty { width: 100%; flex: none; }

/* ── Feed: ranked list ── */
.rank-list { margin-top: 20px; overflow: hidden; }
.rank-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 40px; align-items: center; gap: 12px;
  min-height: 72px; padding: 12px 14px; border-top: 1px solid var(--line); transition: background-color var(--t-tap) var(--ease);
}
.rank-row:first-child { border-top: 0; }
.rank-row.playing { background: var(--card-sel); }
.rank-row-thumb { grid-template-columns: 48px minmax(0, 1fr) 40px; }
.row-thumb {
  width: 48px; height: 56px; padding: 3px; background: var(--card); border-radius: 2px;
  box-shadow: 0 0 0 1px var(--line), 0 2px 6px -3px rgb(43 33 24 / 35%);
}
.row-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rank { text-align: center; font: 500 30px/1 var(--serif); font-variation-settings: var(--fv-display); color: var(--seal-deep); }
.row-body { min-width: 0; }
.row-title {
  display: block; width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left;
  font: 520 17px/22px var(--serif); font-variation-settings: var(--fv-text); color: var(--ink);
}
.row-meta { margin-top: 2px; font: 500 13px/18px var(--sans); color: var(--ink-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.live-wave { display: none; align-items: center; gap: 2px; height: 18px; margin-top: 2px; }
.rank-row.playing .row-meta { display: none; }
.rank-row.playing .live-wave { display: flex; }
.live-wave i { width: 2px; height: 10px; border-radius: 1px; background: var(--line-2); transform-origin: center; animation: bar 1.1s ease-in-out infinite; animation-delay: calc(var(--i) * -70ms); }
.live-wave i:nth-child(3n) { height: 16px; }
.live-wave i:nth-child(4n+1) { height: 6px; }
.live-wave i:nth-child(5n+2) { height: 13px; }
.live-wave i:nth-child(7n) { height: 4px; }
.live-wave i.on { background: var(--seal); }

/* ── Feed: names as luggage tags ── */
.name-tags { display: flex; flex-wrap: wrap; gap: 12px 10px; margin-top: 18px; }
.name-tag {
  position: relative; height: 40px; padding: 0 16px 0 26px; display: inline-flex; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px 20px 20px 4px; box-shadow: var(--sh-1);
  font-size: 22px; line-height: 1; color: var(--ink); transform: rotate(-1deg); transition: transform var(--t-tap) var(--ease);
}
.name-tag:nth-child(even) { transform: rotate(1deg); }
.name-tag::before { content: ''; position: absolute; left: 10px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--paper-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.name-tag:active { transform: scale(.96); }

/* ── Wizard ── */
.wizard { min-height: 100vh; min-height: var(--tg-viewport-stable-height, 100dvh); display: flex; flex-direction: column; }
.wizard-top {
  position: sticky; top: 0; z-index: var(--z-bar); display: grid; grid-template-columns: 40px 1fr 40px; align-items: center;
  min-height: calc(var(--topbar-h) + var(--safe-top)); padding: var(--safe-top) 12px 0;
  background: var(--paper) var(--grain); background-size: 128px 128px; border-bottom: 1px solid var(--line);
}
.wizard-close { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.wizard-close svg { width: 22px; height: 22px; }
.wizard-heading { text-align: center; font: 500 13px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.wizard-body { flex: 1; padding: 20px var(--gutter) 24px; }
.route-track { display: flex; align-items: center; }
.stop { width: 12px; height: 12px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); background: var(--paper); transition: all var(--t-tap) var(--ease); }
.stop.done { border-color: var(--seal); background: var(--seal); }
.stop.now { border-color: var(--seal); background: var(--seal); box-shadow: 0 0 0 4px var(--seal-wash); }
.leg { flex: 1; height: 0; margin: 0 6px; border-top: 2px dashed var(--line-2); }
.leg.done { border-top: 2px solid var(--seal); }
.route-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font: 500 11px/14px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.route-meta b { font-weight: 500; color: var(--seal-deep); white-space: nowrap; }
.route-meta span { text-align: right; }
.step-title { margin-top: 24px; }
.step-sub { margin-top: 8px; }
.step-wrap { margin-top: 22px; }
.step-body { display: grid; gap: 28px; }
.tile-group { display: grid; gap: 12px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  position: relative; min-height: 84px; padding: 14px 14px 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  border-radius: var(--r-tile); background: var(--card); border: 1px solid var(--line); box-shadow: var(--sh-1); color: var(--ink); text-align: left;
  transition: border-color var(--t-tap) var(--ease), background-color var(--t-tap) var(--ease), transform var(--t-tap) var(--ease);
}
.tile:active { transform: scale(.98); }
.tile-plain { min-height: 64px; justify-content: center; }
/* In a grid where other tiles carry a sample phrase, a plain tile keeps the same height and top-aligned label,
   so labels in one row line up ("Me stesso" next to "Moglie «ancora noi due»"). */
.tiles:has(.tile-hint) .tile-plain { min-height: 84px; justify-content: flex-start; }
.tile-label { display: flex; align-items: center; gap: 9px; font: 500 20px/24px var(--serif); font-variation-settings: var(--fv-title); min-width: 0; }
.tile-label > span { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.tile .dot { width: 9px; height: 9px; }
.tile-hint { font: 600 19px/22px var(--hand); color: var(--ink-3); }
.tile-check { display: none; position: absolute; right: 10px; top: 10px; width: 26px; height: 26px; padding: 5px; border-radius: 50%; background: var(--seal); color: var(--on-seal); }
.tile.on { border: 2px solid var(--seal); background: var(--card-sel); padding: 13px 13px 11px; box-shadow: var(--sh-sel); }
.tile.on .tile-label { color: var(--seal-deep); padding-right: 24px; }
.tile.on .tile-check { display: block; animation: pop var(--t-stamp) var(--ease); }
.tiles-rows { grid-template-columns: 1fr; gap: 8px; }
.tiles-rows .tile { min-height: 56px; padding: 0 16px; justify-content: center; }
.tiles-rows .tile.on { padding: 0 15px; }
.tiles-rows .tile-label { font-size: 19px; }
.tiles-rows .tile-check { top: 50%; right: 14px; margin-top: -13px; }
.other-field {
  display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 14px; border-radius: var(--r-tile);
  border: 1.5px dashed var(--line-2); color: var(--ink-3); cursor: text;
  transition: border-color var(--t-tap) var(--ease), background-color var(--t-tap) var(--ease);
}
.other-field > span { width: 18px; height: 18px; flex: none; }
.other-input { flex: 1; min-width: 0; height: 48px; border: 0; padding: 0; background: transparent; font: 400 16px/1.4 var(--sans); color: var(--ink); outline: none; }
.other-field:focus-within { border: 1px solid var(--edge); background: var(--card); box-shadow: 0 0 0 3px rgb(43 88 118 / 18%); padding: 0 14.5px; }
.other-field.on { border: 2px solid var(--seal); background: var(--card-sel); padding: 0 13.5px; color: var(--seal-deep); }
.wizard-foot {
  position: sticky; bottom: 0; z-index: 5;
  padding: 16px var(--gutter) calc(12px + var(--safe-bottom));
  background: linear-gradient(transparent, var(--paper) 30%);
}
.wizard-actions { display: grid; grid-template-columns: 54px 1fr; gap: 10px; }
.wizard-foot.first .wizard-actions { grid-template-columns: 1fr; }
.wizard-actions .btn-primary { width: 100%; }
.wizard-reassure { margin-top: 10px; text-align: center; font: 500 13px/18px var(--sans); color: var(--ink-3); }
.story, .own { display: grid; gap: 12px; }
.story .field-label { margin-bottom: -4px; }
.hint-list { display: flex; flex-wrap: wrap; gap: 8px; }
.hint-list li {
  display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 5px 12px 5px 10px;
  border-radius: 16px; background: var(--card); border: 1px solid var(--line); font: 500 14px/18px var(--sans); color: var(--ink-2);
}
.lined-paper { background: var(--card); border-radius: var(--r-paper); box-shadow: var(--sh-paper); }
.lined-paper:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
textarea.lined {
  display: block; width: 100%; min-height: 196px; padding: 6px 16px; border: 0; outline: none; resize: vertical;
  background: transparent repeating-linear-gradient(transparent 0 27px, var(--line) 27px 28px); background-attachment: local;
  background-position: 0 6px; font: 400 17px/28px var(--sans); color: var(--ink);
}
textarea.lined::placeholder { color: var(--ink-3); opacity: 1; }
.field-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.counter { flex: none; font: 500 12px/16px var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.counter.ok { color: var(--olive); }
.tag-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-btn { font-family: var(--mono); font-size: 13px; letter-spacing: .02em; }
.summary { padding: 4px 16px; }
.sum-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 12px; padding: 12px 0; border-top: 1.5px dashed var(--line-2); }
.sum-row:first-child { border-top: 0; }
.sum-row dt { font: 500 11px/14px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.sum-row dd { grid-column: 1; font: 500 17px/22px var(--serif); font-variation-settings: var(--fv-text); overflow-wrap: anywhere; }
.sum-row .link { grid-column: 2; grid-row: 1 / span 2; }

/* ── Waiting scene (lyrics) and generating card ── */
.waiting {
  position: fixed; inset: 0; z-index: var(--z-wait); display: grid; place-items: center; padding: var(--gutter);
  background: var(--paper) var(--grain); background-size: 128px 128px; opacity: 0; transition: opacity var(--t-screen) var(--ease);
}
.waiting.in { opacity: 1; }
.waiting-card, .gen-card { display: grid; justify-items: center; gap: 10px; padding: 28px 20px; text-align: center; }
.waiting-card { width: 100%; max-width: 360px; }
.seal-mark { display: block; width: 72px; height: 72px; }
.seal-mark svg, .seal-mark img { width: 100%; height: 100%; display: block; }
.seal-wait svg path:nth-of-type(2) { stroke-dasharray: 6 4; animation: ring 1.6s linear infinite; }
.seal-wait { margin-bottom: 6px; }
.wait-line { min-height: 44px; font: 400 15px/22px var(--sans); color: var(--ink-2); }
.wait-line.swap { animation: fade-in 600ms var(--ease); }
.gen-card { margin-top: 20px; }
.gen-card .status { margin-top: 4px; }

/* ── Song ── */
.song-screen > .skeleton-block { margin-inline: var(--gutter); }
.song-head { text-align: center; }
.song-stamp-frame { position: relative; width: 300px; margin: 4px auto 0; transform: rotate(-1deg); filter: drop-shadow(0 1px 1px rgb(74 44 20 / 18%)) drop-shadow(0 10px 14px rgb(74 44 20 / 18%)); }
.stamp-big { width: 300px; height: 340px; padding: 12px; }
.song-stamp-frame .postmark { right: -16px; top: 12px; }
@media (max-width: 339px) { .song-stamp-frame { transform: rotate(-1deg) scale(.9); margin-block: -14px; } }
.song-title { margin-top: 22px; overflow-wrap: anywhere; }
.song-by { margin-top: 2px; font: 500 13px/26px var(--sans); color: var(--ink-3); }
.song-by .t-hand { font-size: 24px; color: var(--ink-2); }
.song-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 10px; margin-top: 6px; }
.page-head .song-meta { justify-content: flex-start; margin-top: 10px; }
.page-head .song-title { margin-top: 4px; }
.ready > .player, .failed > .notice, .ready > .notice { margin-top: 24px; }
.tracks { display: grid; gap: 16px; margin-top: 24px; }
.track { display: grid; gap: 10px; }
/* Download sits right under its player, full width, so it reads as part of that version. */
.track { gap: 8px; }
.track > .btn { justify-self: stretch; }
.lyrics-section { margin-top: 24px; }
.letter { position: relative; padding: 20px 20px 24px; }
.lyrics { font: 400 18px/30px var(--serif); font-variation-settings: var(--fv-text); color: var(--ink); overflow-wrap: break-word; }
.stanza + .stanza { margin-top: 14px; }
.stanza-tag { font: 500 11px/14px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sea); margin-bottom: 4px; }
.stanza.chorus p { font-style: italic; }
.letter.folded .lyrics { max-height: 210px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 40%, transparent); mask-image: linear-gradient(#000 40%, transparent); }
.fold-open { margin-top: 6px; }
.lyrics-details { padding: 4px 20px; }
.lyrics-details summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; list-style: none; cursor: pointer; font: 600 15px/20px var(--sans); color: var(--seal-deep); }
.lyrics-details summary::-webkit-details-marker { display: none; }
.lyrics-details summary > span:last-child { width: 18px; height: 18px; transition: transform var(--t-tap) var(--ease); }
.lyrics-details[open] summary > span:last-child { transform: rotate(90deg); }
.lyrics-details[open] .lyrics { padding-bottom: 20px; }
.generating .lyrics-details, .failed .lyrics-details { margin-top: 20px; }
.unlock-card { display: grid; gap: 8px; margin-top: 20px; padding: 18px 16px; }
.unlock-title { font-size: 21px; line-height: 26px; }
.unlock-card .btn { margin-top: 8px; }
.song-actions { display: grid; gap: 12px; margin-top: 24px; }
.song-actions:empty { display: none; }
.failed > .btn { margin-top: 16px; }
.review-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 20px; }
/* Two secondary actions stacked full width: labels stay on one line in every language. */
.review-actions .btn-pair { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 8px; }
.review-actions .btn-pair .btn { min-height: 50px; font-size: 16px; gap: 8px; white-space: nowrap; }
.change-panel { display: grid; gap: 10px; }
.lyrics-card { margin-top: 20px; transition: opacity var(--t-screen) var(--ease); }
.lyrics-card.rewriting { opacity: .45; animation: pulse 1.2s ease-in-out infinite alternate; }

/* ── Mine ── */
.mine-tools { display: grid; gap: 12px; margin-top: 20px; }
.mine-body { margin-top: 16px; }
.mine-list { overflow: hidden; }
.mine-row {
  position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) 20px; align-items: center; gap: 12px;
  min-height: 72px; padding: 12px 14px; border-top: 1px solid var(--line);
}
.mine-row:first-child { border-top: 0; }
.mine-open { position: absolute; inset: 0; z-index: 0; }
.mine-open:active { background: var(--card-sel); }
.thumb { width: 52px; height: 52px; border-radius: 4px; border: 3px solid var(--stamp); box-shadow: var(--sh-1); overflow: hidden; background: var(--paper-2); pointer-events: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.mine-row .row-body { pointer-events: none; }
.mine-row .row-title { white-space: nowrap; }
.mine-row .row-meta { white-space: normal; }
.row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 6px; }
.row-foot .link { position: relative; z-index: 1; pointer-events: auto; min-height: 28px; }
.row-chevron { width: 20px; height: 20px; color: var(--ink-3); pointer-events: none; }
.list-empty { display: grid; justify-items: center; gap: 10px; padding: 24px 16px 26px; text-align: center; font: 400 15px/22px var(--sans); color: var(--ink-2); }
/* "No results" art: an empty perforated stamp outline (decorative). */
.list-empty::before {
  content: ''; width: 56px; height: 56px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 72 72' fill='none' stroke='%23C9B391' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='14' y='10' width='44' height='52' rx='2' stroke-dasharray='3 3'/%3E%3Crect x='20' y='16' width='32' height='30'/%3E%3Cpath d='M24 54h14'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ── Pay ── */
.balance-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; margin-top: 12px; padding: 0 12px 0 9px;
  border-radius: var(--r-pill); background: var(--paper-2); font: 600 14px/1 var(--sans); color: var(--ink-2);
}
.balance-chip > span:first-child { width: 18px; height: 18px; color: var(--seal-deep); }
.pay > .notice { margin-top: 16px; }
.pack-picker { margin-top: 24px; }
.pack-list { display: grid; gap: 12px; }
.pack-popular { margin-top: 2px; }
.pack {
  position: relative; display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; width: 100%; min-height: 92px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-pack); box-shadow: var(--sh-1); color: var(--ink); text-align: left;
  transition: border-color var(--t-tap) var(--ease), box-shadow var(--t-tap) var(--ease);
}
.pack:active { transform: scale(.99); }
.stub { position: relative; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1.5px dashed var(--line-2); }
.stub::before, .stub::after { content: ''; position: absolute; right: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); border: 1px solid var(--line); }
.stub::before { top: -9px; clip-path: inset(50% 0 0 0); }
.stub::after { bottom: -9px; clip-path: inset(0 0 50% 0); }
.stub-n { font: 500 36px/1 var(--serif); font-variation-settings: var(--fv-display); font-variant-numeric: lining-nums; }
.stub-u { margin-top: 4px; font: 500 10px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.pack-mid { display: grid; gap: 2px; padding: 14px 0 14px 16px; min-width: 0; }
.pack-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.amount { font: 600 22px/26px var(--serif); font-variation-settings: var(--fv-num); font-variant-numeric: lining-nums tabular-nums; }
.was { font: 400 14px/20px var(--sans); color: var(--ink-3); }
.pack-note { font: 400 14px/20px var(--sans); color: var(--ink-3); }
.pack-end { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding: 0 16px 0 8px; }
.radio { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--edge); background: var(--stamp); }
.save { padding: 5px 7px; border-radius: var(--r-badge); font: 500 12px/1 var(--mono); letter-spacing: .04em; background: var(--seal-wash); color: var(--seal-deep); }
.save-best { background: var(--olive-wash); color: var(--olive); }
.rubber {
  position: absolute; right: 18px; top: -13px; z-index: 1; transform: rotate(-5deg);
  padding: 6px 9px 5px; border: 1.5px solid currentColor; border-radius: 4px; background: var(--card-sel); box-shadow: 0 0 0 2px var(--card-sel);
  font: 500 11px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--seal-deep); white-space: nowrap;
}
.pack.on { border: 2px solid var(--seal); background: var(--card-sel); box-shadow: var(--sh-sel); }
.pack.on .stub { border-right-color: rgb(191 63 39 / 45%); }
.pack.on .stub::before, .pack.on .stub::after { border: 2px solid var(--seal); right: -10px; }
.pack.on .stub::before { top: -10px; }
.pack.on .stub::after { bottom: -10px; }
.pack.on .stub-n { color: var(--seal-deep); }
.pack.on .radio { border: 0; background: var(--seal); }
.pack.on .radio::after { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--on-seal); }
.perks { display: grid; gap: 10px; margin-top: 22px; }
.perks li { display: flex; align-items: flex-start; gap: 10px; font: 400 15px/22px var(--sans); color: var(--ink-2); }
.perks li > span { width: 20px; height: 20px; flex: none; margin-top: 1px; color: var(--olive); }
.pay-with { margin-top: 24px; margin-bottom: 10px; color: var(--ink-3); }
.pay-methods { display: grid; gap: 10px; }
.pay-method { justify-content: space-between; gap: 12px; padding: 0 18px; }
.pay-method-name { font-weight: 600; }
.pay-method-price { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pay-method.busy .pay-method-price { opacity: .5; }
.pay-method.is-off { opacity: .55; }
/* The lock sits inline with the first word, so a two-line note stays centred with its icon. */
.pay-note { display: block; margin-top: 12px; text-align: center; text-wrap: balance; font: 500 13px/18px var(--sans); color: var(--ink-3); }
.pay-note > span:first-child { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.pay-note > span:first-child svg { display: block; width: 14px; height: 14px; }

/* ── Profile ── */
.tessera { position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr); }
.tessera-stub { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 18px 6px; border-right: 1.5px dashed var(--line-2); }
.tessera-stub::before, .tessera-stub::after { content: ''; position: absolute; right: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.tessera-stub::before { top: -8px; clip-path: inset(50% 0 0 0); }
.tessera-stub::after { bottom: -8px; clip-path: inset(0 0 50% 0); }
.tessera-n { font: 500 44px/1 var(--serif); font-variation-settings: var(--fv-display); font-variant-numeric: lining-nums; color: var(--seal-deep); }
.tessera-u { margin-top: 6px; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.tessera-body { padding: 16px 16px 18px; min-width: 0; }
.tessera-name { font: 500 22px/26px var(--serif); font-variation-settings: var(--fv-title); overflow-wrap: anywhere; }
.tessera-rule { margin: 6px 0 2px; font: 500 11px/14px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.tessera-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
/* Side by side when they fit, each full width when a long label ("Comprar créditos") wraps the row. */
.tessera-actions .btn { flex: 1 1 auto; padding: 0 14px; }
.referral { margin-top: 24px; padding: 18px 16px; }
.ref-stats { display: flex; gap: 20px; margin: 14px 0 12px; }
.ref-stats div { display: flex; flex-direction: column-reverse; }
.ref-stats dt { font: 500 13px/18px var(--sans); color: var(--ink-3); }
.ref-stats dd { font: 600 20px/24px var(--serif); font-variation-settings: var(--fv-num); font-variant-numeric: lining-nums; }
.referral .btn-pair { margin-top: 12px; }
.settings { overflow: hidden; }
.set-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 16px; border-top: 1px solid var(--line); text-align: left; }
.set-row:first-child { border-top: 0; }
.set-lang { flex-wrap: wrap; }
.set-lang .set-label { flex: 1 0 100%; }
.set-lang .segmented { flex: 1; }
.set-label { font: 600 16px/22px var(--sans); color: var(--ink); }
.set-text { flex: 1; display: grid; gap: 2px; min-width: 0; }
.set-value { font: 500 15px/20px var(--sans); color: var(--sea); overflow-wrap: anywhere; }
.set-link:active { background: var(--card-sel); }
.set-link .row-chevron { flex: none; }
.danger-zone { margin-top: 16px; }
.set-danger .set-label, .set-danger .row-chevron { color: var(--seal-deep); }
.set-danger.busy { opacity: .6; cursor: progress; }

/* ---------- account deleted ---------- */
.sheet-list { margin: 6px 0 0; padding-left: 20px; list-style: disc; }
.sheet-list li + li { margin-top: 4px; }
body.account-gone .tabbar, body.account-gone .credit-pill, body.account-gone .me-btn { display: none; }
body.account-gone .brand { pointer-events: none; }
body.account-gone .view { padding-bottom: calc(var(--safe-bottom) + 32px); }

/* ── Browse (all songs of a shelf) ── */
.browse .rank-list { margin-top: 20px; }
.browse-more { margin-top: 16px; }
.browse-error { padding: 14px; list-style: none; }
.browse .empty { margin-top: 20px; }

/* ---------- terms and privacy ---------- */
.legal-body { padding: 20px 18px 28px; display: grid; gap: 0; color: var(--ink); font: 400 15px/24px var(--sans); overflow-wrap: anywhere; }
.legal-body .sk-line { margin: 8px 0; }
.legal-body h1 { font: 600 26px/32px var(--serif); margin: 0 0 4px; }
.legal-body h2 { font: 600 18px/24px var(--serif); margin: 24px 0 6px; }
.legal-body p { margin: 0 0 10px; }
.legal-body ul { margin: 0 0 10px; padding-left: 20px; }
.legal-body li + li { margin-top: 6px; }
.legal-body a { color: var(--sea); }
.legal-body .legal-updated { font: 500 13px/18px var(--mono); color: var(--ink-3); }
.legal-body .legal-operator { font-weight: 600; }
.pay-legal { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 8px 16px 0; }
.pay-legal-links { display: flex; gap: 20px; justify-content: center; }
.pay-legal-links .link { min-height: 44px; }
.legal-ack { font-size: 13px; }

/* ---------- delete song ---------- */
.link-danger { color: var(--seal-deep); }
.delete-song { justify-self: center; min-height: 44px; margin-top: 8px; }

/* ---------- report song (listener) ---------- */
.report-song { justify-self: center; min-height: 44px; font-size: 14px; font-weight: 500; color: var(--ink-3); }
.report-done { margin: 0; }
.report-cancel { display: flex; margin: 14px auto 0; min-height: 44px; color: var(--ink-2); }
.btn-danger { background: var(--seal-deep); color: #FFFAF2; border: 0; }
.btn-danger:active:not(:disabled) { transform: scale(.98); filter: brightness(.95); }
