/* ═══════════════════════════════════════════════════════════════
 *  RED OAKER GUILD — DESIGN SYSTEM

 * ═══════════════════════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,700;1,400&family=Special+Elite&display=swap');

:root {
  --red: #8b0000;
  --red-b: #cc0000;
  --red-m: #ff4d4d;
  --red-g: #ff1a1a;
  --red-d: #5c0000;
  --blk: #000;
  --blk-s: #0a0a0a;
  --blk-c: #111;
  --blk-p: #1a1a1a;
  --blk-e: #222;
  --wht: #fff;
  --wht-m: #ccc;
  --wht-d: #b3b3b3;
  --wht-f: #8a8a8a;
  --font-m: 'IBM Plex Mono', monospace;
  --font-d: 'Special Elite', monospace;
  --tr: .15s ease;
  /* Alias variables kept for pages that used older token names */
  --blk-b: var(--blk);
  --blk-m: var(--blk-p);
  --blk-d: var(--blk-e);
  --wht-b: var(--wht);
  --font-h: var(--font-d);
  color-scheme: dark;
}

/* Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--red) var(--blk);
  background: var(--blk);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-m);
  background: var(--blk);
  color: var(--wht-m);
  line-height: 1.7;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto
}

iframe {
  max-width: 100%
}

table {
  max-width: 100%
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit
}

button,
[type='button'],
[type='submit'] {
  touch-action: manipulation
}

::-webkit-scrollbar {
  width: 8px
}

::-webkit-scrollbar-track {
  background: var(--blk)
}

::-webkit-scrollbar-thumb {
  background: var(--red-d)
}

::-webkit-scrollbar-thumb:hover {
  background: var(--red)
}

html.terminal-active,
body.terminal-active {
  overflow: hidden
}

html.terminal-active::-webkit-scrollbar,
body.terminal-active::-webkit-scrollbar {
  width: 0;
  height: 0
}

html.terminal-active,
body.terminal-active {
  scrollbar-width: none
}

/* Links */
a {
  color: var(--red-b);
  text-decoration: none;
  transition: color var(--tr)
}

a:hover {
  color: var(--red-g);
  text-decoration: underline
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--red-g);
  outline-offset: 2px
}

/* Headings */
h1,
h2,
h3 {
  font-family: var(--font-d);
  color: var(--wht);
  letter-spacing: 1px;
  text-transform: uppercase
}

h1 {
  font-size: 2rem;
  margin-bottom: 24px
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--red-d);
  padding-bottom: 8px
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 8px
}

hr {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
  margin: 32px 0
}

/* Layout */
.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 16px
}

.section {
  margin-bottom: 64px;
  padding: 24px;
  border: 1px solid var(--red-d);
  background: var(--blk-s);
  position: relative
}

.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--red)
}

.section-hd {
  font-family: var(--font-d);
  font-size: 1.3rem;
  color: var(--red-b);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--red-d)
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 24px;
  font-family: var(--font-m);
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: 2px solid;
  cursor: pointer;
  transition: all var(--tr);
  text-decoration: none;
  background: transparent
}

.btn-p {
  color: var(--red-b);
  border-color: var(--red-b)
}

.btn-p:hover {
  background: var(--red-b);
  color: var(--blk);
  text-decoration: none;
  box-shadow: 0 0 15px rgba(204, 0, 0, .4)
}

.btn-s {
  color: var(--wht-m);
  border-color: var(--wht-d)
}

.btn-s:hover {
  background: var(--wht-m);
  color: var(--blk);
  text-decoration: none
}

.btn-d {
  color: var(--red-g);
  border-color: var(--red-g)
}

.btn-d:hover {
  background: var(--red-g);
  color: var(--blk);
  text-decoration: none
}

.btn-sm {
  padding: 4px 16px;
  font-size: .75rem
}

/* Grid */
.g2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px
}

.g3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px
}

@media(max-width:768px) {

  .g2,
  .g3 {
    grid-template-columns: 1fr
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Cards */
.card {
  border: 1px solid var(--red-d);
  padding: 16px;
  background: var(--blk-c);
  transition: border-color var(--tr), box-shadow var(--tr)
}

.card:hover {
  border-color: var(--red-b);
  box-shadow: 0 0 8px rgba(139, 0, 0, .3)
}

.card-t {
  font-family: var(--font-m);
  font-weight: 700;
  color: var(--wht);
  font-size: .95rem;
  margin-bottom: 8px
}

.card-m {
  font-size: .75rem;
  color: var(--wht-d);
  margin-bottom: 8px
}

.card-b {
  font-size: .85rem;
  color: var(--wht-m);
  line-height: 1.6
}

/* Tags */
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: .7rem;
  font-family: var(--font-m);
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 1px solid var(--red-d);
  color: var(--red-b);
  margin-right: 4px;
  margin-bottom: 4px
}

/* Header */
.hdr {
  border-bottom: 1px solid rgba(139, 0, 0, .45);
  padding: 10px 0 14px;
  background: linear-gradient(180deg, rgba(16, 16, 16, .98), rgba(8, 8, 8, .94));
  position: sticky;
  top: 0;
  z-index: 220;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .28);
  transition: transform .24s ease, border-color .24s ease, box-shadow .24s ease
}

.hdr.is-collapsed {
  transform: translateY(calc(-100% + 10px));
  border-color: rgba(139, 0, 0, .65);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35)
}

.hdr-in {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  position: relative
}

.hdr-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  text-decoration: none
}

.hdr-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--red);
  object-fit: cover
}

.hdr-title {
  font-family: var(--font-d);
  font-size: 1.2rem;
  color: var(--red-b);
  text-transform: uppercase;
  letter-spacing: 3px
}

.nav {
  display: flex;
  gap: 20px;
  list-style: none;
  align-items: center;
  flex: 1;
  justify-content: flex-end;
  margin-left: 22px
}

.nav a {
  font-family: var(--font-m);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--wht-d);
  padding: 10px 0;
  border-bottom: 2px solid transparent;
  transition: all var(--tr)
}

.nav a:hover,
.nav a.active {
  color: var(--red-b);
  border-bottom-color: var(--red-b);
  text-decoration: none
}

