:root {
  color-scheme: dark;
  font-family: Inter, system-ui, sans-serif;
  background: #101217;
  color: #f7f8fa;
  --accent: #68e0ce;
  --border: #ffffff29;
  --muted: #b6bac4;
}
*, *::before, *::after { box-sizing: border-box }
body { margin: 0 }
button, input, textarea, select { font: inherit }
button, a, video { -webkit-tap-highlight-color: transparent }
button {
  border: 1px solid transparent;
  border-radius: 9px;
  padding: .6rem .9rem;
  min-height: 44px;
  background: var(--accent);
  color: #101217;
  font-weight: 650;
  cursor: pointer;
}
button:disabled { cursor: default; opacity: .45 }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
input, textarea, select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .6rem .72rem;
  background: #101217;
  color: inherit;
}
textarea { resize: vertical; min-height: 5.5rem }
label { display: grid; gap: .45rem; font-weight: 620 }
small, .muted { color: var(--muted) }
h1, h2, p { margin: 0 }
h1 { font-size: 1.4rem }
h2 { font-size: 1.1rem }
[role=status], [role=alert] { overflow-wrap: anywhere; color: var(--accent) }
[role=status]:empty, [role=alert]:empty { display: none }
.icon-button {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  background: #14171de6;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: 50%;
  flex: 0 0 auto;
}
.icon-button img { width: 23px; height: 23px; filter: invert(1) }
.icon-button[aria-pressed=true] { background: color-mix(in srgb, var(--accent) 25%, #14171d); border-color: var(--accent) }
.feed-shell {
  position: relative;
  isolation: isolate;
  margin: 0 auto;
  max-width: 560px;
  height: 100vh;
  height: 100dvh;
  background: #101217;
  overflow: hidden;
}
@media (min-width: 541px) {
  .feed-shell { border-inline: 1px solid #ffffff12; box-shadow: 0 0 70px #0008 }
}
.feed-scroll {
  position: relative;
  height: 100%;
  overflow: auto;
  scrollbar-width: none;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
}
.feed-scroll::-webkit-scrollbar { display: none }
.feed-scroll:focus-visible { outline-offset: -3px }
.slide { position: relative; height: 100%; scroll-snap-align: start; scroll-snap-stop: always }
.slide video, .video-hit { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent }
.video-hit { border: 0; padding: 0; border-radius: 0 }
.video-hit:focus-visible { outline-offset: -4px }
.post-card { pointer-events: auto }
.feed-bottom {
  bottom: 0;
  padding: 38px max(12px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: linear-gradient(transparent,#07090ccc);
}
.actions {
  position: absolute;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(28px, calc(env(safe-area-inset-bottom) + 18px));
  display: grid;
  gap: clamp(5px, 1.1dvh, 10px);
}
.actions .icon-button { background: #10121752; border-color: #ffffff42; box-shadow: 0 2px 8px #0005; }
.actions .icon-button[aria-pressed=true] { background: #203737; border-color: var(--accent); }
.post-card {
  width: min(390px, calc(100% - 58px));
  padding: 4px 5px;
  text-shadow: 0 1px 4px #000, 0 2px 10px #000;
}
.post-name { display: flex; gap: 9px; align-items: center; min-width: 0 }
.post-name strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.avatar { width: 35px; height: 35px; object-fit: cover; border-radius: 50%; border: 1px solid #ffffff78; flex: 0 0 auto }
.avatar.fallback { display: grid; place-items: center; color: var(--accent); background: #ffffff17; font-weight: bold }
.caption, .comment-list p, .moderation p { white-space: pre-wrap; overflow-wrap: anywhere }
.caption {
  margin-top: .4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  overflow: hidden;
}
.caption.expanded { display: block; max-height: min(29dvh,13rem); overflow: auto; overscroll-behavior: contain }
.text-button { background: transparent; color: var(--accent); border: 0; min-height: 30px; padding: .2rem 0 }
progress { accent-color: var(--accent); width: 100% }
.empty { display: grid; gap: 1rem; align-content: center; justify-items: center; height: 100%; padding: 1.5rem; text-align: center }
.feed-shell {
  --accent: #fff;
  --reel-safe-left: max(14px, env(safe-area-inset-left));
  --reel-safe-right: max(14px, env(safe-area-inset-right));
  --reel-dock-bottom: max(17px, calc(env(safe-area-inset-bottom) + 4px));
  --reel-dock-height: 56px;
  --reel-track-bottom: calc(var(--reel-dock-bottom) + var(--reel-dock-height) + 13px);
  --reel-step: clamp(44px, 7.95dvh, 68px);
  background: #0b0b11;
  color: #fff;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.reel-overlay { position: sticky; top: 0; z-index: 3; height: 0; pointer-events: none }
.reel-frame {
  position: absolute; inset: 0 0 auto; height: 100vh; height: 100dvh;
  pointer-events: none;
}
.reel-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,#07070946 0%,transparent 20%,transparent 51%,#0b0b1018 71%,#10101491 97%);
}
.reel-ornament, .reel-like, .reel-details { pointer-events: auto }
.reel-ornament .reel-art, .reel-like .reel-art { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none }
.reel-top {
  position: absolute;
  top: max(clamp(27px, 7.1dvh, 63px), calc(env(safe-area-inset-top) + 17px));
  left: var(--reel-safe-left); right: var(--reel-safe-right);
  height: 48px;
  display: grid; place-items: center;
}
.reel-title {
  display: flex; align-items: center; gap: 5px; height: 44px;
  filter: drop-shadow(0 1px 4px #0007);
  pointer-events: auto;
}
.reel-title .reel-art { object-fit: contain }
.reel-wordmark { width: 58px; height: 28px }
.reel-chevron { width: 12px; height: 12px }
.reel-add { position: absolute; left: -10px; display: grid; place-items: center; width: 44px; height: 44px }
.reel-add .reel-art { width: 25px; height: 25px }
.reel-actions {
  position: absolute;
  bottom: var(--reel-track-bottom);
  right: max(6px, env(safe-area-inset-right));
  display: grid;
  grid-auto-rows: var(--reel-step);
  justify-items: center;
  align-items: center;
}
.reel-action, .reel-like {
  width: 46px; height: 44px; min-height: 44px;
  display: grid; place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
}
.reel-action .reel-art, .reel-like .reel-art { width: 30px; height: 30px; filter: drop-shadow(0 2px 4px #000a) }
.reel-details {
  position: absolute;
  left: var(--reel-safe-left);
  right: max(64px, calc(env(safe-area-inset-right) + 54px));
  bottom: calc(var(--reel-track-bottom) + 14px);
  text-shadow: 0 1px 5px #000, 0 2px 12px #0008;
}
.reel-byline { display: flex; align-items: center; gap: 11px; min-width: 0 }
.reel-byline strong { font-size: 14px }
.reel-byline .avatar {
  width: 40px; height: 40px; border: 2px solid transparent;
  background: linear-gradient(#202024,#202024) padding-box, conic-gradient(#ff258e,#e52cd7,#ff3654,#ffad28,#ff258e) border-box;
}
.reel-follow { display: block; flex: 0 0 57px; height: 27px }
.reel-details .caption { font-size: 14px; margin-top: 7px }
.reel-details .caption.expanded { max-height: min(23dvh, 10rem) }
.reel-more { background: transparent; border: 0; padding: 2px 0; min-height: 26px; color: #fff; font-size: 12px }
.reel-progress {
  appearance: none;
  pointer-events: auto;
  position: absolute;
  left: var(--reel-safe-left);
  right: var(--reel-safe-right);
  bottom: var(--reel-track-bottom);
  display: block;
  width: auto;
  height: 2px;
  border: 0;
  background: #ffffff45;
  color: #fff;
}
.reel-progress::-webkit-progress-bar { background: #ffffff45 }
.reel-progress::-webkit-progress-value { background: #fff }
.reel-progress::-moz-progress-bar { background: #fff }
.reel-dock {
  position: absolute;
  inset: auto max(20px, var(--reel-safe-right)) var(--reel-dock-bottom) max(20px, var(--reel-safe-left));
  height: var(--reel-dock-height);
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  align-items: stretch;
  padding: 3px 5px;
  border: 1px solid #ffffff25;
  border-radius: 999px;
  background: #222023a8;
  backdrop-filter: blur(14px);
}
.reel-dock > span { display: grid; place-items: center; position: relative }
.reel-dock .reel-art { width: 24px; height: 24px }
.reel-dock-current { border-radius: 999px; background: #f6f6f640 }
.reel-dock img.reel-dock-avatar, .reel-avatar-fallback {
  width: 25px; height: 25px; border-radius: 50%; object-fit: cover;
  border: 1px solid #fff8;
}
.reel-avatar-fallback { display: grid; place-items: center; font-size: 11px; background: #242433 }
.reel-notice {
  position: absolute;
  inset: max(115px, calc(env(safe-area-inset-top) + 74px)) var(--reel-safe-right) auto var(--reel-safe-left);
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 10px; color: #fff; background: #171721ef;
  border-radius: 8px; overflow-wrap: anywhere;
}
@media (max-height: 455px) {
  .reel-actions { grid-template-columns: repeat(2,46px) }
  .reel-details { right: max(110px, calc(env(safe-area-inset-right) + 100px)) }
}
.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 16px }
.login { width: min(100%,410px) }
.panel-shell { max-width: 1500px; margin: auto; padding: 18px; display: grid; gap: 18px }
.panel-top, .panel-top nav, .editor-actions { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px }
.secondary, .danger, .post-select { background: #242832; color: inherit; border-color: var(--border) }
.secondary[aria-pressed=true], .post-select[aria-current=true] { border-color: var(--accent) }
.danger { color: #ffabb2 }
.panel-grid { display: grid; grid-template-columns: minmax(230px,1fr) minmax(300px,1.35fr) minmax(240px,1fr); align-items: start; gap: 14px }
.panel-box, .panel-box form { display: grid; gap: 14px }
.panel-box { background: #181b22; border: 1px solid var(--border); padding: 16px; border-radius: 15px; min-width: 0 }
.library ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px }
.library li { display: flex; align-items: center; gap: 5px }
.library .icon-button { width: 36px; height: 36px; min-height: 36px }
.post-select { min-width: 0; flex: 1; display: flex; align-items: center; text-align: left; gap: 8px; padding: 6px 8px; overflow-wrap: anywhere }
.post-select small { display: block }
.post-select img { width: 32px; height: 40px; object-fit: cover; border-radius: 5px; flex: 0 0 auto }
.picker { padding: 10px; border: 1px dashed var(--border); border-radius: 9px; display: grid; gap: 6px; overflow-wrap: anywhere }
.picker.drag { border-color: var(--accent) }
.job { display: grid; gap: 6px; padding: 8px; background: #101217; border-radius: 8px }
.preview { position: relative; aspect-ratio: 9 / 16; max-height: 68dvh; background: #101217; border-radius: 12px; overflow: hidden }
.preview video { width: 100%; height: 100% }
.preview-info { position: absolute; inset: 8px 8px 54px; display: flex; align-items: start; justify-content: flex-end; flex-direction: column; pointer-events: none }
.preview-info .post-card { width: 100%; pointer-events: none }
.moderation article { padding: 12px; border: 1px solid var(--border); border-radius: 10px }
.moderation article small, .moderation article button + button { margin-left: 8px }
.moderation article p { margin: .6rem 0 }
@media (max-width: 935px) { .panel-grid { grid-template-columns: 1fr 1fr } }
@media (max-width: 620px) { .panel-grid { grid-template-columns: minmax(0,1fr) } }
