:root {
  color-scheme: dark;
  --page: #050505;
  --panel: #0d0f10;
  --panel-raised: #121516;
  --field: #080a0b;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(242, 193, 61, .34);
  --text: #f5f5f1;
  --muted: #929895;
  --muted-strong: #b7bcb7;
  --gold: #f2c13d;
  --gold-light: #ffe39a;
  --green: #9dd5ad;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; background: var(--page); }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  min-height: 100vh;
  min-height: 100svh;
  color: var(--text);
  background: var(--page);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.main-shell {
  width: min(100% - 36px, 780px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: clamp(22px, 6vh, 64px) 0;
  display: grid;
  align-content: center;
}

.download-panel {
  width: 100%;
  min-width: 0;
  position: relative;
  overflow: hidden;
  padding: clamp(20px, 3.5vw, 34px);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(155deg, #101213 0%, #0b0d0e 48%, #090b0c 100%);
  box-shadow: 0 26px 74px rgba(0, 0, 0, .62), 0 0 0 1px rgba(242, 193, 61, .035), inset 0 1px 0 rgba(255, 255, 255, .055);
  isolation: isolate;
  transition: border-color .28s ease, box-shadow .28s ease;
}
.download-panel::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  left: -38%;
  width: 30%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 227, 154, .9), transparent);
  box-shadow: 0 0 10px rgba(242, 193, 61, .25);
  animation: panelTrace 10s cubic-bezier(.42, 0, .28, 1) infinite;
  pointer-events: none;
}
.download-panel:hover {
  border-color: rgba(242, 193, 61, .48);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .66), 0 0 0 1px rgba(242, 193, 61, .055), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.portal-header {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, .075);
}
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 227, 154, .5);
  border-radius: 8px;
  color: #171306;
  background: linear-gradient(145deg, #ffe39a, #eab12f);
  box-shadow: 0 4px 14px rgba(242, 193, 61, .14), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.brand-mark .icon { width: 16px; height: 16px; stroke-width: 2.1; }
.brand-name { color: #f7f6f0; font-size: 13px; font-weight: 800; letter-spacing: 2px; }
.brand-caption { color: #818782; font-size: 9px; font-weight: 700; letter-spacing: 1.45px; }

.panel-heading { margin: 24px 0 22px; }
.panel-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.35px;
}
.title-indicator { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 11px rgba(242, 193, 61, .48); }
.panel-heading p { margin: 8px 0 0 15px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.field-label, .verification-label {
  display: block;
  margin: 0 0 9px;
  color: #c3c8c1;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .9px;
}

.url-field-wrap {
  min-width: 0;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 9px 0 16px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 11px;
  background: var(--field);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .025), 0 8px 22px rgba(0, 0, 0, .18);
  transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}
.url-field-wrap:focus-within {
  border-color: rgba(255, 211, 91, .78);
  background: #090b0c;
  box-shadow: 0 0 0 3px rgba(242, 193, 61, .085), 0 10px 25px rgba(0, 0, 0, .24);
}
.link-icon { display: grid; place-items: center; color: var(--gold); }
#media-url {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
}
#media-url::placeholder, .verification-input-row input::placeholder { color: #656d69; }
.paste-button {
  height: 38px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid rgba(242, 193, 61, .3);
  border-radius: 8px;
  color: var(--gold-light);
  background: rgba(242, 193, 61, .075);
  font-family: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.paste-button:hover { border-color: rgba(255, 222, 134, .72); background: rgba(242, 193, 61, .14); }
.paste-button:active { transform: scale(.97); }
.paste-button .icon { width: 15px; height: 15px; }

.submit-button {
  position: relative;
  width: 100%;
  height: 50px;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 231, 167, .72);
  border-radius: 9px;
  color: #191407;
  background: linear-gradient(110deg, #e2a923 0%, #ffdf84 50%, #e7b332 100%);
  box-shadow: 0 8px 22px rgba(178, 127, 22, .18), inset 0 1px 0 rgba(255, 255, 255, .62);
  font-family: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  transition: transform .22s cubic-bezier(.2, .7, .2, 1), box-shadow .22s ease, filter .22s ease;
}
.submit-button::after {
  content: "";
  position: absolute;
  inset: -40% auto -40% -44%;
  width: 24%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .52), transparent);
  transform: skewX(-18deg);
  animation: buttonTrace 8.5s cubic-bezier(.42, 0, .28, 1) infinite;
  pointer-events: none;
}
.submit-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 11px 26px rgba(190, 139, 27, .24), inset 0 1px 0 rgba(255, 255, 255, .7); filter: saturate(1.06) brightness(1.025); }
.submit-button:active:not(:disabled) { transform: translateY(0) scale(.995); }
.submit-button:disabled { opacity: .72; cursor: wait; }
.submit-button:disabled::after { animation: none; }
.submit-button .icon { width: 16px; height: 16px; }