.nav-btn {
  font-family: var(--font-m);
  font-size: .68rem;
  padding: 7px 12px;
  border: 1px solid var(--red-d);
  background: transparent;
  color: var(--red-b);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .8px;
  transition: all var(--tr);
  min-height: 36px
}

.nav-btn,
.btn,
.file-tile,
.upvote-button,
.back-to-top,
.community-result {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent
}

.nav-btn:hover {
  background: var(--red);
  color: var(--wht)
}

.nav-toggle {
  position: absolute;
  left: 50%;
  bottom: -14px;
  transform: translateX(-50%);
  width: 15px;
  height: 8px;
  min-width: 15px;
  min-height: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  cursor: pointer;
  z-index: 260;
  line-height: 1;
  font-size: 0;
  display: block
}

.nav-toggle::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 8px solid var(--red-b);
  transition: transform .22s ease, opacity .22s ease
}

.nav-toggle:hover::before,
.nav-toggle:focus-visible::before {
  opacity: .85
}

.hdr.is-collapsed .nav-toggle::before {
  transform: rotate(180deg)
}

.hdr.is-collapsed .nav {
  opacity: 0;
  pointer-events: none
}

.hdr.is-collapsed .hdr-title,
.hdr.is-collapsed .hdr-logo {
  opacity: .05
}

.user-menu {
  position: relative;
  display: inline-block
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px
}

.user-menu-caret {
  font-size: .65rem;
  line-height: 1;
  opacity: .8
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--blk-s);
  border: 1px solid var(--red-d);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  padding: 6px;
  display: none;
  z-index: 250
}

.user-menu.open .user-menu-panel {
  display: block
}

.user-menu-setting {
  padding: 8px 10px;
  border: 1px solid var(--blk-d);
  margin: 4px 0 6px;
  background: rgba(0, 0, 0, .25)
}

.user-menu-setting-label {
  display: block;
  font-family: var(--font-m);
  font-size: .66rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--wht-f);
  margin-bottom: 6px
}

.user-menu-setting-select {
  width: 100%;
  background: var(--blk-b);
  border: 1px solid var(--red-d);
  color: var(--wht-d);
  padding: 7px 9px;
  font-family: var(--font-m);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .9px;
  min-height: 36px
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--wht-d);
  font-family: var(--font-m);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: left;
  cursor: pointer;
  transition: all var(--tr)
}

.user-menu-item:hover {
  background: var(--red);
  color: var(--wht);
  border-color: var(--red)
}

.admin-menu {
  position: relative;
  display: inline-block
}

.admin-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px
}

.admin-menu-caret {
  font-size: .65rem;
  line-height: 1;
  opacity: .8
}

.admin-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--blk-s);
  border: 1px solid var(--red-d);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  padding: 6px;
  display: none;
  z-index: 250
}

.admin-menu.open .admin-menu-panel {
  display: block
}

.admin-menu-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--wht-d);
  font-family: var(--font-m);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: left;
  cursor: pointer;
  transition: all var(--tr)
}

.admin-menu-item:hover {
  background: var(--red);
  color: var(--wht);
  border-color: var(--red)
}

@media(min-width:769px) {
  .nav {
    gap: 20px;
    opacity: 1;
    transition: opacity .22s ease
  }

  .nav li {
    display: flex;
    justify-content: flex-end;
    flex: 0 0 auto;
    min-width: 0
  }

  .nav a {
    text-align: center
  }

  #nav-auth {
    justify-content: flex-end;
    flex: 0 0 auto
  }
}

@media(max-width:768px) {
  .hdr {
    padding: 10px 0 12px
  }

  .hdr-brand {
    max-width: 56%
  }

  .hdr-title {
    font-size: .92rem;
    letter-spacing: 1.2px
  }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--blk-s);
    border-top: 1px solid var(--red-d);
    border-bottom: 1px solid var(--red-d);
    flex-direction: column;
    gap: 0;
    margin-left: 0;
    padding: 0;
    z-index: 250
  }

  .nav.open {
    display: flex
  }

  .nav li {
    width: 100%;
    display: flex;
    justify-content: stretch
  }

  .nav a {
    display: block;
    width: 100%;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid var(--blk-m);
    border-bottom-color: transparent;
    transition: all var(--tr)
  }

  .nav a:hover,
  .nav a.active {
    border-bottom-color: var(--red-b);
    background: rgba(139, 0, 0, .08)
  }

  .nav-btn {
    display: block;
    width: 100%;
    text-align: left;
    min-height: 44px;
    padding: 14px 16px;
    margin: 0;
    border: none;
    border-bottom: 1px solid var(--blk-m);
    background: transparent;
    color: var(--red-b)
  }

  .nav-btn:hover {
    background: rgba(139, 0, 0, .08)
  }

  .hdr .nav-toggle {
    position: static !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 8px;
    border: 0;
    background: transparent;
    color: var(--red-b) !important;
    cursor: pointer;
    z-index: 260;
    font-size: 24px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-left: auto;
    line-height: 1
  }

  .hdr .nav-toggle::before {
    display: none !important
  }

  .nav-toggle:active {
    background: rgba(139, 0, 0, .1)
  }

  .user-menu {
    width: 100%
  }

  .user-menu-panel {
    position: static;
    min-width: 0;
    margin-top: 8px;
    width: 100%;
    padding: 10px
  }

  .user-menu-trigger {
    width: 100%;
    justify-content: space-between
  }

  .user-menu-setting {
    margin: 0 0 8px;
    padding: 10px
  }

  .user-menu-setting-select {
    min-height: 44px;
    font-size: .78rem
  }

  .admin-menu {
    width: 100%
  }

  .admin-menu-panel {
    position: static;
    min-width: 0;
    margin-top: 8px;
    width: 100%;
    padding: 10px
  }

  .admin-menu-trigger {
    width: 100%;
    justify-content: space-between
  }

  .admin-menu-item {
    font-size: .8rem;
    padding: 12px 14px
  }
}

.submit-alert-open {
  overflow: hidden
}

.submit-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 420;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, .82);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px)
}

