/* ============================================================
   Real Estate Photo Sorter — design system
   Public Sans + IBM Plex Mono, blue #2f68d8, twilight purples
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Public+Sans:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg: #eef0f3;
  --surface: #ffffff;
  --ink: #16202a;
  --ink-soft: #3d4a5a;
  --muted: #64707e;
  --muted-2: #8a94a3;
  --line: #e6e9ef;
  --line-2: #dde2ea;
  --field: #f8fafc;
  --blue: #2f68d8;
  --blue-ink: #2456bd;
  --blue-soft: #eef4fd;
  --blue-100: #dfe7f6;
  --green: #128a5b;
  --green-soft: #e7f5ee;
  --amber: #b7791f;
  --amber-soft: #fdf6ec;
  --orange: #c2410c;
  --orange-soft: #fdece2;
  --purple: #6b4fc0;
  --purple-soft: #f0ecfb;
  --tw-1: #2a2550;
  --tw-2: #4a3a6e;
  --tw-gold: #ffd08a;
  --radius: 12px;
  --radius-sm: 9px;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-pop: 0 24px 70px rgba(10, 15, 25, .4);
  --shadow-btn: 0 2px 8px rgba(47, 104, 216, .3);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  font-family: 'Public Sans', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
::selection { background: #c9dcff; }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #cdd3db; border-radius: 8px; border: 3px solid var(--bg); }
.hidden { display: none !important; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- primitives ---------- */
.btn {
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm); border: 1px solid transparent; padding: 9px 18px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .12s, box-shadow .12s, border-color .12s, opacity .12s; white-space: nowrap;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: var(--shadow-btn); }
.btn-primary:hover:not(:disabled) { background: var(--blue-ink); }
.btn-secondary { background: #fff; color: var(--ink-soft); border-color: var(--line-2); }
.btn-secondary:hover:not(:disabled) { background: #f5f7fa; }
.btn-ghost { background: transparent; color: var(--muted); padding: 7px 10px; }
.btn-ghost:hover:not(:disabled) { color: var(--ink); }
.btn-tw { background: linear-gradient(135deg, var(--tw-1), var(--tw-2)); color: #fff; }
.btn-tw:hover:not(:disabled) { filter: brightness(1.08); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { filter: brightness(1.06); }
.btn-block { width: 100%; }
.btn-lg { padding: 11px 22px; font-size: 14px; }

.mono { font-family: var(--mono); }
.eyebrow { font: 600 8px var(--mono); letter-spacing: .16em; color: var(--muted-2); text-transform: uppercase; margin: 0; }
.section-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); }

.message { font-size: 13px; margin: 10px 0 0; min-height: 18px; color: var(--muted); }
.message.error { color: var(--orange); }
.message.ok { color: var(--green); }

/* ============================================================
   AUTH
   ============================================================ */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-hero { order: 2; padding: 40px 26px; }
  .auth-panel { order: 1; }
  .lp-preview { display: none; }
}
.auth-hero {
  position: relative; overflow: hidden;
  background: linear-gradient(158deg, #356ddb 0%, #2450a0 100%);
  color: #fff; padding: clamp(32px, 4vw, 60px) clamp(28px, 3.5vw, 64px);
  display: flex; flex-direction: column; justify-content: center;
}
.auth-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 8% 0%, rgba(255, 255, 255, .13), transparent 55%); pointer-events: none; }
.lp-hero-inner { position: relative; width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; gap: 2px; }
.brand-eyebrow { font: 600 8px var(--mono); letter-spacing: .16em; color: var(--muted-2); }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -.015em; }
.auth-hero .brand-eyebrow { color: rgba(255, 255, 255, .58); }
.auth-hero .brand-name { color: #fff; }
.auth-hero h1 { font-size: clamp(32px, 3.6vw, 48px); line-height: 1.03; letter-spacing: -.025em; margin: 0; max-width: 15ch; font-weight: 800; }
.lp-stat { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 15px; color: rgba(255, 255, 255, .72); flex-wrap: wrap; }
.lp-stat b { color: #fff; font-weight: 700; }
.lp-stat .arw { color: var(--tw-gold); font-weight: 700; }
.auth-feature-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.auth-feature-list li { display: flex; gap: 12px; align-items: flex-start; }
.auth-feature-list .dot { width: 24px; height: 24px; border-radius: 7px; background: rgba(255, 255, 255, .16); flex: none; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.auth-feature-list strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.auth-feature-list .txt { display: block; font-size: 13px; line-height: 1.5; color: rgba(255, 255, 255, .7); margin-top: 2px; }

/* landing product preview card */
.lp-preview { background: #fff; border-radius: 15px; box-shadow: 0 22px 46px -22px rgba(11, 25, 60, .5); color: var(--ink); overflow: hidden; }
.lp-pv-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px; }
.lp-pv-title { font-size: 14px; font-weight: 800; letter-spacing: -.01em; }
.lp-pv-meta { font: 600 10.5px var(--mono); color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }
.lp-pv-hint { font: 600 10.5px var(--mono); color: var(--blue); background: #eef4fd; padding: 5px 9px; border-radius: 999px; }
.lp-row { display: flex; align-items: center; gap: 12px; padding: 9px 14px; }
.lp-row + .lp-row { border-top: 1px solid #f0f2f6; }
.lp-idx { font: 700 11.5px var(--mono); color: #b7c0d0; width: 18px; text-align: center; flex: none; }
.lp-thumb { width: 50px; height: 38px; border-radius: 7px; flex: none; background-size: cover; background-position: center; background-color: #e6ecf4; }
.lp-rb { flex: 1; min-width: 0; }
.lp-rname { font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.lp-rfile { font: 11.5px var(--mono); color: var(--muted-2); margin-top: 2px; }
.lp-badge { font: 800 9.5px 'Public Sans'; color: var(--green); background: #e7f5ee; padding: 3px 8px; border-radius: 6px; flex: none; letter-spacing: .02em; }
.lp-drag { color: #c4cbd8; letter-spacing: 1px; font-size: 14px; line-height: .6; flex: none; }
.lp-pv-foot { border-top: 1px solid #eef1f6; background: #fbfcfe; padding: 12px 16px 15px; }
.lp-foot-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.lp-foot-lbl { font: 700 10px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--muted-2); }
.lp-foot-keep { font-size: 13.5px; font-weight: 800; margin-top: 3px; letter-spacing: -.01em; }
.lp-foot-count { font: 800 14px var(--mono); color: var(--blue); }
.lp-foot-count .tot { color: var(--muted-2); font-weight: 600; }
.lp-track { position: relative; height: 6px; border-radius: 20px; background: #e4e9f2; }
.lp-track .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 62%; background: var(--blue); border-radius: 20px; }
.lp-track .knob { position: absolute; top: 50%; left: 62%; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--blue); transform: translate(-50%, -50%); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }

/* landing twilight before/after */
.lp-tw { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border-radius: 13px; overflow: hidden; box-shadow: 0 16px 32px -20px rgba(0, 0, 0, .55); }
.lp-tw-frame { position: relative; height: 128px; background-size: cover; background-position: center; }
.lp-tw-frame .tag { position: absolute; bottom: 8px; left: 8px; font: 700 10px 'Public Sans'; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: rgba(15, 20, 32, .5); padding: 3px 8px; border-radius: 6px; }
.lp-tw-frame.dusk .tag { background: rgba(58, 47, 92, .72); color: var(--tw-gold); }
.lp-tw-cap { margin: -12px 0 0; font-size: 12.5px; color: rgba(255, 255, 255, .66); }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card > .brand-lockup { margin-bottom: 26px; }
.auth-card .brand-name b { color: var(--blue); }
.auth-tabs { display: flex; gap: 4px; background: #eef1f6; padding: 4px; border-radius: 10px; margin-bottom: 22px; }
.auth-tabs button { flex: 1; border: none; background: transparent; font-family: inherit; font-size: 13.5px; font-weight: 600; color: var(--muted); padding: 8px; border-radius: 7px; cursor: pointer; }
.auth-tabs button.active { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.auth-form { display: flex; flex-direction: column; gap: 14px; animation: fade-in .2s ease; }
.auth-form h2 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.auth-form .sub { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
input, textarea, select { font-family: inherit; }
.field, .auth-form input {
  border: 1px solid var(--line-2); background: var(--field); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 14px; color: var(--ink); width: 100%;
}
.auth-form input:focus, .field:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px rgba(47, 104, 216, .12); }
.link-btn { background: none; border: none; color: var(--blue); font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px; align-self: flex-start; }

/* ============================================================
   APP SHELL + HEADER
   ============================================================ */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.app-header {
  position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 22px; padding: 0 24px; height: 60px;
}
.app-header .brand-lockup { flex: none; }
.app-header .brand-name b { color: var(--blue); }

.header-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; }
.header-nav .nav-btn { border: none; background: transparent; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 7px 12px; border-radius: 8px; cursor: pointer; }
.header-nav .nav-btn:hover { color: var(--ink); }
.header-nav .nav-btn.active { background: var(--blue-soft); color: var(--blue); }

.btn-home { display: inline-flex; align-items: center; gap: 7px; flex: none; background: transparent; border: none; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 7px 11px; border-radius: 8px; cursor: pointer; }
.btn-home:hover { background: var(--blue-soft); color: var(--blue); }
.header-divider { width: 1px; height: 22px; background: var(--line); flex: none; margin: 0 4px; }
@media (max-width: 620px) { .btn-home span { display: none; } }
.step-nav { display: flex; align-items: center; gap: 2px; flex: 1; min-width: 0; overflow-x: auto; }
.step-btn { display: flex; align-items: center; gap: 9px; background: transparent; border: none; padding: 7px 12px 7px 8px; border-radius: 9px; cursor: pointer; font-family: inherit; flex: none; }
.step-btn:disabled { cursor: default; }
.step-btn .dot { width: 22px; height: 22px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font: 700 11.5px 'Public Sans'; background: #eef1f6; color: var(--muted-2); }
.step-btn .lbl { font-size: 13px; font-weight: 600; color: var(--muted-2); white-space: nowrap; }
.step-btn.done .dot { background: var(--blue-100); color: var(--blue); }
.step-btn.done .lbl { color: var(--ink-soft); }
.step-btn.active { background: var(--blue-soft); }
.step-btn.active .dot { background: var(--blue); color: #fff; }
.step-btn.active .lbl { color: var(--blue); }
.step-sep { width: 16px; height: 1px; background: #dde1e8; flex: none; }

.header-right { display: flex; align-items: center; gap: 14px; flex: none; }
.credit-pills { display: flex; gap: 8px; }
.credit-pill { font: 600 12px var(--mono); padding: 5px 10px; border-radius: 8px; background: #eef2f8; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.credit-pill b { color: var(--blue); font-weight: 700; }
.credit-pill.tw b { color: var(--purple); }
.listing-tag { text-align: right; line-height: 1.2; }
.listing-tag .name { font-size: 12.5px; font-weight: 600; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-tag .sub { font: 11px var(--mono); color: var(--muted-2); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-100); color: var(--blue); font-weight: 700; font-size: 12.5px; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; flex: none; }
.avatar-wrap { position: relative; }
.avatar-menu { position: absolute; top: 42px; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(16, 24, 40, .16); padding: 6px; min-width: 210px; z-index: 50; }
.avatar-menu .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.avatar-menu .who strong { font-size: 13px; display: block; }
.avatar-menu .who small { color: var(--muted-2); font-size: 11.5px; }
.avatar-menu button { width: 100%; text-align: left; background: none; border: none; font-family: inherit; font-size: 13px; color: var(--ink-soft); padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.avatar-menu button:hover { background: #f3f5f8; }

/* ============================================================
   PAGE LAYOUT
   ============================================================ */
.page { flex: 1; width: 100%; margin: 0 auto; padding: 34px 24px 60px; animation: fade-in .18s ease; }
.page-narrow { max-width: 760px; }
.page-mid { max-width: 1000px; }
.page-wide { max-width: 1200px; }
.page-head { margin-bottom: 22px; }
.page-head h1 { margin: 0 0 5px; font-size: 23px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { margin: 0; color: var(--muted); font-size: 14px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.card-pad { padding: 18px 20px; }

/* ---------- dashboard ---------- */
.dash-band { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dash-band h2 { margin: 0 0 3px; font-size: 17px; letter-spacing: -.01em; }
.dash-band p { margin: 0; color: var(--muted); font-size: 13px; }

/* Compact credits strip */
.dash-stats { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 13px 18px; box-shadow: var(--shadow-card); margin-bottom: 26px; }
.dstats { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.dstat b { font-weight: 700; font-size: 15px; }
.dstat.l b { color: var(--blue); }
.dstat.t b { color: var(--purple); }
.dstat.s b { color: var(--ink); }
.dstat-sep { width: 1px; height: 15px; background: var(--line-2); }

.dash-head-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.dash-head-row h2 { margin: 0; font-size: 17px; letter-spacing: -.01em; }
.dash-count { font-size: 13px; color: var(--muted-2); font-weight: 600; }

.listing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; align-items: stretch; }

/* New-listing tile */
.listing-new { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 210px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: var(--field); cursor: pointer; font-family: inherit; }
.listing-new:hover { background: var(--blue-soft); border-color: var(--blue-100); }
.listing-new .ln-plus { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; border-radius: 11px; background: var(--blue-soft); color: var(--blue); font-size: 24px; font-weight: 400; margin-bottom: 4px; }
.listing-new .ln-title { font-size: 14px; font-weight: 700; color: var(--blue); }
.listing-new .ln-sub { font-size: 12px; color: var(--muted-2); }

/* Unified listing card (.lc) */
.lc { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-card); display: flex; flex-direction: column; }
.lc.is-failed { border-color: #f0c0a8; }
.lc-cover { position: relative; aspect-ratio: 16 / 10; background-size: cover; background-position: center; background-color: #eef2f7; cursor: pointer; }
.lc-cover.placeholder { background: repeating-linear-gradient(135deg, #eef2f7 0 14px, #e6ecf4 14px 28px); }
.lc-badge { position: absolute; top: 10px; left: 10px; font: 700 10.5px 'Public Sans'; padding: 3px 8px; border-radius: 6px; letter-spacing: .01em; }
.lc-badge.green { background: var(--green-soft); color: var(--green); }
.lc-badge.gray { background: rgba(255, 255, 255, .92); color: var(--muted); border: 1px solid var(--line); }
.lc-badge.orange { background: var(--orange-soft); color: var(--orange); }
.lc-count { position: absolute; bottom: 10px; right: 10px; font: 600 11px 'Public Sans'; color: #fff; background: rgba(20, 28, 38, .72); padding: 3px 8px; border-radius: 6px; }
.lc-body { padding: 12px 14px 13px; display: flex; flex-direction: column; gap: 7px; }
.lc-title { font-size: 15px; font-weight: 700; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-sub { font-size: 12.5px; color: var(--muted-2); margin-top: -3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-progress { height: 5px; background: #eef2f7; border-radius: 3px; overflow: hidden; }
.lc-progress span { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.lc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; row-gap: 6px; flex-wrap: wrap; margin-top: 1px; min-height: 22px; }
.lc-actions { display: flex; align-items: center; gap: 10px; }
.lc-link { border: none; background: transparent; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--blue); cursor: pointer; padding: 2px 0; }
.lc-link:disabled { color: var(--muted-2); cursor: default; }
.lc-del { border: none; background: transparent; color: var(--muted-2); cursor: pointer; padding: 2px; display: flex; }
.lc-del:hover { color: var(--orange); }
.listing-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-card); display: flex; flex-direction: column; }
.listing-card.is-failed { border-color: #f0c0a8; }
.listing-cover { aspect-ratio: 16 / 9; background-size: cover; background-position: center; background-color: #eef2f7; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.listing-cover.placeholder { background: repeating-linear-gradient(135deg, #eef2f7 0 14px, #e6ecf4 14px 28px); cursor: default; }
.listing-cover.placeholder span { font: 500 11px var(--mono); color: #9aa4b2; text-transform: uppercase; letter-spacing: .05em; }
.listing-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.listing-card h3 { margin: 0; font-size: 15px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-status { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; }
.status-chip { font: 600 11px 'Public Sans'; padding: 3px 9px; border-radius: 6px; white-space: nowrap; }
.status-chip.ready { background: var(--green-soft); color: var(--green); }
.status-chip.processing { background: var(--blue-soft); color: var(--blue); }
.status-chip.failed { background: var(--orange-soft); color: var(--orange); }
.status-chip.exported { background: #eef1f6; color: var(--ink-soft); }
.listing-card .meta { font-size: 12px; color: var(--muted-2); margin: 0; }
.listing-delete { flex: none; padding: 9px 12px; color: var(--muted); }
.listing-delete:hover:not(:disabled) { color: var(--orange); border-color: #f0c0a8; background: var(--orange-soft); }
.listing-progress { height: 6px; background: #eef1f6; border-radius: 20px; overflow: hidden; }
.listing-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #5b8bec); border-radius: 20px; transition: width .4s; }
.empty-card { grid-column: 1 / -1; text-align: center; padding: 40px 20px; background: #fff; border: 1px dashed var(--line-2); border-radius: 14px; }
.empty-card h3 { margin: 0 0 6px; }
.empty-card p { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* ---------- pricing ---------- */
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.price-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-card); }
.price-card h3 { margin: 0; font-size: 15px; }
.price-card .price { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.price-card .price small { font-size: 13px; font-weight: 500; color: var(--muted-2); }
.price-card .desc { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.5; flex: 1; }
.price-card .credits { font: 500 11.5px var(--mono); color: var(--ink-soft); background: #f4f6f9; border-radius: 8px; padding: 8px 10px; line-height: 1.5; }
.price-card label { font-size: 12px; font-weight: 600; color: var(--ink-soft); display: flex; flex-direction: column; gap: 5px; }

/* ============================================================
   SORTER — UPLOAD
   ============================================================ */
.name-field { margin-bottom: 20px; }
.name-field label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted-2); margin-bottom: 8px; }
.dropzone { border: 2px dashed #b9c6dd; background: #f7f9fc; border-radius: 16px; padding: 44px 24px; text-align: center; margin-bottom: 26px; cursor: pointer; transition: border-color .15s, background .15s; display: block; }
.dropzone.drag { border-color: var(--blue); background: var(--blue-soft); }
.dropzone input[type=file] { display: none; }
.dz-icon { width: 56px; height: 56px; border-radius: 14px; background: #e6eefb; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.dz-title { font-size: 16px; font-weight: 600; margin-bottom: 5px; }
.dz-sub { font-size: 13px; color: var(--muted-2); margin-bottom: 18px; }
.dz-tags { margin-top: 20px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; font: 500 11px var(--mono); color: #9aa4b2; }
.dz-tags span { padding: 3px 8px; background: #eef1f6; border-radius: 6px; }

.upload-status { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.upload-status .lbl { font-size: 13.5px; font-weight: 600; }
.upload-status .lbl span { color: var(--muted-2); font-weight: 500; }
.upload-status .count { font: 12px var(--mono); color: var(--muted-2); }
.upload-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-bottom: 30px; }
.upload-tile { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #fff; }
.upload-tile .thumb { position: relative; aspect-ratio: 4 / 3; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; }
.upload-tile .thumb.placeholder { background: repeating-linear-gradient(135deg, #eef2f7 0 13px, #e6ecf4 13px 26px); }
.upload-tile .name { font: 500 10px var(--mono); color: #9aa4b2; text-transform: uppercase; letter-spacing: .04em; padding: 0 6px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.upload-tile .check { position: absolute; top: 6px; right: 6px; width: 18px; height: 18px; border-radius: 50%; background: var(--green); display: flex; align-items: center; justify-content: center; }
.upload-tile .bar { height: 4px; background: #eef1f6; }
.upload-tile .bar span { display: block; height: 100%; background: var(--blue); transition: width .2s; }
.row-end { display: flex; justify-content: flex-end; gap: 10px; }

/* ============================================================
   SORTER — ANALYZE
   ============================================================ */
.analyze-progress { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 22px; }
.analyze-progress .track { flex: 1; }
.analyze-progress .track-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; margin-bottom: 7px; }
.analyze-progress .track-head span:last-child { color: var(--muted-2); font-family: var(--mono); }
.bar-lg { height: 7px; background: #eef1f6; border-radius: 20px; overflow: hidden; }
.bar-lg span { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #5b8bec); border-radius: 20px; transition: width .3s; }
.analyze-grid { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
@media (max-width: 860px) { .analyze-grid { grid-template-columns: 1fr; } }
.detect-list { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.detect-row { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-bottom: 1px solid #f0f2f6; }
.detect-row:last-child { border-bottom: none; }
.detect-row .thumb { width: 58px; height: 44px; flex: none; border-radius: 7px; background-size: cover; background-position: center; }
.detect-row .thumb.placeholder { background: repeating-linear-gradient(135deg, #eef2f7 0 10px, #e6ecf4 10px 20px); }
.detect-row .body { flex: 1; min-width: 0; }
.detect-row .title { display: flex; align-items: center; gap: 8px; }
.detect-row .title .room { font-size: 13.5px; font-weight: 600; }
.detect-row .desc { font-size: 12px; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.conf { font: 700 11px var(--mono); }
.spinner { width: 18px; height: 18px; flex: none; border: 2px solid #dfe4ec; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
.check-badge { width: 20px; height: 20px; flex: none; border-radius: 50%; background: var(--green-soft); display: flex; align-items: center; justify-content: center; }
.low-flag { font: 600 10px 'Public Sans'; color: var(--orange); background: var(--orange-soft); padding: 1px 6px; border-radius: 5px; }
.tally-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.tally-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.tally-row .name { font-size: 13px; flex: 1; }
.tally-row .track { width: 70px; height: 6px; background: #eef1f6; border-radius: 20px; overflow: hidden; }
.tally-row .track span { display: block; height: 100%; background: var(--blue); border-radius: 20px; }
.tally-row .n { font: 600 12px var(--mono); color: var(--muted); width: 14px; text-align: right; }
.hint-card { background: var(--amber-soft); border: 1px solid #f2e2c8; border-radius: 14px; padding: 14px 16px; display: flex; gap: 9px; margin-top: 16px; }
.hint-card .body { font-size: 12.5px; color: #8a6516; line-height: 1.45; }

/* ============================================================
   SORTER — ORGANIZE
   ============================================================ */
.organize-bar { position: sticky; top: 60px; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); padding: 12px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.grow { flex: 1; }
.segmented { display: flex; gap: 2px; background: #eef1f6; padding: 3px; border-radius: 9px; }
.segmented button { border: none; cursor: pointer; font-family: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: 7px; background: transparent; color: var(--muted); }
.segmented button.active { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }

.organize-body { max-width: 1240px; width: 100%; margin: 0 auto; padding: 24px 24px 70px; animation: fade-in .18s ease; }
.room-group { margin-bottom: 30px; }
.room-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
.room-group-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); flex: none; }
.room-group-head.tw .dot { background: var(--tw-2); }
.room-group-head h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.room-group-head .n { font: 12px var(--mono); color: #9aa4b2; }
.room-group-head .dup-tag { font: 600 11px 'Public Sans'; color: var(--purple); background: var(--purple-soft); padding: 2px 8px; border-radius: 6px; }
.photo-grid { display: grid; gap: 14px; }
.photo-grid.grouped { grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); }
.photo-grid.grid-view { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }

.photo-card { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #fff; box-shadow: var(--shadow-card); }
.photo-card.hidden-photo { opacity: .5; }
.photo-card.is-fav { border-color: #f5cf6a; }
.photo-card.is-low { border-color: #f0c98a; }
.photo-card.dragging { opacity: .4; }
.photo-card.drop-target { box-shadow: 0 0 0 2px var(--blue); }
.photo-thumb { position: relative; aspect-ratio: 4 / 3; overflow: hidden; display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; }
.photo-thumb.placeholder { background: repeating-linear-gradient(135deg, #eef2f7 0 14px, #e6ecf4 14px 28px); }
.photo-thumb .room-label { position: relative; z-index: 1; font: 600 12px var(--mono); color: #9aa4b2; text-transform: uppercase; letter-spacing: .05em; }
.drag-handle { position: absolute; top: 8px; left: 8px; width: 22px; height: 22px; border-radius: 6px; background: rgba(255, 255, 255, .85); display: flex; align-items: center; justify-content: center; cursor: grab; z-index: 2; }
.thumb-actions { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 2; }
.icon-btn { width: 26px; height: 26px; border-radius: 7px; border: none; cursor: pointer; background: rgba(255, 255, 255, .9); display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: #fff; }
.icon-btn.moon-on { background: var(--tw-1); }
.thumb-badges { position: absolute; bottom: 8px; left: 8px; display: flex; gap: 6px; z-index: 2; flex-wrap: wrap; }
.badge { font: 700 10.5px 'Public Sans'; color: #fff; padding: 2px 8px; border-radius: 6px; display: flex; align-items: center; gap: 4px; }
.badge.tw { background: var(--tw-2); }
.badge.best { background: var(--green); }
.badge.blur { background: var(--orange); }
.badge.dup { background: var(--purple); }
.variant-toggle { position: absolute; bottom: 8px; right: 8px; display: flex; background: rgba(15, 20, 32, .72); border-radius: 8px; padding: 2px; z-index: 2; }
.variant-toggle button { border: none; cursor: pointer; font-family: inherit; font: 700 10.5px 'Public Sans'; padding: 3px 8px; border-radius: 6px; background: transparent; color: #c9d2e2; }
.variant-toggle button.on { background: #0f1420; color: #fff; }
.variant-toggle button.on.tw { background: var(--tw-2); color: var(--tw-gold); }
.tw-thumb { background: linear-gradient(180deg, #141d38 0%, #2a2550 42%, #5a3a56 70%, #b8794e 100%); }

.photo-body { padding: 11px 12px 12px; }
.photo-row { display: flex; align-items: center; gap: 7px; margin-bottom: 9px; }
.pos-num { width: 38px; flex: none; text-align: center; font: 700 12px var(--mono); color: var(--ink-soft); border: 1px solid var(--line-2); background: var(--field); border-radius: 7px; padding: 6px 3px; }
.pos-num:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 2px rgba(47, 104, 216, .14); }
.pos-num.muted { color: #b6bfcc; border-style: dashed; background: transparent; display: inline-flex; align-items: center; justify-content: center; min-height: 30px; }
.select-wrap { position: relative; flex: 1; }
.select-wrap select { width: 100%; appearance: none; -webkit-appearance: none; border: 1px solid var(--line-2); background: var(--field); border-radius: 8px; padding: 6px 26px 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.select-wrap .chev { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.qual-row { display: flex; align-items: center; gap: 8px; margin-top: 9px; }
.qual-row .lbl { font: 600 10.5px var(--mono); color: var(--muted-2); }
.qual-row .track { flex: 1; height: 5px; background: #eef1f6; border-radius: 20px; overflow: hidden; }
.qual-row .track span { display: block; height: 100%; border-radius: 20px; }
.qual-row .n { font: 700 11px var(--mono); }

.photo-card.compact .photo-body { padding: 8px 10px; }
.photo-card.compact .photo-row { margin-bottom: 0; }

/* Twilight version rendered as its own orderable card */
.photo-card.is-twilight { border-color: var(--tw-2); background: linear-gradient(180deg, #fbf8ff 0%, #fff 40%); }
.photo-card.is-twilight .drag-handle { background: rgba(20, 16, 40, .6); }
.tw-card-label { flex: 1; display: inline-flex; align-items: center; font: 700 12px 'Public Sans'; color: var(--tw-2); text-transform: uppercase; letter-spacing: .02em; }

.sequence-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
@media (max-width: 860px) { .sequence-grid { grid-template-columns: 1fr; } }
.sequence-list { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.sequence-list .head { padding: 11px 18px; border-bottom: 1px solid #eef1f6; }
.seq-row { display: flex; align-items: center; gap: 14px; padding: 9px 18px; border-bottom: 1px solid #f3f5f8; background: #fff; }
.seq-row:last-child { border-bottom: none; }
.seq-row.dragging { opacity: .4; }
.seq-row.drop-target { box-shadow: inset 0 2px 0 var(--blue); }
.seq-row.is-tw { background: linear-gradient(90deg, #faf7ff, #fff); }
.seq-row.is-tw .thumb.tw-thumb { background: linear-gradient(180deg, #141d38, #2a2550 45%, #5a3a56 75%, #b8794e); }
.seq-row .body .room svg { vertical-align: -1px; }
.seq-row .num { width: 26px; flex: none; font: 700 13px var(--mono); color: #b6bfcc; text-align: right; }
.seq-row .thumb { width: 56px; height: 42px; flex: none; border-radius: 7px; background-size: cover; background-position: center; }
.seq-row .thumb.placeholder { background: repeating-linear-gradient(135deg, #eef2f7 0 10px, #e6ecf4 10px 20px); }
.seq-row .body { flex: 1; min-width: 0; }
.seq-row .body .select-wrap { display: block; max-width: 260px; }
.seq-row .body .room { font-size: 13px; font-weight: 600; }
.seq-row .body .fn { font: 11.5px var(--mono); color: var(--muted-2); }
.seq-row .handle { width: 22px; height: 22px; flex: none; display: flex; align-items: center; justify-content: center; cursor: grab; }
.seq-side { background: var(--blue-soft); border: 1px solid #d4e2f8; border-radius: 14px; padding: 16px 18px; position: sticky; top: 130px; }
.seq-side h3 { margin: 0 0 6px; font-size: 13.5px; }
.seq-side p { margin: 0 0 12px; font-size: 12.5px; color: #4a6285; line-height: 1.5; }

/* ============================================================
   SORTER — EXPORT
   ============================================================ */
.export-wrap { max-width: 760px; margin: 0 auto; animation: fade-in .18s ease; }
.export-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 8px 30px rgba(16, 24, 40, .09); }
.export-card .head { padding: 20px 24px; border-bottom: 1px solid #eef1f6; }
.export-card .head h1 { margin: 0 0 3px; font-size: 19px; letter-spacing: -.01em; }
.export-card .head p { margin: 0; color: var(--muted-2); font-size: 13px; }
.export-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 22px; }
.export-body .section-label { display: block; margin-bottom: 8px; }
.export-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 22px; }
@media (max-width: 560px) { .export-opts { grid-template-columns: 1fr; } }
.opt-toggle { display: flex; align-items: center; gap: 10px; background: none; border: none; padding: 7px 0; cursor: pointer; font-family: inherit; text-align: left; }
.opt-box { width: 19px; height: 19px; flex: none; border-radius: 6px; border: 1.5px solid #c4ccd8; background: #fff; display: flex; align-items: center; justify-content: center; }
.opt-toggle.on .opt-box { border-color: var(--blue); background: var(--blue); }
.opt-toggle .opt-lbl { font-size: 13px; color: var(--ink-soft); }
.opt-toggle.locked { opacity: .6; cursor: default; }
.rename-terminal { background: #0f1723; border-radius: 11px; padding: 14px 16px; font: 500 12.5px var(--mono); line-height: 1.9; overflow-x: auto; }
.rename-terminal .row { display: flex; gap: 10px; }
.rename-terminal .num { color: #5b6b82; width: 20px; flex: none; }
.rename-terminal .fn { color: #9fd0a8; white-space: nowrap; }
.rename-terminal .more { color: #5b6b82; margin-top: 2px; }
.export-foot { padding: 16px 24px; border-top: 1px solid #eef1f6; display: flex; align-items: center; justify-content: space-between; background: #fbfcfe; gap: 12px; flex-wrap: wrap; }
.export-foot .meta { font: 12.5px var(--mono); color: var(--muted-2); }

/* ============================================================
   TWILIGHT MODAL
   ============================================================ */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(15, 20, 32, .55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade-in .15s ease; }
.tw-modal { width: 920px; max-width: 94vw; max-height: 90vh; background: #fff; border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); }
.tw-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid #eef1f6; }
.tw-head .icon { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, var(--tw-1), #5a3a56); display: flex; align-items: center; justify-content: center; flex: none; }
.tw-head .t { flex: 1; }
.tw-head .t .title { font-size: 15.5px; font-weight: 700; }
.tw-head .t .sub { font-size: 12px; color: var(--muted-2); }
.tw-close { width: 30px; height: 30px; border-radius: 8px; border: none; background: #f1f3f7; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tw-body { display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; flex: 1; min-height: 0; }
@media (max-width: 720px) { .tw-body { grid-template-columns: 1fr; } }
.tw-orig { padding: 20px; border-right: 1px solid #eef1f6; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.tw-orig .frame { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: repeating-linear-gradient(135deg, #eef2f7 0 14px, #e6ecf4 14px 28px); display: flex; align-items: center; justify-content: center; background-size: cover; background-position: center; }
.tw-note { display: flex; gap: 8px; align-items: flex-start; background: #f4f8ff; border: 1px solid #dbe6fa; border-radius: 10px; padding: 10px 12px; font-size: 12px; color: #3f5b86; line-height: 1.5; }
.tw-controls { padding: 20px; overflow: auto; display: flex; flex-direction: column; gap: 16px; }
.tw-stage-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 300px; text-align: center; }
.tw-spinner { width: 40px; height: 40px; border: 3px solid #e5e2f0; border-top-color: var(--tw-2); border-radius: 50%; animation: spin .8s linear infinite; }
.tw-stage-center .t { font-size: 14px; font-weight: 600; }
.tw-stage-center .s { font-size: 12.5px; color: var(--muted-2); margin-top: 3px; }
.tw-textarea { width: 100%; min-height: 96px; resize: vertical; border: 1px solid var(--line-2); border-radius: 10px; padding: 11px 12px; font-family: inherit; font-size: 13px; line-height: 1.55; color: #2b3543; }
.tw-textarea:focus { outline: none; border-color: var(--tw-2); box-shadow: 0 0 0 3px rgba(74, 58, 110, .12); }
.tw-feedback { width: 100%; min-height: 64px; resize: vertical; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; font-family: inherit; font-size: 13px; line-height: 1.5; }
.tw-compare { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #0f1420; }
.tw-compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tw-compare .after-clip { position: absolute; inset: 0; overflow: hidden; }
.tw-compare .divider { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .4); transform: translateX(-1px); }
.tw-compare .tw-tag { position: absolute; top: 8px; font: 700 10px 'Public Sans'; color: #fff; background: rgba(15, 20, 32, .68); padding: 2px 8px; border-radius: 6px; letter-spacing: .02em; }
.tw-compare .tw-tag-l { left: 8px; }
.tw-compare .tw-tag-r { right: 8px; }
.tw-slider { width: 100%; margin-top: 8px; accent-color: var(--tw-2); }

/* enlarged photo viewer (lightbox) */
.lightbox { width: min(1100px, 94vw); max-height: 92vh; background: #fff; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); }
.lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid #eef1f6; }
.lightbox-room { font-size: 14px; font-weight: 700; }
.lightbox-fn { font: 11.5px var(--mono); color: var(--muted-2); }
.lightbox-body { padding: 18px; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.lightbox-img { width: 100%; max-height: 74vh; object-fit: contain; border-radius: 10px; background: #0f1420; }
.lightbox-compare { max-width: 780px; width: 100%; margin: 0 auto; }

/* default room-order editor */
.ro-modal { width: 440px; max-width: 94vw; max-height: 88vh; background: #fff; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); }
.ro-body { padding: 12px 16px; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.ro-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.ro-row.dragging { opacity: .4; }
.ro-row.drop-target { box-shadow: inset 0 2px 0 var(--blue); border-color: var(--blue); }
.ro-row.in-listing { border-color: #cfe0f7; background: #fafcff; }
.ro-row.muted { opacity: .62; }
.ro-pos { width: 46px; flex: none; text-align: center; font: 700 12px var(--mono); color: var(--ink-soft); border: 1px solid var(--line-2); background: var(--field); border-radius: 6px; padding: 5px 4px; }
.ro-pos:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 2px rgba(47, 104, 216, .14); }
.ro-name-wrap { flex: 1; display: flex; align-items: center; min-width: 0; }
.ro-name-input { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--ink); border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 5px 8px; }
.ro-name-input:hover { border-color: var(--line-2); background: var(--field); }
.ro-name-input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 2px rgba(47, 104, 216, .14); }
.ro-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); margin-right: 7px; flex: none; }
.ro-moves { display: flex; gap: 4px; flex: none; }
.ro-move { width: 26px; height: 26px; border: 1px solid var(--line-2); background: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); padding: 0; }
.ro-move:hover:not(:disabled) { background: var(--blue-soft); color: var(--blue); border-color: var(--blue-100); }
.ro-move:disabled { opacity: .3; cursor: default; }
.ro-remove { width: 26px; height: 26px; flex: none; border: 1px solid var(--line-2); background: #fff; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted-2); padding: 0; }
.ro-remove:hover { background: var(--orange-soft); color: var(--orange); border-color: #f3cbb4; }
.ro-row .ro-handle { flex: none; display: flex; align-items: center; cursor: grab; }
.ro-add { margin-top: 4px; width: 100%; border: 1px dashed var(--line-2); background: var(--field); border-radius: 9px; padding: 9px; font: 700 12.5px 'Public Sans'; color: var(--blue); cursor: pointer; }
.ro-add:hover { background: var(--blue-soft); border-color: var(--blue-100); }
.ro-more-toggle { width: 100%; margin: 6px 0 2px; border: 0; background: transparent; font: 700 12px 'Public Sans'; color: var(--muted); cursor: pointer; padding: 7px; border-top: 1px dashed var(--line-2); text-align: center; }
.ro-more-toggle:hover { color: var(--blue); }
.ro-more { display: flex; flex-direction: column; gap: 7px; }
.ro-foot { padding: 14px 16px; border-top: 1px solid #eef1f6; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fbfcfe; }

/* ---- Selection counter pill ---- */
.sel-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font: 600 13px 'Public Sans'; border: 1px solid var(--line-2); background: #fff; color: var(--ink-soft); }
.sel-pill b { font-weight: 800; }
.sel-pill .sel-target { font: 700 11px var(--mono); text-transform: uppercase; letter-spacing: .04em; color: var(--muted-2); padding-left: 8px; border-left: 1px solid var(--line); }
.sel-pill.ok { background: var(--green-soft); border-color: #bfe3d0; color: var(--green); }
.sel-pill.ok .sel-target { color: var(--green); border-color: #bfe3d0; }
.sel-pill.over { background: var(--orange-soft); border-color: #f3cbb4; color: var(--orange); }
.sel-pill.over .sel-target { color: var(--orange); border-color: #f3cbb4; }
.sel-pill.under { background: var(--blue-soft); border-color: var(--blue-100); color: var(--blue-ink); }
.sel-pill.under .sel-target { color: var(--blue-ink); border-color: var(--blue-100); }

/* ---- Cull (trim-to-target) modal ---- */
.cull-modal { width: 480px; max-width: 94vw; max-height: 88vh; background: #fff; border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-pop); }
.cull-target-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.cull-target-row label { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.cull-target { width: 74px; text-align: center; font: 800 15px 'Public Sans'; color: var(--ink); border: 1px solid var(--line-2); background: #fff; border-radius: 8px; padding: 7px 6px; }
.cull-target:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 104, 216, .12); }
.cull-target-hint { font-size: 12px; color: var(--muted-2); }
.cull-body { padding: 10px 16px; overflow: auto; display: flex; flex-direction: column; gap: 5px; }
.cull-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; }
.cull-room { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.cull-avail { font: 600 11px var(--mono); color: var(--muted-2); white-space: nowrap; }
.cull-step { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.cull-btn { width: 26px; height: 28px; border: 1px solid var(--line-2); background: var(--field); border-radius: 7px; cursor: pointer; font: 700 16px 'Public Sans'; line-height: 1; color: var(--ink-soft); display: flex; align-items: center; justify-content: center; }
.cull-btn:hover { background: #eef2f7; border-color: #cbd3de; }
.cull-num { width: 46px; text-align: center; font: 700 13px var(--mono); color: var(--ink); border: 1px solid var(--line-2); background: #fff; border-radius: 7px; padding: 6px 3px; }
.cull-num:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 2px rgba(47, 104, 216, .14); }
.cull-foot { padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; }
.cull-count { font-size: 14px; font-weight: 700; color: var(--ink); }
.cull-count b { font-weight: 800; }
.cull-count.ok { color: var(--green); }
.cull-count.under { color: var(--blue-ink); }
.cull-sub { font-size: 12px; color: var(--muted-2); margin-top: 2px; }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ============================================================
   SHARE — social Studio
   ============================================================ */
.share-wrap { display: flex; flex-direction: column; min-height: calc(100vh - 60px); }
.share-toolbar { position: sticky; top: 60px; z-index: 20; background: #fff; border-bottom: 1px solid var(--line); padding: 11px 22px; display: flex; align-items: center; gap: 14px; }
.sh-tabs { display: flex; gap: 3px; background: #eef1f6; padding: 3px; border-radius: 10px; }
.sh-tab { border: none; background: transparent; font-family: inherit; font-size: 13px; font-weight: 600; color: var(--muted); padding: 7px 12px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; gap: 7px; }
.sh-tab.on { background: #fff; color: var(--blue); box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.sh-tab .dims { font: 500 10px var(--mono); color: var(--muted-2); }
.sh-tab.on .dims { color: var(--blue); }

.share-body { display: grid; grid-template-columns: 256px minmax(0, 1fr) 302px; flex: 1; align-items: start; }
.sh-rail { background: #fff; padding: 16px; }
/* Photo rail + preview stay pinned; the details rail (right) scrolls the page. */
.sh-left { border-right: 1px solid var(--line); position: sticky; top: 119px; align-self: start; max-height: calc(100vh - 119px); overflow-y: auto; }
.sh-right { border-left: 1px solid var(--line); }
.sh-rail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.sh-rail-head .section-label { flex: 1; }
.sh-toggle { width: 34px; height: 19px; border-radius: 20px; border: none; background: #cdd4de; position: relative; cursor: pointer; flex: none; padding: 0; }
.sh-toggle.on { background: var(--blue); }
.sh-toggle .knob { position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; transition: left .15s; }
.sh-toggle.on .knob { left: 17px; }
.sh-toggle-lbl { font-size: 11.5px; font-weight: 600; color: var(--ink-soft); }
.sh-rail-hint { margin: 0 0 8px; font-size: 11px; color: var(--muted-2); line-height: 1.4; }
.sh-photos { display: flex; flex-direction: column; gap: 3px; }
.sh-photo { display: flex; align-items: center; gap: 9px; padding: 5px 6px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; }
.sh-photo:hover { background: #f6f8fb; }
.sh-photo.incl { background: #f4f8ff; cursor: grab; }
.sh-photo.incl:active { cursor: grabbing; }
.sh-photo.sel { background: #eef4fd; border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.sh-photo.dragging { opacity: .4; }
.sh-photo.drop-target { box-shadow: inset 0 2px 0 var(--blue); }
.sh-thumb { position: relative; width: 46px; height: 35px; flex: none; border-radius: 5px; background-size: cover; background-position: center; background-color: #e6ecf4; }
.sh-badge { position: absolute; top: 2px; left: 2px; display: flex; align-items: center; justify-content: center; border-radius: 5px; color: #fff; }
.sh-badge.feat { width: 18px; height: 18px; background: var(--blue); }
.sh-badge.feat svg { width: 11px; height: 11px; }
.sh-badge.feat svg path, .sh-badge.feat svg circle { stroke: #fff; }
.sh-badge.pos { min-width: 16px; height: 16px; padding: 0 3px; background: rgba(15, 20, 32, .68); font: 700 10px var(--mono); }
.sh-pm { flex: 1; min-width: 0; }
.sh-room { font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sh-q { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.sh-q .bar { flex: 1; height: 4px; background: #eef1f6; border-radius: 20px; overflow: hidden; }
.sh-q .bar span { display: block; height: 100%; border-radius: 20px; }
.sh-q .qn { font: 500 10px var(--mono); }
.sh-check { width: 20px; height: 20px; flex: none; border-radius: 6px; border: 1.5px solid #c4ccd8; background: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.sh-check.on { background: var(--blue); border-color: var(--blue); }

.sh-stage { background: #e4e8ee; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; position: sticky; top: 119px; align-self: start; height: calc(100vh - 119px); }
.sh-stage-meta { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-transform: capitalize; }
.sh-stage-meta .mono { font-family: var(--mono); color: var(--muted-2); font-weight: 500; text-transform: none; margin-left: 6px; }
.sh-canvas-wrap { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; }
#shareCanvas { max-width: 100%; max-height: 58vh; width: auto; height: auto; border-radius: 14px; box-shadow: 0 20px 55px rgba(10, 18, 40, .3); background: #0f1420; touch-action: none; }
#shareCanvas.draggable { cursor: grab; }
#shareCanvas.draggable:active { cursor: grabbing; }
.sh-hint { font-size: 11.5px; color: var(--muted-2); }
.sh-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; flex: 1; text-align: center; color: var(--muted-2); }
.sh-empty-icon { width: 60px; height: 60px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.sh-empty h3 { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink-soft); }
.sh-empty p { margin: 0; font-size: 12.5px; max-width: 240px; line-height: 1.5; }
.sh-pager { display: flex; align-items: center; gap: 12px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.sh-pager button { width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; font-size: 16px; color: var(--ink-soft); }
.sh-pager button:disabled { opacity: .4; cursor: default; }

.sh-tmpls { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.sh-tmpl { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.sh-tmpl:hover { border-color: var(--line-2); }
.sh-tmpl.on { border-color: var(--blue); background: #f5f9ff; box-shadow: inset 0 0 0 1px var(--blue); }
.sh-tmpl .tn { font-size: 13px; font-weight: 700; color: var(--ink); }
.sh-tmpl .td { font-size: 11.5px; color: var(--muted-2); }
.sh-accents { display: flex; gap: 8px; margin-top: 9px; align-items: center; }
.sh-sw { width: 30px; height: 30px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; padding: 0; position: relative; }
.sh-sw.on { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }
.sh-sw.custom { overflow: hidden; display: inline-flex; }
.sh-sw.custom input { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); opacity: 0; cursor: pointer; }
.sh-fields { display: flex; flex-direction: column; gap: 8px; margin-top: 9px; }
.sh-three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.sh-agent { display: flex; gap: 12px; margin-top: 9px; }
.sh-head { width: 54px; height: 54px; flex: none; border-radius: 50%; background: #eef1f6; border: 1px dashed #c4ccd8; display: flex; align-items: center; justify-content: center; cursor: pointer; background-size: cover; background-position: center; }
.sh-head span { font: 700 8px var(--mono); color: var(--muted-2); text-align: center; letter-spacing: .06em; }
.sh-head.has { border-style: solid; border-color: var(--line-2); }
.sh-agent-fields { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sh-saved { font-size: 12px; color: var(--green); font-weight: 600; margin: 10px 0 0; min-height: 16px; }

@media (max-width: 980px) {
  .share-body { grid-template-columns: 1fr; }
  .sh-left, .sh-right, .sh-stage { position: static; height: auto; border: none; border-top: 1px solid var(--line); }
  .sh-left { max-height: 300px; overflow-y: auto; }
  .sh-stage { min-height: 380px; }
  #shareCanvas { max-height: 52vh; }
}
