@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/golos-text-regular.ttf") format("truetype");
}
@font-face {
  font-family: "Golos Text";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/static/fonts/golos-text-semibold.ttf") format("truetype");
}
:root {
  --app-bg: #f5f7fb;
  --surface: #fff;
  --accent: #2862e9;
  --accent-hover: #2157d3;
  --tint: #eff6ff;
  --ink: #20242c;
  --muted: #5b677a;
  --border: #dbe3ef;
  --field: #f8fafc;
  --danger: #b42318;
  --success: #18734a;
  --app-safe-top: calc(
    max(env(safe-area-inset-top, 0px), var(--tg-safe-area-inset-top, 0px)) +
      var(--tg-content-safe-area-inset-top, 0px)
  );
  --app-safe-bottom: calc(
    max(
        env(safe-area-inset-bottom, 0px),
        var(--tg-safe-area-inset-bottom, 0px)
      ) +
      var(--tg-content-safe-area-inset-bottom, 0px)
  );
  font-family: "Golos Text", system-ui, sans-serif;
  color: var(--ink);
  background: var(--app-bg);
  color-scheme: light;
  -webkit-font-smoothing: antialiased;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  max-width: 960px;
  margin: auto;
  padding: calc(24px + var(--app-safe-top)) 28px
    calc(110px + var(--app-safe-bottom));
  min-height: var(--app-viewport-height, 100dvh);
}
[hidden] {
  display: none !important;
}
.symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: var(--muted);
}
.badge {
  margin-left: auto;
  border-radius: 24px;
  background: var(--tint);
  color: var(--accent);
  padding: 8px 12px;
  font-size: 12px;
}
.intro {
  padding: 36px 0 28px;
}
h1 {
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.13;
  letter-spacing: -0.04em;
  margin: 12px 0 0;
  font-weight: 600;
}
h1 span {
  color: var(--accent);
}
.intro p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  max-width: 440px;
  margin: 16px 0 0;
}
h2 {
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -0.025em;
  margin: 8px 0 0;
  font-weight: 600;
}
h3 {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}
p {
  line-height: 1.6;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 28px;
  padding: 20px 0;
}
.stats div {
  padding: 0 22px;
  border-right: 1px solid var(--border);
}
.stats div:last-child {
  border: 0;
}
.stats strong {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 500;
  display: block;
}
.stats span {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin-top: 5px;
}
section,
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 16px;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.limit {
  font-size: 12px;
  white-space: nowrap;
  padding: 8px 10px;
  border-radius: 20px;
  color: var(--muted);
  background: var(--field);
}
.drop-zone {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  text-align: center;
  padding: 28px 16px;
  margin: 22px 0 16px;
  background: var(--field);
  border: 1px dashed #aab8cd;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.drop-zone:hover {
  background: var(--tint);
}
.upload-icon {
  color: var(--accent);
  background: #e8efff;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-bottom: 8px;
}
.drop-zone strong {
  font-size: 17px;
  font-weight: 500;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.drop-zone > span:last-of-type {
  font-size: 13px;
  color: var(--muted);
}
.metadata {
  border-top: 1px solid var(--border);
  padding: 8px 0;
}
summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}
summary span {
  font-size: 12px;
  color: var(--muted);
}
label {
  display: block;
  font-size: 14px;
  margin: 16px 0 8px;
  color: var(--muted);
}
input,
textarea,
select,
button {
  font: inherit;
  min-height: 44px;
  max-width: 100%;
  border-radius: 9px;
  border: 1px solid var(--border);
  padding: 11px 14px;
}
input,
textarea,
select {
  width: 100%;
  background: var(--surface);
  color: var(--ink);
  font-size: 16px;
}
textarea {
  min-height: 110px;
  resize: vertical;
}
input::placeholder,
textarea::placeholder {
  color: #737e8e;
}
button {
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-weight: 500;
  touch-action: manipulation;
  transition:
    background-color 160ms,
    color 160ms,
    opacity 160ms;
}
button:hover {
  background: var(--field);
}
button:active {
  opacity: 0.8;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
.primary {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  background: var(--accent);
  color: white;
  width: 100%;
  border-color: var(--accent);
  font-weight: 500;
}
.primary:hover {
  background: var(--accent-hover);
}
.link-button {
  text-decoration: none;
  padding: 14px;
  margin-top: 24px;
}
.quiet {
  width: 100%;
  border: 0;
  color: var(--muted);
  background: transparent;
}
.row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.row input {
  flex: 1;
  min-width: 120px;
}
.row > label {
  flex: 1;
  min-width: 120px;
}
.catalog-head {
  margin: 30px 0 16px;
}
.catalog-head h2 {
  margin: 0;
}
.catalog-head .eyebrow {
  font-size: 10px;
}
nav {
  position: fixed;
  z-index: 20;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 960px);
  display: flex;
  gap: 8px;
  padding: 10px 20px calc(10px + var(--app-safe-bottom));
  background: #fffffff5;
  border-top: 1px solid var(--border);
  backdrop-filter: blur(12px);
}
nav button {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 60px;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  padding: 6px 8px;
  background: transparent;
}
nav button.active {
  background: var(--tint);
  color: var(--accent);
}
nav svg {
  width: 21px;
  height: 21px;
}
progress {
  width: 100%;
  height: 5px;
  margin: 14px 0 4px;
  accent-color: var(--accent);
}
.muted,
.footnote,
#uploadLabel {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.warning {
  color: #865b04;
}
#notice:not(:empty) {
  padding: 14px 16px;
  background: var(--tint);
  border: 1px solid #c6d8ff;
  border-radius: 12px;
  margin-bottom: 20px;
  color: #204b9c;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.card {
  padding: 20px;
  min-width: 0;
}
.card button {
  margin: 8px 8px 0 0;
  font-size: 13px;
}
.card input {
  margin-top: 8px;
}
.card p {
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.card details {
  margin: 12px 0 8px;
}
.card details summary {
  border-top: 1px solid var(--border);
  color: var(--muted);
  padding-top: 6px;
}
.card small {
  display: inline-block;
  color: var(--accent);
  font-size: 12px;
  margin: 8px 0;
}
.empty {
  padding: 30px 20px;
  text-align: center;
  background: transparent;
  border: 1px dashed var(--border);
}
.empty svg {
  color: var(--accent);
  margin-bottom: 10px;
}
.empty h3 {
  font-size: 16px;
}
.empty p {
  margin-bottom: 0;
}
.social-buttons {
  display: flex;
  gap: 10px;
  margin: 20px 0 12px;
}
.social-buttons button {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
}
.social-buttons button > span:last-child {
  margin-left: auto;
}
#members {
  margin-top: 20px;
}
#members .card {
  background: var(--field);
  border: 0;
}
#members h3 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
}
.member-username {
  color: var(--accent);
  font-size: 14px;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.member-username:hover {
  text-decoration: underline;
}
.permission-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
}
.permission-toggle input {
  width: 20px;
  height: 20px;
  min-height: 20px;
}
.publication-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 12px 0;
}
.history-count {
  font-size: 13px;
  color: var(--muted);
}
.publication-chip {
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  max-width: 100%;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
  background: var(--field);
  color: var(--muted);
}
.publication-chip > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.publication-chip.success {
  background: #edf8f1;
  color: var(--success);
}
.publication-chip.attention {
  background: #fff0ee;
  color: var(--danger);
}
.social-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  vertical-align: middle;
  line-height: 0;
}
.social-icon svg {
  display: block;
  width: 24px;
  height: 24px;
}
.social-icon.instagram {
  color: var(--accent);
}
.social-icon.instagram circle:last-child {
  fill: currentColor;
  stroke: none;
}
.publication-chip .social-icon,
.publication-chip .social-icon svg {
  width: 18px;
  height: 18px;
}
.publication-chip .social-icon {
  flex-basis: 18px;
}
.card h3 > .social-icon,
.selected-file > .social-icon {
  margin-right: 8px;
}
.upload-file {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 44px;
  gap: 6px 12px;
  align-items: start;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.upload-file .upload-name {
  grid-column: 2;
  min-width: 0;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.upload-file .upload-status {
  grid-column: 2;
  font-size: 12px;
  color: var(--muted);
}
.upload-file .upload-cancel {
  grid-column: 3;
  grid-row: 1/3;
  width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  font-size: 24px;
  color: var(--muted);
}
.upload-file progress {
  grid-column: 2/-1;
  width: 100%;
  margin: 4px 0;
}
.upload-file .upload-poster {
  grid-column: 1;
  grid-row: 1/4;
  width: 52px;
  min-height: 74px;
  height: 74px;
  position: relative;
  overflow: hidden;
  padding: 0;
  margin: 0;
  background: #10151d;
  contain: paint;
  isolation: isolate;
}
.upload-poster video {
  display: block;
  position: absolute;
  inset: 0;
  max-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
}
.upload-poster::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  font-size: 18px;
  z-index: 1;
  text-shadow: 0 1px 4px #0009;
}
.upload-error .upload-status {
  color: var(--danger);
}
#uploadLabel {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
#uploadFiles:not(:empty) {
  margin-top: 12px;
}
.source-head {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}
.source-head h3 {
  flex: 1;
  min-width: 100px;
  margin: 0;
}
.source-head .source-poster {
  margin: 0;
  flex: 0 0 52px;
}
.source-head .cover-control {
  flex-basis: 100%;
  margin-left: 64px;
}
.source-head .cover-control button {
  margin: 0;
}
.source-poster,
.version-poster {
  display: grid;
  place-items: center;
  width: 52px;
  height: 74px;
  min-height: 74px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: var(--field);
  font-size: 18px;
}
.source-poster img,
.version-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.source-poster:has(img)::after,
.version-poster:has(img)::after {
  content: "▶";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  text-shadow: 0 1px 5px #000;
}
.cover-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cover-control button {
  border: 0;
  background: transparent;
  color: var(--accent);
  padding: 8px 0;
  font-size: 13px;
  min-height: 44px;
}
.quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.quick-actions button {
  margin: 8px 0 0;
}
.expand {
  width: 100%;
  text-align: left;
  background: var(--field);
  margin-top: 16px !important;
}
.versions {
  padding-top: 16px;
}
.version {
  position: relative;
  padding: 16px;
  margin-bottom: 10px;
  background: var(--field);
}
.version .card-swipe-content {
  background: var(--field);
}
.version h3 {
  font-size: 16px;
}
.version-poster {
  float: left;
  margin: 0 12px 12px 0 !important;
}
.version .cover-control {
  clear: both;
}
.copy-file-name {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.selectable {
  position: relative;
  cursor: pointer;
}
.asset-select {
  position: absolute;
  right: 12px;
  top: 6px;
  margin: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}
.asset-select input,
.target-card input {
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  accent-color: var(--accent);
  margin: 0;
}
.selectable h3 {
  padding-right: 32px;
}
.selectable.selected {
  background: var(--tint);
  border-color: var(--accent);
}
.selectable.selected > .card-swipe-content {
  background: var(--tint);
}
.swipe-card {
  overflow: hidden;
}
.card-swipe-content {
  position: relative;
  min-width: 0;
  background: var(--surface);
  transition: transform 180ms;
  z-index: 1;
}
.swipe-open > .card-swipe-content {
  transform: translateX(-64px);
}
.card .card-delete {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff0ee;
  color: var(--danger);
  border: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  visibility: hidden;
}
.swipe-open > .card-delete {
  visibility: visible;
}
.export-tasks {
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
  overflow-wrap: anywhere;
}
.export-tasks button {
  margin-left: 8px;
}
dialog {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  border-radius: 18px;
  padding: 24px;
  width: min(94vw, 540px);
  overscroll-behavior: contain;
  overflow-y: auto;
  overflow-x: hidden;
}
dialog[open] {
  top: calc(var(--app-safe-top) + 12px);
  bottom: auto;
  margin: 0 auto;
  max-height: calc(
    var(--app-viewport-height, 100dvh) - var(--app-safe-top) -
      var(--app-safe-bottom) - 24px
  );
  scroll-padding: 80px 0 28px;
}
dialog::backdrop {
  background: #14213680;
  backdrop-filter: blur(4px);
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: -24px;
  background: var(--surface);
  z-index: 5;
  padding: 8px 0 12px;
}
.dialog-heading h2 {
  margin: 0;
  font-size: 21px;
}
.dialog-heading button {
  padding: 0;
  min-width: 44px;
  border: 0;
  background: transparent;
  font-size: 26px;
}
.target-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  min-height: 52px;
}
.target-card:has(input:checked) {
  background: var(--tint);
  border-color: var(--accent);
}
.target-card > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
fieldset {
  margin: 20px 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
legend {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 8px;
}
.selected-file {
  background: var(--field);
  padding: 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  margin: 8px 0;
  overflow-wrap: anywhere;
}
.version-text {
  padding: 16px;
  background: var(--field);
  border: 0;
  margin-bottom: 12px;
}
.version-text h3 {
  font-size: 14px;
}
.version-text label {
  margin-top: 12px;
}
.version-text textarea {
  width: 100%;
}
.custom-select {
  position: relative;
}
.custom-select > button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
}
.select-chevron {
  width: 18px;
  height: 18px;
}
.custom-select > button[aria-expanded="true"] .select-chevron {
  transform: rotate(180deg);
}
.select-options {
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 10;
  box-shadow: 0 12px 30px #17203314;
}
.select-options button {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  margin: 0;
}
.select-options button[aria-selected="true"] {
  background: var(--tint);
  color: var(--accent);
}
.select-options button[aria-selected="true"]::after {
  content: "✓";
  float: right;
}
#confirmation > button {
  margin-top: 10px;
}
#selectionBar {
  position: fixed;
  z-index: 25;
  bottom: calc(90px + var(--app-safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(calc(100% - 32px), 700px);
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px #17203314;
  font-size: 13px;
}
#selectionBar .primary {
  flex: 1;
  width: auto;
}
#selectionBar > button:last-child {
  min-width: 44px;
  padding: 0;
  font-size: 22px;
  border: 0;
}
.has-selection main {
  padding-bottom: 200px;
}
#playerVideo {
  display: block;
  width: 100%;
  background: #10151d;
  margin-top: 12px;
  max-height: calc(
    (
        var(--app-viewport-height, 100dvh) - var(--app-safe-top) -
          var(--app-safe-bottom)
      ) *
      0.65
  );
}
#playerTitle {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
}
#playerState {
  font-size: 13px;
  color: var(--muted);
}
#uploadSourceDialog > button {
  display: block;
  width: 100%;
  margin-top: 12px;
}
#confirmError,
#publishError,
#exportError,
#deleteError {
  color: var(--danger);
  font-size: 14px;
  overflow-wrap: anywhere;
}
body.modal-open {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}
dialog textarea,
dialog input:not([type="checkbox"]) {
  scroll-margin: 80px 0 24px;
}
#publishForm,
#confirmation,
#versionTexts,
.version-text,
.version-text label,
.card-swipe-content,
.versions {
  min-width: 0;
  max-width: 100%;
}
/* Permanent owner rule: no focus outlines, rings or focus-triggered borders. */
*:focus,
*:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
@media (min-width: 768px) {
  #videos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
  }
  #videos > .empty {
    grid-column: 1/-1;
  }
  .source-card {
    margin: 0;
  }
  .intro {
    padding-top: 40px;
  }
  .upload-card {
    padding: 28px;
  }
  .drop-zone {
    padding: 32px 16px;
  }
}
@media (max-width: 480px) {
  main {
    padding-left: 16px;
    padding-right: 16px;
  }
  header {
    gap: 10px;
  }
  .eyebrow {
    font-size: 10px;
  }
  .intro {
    padding: 28px 0 24px;
  }
  .intro p {
    font-size: 14px;
  }
  .stats {
    padding: 16px 0;
    margin-bottom: 20px;
  }
  .stats div {
    padding: 0 14px;
  }
  .stats strong {
    font-size: 25px;
  }
  .stats span {
    font-size: 11px;
  }
  section,
  .card {
    padding: 18px;
  }
  .catalog-head .eyebrow {
    display: none;
  }
  .upload-card {
    padding: 18px;
  }
  .drop-zone {
    padding: 24px 12px;
  }
  dialog {
    padding: 18px;
  }
  .dialog-heading {
    top: -18px;
  }
  .section-head h2 {
    font-size: 20px;
  }
  .version {
    padding: 14px;
  }
  .source-head h3 {
    font-size: 16px;
  }
  .source-head .cover-control {
    margin-left: 0;
  }
  #selectionBar {
    gap: 6px;
    padding: 10px;
  }
  #selectionBar .primary {
    padding: 10px;
    font-size: 13px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