.submit-alert-modal {
  width: min(100%, 420px);
  border: 1px solid var(--red-d);
  background: linear-gradient(180deg, rgba(14, 14, 14, .99), rgba(6, 6, 6, .99));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .65), 0 0 0 1px rgba(204, 0, 0, .08) inset;
  padding: 18px 18px 16px
}

.submit-alert-head {
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px dashed var(--red-d)
}

.submit-alert-kicker {
  font-family: var(--font-m);
  font-size: .65rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--red-b);
  margin-bottom: 6px
}

.submit-alert-head h3 {
  margin: 0;
  border: none;
  font-size: 1.05rem
}

.submit-alert-body {
  font-size: .84rem;
  line-height: 1.8;
  color: var(--wht-d)
}

.submit-alert-body p {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word
}

.submit-alert-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 1200;
  background: var(--red-b);
  color: var(--blk);
  padding: 10px 14px;
  border-radius: 4px;
  border: 1px solid var(--red-d);
  font-family: var(--font-m);
  font-size: .78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: top .12s ease
}

.skip-link:focus {
  top: 12px;
  color: var(--blk);
  text-decoration: none
}

.back-to-top {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 180;
  background: var(--blk-s);
  color: var(--wht);
  border: 1px solid var(--red-d);
  min-height: 44px;
  min-width: 44px;
  border-radius: 999px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  font-size: .95rem
}

.back-to-top.show {
  display: flex
}

.back-to-top:hover {
  background: var(--red);
  color: var(--wht)
}

/* Footer */
.ftr {
  border-top: 2px solid var(--red);
  padding: 32px 0;
  margin-top: 64px;
  text-align: center;
  background: var(--blk-s)
}

.ftr-in {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left))
}

.ftr-links {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  margin-bottom: 16px
}

.ftr-links a {
  font-family: var(--font-m);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--wht-d)
}

.ftr-links a:hover {
  color: var(--red-b)
}

.ftr-copy {
  font-size: .7rem;
  color: var(--wht-f)
}

/* Warning Banner */
.warn {
  text-align: center;
  padding: 48px 24px;
  border: 3px solid var(--red-b);
  background: linear-gradient(180deg, rgba(139, 0, 0, .15), var(--blk));
  margin-bottom: 64px;
  position: relative;
  overflow: hidden
}

.warn::before {
  content: '⚠';
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 6rem;
  opacity: .06;
  color: var(--red-b)
}

.warn h2 {
  font-family: var(--font-d);
  font-size: 1.8rem;
  color: var(--red-g);
  letter-spacing: 4px;
  border: none;
  margin-bottom: 24px;
  animation: pulse 3s ease-in-out infinite
}

.warn .bgrp {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap
}

@keyframes pulse {

  0%,
  100% {
    text-shadow: 0 0 10px rgba(255, 26, 26, .3)
  }

  50% {
    text-shadow: 0 0 25px rgba(255, 26, 26, .6), 0 0 50px rgba(255, 26, 26, .2)
  }
}

/* Intro */
.intro {
  text-align: center;
  padding: 0 24px 64px;
  border-bottom: 1px solid var(--red-d);
  margin-bottom: 48px
}

.intro-hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px 48px;
  margin-bottom: 24px
}

.intro-logo {
  width: 280px;
  height: 280px;
  object-fit: contain;
  opacity: .25;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 0 40px rgba(139, 0, 0, .4))
}

.intro-t {
  font-family: var(--font-d);
  font-size: 2.8rem;
  color: var(--wht);
  letter-spacing: 8px;
  margin-bottom: 0;
  text-shadow: 0 0 40px rgba(139, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .9);
  position: relative;
  z-index: 1
}

.intro-cl {
  font-family: var(--font-m);
  font-size: .7rem;
  color: var(--red-b);
  letter-spacing: 6px;
  text-transform: uppercase;
  margin-bottom: 16px
}

.intro-r {
  width: 120px;
  height: 2px;
  background: var(--red);
  margin: 24px auto
}

.intro-sub {
  font-size: .9rem;
  color: var(--wht-d);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8
}

@media(max-width:768px) {
  .intro-hero {
    padding: 48px 16px 32px
  }

  .intro-logo {
    width: 180px;
    height: 180px
  }

  .intro-t {
    font-size: 1.6rem;
    letter-spacing: 4px
  }

  .intro-cl {
    font-size: .6rem;
    letter-spacing: 4px
  }
}

@media (max-width: 768px) {
  .file-grid {
    grid-template-columns: 1fr 1fr
  }

  .file-tile {
    min-height: 96px
  }

  .editor-shell-head {
    flex-direction: column;
    align-items: stretch
  }

  .editor-shell-head>div:last-child {
    width: 100%;
    display: flex;
    flex-direction: column
  }

  .editor-shell-head .btn {
    width: 100%
  }

  .doc-toolbar {
    position: static;
    top: auto
  }

  .doc-toolbar .btn,
  .doc-toolbar .fi {
    width: 100%;
    max-width: none
  }

  .tag-picker-tools {
    flex-direction: column;
    align-items: stretch
  }

  .tag-picker-tools .fi {
    min-width: 0
  }

  .mode-btn,
  .tpl-card {
    min-height: 104px
  }

  .mode-btn:hover,
  .tpl-card:hover,
  .file-tile:hover {
    transform: none
  }

  .submit-bar {
    gap: 12px
  }

  .submit-bar .btn {
    min-height: 44px
  }
}

@media (hover: none) and (pointer: coarse) {

  .btn:hover,
  .nav-btn:hover,
  .mode-btn:hover,
  .tpl-card:hover,
  .file-tile:hover,
  .tag-option:hover,
  .review-upload-item:hover img {
    transform: none;
    box-shadow: none
  }
}

@media (max-width: 480px) {
  .file-grid {
    grid-template-columns: 1fr
  }

  .submit-alert-overlay {
    padding: 12px
  }

  .submit-alert-actions .btn {
    width: 100%
  }

  .submit-alert-modal {
    padding: 16px 14px 14px
  }
}

/* Legacy Block */
.legacy-block {
  margin: 0 0 48px;
  padding: 30px 24px;
  border: 1px solid var(--red-d);
  background:
    radial-gradient(circle at top right, rgba(204, 0, 0, .12), transparent 35%),
    linear-gradient(180deg, rgba(139, 0, 0, .08), rgba(0, 0, 0, .55));
  position: relative;
}

