/* mate.fastmate.ai web app — shell, lists, forms, modal. Tokens come from fastmate-landing.css. */
[hidden] { display: none !important; }
.app-body { display: flex; flex-direction: column; min-height: 100dvh; }
.app-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 24px var(--pad) 48px; }
.app-center { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; }
.app-section { margin-bottom: 36px; }
.section-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 3vw, 32px); line-height: 1.1; margin-bottom: 14px; }
.h4 { font-family: var(--serif); font-weight: 400; font-size: 20px; margin-bottom: 10px; }
.app-empty, .app-status, .field-note { color: var(--muted); font-size: 14px; }
.btn-xs { height: 34px; padding: 0 12px; font-size: 13px; }
.btn[disabled], button[disabled] { opacity: .5; cursor: default; }

/* nav — same 760px column as .app-main / .chat-shell so the bar's edges line up with the content below */
.app-nav .wrap { max-width: 760px; }
.landing-body .app-nav .wrap { max-width: var(--wrap); } /* landing hero is full width */
.app-nav .app-links { display: flex; gap: 20px; font-size: 14px; color: var(--ink-2); }
.app-nav .app-links a.active { color: var(--ink); }
.app-nav-right { display: flex; align-items: center; gap: 10px; }
.coin-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.coin-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); }
.nav-icon { width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--ink-2);
  background: var(--surface); border: 1px solid var(--line); transition: color .2s, border-color .2s, background .2s; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-icon:hover { color: var(--ink); border-color: var(--line-2); background: var(--surface-2); }
.app-foot .foot-copy { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* login */
.login-card { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 420px; padding: 36px 24px;
  border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); text-align: center; }
.login-logo { border-radius: 14px; }
.login-google { min-height: 44px; }
.login-error { color: var(--accent); font-size: 14px; }
.login-consent { font-size: 12.5px; line-height: 1.5; color: var(--muted); max-width: 320px; }
.login-consent a { color: var(--ink-2); border-bottom: 1px solid var(--line-2); }

/* onboarding (character preference) */
.onboard { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 640px; }
.onboard-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; margin-top: 10px; }
.onboard-card { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 22px 16px 20px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color .2s, transform .25s var(--ease); }
.onboard-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.onboard-card.picked { border-color: var(--accent); }
.onboard-card:disabled { cursor: default; opacity: .8; }
.onboard-stack { display: flex; justify-content: center; min-height: 120px; }
.onboard-stack img { width: 90px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface-2); }
.onboard-stack img + img { margin-left: -34px; }
.onboard-stack img:nth-child(2) { transform: translateY(-8px); z-index: 1; }
.onboard-label { font-family: var(--serif); font-size: 26px; line-height: 1; }
.section-tools { display: flex; align-items: center; gap: 8px; }
.seg-xs { padding: 3px; }
.seg-xs button { padding: 6px 12px; font-size: 12px; }
.mate-row-badge-soft { background: var(--surface-2); color: var(--ink-2); }

/* landing */
/* Web-app hero = the "pick someone" strip, not a second marketing hero: short, headline + the
   cast's faces, and the card grid starts within the first screen. */
