@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap');

:root {
  --bg: #070b1a;
  --card: #111729;
  --panel: #171d31;
  --panel-strong: #1d243a;
  --line: rgba(178, 192, 235, 0.11);
  --text: #f3f5ff;
  --muted: #97a1c0;
  --muted-2: #6e7899;
  --blue: #4c76ff;
  --purple: #743df1;
  --cyan: #5ae7ff;
  --success: #8bf0c4;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  font-family: 'DM Sans', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { min-width: 320px; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 0%, rgba(39, 76, 164, 0.13), transparent 28rem),
    radial-gradient(circle at 96% 92%, rgba(111, 48, 255, 0.18), transparent 27rem),
    var(--bg);
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  z-index: -1;
  width: 30rem;
  height: 30rem;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.18;
}

.ambient-left { top: -18rem; left: -14rem; background: #2858d8; }
.ambient-right { right: -16rem; bottom: -20rem; background: #7029dc; }

.page-shell {
  width: min(100% - 32px, 720px);
  margin: 22px auto 60px;
}

.app-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(146, 166, 232, 0.12);
  border-radius: var(--radius-xl);
  background: linear-gradient(145deg, rgba(19, 27, 49, 0.98), rgba(12, 17, 32, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255,255,255,0.025);
}

.brand-bar,
.footer-note,
.panel-heading,
.upload-dropzone,
.quick-link-row {
  display: flex;
  align-items: center;
}

.brand-bar {
  justify-content: space-between;
  padding: 2px 4px 17px;
}

.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(135, 158, 255, 0.3);
  border-radius: 11px;
  color: #dfe5ff;
  background: linear-gradient(145deg, #315cf6, #7841ec);
  box-shadow: 0 8px 20px rgba(71, 77, 235, 0.25);
  font-family: 'Manrope', sans-serif;
  font-size: 19px;
  font-weight: 800;
}

.brand-name {
  margin: 0;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.025em;
}
.brand-tagline { margin: 2px 0 0; color: var(--muted-2); font-size: 10px; }
.free-badge {
  padding: 5px 8px;
  border: 1px solid rgba(139, 240, 196, 0.2);
  border-radius: 999px;
  color: var(--success);
  background: rgba(139, 240, 196, 0.07);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.hero-preview {
  position: relative;
  overflow: hidden;
  padding: 25px 25px 19px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--radius-lg);
  background: linear-gradient(125deg, #2e5af0 0%, #4b48ee 54%, #7738ed 100%);
  box-shadow: 0 15px 36px rgba(53, 69, 221, 0.23);
  text-align: center;
}

.hero-preview::before,
.hero-preview::after {
  position: absolute;
  border-radius: 50%;
  content: '';
  pointer-events: none;
}
.hero-preview::before { top: -120px; right: -75px; width: 260px; height: 260px; background: rgba(255,255,255,0.08); }
.hero-preview::after { bottom: -150px; left: -80px; width: 260px; height: 260px; background: rgba(36, 35, 171, 0.18); }

.hero-copy, .preview-media, .primary-cta, .destination-preview, .quick-links-preview { position: relative; z-index: 1; }
.preview-kicker { color: rgba(242, 246, 255, 0.82); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; }
.spark { color: #ffd85e; margin-right: 4px; }
.hero-preview h1 {
  max-width: 540px;
  margin: 8px auto 5px;
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(23px, 4.7vw, 33px);
  font-weight: 800;
  letter-spacing: -0.055em;
  line-height: 1.08;
}
.hero-subtitle { margin: 0; color: rgba(244, 246, 255, 0.72); font-size: 12px; }

.preview-media {
  display: grid;
  width: min(100%, 390px);
  min-height: 116px;
  margin: 18px auto 15px;
  place-items: center;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.45);
  border-radius: 14px;
  background: rgba(8, 18, 84, 0.23);
}
.preview-media img { display: block; width: 100%; max-height: 210px; object-fit: cover; }
.media-placeholder { display: grid; gap: 5px; place-items: center; padding: 18px; color: rgba(246, 248, 255, 0.68); font-size: 11px; }
.media-icon { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid rgba(255,255,255,0.35); border-radius: 50%; color: #fff; font-size: 18px; }

.primary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 190px;
  max-width: 100%;
  padding: 11px 17px;
  border: 0;
  border-radius: 10px;
  color: #17203c;
  background: #ffffff;
  box-shadow: 0 8px 19px rgba(15, 23, 74, 0.2);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.primary-cta:hover { transform: translateY(-2px); box-shadow: 0 11px 24px rgba(15, 23, 74, 0.3); }
.primary-cta.is-disabled { cursor: not-allowed; opacity: 0.62; }
.cta-arrow { color: #4f55ef; font-size: 16px; }
.destination-preview { min-height: 16px; margin: 9px 0 0; overflow: hidden; color: rgba(241, 244, 255, 0.66); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.quick-links-preview { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 14px; }
.quick-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 160px;
  padding: 6px 9px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: rgba(248, 249, 255, 0.84);
  background: rgba(14, 24, 90, 0.23);
  font-size: 10px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quick-pill:hover { background: rgba(255,255,255,0.14); }
.quick-pill::before { width: 5px; height: 5px; border-radius: 50%; background: #9ef5ff; content: ''; }

.panel {
  margin-top: 12px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(24, 30, 50, 0.84);
}
.panel-heading { justify-content: space-between; gap: 16px; }
.section-eyebrow { margin: 0 0 3px; color: #7282ba; font-size: 9px; font-weight: 700; letter-spacing: 0.13em; }
.panel h2 { margin: 0; color: #f0f3ff; font-family: 'Manrope', sans-serif; font-size: 14px; letter-spacing: -0.025em; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-2); font-size: 10px; white-space: nowrap; }
.status-dot span { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 10px rgba(139, 240, 196, 0.8); }

.upload-row { margin-top: 16px; }
.upload-dropzone {
  position: relative;
  gap: 11px;
  min-height: 67px;
  padding: 11px 12px;
  border: 1px dashed rgba(129, 151, 225, 0.35);
  border-radius: var(--radius-md);
  background: rgba(8, 13, 29, 0.24);
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease;
}
.upload-dropzone:hover, .upload-dropzone.is-dragover { border-color: #7b96ff; background: rgba(61, 88, 215, 0.12); }
.upload-dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-icon { display: grid; width: 33px; height: 33px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(121, 150, 255, 0.32); border-radius: 10px; color: #a6bbff; background: rgba(61, 92, 218, 0.18); font-size: 20px; }
.upload-dropzone strong, .upload-dropzone small { display: block; }
.upload-dropzone strong { color: #e9edff; font-size: 12px; }
.upload-dropzone small { margin-top: 4px; color: var(--muted-2); font-size: 10px; }
.browse-label { margin-left: auto; padding: 7px 10px; border: 1px solid rgba(162, 177, 226, 0.17); border-radius: 8px; color: #b9c4ec; background: rgba(255,255,255,0.05); font-size: 10px; font-weight: 700; }
.file-status { margin: 7px 2px 0; color: var(--muted-2); font-size: 10px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.field { display: grid; gap: 7px; }
.field-wide { grid-column: 1 / -1; }
.field > span { color: #aeb8dc; font-size: 10px; font-weight: 700; }
.field input,
.quick-link-row input {
  width: 100%;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(144, 161, 216, 0.15);
  border-radius: 9px;
  outline: none;
  color: #eef1ff;
  background: rgba(8, 13, 29, 0.5);
  font-size: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field input::placeholder, .quick-link-row input::placeholder { color: #596483; }
.field input:focus, .quick-link-row input:focus { border-color: rgba(107, 139, 255, 0.8); box-shadow: 0 0 0 3px rgba(75, 108, 255, 0.13); }
.field input.is-invalid, .quick-link-row input.is-invalid { border-color: #ff7997; box-shadow: 0 0 0 3px rgba(255, 121, 151, 0.1); }
.field-hint { color: var(--muted-2); font-size: 9px; }
.validation-message { min-height: 15px; margin: 9px 1px 0; color: #ffb9c7; font-size: 10px; }

.publish-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.publish-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 10px 14px;
  border: 1px solid rgba(150, 177, 255, 0.32);
  border-radius: 9px;
  color: #ffffff;
  background: linear-gradient(110deg, #416bfa, #713cf0);
  box-shadow: 0 8px 20px rgba(47, 69, 203, 0.22);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease;
}
.publish-button:hover { filter: brightness(1.1); transform: translateY(-1px); }
.publish-button:disabled { cursor: wait; opacity: 0.66; transform: none; }
.publish-error { min-height: 13px; margin: 0; color: #ffb9c7; font-size: 10px; }

.share-panel { border-color: rgba(139, 240, 196, 0.18); background: linear-gradient(145deg, rgba(24, 40, 55, 0.9), rgba(19, 29, 45, 0.9)); }
.share-check { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid rgba(139, 240, 196, 0.32); border-radius: 50%; color: var(--success); background: rgba(139, 240, 196, 0.09); font-size: 13px; }
.share-row { display: flex; align-items: stretch; gap: 8px; }
.share-url { flex: 1; min-width: 0; padding: 9px 10px; border: 1px solid rgba(139, 240, 196, 0.18); border-radius: 9px; outline: none; color: #dfffee; background: rgba(7, 18, 25, 0.42); font-size: 10px; }
.copy-button { padding: 0 13px; border: 1px solid rgba(139, 240, 196, 0.26); border-radius: 9px; color: #b8f6d7; background: rgba(139, 240, 196, 0.1); font-size: 10px; font-weight: 800; cursor: pointer; }
.copy-button:hover { background: rgba(139, 240, 196, 0.17); }
.share-open-link { display: inline-block; margin-top: 11px; color: #9ef5ff; font-size: 10px; font-weight: 700; text-decoration: none; }
.share-open-link:hover { color: #ffffff; }

.catalog-viewer { min-height: 100vh; }
.catalog-header { padding: 39px 18px 24px; border-bottom: 2px solid #ec1b32; text-align: center; }
.catalog-wordmark { margin: 0; color: #ffffff; font-family: 'Manrope', sans-serif; font-size: clamp(25px, 7vw, 37px); font-weight: 800; letter-spacing: -0.055em; }
.catalog-wordmark span:first-child { color: #f6f6f6; }
.catalog-wordmark .wordmark-accent { color: #ed1c35; }
.catalog-tagline { margin: 8px 0 0; color: #777777; font-size: 12px; }
.catalog-promise { margin: 25px 0 0; color: #e2e2e2; font-size: clamp(15px, 4vw, 20px); }
.catalog-search-row { display: flex; align-items: center; gap: 13px; padding: 31px 18px 21px; }
.catalog-search-box { display: flex; align-items: center; flex: 1; gap: 8px; min-width: 0; padding: 12px 16px; border: 1px solid #3a3a3a; border-radius: 999px; background: #1b1b1b; }
.catalog-search-box > span { color: #8f8f8f; font-size: 22px; line-height: 0.7; }
.catalog-search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: #e9e9e9; background: transparent; font-size: 14px; }
.catalog-search-box input::placeholder { color: #777777; }
.catalog-search-button { padding: 13px 21px; border: 0; border-radius: 999px; color: #ffffff; background: #ed1c2f; font-size: 14px; font-weight: 800; cursor: pointer; }
.catalog-search-button:hover { background: #ff2940; }
.telegram-banner { display: block; margin: 0 18px 28px; padding: 13px 16px; border-radius: 999px; color: #ffffff; background: #129bdc; font-size: 15px; font-weight: 800; text-align: center; text-decoration: none; }
.telegram-banner:hover { background: #21abea; }
.story-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; padding: 0 18px; }
.story-card { overflow: hidden; border-radius: 17px; background: #1c1c1c; box-shadow: 0 11px 22px rgba(0, 0, 0, 0.28); }
.story-image { display: block; width: 100%; aspect-ratio: 0.68; object-fit: cover; background: #232323; }
.story-content { padding: 13px 15px 15px; }
.story-content h2 { display: -webkit-box; overflow: hidden; margin: 0; color: #f1f1f1; font-size: 14px; font-weight: 800; line-height: 1.35; line-clamp: 1; -webkit-box-orient: vertical; -webkit-line-clamp: 1; }
.story-meta { margin: 11px 0 12px; color: #898989; font-size: 11px; }
.story-button { display: block; padding: 8px 10px; border-radius: 8px; color: #ffffff; background: #ed1c2f; font-size: 11px; font-weight: 800; text-align: center; text-decoration: none; }
.story-button:hover { background: #ff2940; }
.catalog-empty { grid-column: 1 / -1; margin: 38px 0; color: #8e8e8e; font-size: 14px; text-align: center; }

.viewer-mode { background: #0b0b0b; }
.viewer-mode .page-shell { width: min(100%, 720px); margin: 0 auto; }
.viewer-mode .app-card { max-width: 720px; padding: 0 0 20px; border: 0; border-radius: 0; background: #0b0b0b; box-shadow: none; }
.viewer-mode .hero-preview { margin-bottom: 12px; }
.viewer-mode .footer-note { justify-content: center; }

.compact-heading { margin-bottom: 8px; }
.panel-icon { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid rgba(141, 163, 232, 0.2); border-radius: 8px; color: #9eb2ff; background: rgba(84, 112, 231, 0.12); font-size: 13px; }
.panel-description { margin: 0 0 13px; color: var(--muted-2); font-size: 10px; line-height: 1.55; }
.quick-link-editor { display: grid; gap: 8px; }
.quick-link-row { gap: 8px; }
.quick-label { flex: 0 0 27%; }
.quick-url { flex: 1; }
.quick-link-row input { padding: 8px 9px; font-size: 10px; }

.disclaimer { display: flex; align-items: flex-start; gap: 10px; background: rgba(15, 20, 36, 0.7); }
.disclaimer-mark { display: grid; width: 21px; height: 21px; flex: 0 0 auto; place-items: center; border: 1px solid rgba(130, 157, 238, 0.27); border-radius: 50%; color: #a9b9f0; font-family: Georgia, serif; font-size: 12px; }
.disclaimer h2 { margin: 0 0 5px; color: #dce3ff; font-size: 11px; }
.disclaimer p { margin: 0; color: var(--muted-2); font-size: 10px; line-height: 1.58; }

.footer-note { justify-content: space-between; gap: 12px; padding: 15px 3px 1px; color: #626d8d; font-size: 9px; }
.reset-button { padding: 0; border: 0; color: #7d8cc0; background: transparent; font-size: 9px; cursor: pointer; }
.reset-button:hover { color: #b5c2f5; }

@media (max-width: 570px) {
  .page-shell { width: min(100% - 18px, 720px); margin-top: 9px; }
  .app-card { padding: 12px; border-radius: 20px; }
  .hero-preview { padding: 21px 16px 16px; }
  .panel { padding: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .quick-label { flex-basis: 31%; }
  .upload-dropzone { align-items: flex-start; }
  .browse-label { margin-top: 2px; }
}

@media (max-width: 390px) {
  .brand-tagline { display: none; }
  .upload-dropzone small { max-width: 150px; line-height: 1.3; }
  .browse-label { padding-inline: 8px; }
  .quick-link-row { display: grid; grid-template-columns: 34% 1fr; }
}