.legacy-block::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(139, 0, 0, .35);
  pointer-events: none;
}

.legacy-kicker {
  font-family: var(--font-m);
  font-size: .7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--red-m);
  margin-bottom: 8px;
}

.legacy-title {
  border: none;
  margin-bottom: 14px;
  padding: 0;
  font-size: 1.5rem;
  letter-spacing: 3px;
}

.legacy-copy {
  color: var(--wht-m);
  font-size: .85rem;
  line-height: 1.8;
  margin-bottom: 12px;
  max-width: 900px;
}

.legacy-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Carousel */
.carousel {
  position: relative;
  border: 1px solid var(--red-d);
  background: var(--blk-c);
  margin-bottom: 48px;
  padding-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.carousel-view {
  position: relative;
  overflow: hidden;
  height: 520px;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.carousel-slide a {
  display: block;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: all 0.4s ease;
  filter: grayscale(10%);
  background: #000;
}

.carousel-slide a:hover img {
  filter: brightness(1.1) grayscale(0%);
  transform: scale(1.01);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 20px;
  z-index: 10;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border: 1px solid var(--red-b);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
}

.carousel-dot.on {
  background: var(--red-b);
  transform: scale(1.3);
  box-shadow: 0 0 8px var(--red-b);
}

.carousel-label {
  text-align: center;
  font-family: var(--font-d);
  font-size: 1.1rem;
  color: var(--wht);
  text-transform: uppercase;
  letter-spacing: 3px;
  padding: 20px 10px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--red-d);
  background: rgba(255, 0, 0, 0.02);
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--red-d);
  color: var(--wht-m);
  width: 50px;
  height: 80px;
  cursor: pointer;
  z-index: 20;
  transition: all var(--tr);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.carousel-btn:hover {
  background: var(--red-b);
  color: var(--wht);
  border-color: var(--red-b);
  box-shadow: 0 0 20px rgba(204, 0, 0, 0.5);
}

.carousel-btn.prev {
  left: 0;
  border-left: none;
  border-radius: 0 4px 4px 0;
}

.carousel-btn.next {
  right: 0;
  border-right: none;
  border-radius: 4px 0 0 4px;
}


/* News */
.news-item {
  padding: 16px 0;
  border-bottom: 1px dashed var(--red-d)
}

.news-item:last-child {
  border-bottom: none
}

.news-dt {
  font-size: .7rem;
  color: var(--wht-f);
  font-family: var(--font-m)
}

.news-tt {
  color: var(--wht);
  font-weight: 700;
  font-size: .9rem
}

.news-bd {
  color: var(--wht-m);
  font-size: .85rem;
  margin-top: 4px
}

/* Newest row */
.newest-row {
  padding: 8px 0;
  border-bottom: 1px dashed var(--red-d);
  display: flex;
  justify-content: space-between;
  align-items: center
}

.newest-row:last-child {
  border-bottom: none
}

/* Terminal overlay */
.term {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 9999;
  background: var(--blk);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  color: var(--wht-m);
  background:
    radial-gradient(circle at top, rgba(204, 0, 0, .1), transparent 32%),
    linear-gradient(180deg, #000 0%, #050505 100%)
}

.term-body {
  position: absolute;
  inset: 0;
  overflow: hidden;
  padding: 14px 14px 12px;
  font-size: clamp(10px, 1vw, 13px);
  line-height: 1.3;
  font-weight: 500
}

.term-body {
  -ms-overflow-style: none;
  scrollbar-width: none
}

.term-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none
}

.term-stream {
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(204, 0, 0, .26);
  background: linear-gradient(180deg, rgba(204, 0, 0, .08), rgba(0, 0, 0, .22) 10%, rgba(0, 0, 0, .45));
  box-shadow: inset 0 0 0 1px rgba(204, 0, 0, .12)
}

.term-stream::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 21px);
  pointer-events: none
}

.term-code {
  position: absolute;
  inset: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden
}

.term-row {
  opacity: 0;
  animation: termRowIn .24s ease-out forwards;
  min-height: 1.25em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  filter: drop-shadow(0 0 2px rgba(255, 26, 26, .1));
  transform-origin: left center
}

.term-row.red {
  color: #ff7f7f;
  text-shadow: 0 0 7px rgba(204, 0, 0, .36)
}

.term-row.wht {
  color: #ececec
}

.term-row.hl {
  color: #ff2a2a;
  font-weight: 700;
  text-shadow: 0 0 14px rgba(255, 26, 26, .9)
}

@keyframes termRowIn {
  from {
    opacity: 0;
    transform: translateX(-10px)
  }

  to {
    opacity: 1;
    transform: translateX(0)
  }
}

@keyframes fadeOut {
  from {
    opacity: 1
  }

  ;

  to {
    opacity: 0
  }
}

.term-skip {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  right: max(20px, env(safe-area-inset-right));
  z-index: 10020;
  background: rgba(0, 0, 0, .88);
  padding: 10px 14px;
  border: 1px solid var(--red-d);
  -webkit-backdrop-filter: blur(1px);
  backdrop-filter: blur(1px);
  pointer-events: auto
}

.term-skip .btn {
  pointer-events: auto
}

.term.mobile .term-body {
  padding: 10px 10px 8px;
  font-size: 11px;
  overflow-y: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
  overscroll-behavior: contain
}

.term.mobile .term-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none
}

.term.mobile .term-stream {
  min-height: 72vh;
  height: auto;
  overflow: visible
}

.term.mobile .term-code {
  position: relative;
  inset: auto;
  padding: 8px 8px 18vh;
  gap: 2px
}

.term.mobile .term-row {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-overflow: clip;
  min-height: 0;
  line-height: 1.32;
  filter: none
}

.term.hidden {
  display: none
}

/* Auth modal */
.auth-ov {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200
}

.auth-box {
  width: 100%;
  max-width: 400px;
  padding: 32px;
  background: var(--blk-p);
  border: 2px solid var(--red);
  position: relative
}

.auth-box h2 {
  text-align: center;
  margin-bottom: 24px;
  border: none
}