.message {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid rgba(220, 85, 85, .26);
  border-radius: 9px;
  color: #f1b5b5;
  background: rgba(110, 32, 32, .16);
  font-size: 12px;
  line-height: 1.55;
}
.message.success { color: #bce6c8; border-color: rgba(139, 210, 165, .24); background: rgba(35, 91, 55, .15); }
.message.info { color: #efdda9; border-color: rgba(242, 193, 61, .24); background: rgba(130, 92, 20, .12); }

.mediafire-verification {
  margin-top: 16px;
  padding: 15px;
  border: 1px solid rgba(242, 193, 61, .22);
  border-radius: 11px;
  background: rgba(242, 193, 61, .045);
}
.verification-heading { display: flex; align-items: center; gap: 9px; color: var(--gold-light); font-size: 13px; }
.verification-heading .icon { width: 17px; height: 17px; }
.mediafire-verification p { margin: 9px 0 11px; color: var(--muted-strong); font-size: 12px; line-height: 1.55; }
.verification-open { display: inline-block; margin-bottom: 15px; color: var(--gold-light); font-size: 12px; text-decoration: none; }
.verification-open:hover { text-decoration: underline; }
.verification-input-row { display: flex; gap: 8px; }
.verification-input-row input {
  min-width: 0;
  flex: 1;
  height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  color: white;
  background: var(--field);
}
.verification-input-row input:focus { border-color: var(--gold); }
.verification-input-row button {
  padding: 0 16px;
  border: 1px solid rgba(242, 193, 61, .45);
  border-radius: 8px;
  color: #171306;
  background: var(--gold);
  font-weight: 750;
  cursor: pointer;
}

.result-card { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .1); }
#result-card:not([hidden]) { animation: resultEnter .34s cubic-bezier(.2, .75, .25, 1) both; }
.result-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 13px;
  color: var(--gold-light);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.15px;
}
.reset-button { padding: 6px 0 6px 10px; border: 0; color: #adb3ad; background: transparent; font-family: inherit;
  font-size: 11px;
  font-weight: 650;
  line-height: 1; cursor: pointer; }
