:root {
  --bg: #0b0b10;
  --surface: #15151c;
  --surface-2: #1d1d27;
  --line: #2a2a36;
  --text: #f4f4f7;
  --muted: #9a9aab;
  --faint: #6b6b7c;
  --brand-1: rgb(234, 52, 90);
  --brand-2: rgb(252, 99, 67);
  --brand-3: rgb(255, 145, 76);
  --brand: var(--brand-2);
  --grad: linear-gradient(120deg, var(--brand-1), var(--brand-2) 55%, var(--brand-3));
  --ok: #3ecf8e;
  --warn: #f5b841;
  --bad: #ff5d6c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --nav-h: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 12px);
}
a { color: var(--brand-3); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 24px; font-weight: 750; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 700; }
h3 { font-size: 15px; font-weight: 650; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; }
.narrow { max-width: 460px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 22px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* top bar */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(11, 11, 16, .86); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); }
.topbar .wrap { padding-top: 10px; padding-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.01em; color: var(--text); }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; }
.logo-mark svg { width: 17px; height: 17px; }
.topbar .org { color: var(--muted); font-size: 13px; }
.topnav { display: none; gap: 4px; margin-left: 12px; }
.topnav a { color: var(--muted); padding: 7px 11px; border-radius: 9px; font-size: 14px; }
.topnav a.on, .topnav a:hover { color: var(--text); background: var(--surface-2); }

/* bottom nav (mobile) */
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around;
  background: rgba(16, 16, 22, .96); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottomnav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--faint);
  font-size: 11px; padding: 5px 2px; border-radius: 10px; }
.bottomnav a svg { width: 22px; height: 22px; }
.bottomnav a.on { color: var(--text); }
.bottomnav a.on svg { color: var(--brand-2); }
@media (min-width: 820px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  body { padding-bottom: 24px; }
}

/* surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.flat { padding: 0; overflow: hidden; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 3px 9px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.hot { background: rgba(252, 99, 67, .14); border-color: rgba(252, 99, 67, .4); color: var(--brand-3); }
.pill.ok { background: rgba(62, 207, 142, .12); border-color: rgba(62, 207, 142, .35); color: var(--ok); }
.pill.warn { background: rgba(245, 184, 65, .12); border-color: rgba(245, 184, 65, .35); color: var(--warn); }
.pill.bad { background: rgba(255, 93, 108, .12); border-color: rgba(255, 93, 108, .35); color: var(--bad); }
.tier-1 { color: #d49a6a; } .tier-2 { color: #c8cdd6; } .tier-3 { color: #f2c94c; } .tier-4 { color: #a8e6ff; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); padding: 10px 16px; border-radius: 11px; font-weight: 600;
  cursor: pointer; min-height: 44px; text-align: center; transition: transform .06s, opacity .15s, background .15s; }
.btn:hover { background: #262632; }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; }
.btn.primary:hover { opacity: .93; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn.sm { min-height: 34px; padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.xl { min-height: 58px; font-size: 17px; border-radius: 14px; }
.iconbtn { background: none; border: 0; color: var(--muted); padding: 6px; cursor: pointer; border-radius: 8px; }
.iconbtn:hover { color: var(--text); background: var(--surface-2); }

/* forms */
label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 550; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=url], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px;
  min-height: 44px; outline: none; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(252, 99, 67, .18); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--brand-2); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); padding: 9px 15px; border-radius: 99px; cursor: pointer;
  font-weight: 600; font-size: 14px; min-height: 40px; }