.auth-x {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--wht-d);
  font-size: 1.5rem;
  cursor: pointer
}

.auth-err {
  color: var(--red-g);
  font-size: .8rem;
  text-align: center;
  margin-bottom: 16px
}

.auth-tog {
  text-align: center;
  font-size: .8rem;
  color: var(--wht-d);
  margin-top: 16px
}

.auth-tog a {
  cursor: pointer
}

/* Forms */
.fg {
  margin-bottom: 16px
}

.fl {
  display: block;
  font-size: .8rem;
  color: var(--wht-d);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px
}

.fi,
.fta,
.fse {
  width: 100%;
  padding: 8px 16px;
  background: var(--blk-c);
  border: 1px solid var(--red-d);
  color: var(--wht-m);
  font-family: var(--font-m);
  font-size: .85rem;
  transition: border-color var(--tr)
}

.fi:focus,
.fta:focus,
.fse:focus {
  outline: none;
  border-color: var(--red-b);
  box-shadow: 0 0 5px rgba(204, 0, 0, .2)
}

.fta {
  min-height: 120px;
  resize: vertical
}

/* Admin layout */
.adm {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  min-height: 70vh
}

.adm-side {
  border-right: 1px solid var(--red-d);
  padding: 16px
}

.adm-side a {
  display: block;
  padding: 8px 16px;
  color: var(--wht-d);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-left: 3px solid transparent;
  transition: all var(--tr);
  margin-bottom: 4px;
  cursor: pointer
}

.adm-side a:hover,
.adm-side a.on {
  color: var(--red-b);
  border-left-color: var(--red-b);
  background: rgba(139, 0, 0, .1);
  text-decoration: none
}

.adm-main {
  padding: 16px
}

.adm-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .8rem
}

.adm-tbl th,
.adm-tbl td {
  padding: 8px 16px;
  text-align: left;
  border-bottom: 1px solid var(--red-d)
}

.adm-tbl th {
  color: var(--red-b);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: .75rem
}

.adm-tbl tr:hover {
  background: rgba(139, 0, 0, .05)
}

@media(max-width:768px) {
  .adm {
    grid-template-columns: 1fr
  }

  .adm-side {
    border-right: none;
    border-bottom: 1px solid var(--red-d)
  }
}

@media(max-width:768px) {
  .adm-side a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 12px;
    line-height: 1;
  }

  .adm-main .card div[style*="display:flex"] {
    flex-direction: row !important;
    align-items: center;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .adm-main .card div[style*="display:flex"] .btn {
    width: auto;
    min-height: 44px;
    flex: 0 0 auto;
  }

  .adm-main .card .btn {
    min-height: 44px;
  }

  .adm-main .card .fi,
  .adm-main .card .fse,
  .adm-main .card .fta {
    width: 100%;
  }
}

/* Submit Editor Layout */
.editor-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  min-height: 70vh
}

.editor-pane {
  display: flex;
  flex-direction: column;
  gap: 16px
}

.editor-pane textarea {
  flex: 1;
  min-height: 200px;
  resize: vertical;
  font-family: 'IBM Plex Mono', monospace;
  font-size: .8rem;
  tab-size: 2;
  line-height: 1.5;
  padding: 12px 16px;
  background: var(--blk-c);
  border: 1px solid var(--red-d);
  color: var(--wht-m);
  transition: border-color var(--tr)
}

.editor-pane textarea:focus {
  outline: none;
  border-color: var(--red-b);
  box-shadow: 0 0 8px rgba(204, 0, 0, .2)
}

.editor-label {
  font-family: var(--font-d);
  font-size: .9rem;
  color: var(--red-b);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 8px
}

.editor-label .icon {
  font-size: 1.1rem
}

@media(max-width:768px) {
  .editor-wrap {
    grid-template-columns: 1fr
  }
}

/* Preview Iframe */
.preview-frame {
  width: 100%;
  flex: 1;
  min-height: clamp(640px, 78vh, 1080px);
  border: 1px solid var(--red-d);
  background: var(--blk-c);
  display: block
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: linear-gradient(180deg, rgba(139, 0, 0, .12), var(--blk-c));
  border: 1px solid var(--red-d);
  border-bottom: none;
  font-size: .75rem;
  color: var(--wht-d)
}

.preview-header .badge {
  font-size: .65rem;
  padding: 2px 8px;
  border: 1px solid var(--red-d);
  color: var(--wht-f);
  text-transform: uppercase;
  letter-spacing: 1px
}

/* Image Upload */
.upload-zone {
  border: 2px dashed var(--red-d);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--tr);
  background: var(--blk-c);
  position: relative
}

.upload-zone:hover {
  border-color: var(--red-b);
  background: rgba(139, 0, 0, .05)
}

.upload-zone.dragover {
  border-color: var(--red-g);
  background: rgba(255, 26, 26, .08)
}

.upload-zone .uz-icon {
  font-size: 2rem;
  color: var(--red-d);
  margin-bottom: 8px
}

.upload-zone .uz-text {
  font-size: .8rem;
  color: var(--wht-d)
}

.upload-zone .uz-hint {
  font-size: .7rem;
  color: var(--wht-f);
  margin-top: 4px
}

.upload-progress {
  height: 3px;
  background: var(--blk-c);
  border: 1px solid var(--red-d);
  margin-top: 8px;
  display: none
}

.upload-progress-bar {
  height: 100%;
  background: var(--red-b);
  width: 0;
  transition: width .3s
}

/* Uploaded Images List */
.img-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px
}

.img-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--red-d);
  background: var(--blk-c);
  font-size: .75rem
}

.img-item img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border: 1px solid var(--red-d)
}

.img-item .img-url {
  flex: 1;
  color: var(--wht-d);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-m)
}

.img-item .btn-copy {
  padding: 2px 10px;
  font-size: .65rem;
  cursor: pointer
}

/* Status Badges */
.status {
  display: inline-block;
  padding: 2px 10px;
  font-size: .65rem;
  font-family: var(--font-m);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700
}

.status-pending {
  border: 1px solid #b8860b;
  color: #daa520;
  background: rgba(218, 165, 32, .08)
}

.status-approved {
  border: 1px solid #228b22;
  color: #32cd32;
  background: rgba(50, 205, 50, .08)
}