.reset-button:hover { color: var(--gold-light); }
.video-info {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 11px;
  background: rgba(255, 255, 255, .025);
}
.cover-wrap {
  width: 78px;
  height: 78px;
  flex: 0 0 78px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(242, 193, 61, .2);
  border-radius: 8px;
  background: #080a0b;
}
.cover-wrap img { width: 100%; height: 100%; display: block; object-fit: cover; }
.cover-placeholder { display: grid; place-items: center; color: #7f8781; }
.cover-placeholder .icon { width: 25px; height: 25px; }
.video-meta { min-width: 0; flex: 1; }
.video-author { margin-bottom: 4px; color: #909892; font-size: 10px; }
.video-meta h2 { margin: 0; color: #f2f3ed; font-size: 15px; font-weight: 650; line-height: 1.38; overflow-wrap: anywhere; }
.meta-bottom { margin-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.video-duration { color: #909892; font-size: 10px; }
.platform-label {
  padding: 4px 8px;
  border: 1px solid rgba(242, 193, 61, .25);
  border-radius: 5px;
  color: #e9c975;
  background: rgba(242, 193, 61, .06);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .8px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  margin-top: 14px;
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 10px;
  background: rgba(5, 7, 8, .64);
  scrollbar-width: thin;
  scrollbar-color: rgba(242, 193, 61, .35) transparent;
}
.download-table { width: 100%; min-width: 0; border-collapse: collapse; table-layout: fixed; text-align: left; }
.download-table th {
  padding: 12px 13px;
  color: #aeb5ae;
  background: #151819;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .95px;
  white-space: nowrap;
}
.download-table td {
  padding: 11px 13px;
  border-top: 1px solid rgba(255, 255, 255, .065);
  color: #d9ddd6;
  font-size: 11px;
  overflow-wrap: anywhere;
}
.download-table tbody tr { transition: background-color .2s ease; }
.download-table tbody tr:hover { background: rgba(242, 193, 61, .045); }
.type-cell { display: inline-flex; align-items: center; gap: 8px; color: #f1f2ec; font-weight: 650; }
.type-cell .icon { width: 15px; height: 15px; color: var(--gold); }
.table-download {
  min-width: 98px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(242, 193, 61, .34);
  border-radius: 7px;
  color: var(--gold-light);
  background: rgba(242, 193, 61, .075);
  font-family: inherit;
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
  cursor: pointer;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.table-download .icon { width: 14px; height: 14px; }
.table-download:hover:not(:disabled) {
  transform: translateY(-1px);
  color: #181306;
  border-color: #ffdf82;
  background: var(--gold);
  box-shadow: 0 5px 14px rgba(193, 143, 27, .14);
}
.table-download:disabled { opacity: .6; cursor: wait; }
.table-download-primary { color: #181306; border-color: rgba(255, 226, 151, .72); background: linear-gradient(110deg, #f5c64a, #ffdf83); }

.photo-table-section { margin-top: 17px; }
.photo-table-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  color: var(--gold-light);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.05px;
}
.photo-table-heading span { color: #9ea69f; font-weight: 550; letter-spacing: 0; }
.photo-table th, .photo-table td { padding: 8px 10px; }
.photo-table-preview {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(242, 193, 61, .18);
  border-radius: 7px;
  background: #080a0b;
}
.photo-table-link { color: var(--gold-light); font-size: 11px; text-decoration: none; }
.photo-table-link:hover { text-decoration: underline; }
.photo-table-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.photo-table-unavailable { color: #89928c; font-size: 10px; }
.photo-media-type {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border: 1px solid rgba(242, 193, 61, .25);
  border-radius: 6px;
  color: var(--gold-light);
  background: rgba(242, 193, 61, .07);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .3px;
}

button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }

@keyframes panelTrace {
  0%, 12% { left: -38%; opacity: 0; }
  24% { opacity: .7; }
  70% { opacity: .35; }
  88%, 100% { left: 112%; opacity: 0; }
}
@keyframes buttonTrace {
  0%, 18% { left: -44%; opacity: 0; }
  28% { opacity: .58; }
  58% { opacity: .28; }
  78%, 100% { left: 124%; opacity: 0; }
}
@keyframes resultEnter {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rowEnter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
#result-card:not([hidden]) .download-table tbody tr:not([hidden]) {
  animation: rowEnter .26s ease-out both;
  animation-delay: calc(var(--row-order, 0) * 45ms);
}

@media (max-width: 560px) {
  .main-shell { width: calc(100% - 24px); padding: 18px 0; }
  .download-panel { padding: 18px 14px; border-radius: 14px; }
  .portal-header { padding-bottom: 15px; }
  .brand-mark { width: 28px; height: 28px; }
  .brand-caption { font-size: 8px; letter-spacing: 1px; }
  .panel-heading { margin: 20px 0 18px; }
  .panel-heading p { font-size: 11px; }
  .url-field-wrap { height: 53px; gap: 8px; padding-left: 11px; }
  #media-url { font-size: 12px; }
  .paste-button { height: 35px; padding: 0 9px; font-size: 10px; }
  .submit-button { height: 47px; }
  .video-info { gap: 10px; padding: 9px; }
  .cover-wrap { width: 62px; height: 62px; flex-basis: 62px; }
  .video-meta h2 { font-size: 13px; }
  .download-table th { padding: 9px 5px; font-size: 7px; letter-spacing: .45px; white-space: normal; }
  .download-table td { padding: 8px 5px; font-size: 9px; }
  .download-table th:nth-child(1), .download-table td:nth-child(1) { width: 27%; }
  .download-table th:nth-child(2), .download-table td:nth-child(2) { width: 15%; }
  .download-table th:nth-child(3), .download-table td:nth-child(3) { width: 23%; }
  .download-table th:nth-child(4), .download-table td:nth-child(4) { width: 35%; }
  .type-cell { gap: 4px; font-size: 9px; }
  .type-cell .icon { width: 13px; height: 13px; }
  .table-download { width: 100%; min-width: 0; height: 31px; gap: 4px; padding: 0 4px; font-size: 9px; }
  .table-download .icon { width: 12px; height: 12px; }
  .photo-table th:nth-child(1), .photo-table td:nth-child(1) { width: 27%; }
  .photo-table th:nth-child(2), .photo-table td:nth-child(2) { width: 38%; }
  .photo-table th:nth-child(3), .photo-table td:nth-child(3) { width: 35%; }
  .photo-table th, .photo-table td { padding: 7px 5px; }
  .photo-table-preview { width: 36px; height: 36px; }
  .photo-table-link { font-size: 10px; }
  .photo-media-type { min-height: 23px; padding: 0 5px; font-size: 8px; }
  .verification-input-row { flex-direction: column; }
  .verification-input-row input, .verification-input-row button { width: 100%; min-height: 41px; }
}

@media (max-width: 360px) {
  .main-shell { width: calc(100% - 18px); }
  .download-panel { padding-inline: 11px; }
  .download-table th, .download-table td { padding-inline: 4px; }
  .type-cell { gap: 3px; font-size: 8px; }
  .table-download { font-size: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