.chip.on { background: var(--grad); border-color: transparent; color: #fff; }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 7px 13px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; }
.seg button.on { background: var(--surface-2); color: var(--text); }
.grid2 { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* property cards */
.pgrid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: var(--text);
  display: block; transition: transform .12s, border-color .12s; }
.pcard:hover { transform: translateY(-2px); border-color: #3a3a4a; }
.pcard .cover { aspect-ratio: 16/10; background: var(--surface-2) center/cover no-repeat; position: relative; }
.pcard .cover .badges { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; justify-content: space-between; }
.pcard .body { padding: 12px 14px 14px; }
.cover-fallback { background: radial-gradient(120% 90% at 0% 0%, rgba(234, 52, 90, .45), transparent 60%),
  radial-gradient(120% 90% at 100% 100%, rgba(255, 145, 76, .35), transparent 60%), var(--surface-2) !important; }

/* folders (batches) */
.fgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.folder { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; color: var(--text); display: block; }
.folder:hover { border-color: #3a3a4a; }
.collage { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 2px; aspect-ratio: 16/10; background: var(--bg); }
.collage > div { background: var(--surface-2) center/cover no-repeat; }
.collage > div:first-child { grid-row: span 2; }
.folder .body { padding: 11px 13px 13px; }

/* clip grid */
.cgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 640px) { .cgrid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.clip { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-2); aspect-ratio: 9/14; cursor: pointer;
  border: 1px solid var(--line); }
.clip .thumb { position: absolute; inset: 0; background: center/cover no-repeat; }
.clip .shade { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.78), transparent 45%, transparent 70%, rgba(0,0,0,.45)); }
.clip .tl { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.clip .br { position: absolute; bottom: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; align-items: end; gap: 6px; }
.clip .tag { background: rgba(0,0,0,.6); backdrop-filter: blur(6px); color: #fff; font-size: 11px; font-weight: 650; padding: 3px 7px; border-radius: 7px; }
.clip.full .thumb { filter: grayscale(1) brightness(.45); }
.clip.mine { border-color: var(--brand-2); box-shadow: 0 0 0 1px var(--brand-2); }
.clip .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }

/* sheet / modal */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.66); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--surface); border: 1px solid var(--line); border-radius: 20px 20px 0 0; width: 100%; max-width: 560px;
  max-height: 92vh; overflow: auto; padding: 18px 18px calc(22px + env(safe-area-inset-bottom)); box-shadow: var(--shadow); }
@media (min-width: 700px) { .overlay { align-items: center; } .sheet { border-radius: 20px; } }
.sheet video, .sheet img.preview { width: 100%; max-height: 56vh; background: #000; border-radius: 12px; display: block; object-fit: contain; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }

.goblock { border: 1px dashed rgba(252, 99, 67, .55); background: rgba(252, 99, 67, .06); border-radius: 12px; padding: 12px 14px; }
.copyline { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid rgba(255,255,255,.06); }
.copyline:first-of-type { border-top: 0; }
.copyline code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; }
.notice { border-left: 3px solid var(--warn); background: rgba(245, 184, 65, .07); padding: 10px 12px; border-radius: 0 10px 10px 0; font-size: 14px; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.tscroll { overflow-x: auto; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.mini-thumb { width: 54px; height: 72px; border-radius: 9px; background: var(--surface-2) center/cover no-repeat; flex: none; }

/* stats */
.stats { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font-size: 26px; font-weight: 750; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13px; }

/* upload */
.dropzone { border: 2px dashed var(--line); border-radius: 16px; padding: 26px 16px; text-align: center; transition: border-color .15s, background .15s; }
.dropzone.drag { border-color: var(--brand-2); background: rgba(252, 99, 67, .06); }
.uprow { display: flex; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.uprow:first-child { border-top: 0; }
.bar { height: 6px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .25s; }
.upbar { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px); z-index: 30;
  max-width: 560px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 11px 14px; box-shadow: var(--shadow); cursor: pointer; }
@media (min-width: 820px) { .upbar { bottom: 16px; } }

.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 99; background: var(--surface-2); border: 1px solid var(--line);
  padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: calc(100% - 32px); font-weight: 550; }
.toast.bad { border-color: rgba(255, 93, 108, .5); }
.empty { text-align: center; padding: 38px 18px; color: var(--muted); }
.empty svg { width: 42px; height: 42px; color: var(--faint); margin-bottom: 6px; }
.hero-auth { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.brandglow { position: fixed; inset: -20% -10% auto; height: 60vh; background: radial-gradient(50% 60% at 30% 40%, rgba(234,52,90,.20), transparent 70%),
  radial-gradient(40% 50% at 70% 30%, rgba(255,145,76,.16), transparent 70%); pointer-events: none; z-index: -1; }
.linkbox { display: flex; gap: 8px; }
.linkbox input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tabs a { white-space: nowrap; padding: 8px 13px; border-radius: 10px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.tabs a.on { color: var(--text); border-color: var(--brand-2); }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--brand-2); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.countdown { font-variant-numeric: tabular-nums; }
.pcard .cover .pill, .pcard .cover .pill.hot { background: rgba(10, 10, 14, .78); backdrop-filter: blur(6px); }