.status-rejected {
  border: 1px solid #8b0000;
  color: var(--red-g);
  background: rgba(255, 26, 26, .08)
}

.status-draft {
  border: 1px solid #1e90ff;
  color: #7ec3ff;
  background: rgba(30, 144, 255, .12)
}

/* My Submissions */
.my-sub-row {
  padding: 12px 0;
  border-bottom: 1px dashed var(--red-d);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px
}

.my-sub-row:last-child {
  border-bottom: none
}

.my-sub-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0
}

.my-sub-title {
  color: var(--wht);
  font-size: .85rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap
}

.my-sub-meta {
  font-size: .7rem;
  color: var(--wht-f);
  font-family: var(--font-m)
}

/* Review Modal */
.review-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .94);
  z-index: 300;
  display: flex;
  flex-direction: column;
  padding: 12px 16px
}

.review-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--red-d)
}

.review-modal-header h3 {
  border: none;
  margin: 0;
  font-size: 1rem
}

.review-modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  overflow: hidden;
  align-items: stretch
}

.review-modal-preview {
  width: 100%;
  height: calc(100vh - 180px);
  min-height: 640px;
  border: 1px solid var(--red-d);
  background: var(--blk-c);
  box-shadow: 0 0 0 1px rgba(204, 0, 0, .08) inset
}

.review-modal-meta {
  width: 100%;
  overflow-y: auto;
  padding: 16px;
  border: 1px solid var(--red-d);
  background: var(--blk-s);
  font-size: .8rem
}

.review-modal-meta dt {
  color: var(--red-b);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: .7rem;
  margin-top: 12px
}

.review-modal-meta dt:first-child {
  margin-top: 0
}

.review-modal-meta dd {
  color: var(--wht-m);
  margin: 4px 0 0 0
}

.review-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px
}

.review-upload-item {
  display: block;
  border: 1px solid var(--red-d);
  background: var(--blk-c);
  overflow: hidden
}

.review-upload-item img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
  opacity: .92;
  transition: opacity var(--tr), transform var(--tr)
}

.review-upload-item:hover img {
  opacity: 1;
  transform: scale(1.03)
}

.review-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px
}

@media(max-width:768px) {
  .review-modal-body {
    grid-template-columns: 1fr
  }

  .review-modal-preview {
    height: 58vh;
    min-height: 420px
  }
}

/* Rejection Reason Input */
.reject-reason {
  margin-top: 12px;
  display: none
}

.reject-reason textarea {
  min-height: 60px
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }

  html {
    scroll-behavior: auto;
  }

  .term-row {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Page Viewer */
.page-viewer-header {
  padding: 16px 24px;
  border: 1px solid var(--red-d);
  background: var(--blk-s);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap
}

.page-viewer-title {
  font-family: var(--font-d);
  font-size: 1.4rem;
  color: var(--wht);
  letter-spacing: 2px;
  text-transform: uppercase
}

.page-viewer-meta {
  font-size: .75rem;
  color: var(--wht-d);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px
}

.page-viewer-frame {
  width: 100%;
  min-height: 82vh;
  min-height: 82svh;
  border: 1px solid var(--red-d);
  background: var(--blk-c)
}

/* Create Page Hero */
.create-hero {
  text-align: center;
  padding: 32px 24px 24px;
  margin-bottom: 32px
}

.create-hero h1 {
  font-size: 2rem;
  letter-spacing: 4px;
  margin-bottom: 12px;
  color: var(--wht)
}

.create-hero p {
  font-size: .9rem;
  color: var(--wht-d);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7
}

/* Mode Selector */
.mode-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px
}

.mode-btn {
  background: var(--blk-c);
  border: 2px solid var(--red-d);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all var(--tr);
  color: var(--wht-m)
}

.mode-btn:hover {
  border-color: var(--red-b);
  background: rgba(139, 0, 0, .05)
}

.mode-btn.active {
  border-color: var(--red-b);
  background: rgba(139, 0, 0, .1);
  box-shadow: 0 0 15px rgba(204, 0, 0, .15)
}

.mode-icon {
  font-size: 1.8rem;
  color: var(--red-b);
  margin-bottom: 8px
}

.mode-label {
  font-family: var(--font-d);
  font-size: 1rem;
  color: var(--wht);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px
}

.mode-desc {
  font-size: .75rem;
  color: var(--wht-d)
}

@media(max-width:480px) {
  .mode-selector {
    grid-template-columns: 1fr
  }
}

/* Template Grid */
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px
}

.tpl-card {
  background: var(--blk-c);
  border: 1px solid var(--red-d);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--tr);
  color: var(--wht-m)
}

.tpl-card:hover {
  border-color: var(--red-b)
}

.tpl-card.active {
  border-color: var(--red-b);
  background: rgba(139, 0, 0, .1);
  box-shadow: inset 0 0 0 1px var(--red-b)
}

.tpl-icon {
  font-size: 1.5rem;
  color: var(--red-b);
  margin-bottom: 6px
}

.tpl-name {
  font-family: var(--font-m);
  font-size: .8rem;
  font-weight: 700;
  color: var(--wht);
  margin-bottom: 4px
}

.tpl-desc {
  font-size: .65rem;
  color: var(--wht-d);
  line-height: 1.4
}

@media(max-width:768px) {
  .tpl-grid {
    grid-template-columns: 1fr 1fr
  }
}

@media(max-width:480px) {
  .tpl-grid {
    grid-template-columns: 1fr
  }
}

/* Subsection Blocks */
.subsection-block {
  border-top: 1px dashed var(--red-d);
  padding-top: 8px;
  margin-top: 8px
}

/* Submit Bar */
.submit-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 48px;
  padding: 16px 24px;
  border: 1px solid var(--red-d);
  background: var(--blk-s)
}

/* Create Page CTA (homepage) */
.create-cta {
  text-align: center;
  padding: 32px 24px;
  border: 2px solid var(--red-b);
  background: linear-gradient(180deg, rgba(139, 0, 0, .12), var(--blk));
  margin-bottom: 64px
}

.create-cta h2 {
  font-family: var(--font-d);
  font-size: 1.3rem;
  color: var(--red-g);
  letter-spacing: 3px;
  border: none;
  margin-bottom: 8px;
  padding: 0
}