.app-hero { padding: clamp(28px, 4vw, 48px) 0 clamp(24px, 3vw, 36px); }
.app-hero-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 40px; }
.app-hero-copy { gap: 14px; }
.app-hero-copy .app-hero-title { font-size: clamp(36px, 5.2vw, 60px); max-width: none; }
.app-hero-title em { display: block; } /* sentence per line in every language */
.app-body .fm-cast { padding-top: clamp(32px, 4vw, 48px); }
.app-hero .lead { font-size: 16px; max-width: 32em; }
.app-hero-faces { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.face-stack { display: flex; }
.face-stack img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid var(--bg); background: var(--surface-2); box-shadow: 0 0 0 1px var(--line-2); }
.face-stack img + img { margin-left: -12px; }
.face-hint { font-size: 13px; color: var(--muted); letter-spacing: .02em; }
.app-cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; overflow: visible; }
.app-cast-card { position: relative; display: block; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.app-cast-card .cast-img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.app-cast-card .cast-meta { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 12px 12px; display: flex; flex-direction: column; gap: 2px;
  background: linear-gradient(to top, rgba(0,0,0,.85), transparent); }
.cast-name { font-family: var(--serif); font-size: 20px; }
.cast-role { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-cta { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; opacity: 0; transition: opacity .2s; }
.app-cast-card:hover .cast-cta, .app-cast-card:focus-visible .cast-cta { opacity: 1; }

/* mates page */
.mate-list { display: flex; flex-direction: column; gap: 8px; }
.mate-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.mate-row:hover { border-color: var(--line-2); }
.mate-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.mate-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mate-row-name { font-weight: 600; }
.mate-row-last { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mate-row-badge { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; }
.h3-inline { margin-bottom: 0; }
.teaser { padding: 28px 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.teaser-title { font-family: var(--serif); font-size: 22px; line-height: 1.2; }
.teaser-body { color: var(--muted); font-size: 14px; max-width: 46ch; margin-bottom: 8px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.char-card { display: block; border-radius: var(--r); overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.char-img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--surface-2); }
.char-meta { padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.char-name { font-weight: 600; font-size: 15px; }
.char-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 15px; }
/* Tag rows (discover v1.3) — one horizontal strip per tag, cards same as the grid. */
.tag-row { margin-bottom: 28px; }
.tag-row-title { margin-bottom: 12px; }
.card-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.card-row .char-card { flex: 0 0 150px; scroll-snap-align: start; }
/* Browse bar — search + single-tag chips, sort toggle; browsing replaces the curated sections. */
.browse-bar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 30px; }
.search-box { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.search-box:focus-within { border-color: var(--line-2); }
.search-icon { color: var(--muted); font-size: 16px; transform: rotate(-45deg); }
.search-box input { flex: 1; min-width: 0; background: none; border: 0; color: var(--ink); font: inherit; font-size: 15px; outline: none; }
.search-box input::placeholder { color: var(--muted); }
.search-clear { color: var(--muted); font-size: 20px; line-height: 1; padding: 0 2px; }
.chip-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chip-strip::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 8px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s; }
.chip:hover { border-color: var(--line-2); }
.chip.active { background: var(--ink); color: #111; border-color: var(--ink); }
.browse-count { font-family: var(--sans); font-size: 14px; color: var(--muted); margin-left: 6px; vertical-align: middle; }
.section-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
/* Heart on cards (browser-local wishlist). */
.char-card { position: relative; }
.char-save { position: absolute; top: 8px; right: 8px; width: 32px; height: 32px; border-radius: 999px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 17px; line-height: 32px; text-align: center; backdrop-filter: blur(4px); transition: transform .15s; }
.char-save:hover { transform: scale(1.08); }
.char-save.on { color: var(--accent); }
.char-rank { position: absolute; top: 8px; left: 8px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 8px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 13px; font-weight: 700; line-height: 26px; text-align: center; backdrop-filter: blur(4px); }
.char-new { position: absolute; left: 8px; top: 8px; padding: 3px 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.char-rank:not([hidden]) ~ .char-new { left: 42px; }
/* Top N row — bigger cards, oversized serif rank over the image (ranking, not just another strip). */
.top-title { color: var(--gold); }
.top-row { gap: 16px; padding-top: 4px; }
.top-row .char-card { flex: 0 0 196px; border-color: var(--line-2); }
.top-row .char-img { aspect-ratio: 2 / 3; }
.top-row .char-rank { top: auto; left: 8px; bottom: calc(100% / 4 + 2px); min-width: 0; height: auto; padding: 0; border-radius: 0; background: none; backdrop-filter: none; font-family: var(--serif); font-size: 64px; line-height: .85; color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, .75), 0 0 2px rgba(0, 0, 0, .9); }
.top-row .char-card:nth-child(-n+3) .char-rank { color: var(--gold); }
.top-row .char-meta { padding-top: 12px; }
.char-official { position: absolute; left: 8px; bottom: calc(25% + 8px); padding: 2px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 10px; font-weight: 600; letter-spacing: .03em; backdrop-filter: blur(4px); }
.char-likes { font-size: 12px; color: var(--muted); }
.section-back { font-size: 26px; line-height: 1; padding: 0 6px 0 0; color: var(--ink-2); vertical-align: -2px; }
.mate-row-hub .mate-avatar { cursor: pointer; }
/* Taste tiles (onboarding step 2). */
.onboard-wide { max-width: 720px; }
.tag-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; margin-top: 8px; }
@media (max-width: 480px) { .tag-tiles { grid-template-columns: repeat(2, 1fr); } }
.tag-tile { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 2px solid transparent; cursor: pointer; transition: border-color .15s, transform .2s var(--ease); }
.tag-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.tag-tile:hover { transform: translateY(-2px); }
.tag-tile.picked { border-color: var(--accent); }
.tag-tile.picked img { opacity: 1; }
.tag-tile-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 8px; text-align: center; color: #fff; font-weight: 700; font-size: 16px; text-shadow: 0 1px 8px rgba(0, 0, 0, .8); background: linear-gradient(to top, rgba(0, 0, 0, .55), rgba(0, 0, 0, .1)); }
.onboard-actions { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }

/* works */
.works-list { display: flex; flex-direction: column; gap: 8px; }
.work-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.work-img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.work-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.work-name { font-weight: 600; }
.work-status { font-size: 12px; color: var(--muted); }
.work-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(0,0,0,.6); }
.modal-card { width: 100%; max-width: 380px; padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 12px; }
.modal-title { font-family: var(--serif); font-weight: 400; font-size: 24px; }
.modal-body { color: var(--ink-2); font-size: 15px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

/* recharge guide (no web payment — coins come from the app) */
.coin-chip { cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; transition: border-color .2s, background .2s; }
.coin-chip:hover { border-color: var(--line-2); background: var(--surface-2); }
.coin-chip .coin-plus { color: var(--muted); font-weight: 700; margin-left: 2px; }
.coin-chip.empty { border-color: rgba(255, 77, 109, .5); }
.coin-chip.empty .coin-dot { background: var(--accent); }
.recharge-card { position: relative; max-width: 400px; align-items: flex-start; gap: 10px; padding: 26px 24px 20px; }
.recharge-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border-radius: 50%; color: var(--muted); font-size: 22px; line-height: 1; }
.recharge-close:hover { color: var(--ink); background: var(--surface-2); }
.recharge-coin { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(232, 192, 122, .12); border: 1px solid rgba(232, 192, 122, .3); margin-bottom: 4px; }
.recharge-coin .coin-dot { width: 16px; height: 16px; box-shadow: 0 0 18px rgba(232, 192, 122, .6); }
.recharge-kicker { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.recharge-card .modal-title { font-size: 26px; line-height: 1.1; }
.recharge-card .modal-body { line-height: 1.5; }
.recharge-steps { list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; padding: 0; font-size: 14px; color: var(--ink-2); }
.recharge-steps li { display: flex; align-items: center; gap: 10px; }
.recharge-step-n { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); color: var(--ink); font-size: 12px; font-weight: 600; }
.recharge-stores { display: flex; gap: 8px; width: 100%; margin-top: 6px; }
.recharge-store { flex: 1; gap: 8px; }
.recharge-note { font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.recharge-later { align-self: center; margin-top: 2px; padding: 6px 12px; color: var(--muted); font-size: 14px; font: inherit; }
.recharge-later:hover { color: var(--ink); }

/* free coins (daily / weekly claim) */
.coin-chip.claimable { border-color: rgba(232, 192, 122, .5); }
.coin-chip.claimable .coin-plus { display: none; }
.coin-claim-badge { margin-left: 2px; padding: 1px 6px; border-radius: 999px; background: var(--gold); color: #111; font-size: 11px; font-weight: 700; animation: claimPulse 1.2s ease-in-out infinite; }
@keyframes claimPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.reward-block { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.reward-block:has([data-reward-rows][hidden]) { display: none; }
.reward-rows { display: flex; flex-direction: column; gap: 6px; }
.reward-row { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.reward-row.on { border-color: rgba(232, 192, 122, .45); }
.reward-icon { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.reward-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.reward-name { font-size: 14px; font-weight: 600; }
.reward-status { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.reward-row.on .reward-status { color: var(--gold); }
.reward-claim { min-width: 74px; font-variant-numeric: tabular-nums; }
.reward-row.on .reward-claim { animation: claimPulse 1.2s ease-in-out infinite; }
.reward-claim[disabled] { animation: none; }
.reward-float { position: absolute; right: 14px; top: 8px; color: var(--gold); font-weight: 700; font-size: 14px; pointer-events: none; animation: rewardRise .8s ease-out forwards; }
@keyframes rewardRise { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-20px); } }
.recharge-card .reward-kicker { padding-top: 2px; }
.reward-first .recharge-steps, .reward-first .recharge-note, .reward-first .reward-kicker { display: none; } /* opened for free coins: rows first, store links as the footer */
.reward-first .recharge-stores { margin-top: 10px; }

/* sheets (language, settings) — dotdotdot-style grouped rows with chevrons */
.sheet-card { max-width: 400px; padding: 20px 16px 18px; gap: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.sheet-head .modal-title { font-size: 24px; }
.sheet-head .recharge-close { position: static; }
.sheet-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow-y: auto; }
.sheet-group { display: flex; flex-direction: column; gap: 2px; }
.sheet-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 0 12px 6px; }
.sheet-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 12px; border-radius: 14px; background: none; color: var(--ink);
  font: inherit; font-size: 15px; text-align: left; transition: background .15s; }
.sheet-row:hover { background: var(--surface-2); }
.sheet-row.on { color: var(--ink); }
.sheet-row-icon { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-size: 15px; }
.sheet-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sheet-row-text small { font-size: 12px; color: var(--muted); }
.sheet-row-value { color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.sheet-row-value.gold { color: var(--gold); font-weight: 600; }
.sheet-chevron { color: var(--muted); font-size: 20px; line-height: 1; }
.sheet-check { color: var(--accent); font-weight: 700; min-width: 16px; text-align: right; }
.sheet-signout { width: 100%; margin-top: 4px; }

/* generic form bits (shared by create) */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--ink-2); }
.field input[type="text"], .field textarea, .refine-appearance input { width: 100%; padding: 12px 14px; border-radius: 14px; background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); font: inherit; font-size: 15px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--line-2); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.chip.active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.skeleton-portrait { width: 200px; aspect-ratio: 3 / 4; border-radius: var(--r-lg); }
@media (max-width: 640px) {
  /* One row at 390px: icon-only brand, tighter links, sign-out as an icon button. */
  .app-nav .wrap { gap: 12px; }
  .app-nav .brand span { display: none; }
  .app-nav .brand img { flex: none; }
  .app-nav .app-links { gap: 14px; font-size: 14px; }
  .app-nav .app-links a { white-space: nowrap; }
  .app-nav-right { margin-left: auto; gap: 8px; }
  .app-nav #langBtn { display: none; } /* language lives in the settings sheet on phones */
  .coin-chip .coin-plus { display: none; }
  .app-hero-faces { display: none; }
}
