/* Crafters: the design system. Tokens, base elements and the shared components every page uses.
   Page-specific styles live in store.css (shopping, watching, the buyer's account) and
   manage.css (selling and admin). Light and dark follow the device. */

:root {
  color-scheme: light dark;
  --bg: #FAF6EF;
  --surface: #FFFFFF;
  --surface-2: #F3ECE1;
  --ink: #2A2420;
  --ink-2: #5B5049;
  --muted: #7A6F66;
  --line: #E8DFD3;
  --primary: #C4572E;
  --primary-hover: #A94822;
  --on-primary: #FFFFFF;
  --primary-soft: #F8E6DD;
  --green: #2F4A3C;
  --green-soft: #E3EDE5;
  --gold: #C28A12;
  --danger: #B3261E;
  --danger-soft: #FBE9E7;
  --warn: #8A5A00;
  --warn-soft: #FBF0D9;
  --info: #2D5B7A;
  --info-soft: #E3EEF5;
  --shadow: 0 1px 2px rgba(42, 36, 32, .06), 0 8px 24px rgba(42, 36, 32, .06);
  --shadow-lg: 0 2px 6px rgba(42, 36, 32, .08), 0 24px 60px rgba(42, 36, 32, .16);
  --radius: 14px;
  --radius-sm: 10px;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --page: 1220px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #191512;
    --surface: #231E1A;
    --surface-2: #2C2621;
    --ink: #F3ECE2;
    --ink-2: #D5CABD;
    --muted: #A89C90;
    --line: #3A322C;
    --primary: #E0764D;
    --primary-hover: #EC8A63;
    --on-primary: #1B120D;
    --primary-soft: #3A251C;
    --green: #9CC4AC;
    --green-soft: #22312A;
    --gold: #E2B24A;
    --danger: #F08A80;
    --danger-soft: #3A1F1C;
    --warn: #E5B95A;
    --warn-soft: #33290F;
    --info: #8FBBD6;
    --info-soft: #1C2A33;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .4), 0 24px 60px rgba(0, 0, 0, .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--body); -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
#app { display: flex; flex-direction: column; min-height: 100vh; }
main#outlet { flex: 1; width: 100%; }
img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a.link:hover, .prose a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; letter-spacing: -0.012em; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; font-family: var(--body); font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.ink-2 { color: var(--ink-2); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.num { font-variant-numeric: tabular-nums; }
.hide { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--primary); color: var(--on-primary); }

/* --- layout ------------------------------------------------------------------------------- */

.page { width: 100%; max-width: var(--page); margin: 0 auto; padding: 28px 20px 64px; }
.page.narrow { max-width: 760px; }
.page.mid { max-width: 980px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { color: var(--muted); margin: 6px 0 0; }
.section { margin-top: 44px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head a { color: var(--primary); font-weight: 600; font-size: .95rem; white-space: nowrap; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.row.end { justify-content: flex-end; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack.lg { gap: 22px; }
.stack.sm { gap: 6px; }
.grow { flex: 1; min-width: 0; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .cols-2, .cols-3 { grid-template-columns: 1fr; } }

/* A page with a side column: the main part and an aside (order summary, a shop's card). */
.with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
.with-aside > aside { position: sticky; top: 88px; }
@media (max-width: 960px) { .with-aside { grid-template-columns: minmax(0, 1fr); } .with-aside > aside { position: static; } }

/* A managing page: a menu down the side (selling, admin, the account). */
.with-menu { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; align-items: start; }
.side-menu { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 2px; }
.side-menu .menu-title { font: 600 .78rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 12px 10px; }
.side-menu a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--ink-2); font-weight: 500; }
.side-menu a:hover { background: var(--surface-2); color: var(--ink); }
.side-menu a.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.side-menu .count { background: var(--primary); color: var(--on-primary); font: 700 .72rem/1 var(--body); padding: 4px 7px; border-radius: 999px; }
@media (max-width: 860px) {
  .with-menu { grid-template-columns: 1fr; gap: 18px; }
  .side-menu { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .side-menu .menu-title { display: none; }
  .side-menu a { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); }
}

/* --- header and footer -------------------------------------------------------------------- */

.notice-bar { background: var(--green); color: var(--bg); font-size: .875rem; text-align: center; padding: 7px 16px; }
.notice-bar a { text-decoration: underline; text-underline-offset: 2px; }
@media (prefers-color-scheme: dark) { .notice-bar { color: #14110E; } }

.site-header { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .bar { max-width: var(--page); margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 18px; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; font: 600 1.5rem/1 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.wordmark svg { width: 28px; height: 28px; }
.site-header nav.primary { display: flex; gap: 4px; }
.site-header nav.primary a { padding: 8px 12px; border-radius: 999px; font-weight: 600; color: var(--ink-2); }
.site-header nav.primary a:hover, .site-header nav.primary a.active { background: var(--surface-2); color: var(--ink); }
.header-search { flex: 1; position: relative; max-width: 520px; }
.header-search input[type=search] { width: 100%; border-radius: 999px; padding: 10px 16px 10px 42px; background: var(--surface); }
.header-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.header-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn .dot { position: absolute; top: 4px; right: 3px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: var(--on-primary); font: 700 .68rem/17px var(--body); text-align: center; }
.menu-wrap { position: relative; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.dropdown a, .dropdown button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer; text-align: left; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }
.dropdown .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown .who b { display: block; }
.dropdown hr { margin: 6px 0; }
@media (max-width: 900px) {
  /* On a phone the header is three short rows and scrolls away with the page: stuck to the top
     it would take a third of the screen. */
  .site-header { position: static; }
  .site-header .bar { flex-wrap: wrap; gap: 8px 10px; padding: 10px 14px; }
  .site-header nav.primary { order: 4; width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; }
  .site-header nav.primary a { padding: 6px 12px; white-space: nowrap; }
  .header-search { order: 3; max-width: none; flex-basis: 100%; }
  .header-actions .btn.ghost { display: none; }
  .wordmark { font-size: 1.3rem; }
  .with-menu > .side-menu, .with-aside > aside { top: auto; }
}

.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); margin-top: auto; }
.site-footer .inner { max-width: var(--page); margin: 0 auto; padding: 36px 20px; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.site-footer h4 { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.site-footer a { display: block; padding: 3px 0; color: var(--ink-2); }
.site-footer a:hover { color: var(--primary); }
.site-footer .legal { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 18px; color: var(--muted); font-size: .875rem; }
@media (max-width: 720px) { .site-footer .inner { grid-template-columns: 1fr 1fr; } }

.route-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--primary); z-index: 100; transition: width .25s ease, opacity .3s ease; }
.route-progress.on { width: 72%; }
.route-progress.done { width: 100%; opacity: 0; }

/* --- buttons ------------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  font: 600 .98rem/1.2 var(--body); padding: 11px 20px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.green { background: var(--green); border-color: var(--green); color: var(--bg); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--primary); padding-inline: 12px; }
.btn.ghost:hover { background: var(--primary-soft); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); background: var(--danger-soft); }
.btn.danger.solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.small { padding: 7px 14px; font-size: .875rem; }
.btn.large { padding: 14px 26px; font-size: 1.05rem; }
.btn.block { display: flex; width: 100%; }
.btn[disabled], .btn.busy { opacity: .6; cursor: default; pointer-events: none; }
.btn.busy::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn svg { width: 18px; height: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --- forms --------------------------------------------------------------------------------- */

input, select, textarea, button { font: inherit; color: inherit; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input[type=tel], input[type=url], select, textarea {
  width: 100%; padding: 10px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237A6F66' stroke-width='2'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field > .label { font-weight: 600; font-size: .92rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
.field .error { color: var(--danger); font-size: .85rem; }
.check { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check span small { display: block; color: var(--muted); }
.money-input { position: relative; }
.money-input span { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money-input input { padding-left: 28px; }
.form { display: flex; flex-direction: column; gap: 18px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.form-error { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 10px 14px; font-size: .93rem; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.stepper button { width: 36px; height: 36px; border: 0; background: none; cursor: pointer; font-size: 1.1rem; border-radius: 999px; }
.stepper button:hover { background: var(--surface-2); }
.stepper span { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- cards and surfaces -------------------------------------------------------------------- */

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card.pad-lg { padding: 28px; }
.card.flat { background: var(--surface-2); border-color: transparent; }
.card > h3:first-child, .card > h2:first-child { margin-bottom: 12px; }
.card-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card-list > * { display: block; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.card-list > *:last-child { border-bottom: 0; }
.card-list > a:hover { background: var(--surface-2); }
.callout { border-radius: var(--radius); padding: 14px 16px; background: var(--info-soft); color: var(--info); display: flex; gap: 12px; align-items: flex-start; }
.callout.good { background: var(--green-soft); color: var(--green); }
.callout.warn { background: var(--warn-soft); color: var(--warn); }
.callout.bad { background: var(--danger-soft); color: var(--danger); }
.callout svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.callout b { display: block; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 0; margin: 0; }
.dl dt { color: var(--muted); padding-right: 18px; }
.dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.dl .total { font-weight: 700; font-size: 1.08rem; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: block; }
a.stat:hover { border-color: var(--primary); }
.stat .label { color: var(--muted); font-size: .86rem; }
.stat .value { font: 600 1.7rem/1.2 var(--display); margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: .85rem; }
.stat.alert .value { color: var(--primary); }

/* --- badges, pills, chips ------------------------------------------------------------------ */

.verified { display: inline-flex; align-items: center; gap: 6px; background: var(--green-soft); color: var(--green); font: 700 .8rem/1 var(--body); padding: 6px 10px 6px 7px; border-radius: 999px; white-space: nowrap; }
.verified svg { width: 15px; height: 15px; }
.verified.small { font-size: .72rem; padding: 4px 8px 4px 5px; }
.verified.small svg { width: 13px; height: 13px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font: 700 .76rem/1 var(--body); padding: 5px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.pill.good { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--danger-soft); color: var(--danger); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--primary-soft); color: var(--primary); }
.pill.test { background: repeating-linear-gradient(135deg, var(--warn-soft) 0 8px, transparent 8px 16px), var(--surface-2); color: var(--warn); text-transform: uppercase; letter-spacing: .06em; }
.premium-tag { display: inline-flex; align-items: center; gap: 5px; font: 700 .72rem/1 var(--body); letter-spacing: .05em; text-transform: uppercase; padding: 5px 9px; border-radius: 999px; background: #2A2420; color: #F2D28A; }
.premium-tag svg { width: 12px; height: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--ink-2); }
.chip.active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.tag { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: .85rem; }

.stars { display: inline-flex; align-items: center; gap: 5px; font-size: .9rem; color: var(--ink-2); white-space: nowrap; }
.stars .glyphs { color: var(--gold); letter-spacing: 1px; font-size: 1rem; line-height: 1; }
.stars .glyphs .off { color: var(--line); }
.star-input { display: inline-flex; gap: 4px; }
.star-input button { border: 0; background: none; cursor: pointer; font-size: 2rem; line-height: 1; color: var(--line); padding: 0 2px; }
.star-input button.on { color: var(--gold); }

.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; display: inline-grid; place-items: center; font: 700 1rem/1 var(--display); color: var(--ink-2); overflow: hidden; }
.avatar.lg { width: 72px; height: 72px; font-size: 1.6rem; }
.avatar.xl { width: 104px; height: 104px; font-size: 2.2rem; border: 4px solid var(--bg); }
.avatar.sm { width: 28px; height: 28px; font-size: .8rem; }

/* --- listings, shops, videos --------------------------------------------------------------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 22px 18px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; } .grid.wide { grid-template-columns: 1fr; } }

.listing-card { display: flex; flex-direction: column; gap: 9px; position: relative; }
.listing-card .photo { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.listing-card .photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.listing-card:hover .photo img { transform: scale(1.035); }
.listing-card .photo .verified { position: absolute; left: 8px; bottom: 8px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); }
.listing-card .fav { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(6px); display: grid; place-items: center; cursor: pointer; color: var(--ink-2); }
.listing-card .fav svg { width: 18px; height: 18px; }
.listing-card .fav.on { color: var(--primary); }
.listing-card .fav.on svg { fill: currentColor; }
.listing-card .title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing-card .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 2px 8px; flex-wrap: wrap; }
.listing-card .price { font: 600 1.08rem/1 var(--display); font-variant-numeric: tabular-nums; }
.listing-card .shop { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.listing-card .sold-out { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 60%, transparent); font-weight: 700; }

.shop-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.shop-card:hover { border-color: var(--primary); }
.shop-card .name { font: 600 1.08rem/1.2 var(--display); }
.shop-card .tagline { color: var(--muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

.video-card { display: flex; flex-direction: column; gap: 9px; }
.video-card .poster { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #1c1815; }
.video-card .poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.video-card:hover .poster img { transform: scale(1.03); }
.video-card .poster .premium-tag { position: absolute; top: 9px; left: 9px; }
.video-card .poster .length { position: absolute; right: 8px; bottom: 8px; background: rgba(20, 16, 14, .82); color: #fff; font: 600 .78rem/1 var(--body); padding: 4px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.video-card .poster .play { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; opacity: 0; transition: opacity .2s; background: rgba(20, 16, 14, .25); }
.video-card:hover .poster .play { opacity: 1; }
.video-card .poster .play svg { width: 52px; height: 52px; }
.video-card .title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-card .by { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; }

.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #14100E; }
.player video, .player img { width: 100%; height: 100%; object-fit: contain; background: #14100E; }

/* --- tables, tabs --------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font: 600 .78rem/1 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 13px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: var(--surface-2); }
.table .thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.table td.right, .table th.right { text-align: right; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 22px; overflow-x: auto; scrollbar-width: none; }
.tabs button, .tabs a { border: 0; background: none; padding: 11px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover, .tabs a:hover { color: var(--ink); }
.tabs .active { color: var(--primary); border-bottom-color: var(--primary); }
.tabs .count { color: var(--muted); font-weight: 500; margin-left: 5px; }

.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 30px; color: var(--muted); }

/* --- empty, loading, errors ----------------------------------------------------------------- */

.empty { text-align: center; padding: 56px 20px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty h3 { color: var(--ink); }
.empty svg { width: 44px; height: 44px; color: var(--line); }
.empty .btn { margin-top: 8px; }
.loading { display: grid; place-items: center; padding: 80px 20px; color: var(--muted); }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: spin .8s linear infinite; }
.skeleton { background: linear-gradient(100deg, var(--surface-2) 40%, var(--line) 50%, var(--surface-2) 60%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* --- overlays ------------------------------------------------------------------------------- */

.modal-backdrop { position: fixed; inset: 0; background: rgba(28, 22, 18, .5); z-index: 60; display: grid; place-items: center; padding: 20px; animation: fade .15s ease; overflow-y: auto; }
.modal { width: 100%; max-width: 520px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 26px; animation: rise .18s ease; margin: auto; }
.modal.wide { max-width: 760px; }
.modal h2 { margin-bottom: 14px; font-size: 1.4rem; }
.modal .modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; box-shadow: var(--shadow-lg); font-weight: 500; animation: rise .2s ease; pointer-events: auto; text-align: center; }
.toast.bad { background: var(--danger); color: #fff; }
.toast.good { background: var(--green); color: var(--bg); }

/* --- uploads -------------------------------------------------------------------------------- */

.photo-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.photo-picker .slot { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.photo-picker .slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-picker .slot .remove, .photo-picker .slot .move { position: absolute; top: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(20, 16, 14, .72); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: .9rem; line-height: 1; }
.photo-picker .slot .remove { right: 5px; }
.photo-picker .slot .move { left: 5px; }
.photo-picker .slot .first { position: absolute; left: 5px; bottom: 5px; background: rgba(20, 16, 14, .72); color: #fff; font-size: .68rem; font-weight: 700; padding: 3px 6px; border-radius: 6px; }
.photo-picker .add { aspect-ratio: 1; border-radius: var(--radius-sm); border: 1.5px dashed var(--line); background: none; cursor: pointer; display: grid; place-items: center; color: var(--muted); font-size: .85rem; text-align: center; padding: 6px; }
.photo-picker .add:hover { border-color: var(--primary); color: var(--primary); }
.dropzone { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 28px 20px; text-align: center; color: var(--muted); cursor: pointer; background: var(--surface); }
.dropzone:hover, .dropzone.over { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 999px; transition: width .2s; }

/* --- conversation threads (messages, cases) ------------------------------------------------- */

.thread { display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: min(560px, 86%); padding: 11px 15px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; }
.bubble.mine { align-self: flex-end; background: var(--primary-soft); border-color: transparent; }
.bubble.system { align-self: center; max-width: 100%; background: var(--surface-2); border-color: transparent; color: var(--ink-2); font-size: .92rem; text-align: center; border-radius: 999px; padding: 8px 16px; }
.bubble .who { font-size: .8rem; font-weight: 700; color: var(--muted); margin-bottom: 3px; }
.bubble .when { font-size: .76rem; color: var(--muted); margin-top: 4px; }
.bubble .photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.bubble .photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.composer { display: flex; gap: 10px; align-items: flex-end; margin-top: 16px; }
.composer textarea { min-height: 48px; max-height: 180px; border-radius: 18px; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; padding: 0 0 18px 24px; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: 0; width: 1px; background: var(--line); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline .when { color: var(--muted); font-size: .84rem; }