.create-cta p {
  font-size: .85rem;
  color: var(--wht-d);
  margin-bottom: 16px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto
}

/* Shared Loading State */
.load-state {
  max-width: 980px;
  margin: 34px auto 52px
}

.load-title {
  margin-bottom: 10px
}

.load-copy {
  font-size: .85rem;
  color: var(--wht-d);
  margin-bottom: 14px
}

.load-monocode {
  position: relative;
  height: clamp(310px, 60vh, 560px);
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--red-d);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 26, 26, .16), transparent 34%),
    radial-gradient(circle at 92% 90%, rgba(255, 26, 26, .1), transparent 36%),
    linear-gradient(180deg, #0c0c0c, #030303 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 26, 26, .14), 0 0 36px rgba(139, 0, 0, .22);
  overflow: hidden;
  font-family: var(--font-m);
  font-size: clamp(.66rem, .9vw, .83rem);
  line-height: 1.58;
  color: rgba(255, 245, 245, .82);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  animation: monoDrift 8.2s ease-in-out infinite, monoGlow 3.4s ease-in-out infinite;
}

.load-monocode::before {
  content: '';
  position: absolute;
  inset: -30% -20% auto -20%;
  height: 44%;
  background: conic-gradient(from 180deg at 50% 50%, rgba(255, 26, 26, .05), rgba(255, 26, 26, .28), rgba(255, 26, 26, .05));
  filter: blur(12px);
  animation: monoAura 5.8s ease-in-out infinite;
  pointer-events: none
}

.load-monocode::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 22%, transparent 78%, rgba(255, 255, 255, .02));
  mix-blend-mode: screen;
  opacity: .72;
  pointer-events: none
}

@keyframes monoDrift {

  0%,
  100% {
    transform: translateY(0)
  }

  35% {
    transform: translateY(-6px)
  }

  65% {
    transform: translateY(4px)
  }
}

@keyframes monoGlow {

  0%,
  100% {
    text-shadow: 0 0 0 rgba(255, 26, 26, 0)
  }

  45% {
    text-shadow: 0 0 7px rgba(255, 26, 26, .4)
  }
}

@keyframes monoAura {

  0%,
  100% {
    transform: translateX(-4%) rotate(-2deg);
    opacity: .42
  }

  50% {
    transform: translateX(6%) rotate(2deg);
    opacity: .85
  }
}

@media (max-width: 768px) {
  .term-body {
    padding: 10px 10px 8px;
    font-size: 11px;
  }

  .term-code {
    padding: 8px 8px;
    gap: 2px;
  }

  .term-row {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-overflow: clip;
    min-height: 0;
    line-height: 1.32;
  }

  .load-state {
    margin: 20px auto 34px;
  }

  .load-copy {
    margin-bottom: 10px;
    line-height: 1.75;
  }

  .load-monocode {
    height: clamp(250px, 50vh, 420px);
    padding: 14px 12px;
    font-size: .68rem;
    line-height: 1.5;
  }
}

@media (prefers-reduced-motion: reduce) {

  .load-monocode,
  .load-monocode::before {
    animation: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
 *  LOADING ANIMATIONS & PROGRESS INDICATORS
 * ═══════════════════════════════════════════════════════════════ */

/* Spinner (Google/YouTube inspired) */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, .2);
  border-top-color: var(--red-b);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

.spinner-sm {
  width: 14px;
  height: 14px;
  border-width: 2px
}

.spinner-lg {
  width: 32px;
  height: 32px;
  border-width: 3px
}

@keyframes spin {
  to {
    transform: rotate(360deg)
  }
}

/* Progress Bar */
.progress-bar {
  height: 3px;
  background: var(--blk-c);
  border: 1px solid var(--red-d);
  overflow: hidden;
  margin: 8px 0;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--red-d), var(--red-b), var(--red-m));
  width: 0;
  transition: width .3s ease;
  animation: progressPulse 1.2s ease-in-out infinite;
}

.progress-bar.indeterminate .progress-bar-fill {
  width: 30%;
  animation: progressIndeterminate 2s ease-in-out infinite;
}

@keyframes progressPulse {

  0%,
  100% {
    opacity: .8
  }

  50% {
    opacity: 1
  }
}

@keyframes progressIndeterminate {
  0% {
    transform: translateX(-100%)
  }

  100% {
    transform: translateX(400%)
  }
}

@media (prefers-reduced-motion: reduce) {

  .spinner,
  .progress-bar-fill,
  .progress-bar.indeterminate .progress-bar-fill {
    animation: none !important;
    transition: none !important;
  }
}

/* Loading Container (Google style) */
.loading-container {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px;
  font-size: .8rem;
  color: var(--wht-d);
  background: rgba(139, 0, 0, .08);
  border: 1px solid var(--red-d);
  border-radius: 2px;
}

.loading-container.hidden {
  display: none
}

/* Spinner in button */
.btn .spinner {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: middle;
}

.btn.loading {
  opacity: .8;
  cursor: wait;
  pointer-events: none;
}

/* Status message */
.status-msg {
  font-size: .8rem;
  padding: 8px 12px;
  margin: 8px 0;
  border-left: 3px solid;
  background: rgba(0, 0, 0, .2);
}

.status-msg.loading {
  border-left-color: var(--red-b);
  color: var(--wht-m);
}

.status-msg.success {
  border-left-color: #32cd32;
  color: #90ee90;
}

.status-msg.error {
  border-left-color: var(--red-g);
  color: var(--red-m);
}

/* Upload progress */
.upload-item-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: .7rem;
  color: var(--wht-d);
}

.upload-item-progress-bar {
  flex: 1;
  height: 2px;
  background: var(--blk-c);
  border: 1px solid var(--red-d);
  overflow: hidden;
}

.upload-item-progress-bar-fill {
  height: 100%;
  background: var(--red-b);
  width: 0;
  transition: width .2s ease;
}

.upload-item-progress-text {
  min-width: 40px;
  text-align: right;
}

/* Utility */
.hidden {
  display: none !important
}

.tc {
  text-align: center
}

.mt-md {
  margin-top: 16px
}

