:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #00132b;
  --muted: #64707f;
  --line: #e3e6eb;
  --accent: #00132b;
  --accent-text: #ffffff;
  --mark-r: var(--accent);
  --ok: #0f7b4b;
  --warn: #9a6200;
  --bad: #b42318;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f15;
    --surface: #141a22;
    --text: #eef1f5;
    --muted: #93a0b0;
    --line: #263040;
    --accent: #ffffff;
    --accent-text: #00132b;
    --mark-r: var(--accent);
    --ok: #4cc38a;
    --warn: #e0a83a;
    --bad: #f07067;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
}
main { max-width: 860px; margin: 0 auto; padding: 24px 16px 64px; }
a { color: inherit; }
h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; margin: 0 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin: 0 0 12px; }
code { font-size: 12px; word-break: break-all; }

.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; }
.brand .dot { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(135deg, #ff7a59, #ffb347); }
.tag { font-weight: 500; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 1px 8px; }
.me { display: flex; align-items: center; gap: 8px; min-width: 0; }
.me form { margin: 0; }
.me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; }
.initials { display: grid; place-items: center; background: var(--line); font-weight: 600; text-transform: uppercase; }
@media (max-width: 560px) { .tag, .me-name { display: none; } }

.hero { text-align: center; padding: 72px 0 40px; max-width: 560px; margin: 0 auto; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 28px; }
.fine { color: var(--muted); font-size: 13px; }

.rendy-btn {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--accent); color: var(--accent-text);
  padding: 13px 22px; border-radius: 12px; font-weight: 600; font-size: 16px; text-decoration: none;
}
.rendy-btn:hover { opacity: 0.9; }
.mark { width: 22px; height: 22px; color: var(--accent-text); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.notice { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }

.stack { display: grid; gap: 14px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
label { display: grid; gap: 6px; font-weight: 600; font-size: 13px; }
input, select {
  font-weight: 400;
  font: inherit; color: inherit; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%;
}
.drop {
  display: block; border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 26px 16px; text-align: center; font-weight: 500; color: var(--muted); cursor: pointer;
}
.drop.over { border-color: var(--text); color: var(--text); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.thumbs:empty { display: none; }
.thumbs figure { position: relative; margin: 0; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--line); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .uploading img { opacity: 0.4; }
.thumbs .failed { outline: 2px solid var(--bad); }
.thumbs button { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgb(0 0 0 / 0.6); color: #fff; cursor: pointer; line-height: 1; }

button { font: inherit; cursor: pointer; }
.primary, .secondary, .as-btn {
  display: inline-block; border-radius: 10px; padding: 10px 16px; font-weight: 600; text-decoration: none; text-align: center;
}
.primary { background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); }
.primary:disabled { opacity: 0.4; cursor: default; }
.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.link { background: none; border: 0; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.danger { color: var(--bad); }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.form-msg { margin: 0; color: var(--muted); min-height: 1.5em; }

.listings { display: grid; gap: 8px; }
.listing-row { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; }
.listing-row:hover { border-color: var(--muted); }
.listing-row .thumb { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; background: var(--line); flex: none; }
.listing-row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pill { font-size: 12px; font-weight: 600; border-radius: 99px; padding: 3px 10px; white-space: nowrap; background: var(--line); }
.pill.success { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pill.error { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }
.pill.generating, .pill.regenerating { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }

.bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-bottom: 8px; }
.bar span { display: block; height: 100%; background: var(--text); transition: width 0.6s; }

.videos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.videos.landscape { grid-template-columns: 1fr; }
.video video { width: 100%; border-radius: 12px; background: #000; display: block; }
.videos.portrait video { aspect-ratio: 9 / 16; }
.videos.landscape video { aspect-ratio: 16 / 9; }
.video-actions { display: flex; gap: 8px; margin-top: 10px; }
.video-actions > * { flex: 1; }
.share-box { margin-top: 10px; }
.copy { display: flex; gap: 6px; }
.copy input { font-size: 12px; padding: 8px; }
.socials { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; font-size: 14px; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 16px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; min-width: 0; }
@media (max-width: 560px) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: 6px; } }

.share { display: grid; gap: 24px; align-items: center; padding-top: 16px; }
.share.portrait { grid-template-columns: minmax(0, 360px) 1fr; }
.share video { width: 100%; border-radius: 16px; background: #000; display: block; }
.share.portrait video { aspect-ratio: 9 / 16; }
.share.landscape video { aspect-ratio: 16 / 9; }
@media (max-width: 680px) { .share.portrait { grid-template-columns: 1fr; } }