.mb-md {
  margin-bottom: 16px
}

/* Browser and accessibility fallbacks */
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {

  .submit-alert-overlay,
  .term-skip {
    background: rgba(0, 0, 0, .92);
  }
}

@supports not (position: sticky) {
  .hdr {
    position: relative;
  }
}

/* Default schema for all new generated pages */
.page-shell {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px
}

.page-header {
  padding: 24px;
  border-bottom: 2px solid var(--red-d);
  margin-bottom: 24px;
  background: linear-gradient(180deg, rgba(139, 0, 0, .1), transparent)
}

.page-title {
  font-family: var(--font-d);
  font-size: 2rem;
  color: var(--wht);
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 8px
}

.page-subtitle {
  font-size: .8rem;
  color: var(--red-b);
  letter-spacing: 2px;
  text-transform: uppercase
}

.page-section {
  margin-bottom: 24px;
  padding: 20px;
  border: 1px solid var(--red-d);
  background: var(--blk-s)
}

.page-section h2 {
  border-bottom: 1px dashed var(--red-d)
}

/* Mobile Overrides */
@media (max-width: 768px) {

  .fi,
  .fse,
  .fta,
  input,
  select,
  textarea {
    font-size: 16px;
  }

  .wrap {
    padding: 12px;
  }

  .section {
    padding: 18px 14px;
    margin-bottom: 32px;
  }

  .section-hd {
    font-size: 1.05rem;
    letter-spacing: 2px;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.15rem;
  }

  .hdr-in {
    padding: 0 12px;
    gap: 12px;
  }

  .hdr-brand {
    gap: 10px;
  }

  .hdr-logo {
    width: 40px;
    height: 40px;
  }

  .hdr-title {
    font-size: .92rem;
    letter-spacing: 1.2px;
  }

  .nav a,
  .nav-btn {
    width: auto;
    text-align: left;
  }

  .nav {
    gap: 12px;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .intro {
    padding: 0 10px 40px;
    margin-bottom: 32px;
  }

  .intro-hero {
    padding: 40px 12px 24px;
  }

  .intro-logo {
    width: 140px;
    height: 140px;
  }

  .intro-t {
    font-size: 1.35rem;
    letter-spacing: 3px;
  }

  .legacy-block {
    padding: 22px 14px;
    margin-bottom: 34px;
  }

  .legacy-title {
    font-size: 1.16rem;
    letter-spacing: 2px;
  }

  .legacy-copy {
    font-size: .82rem;
  }

  .warn {
    padding: 28px 16px;
    margin-bottom: 40px;
  }

  .warn h2 {
    font-size: 1.15rem;
    letter-spacing: 2px;
  }

  .carousel-view {
    height: 340px;
  }

  .card {
    padding: 14px;
  }

  .card-b {
    font-size: .82rem;
  }

  .news-item {
    grid-template-columns: 1fr !important;
  }

  .news-item img {
    width: 100%;
    height: 180px;
  }

  .newest-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .page-viewer-header {
    padding: 14px 16px;
  }

  .page-viewer-frame {
    min-height: 68vh;
    min-height: 68svh;
  }

  .preview-frame {
    min-height: 70vh;
    min-height: 70svh;
  }

  .preview-header {
    padding: 8px 10px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .submit-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .submit-bar>div:last-child {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .submit-bar .btn {
    width: 100%;
  }

  .mode-selector,
  .tpl-grid,
  .g2,
  .g3,
  .editor-wrap {
    grid-template-columns: 1fr;
  }

  .adm {
    grid-template-columns: 1fr;
  }

  .adm-side {
    border-right: none;
    border-bottom: 1px solid var(--red-d);
    overflow-x: auto;
    display: flex;
    gap: 8px;
    padding: 12px;
  }

  .adm-side a {
    margin-bottom: 0;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .adm-main {
    padding: 12px;
  }

  .adm-tbl {
    display: block;
    overflow-x: auto;
    width: 100%;
  }

  .review-modal {
    padding: 8px;
  }

  .review-modal-body {
    grid-template-columns: 1fr;
  }

  .review-modal-preview {
    min-height: 48vh;
    height: 48vh;
  }

  .review-modal-meta {
    max-height: 34vh;
  }

  .review-upload-grid {
    grid-template-columns: 1fr;
  }

  .page-viewer-frame {
    min-height: 72vh;
  }

  .page-viewer-meta {
    gap: 8px;
  }

  .ftr-links {
    gap: 18px;
  }

  .ftr-copy {
    line-height: 1.8;
  }

  .doc-wrap {
    padding: 20px !important;
    margin: 20px 12px !important;
  }

  .doc-hdr h1 {
    font-size: 1.65rem;
  }

  .doc-hdr p {
    letter-spacing: 2px;
  }

  .doc-table {
    display: block;
    overflow-x: auto;
    width: 100%;
  }

  .adm-tbl {
    -webkit-overflow-scrolling: touch;
  }

  .review-modal-header {
    align-items: flex-start;
    gap: 12px;
  }

  .review-actions {
    flex-direction: column;
  }

  .review-actions .btn {
    width: 100%;
  }

  .img-item {
    align-items: flex-start;
  }

  .img-item .btn-copy {
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .wrap {
    padding: 10px;
  }

  .section {
    padding: 16px 12px;
  }

  .hdr {
    padding: 12px 0;
  }

  .hdr-title {
    font-size: .9rem;
    letter-spacing: 1px;
  }

  .create-hero h1 {
    font-size: 1.45rem;
    letter-spacing: 2px;
  }

  .mode-btn,
  .tpl-card {
    padding: 18px 14px;
  }

  .preview-header,
  .page-viewer-header {
    padding: 10px 12px;
  }

  .preview-frame {
    min-height: 62vh;
    min-height: 62svh;
  }

  .page-viewer-frame {
    min-height: 68vh;
    min-height: 68svh;
  }

  .carousel-view {
    height: 260px;
  }

  .news-tt {
    font-size: .88rem;
  }

  .news-bd {
    font-size: .82rem;
  }

  .review-modal-preview {
    min-height: 42vh;
    height: 42vh;
  }

  .review-modal-meta {
    max-height: 38vh;
  }
}