/* Rising Sunburn — unauthorized desk dossier
   Self-contained. First-mission special. */

.rsd-body *, .rsd-body *::before, .rsd-body *::after { box-sizing: border-box; }
.rsd-body h1, .rsd-body h2, .rsd-body h3, .rsd-body p, .rsd-body figure { margin-top: 0; }

.rsd-body {
  --rsd-wood: #2a1a10;
  --rsd-blotter: #1e3a2f;
  --rsd-paper: #f3e6c8;
  --rsd-ink: #1a120c;
  --rsd-red: #c23b2a;
  --rsd-brass: #d4a017;
  --rsd-cream: #f7efe0;
  --rsd-mono: "Share Tech Mono", ui-monospace, Consolas, monospace;
  --rsd-sans: "Barlow Condensed", system-ui, "Arial Narrow", sans-serif;
  margin: 0;
  min-height: 100dvh;
  color: var(--rsd-cream);
  background: #0d0907;
  font-family: var(--rsd-sans);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
.rsd-body::before {
  content: "";
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(212,160,23,0.12), transparent 55%),
    linear-gradient(180deg, #1a100c 0%, #0d0907 60%, #080605 100%);
}

.rsd-skip {
  position: absolute; left: -999px; top: 0; z-index: 999;
  background: var(--rsd-brass); color: #111; padding: 0.5rem 1rem;
}
.rsd-skip:focus { left: 0.5rem; top: 0.5rem; }

.rsd-top {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  padding-top: max(0.55rem, env(safe-area-inset-top, 0px));
  background: rgba(13,9,7,0.94);
  border-bottom: 1px solid rgba(212,160,23,0.28);
  backdrop-filter: blur(10px);
}
.rsd-brand {
  display: flex; align-items: center; gap: 0.55rem;
  text-decoration: none; color: inherit;
  min-width: 0;
}
.rsd-brand img { display: block; border-radius: 4px; flex: 0 0 auto; }
.rsd-brand span { min-width: 0; }
.rsd-brand strong {
  display: block; font-family: var(--rsd-mono);
  letter-spacing: 0.1em; font-size: 0.72rem; color: #fff;
}
.rsd-brand em {
  display: block; font-style: normal; font-family: var(--rsd-mono);
  font-size: 0.55rem; letter-spacing: 0.06em; color: var(--rsd-red);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: min(52vw, 14rem);
}

.rsd-wrap {
  max-width: 980px; margin: 0 auto; padding: 0.85rem 0.75rem 2rem;
  padding-bottom: max(2rem, env(safe-area-inset-bottom, 0px));
}

/* Gate */
.rsd-gate {
  min-height: calc(100dvh - 70px);
  display: grid; place-items: center;
  padding: 1.5rem 1rem 3rem;
}
.rsd-gate[hidden] { display: none !important; }
.rsd-desk-card {
  width: min(920px, 100%);
  border: 1px solid rgba(212,160,23,0.35);
  border-radius: 10px;
  overflow: hidden;
  background: #140e0a;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55);
}
.rsd-desk-card img { display: block; width: 100%; height: auto; }
.rsd-gate-panel {
  padding: 1.1rem 1.15rem 1.35rem;
  background: linear-gradient(180deg, #1a120c, #100b08);
  border-top: 1px solid rgba(194,59,42,0.45);
}
.rsd-warn {
  font-family: var(--rsd-mono); font-size: 0.78rem; letter-spacing: 0.08em;
  color: #ffb4a8; text-transform: uppercase; margin: 0 0 0.65rem;
}
.rsd-gate-panel h1 {
  font-size: clamp(1.4rem, 5vw, 2rem); color: #fff; margin: 0 0 0.55rem;
}
.rsd-gate-panel p { margin: 0 0 0.85rem; color: #d7c4a8; line-height: 1.45; }
.rsd-gate-actions {
  display: flex; flex-direction: column; gap: 0.5rem;
}
@media (min-width: 560px) {
  .rsd-gate-actions { flex-direction: row; flex-wrap: wrap; }
  .rsd-brand em { max-width: none; }
}

.rsd-btn {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
  min-height: 52px; padding: 0.7rem 1rem;
  font-family: var(--rsd-mono); font-size: 0.78rem; letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 700;
  background: var(--rsd-brass); color: #111; border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}
@media (min-width: 560px) {
  .rsd-btn { width: auto; min-width: 10rem; }
}
.rsd-btn-ghost {
  background: transparent; color: #ffb4a8;
  border: 1px solid rgba(194,59,42,0.55);
}
.rsd-btn-danger { background: var(--rsd-red); color: #fff; }

/* Dossier workspace */
.rsd-dossier[hidden] { display: none !important; }
.rsd-progress {
  font-family: var(--rsd-mono); font-size: 0.72rem; letter-spacing: 0.1em;
  color: var(--rsd-brass); margin: 0.35rem 0 0.85rem;
}

.rsd-rail {
  display: flex; gap: 0.4rem; overflow-x: auto;
  padding: 0.25rem 0 0.85rem; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.rsd-rail::-webkit-scrollbar { display: none; }
.rsd-tab {
  flex: 0 0 auto; appearance: none; cursor: pointer;
  min-height: 48px; padding: 0.55rem 0.85rem;
  border-radius: 4px 4px 0 0;
  border: 1px solid rgba(212,160,23,0.35);
  border-bottom: 0;
  background: #c4a574; color: #2a1a10;
  font-family: var(--rsd-mono); font-size: 0.66rem; letter-spacing: 0.05em;
  text-transform: uppercase; font-weight: 700;
  -webkit-tap-highlight-color: transparent;
}
.rsd-tab.is-on {
  background: var(--rsd-paper); color: var(--rsd-ink);
  box-shadow: 0 -2px 0 var(--rsd-red) inset;
}
.rsd-tab.is-open::after { content: " ·"; }

.rsd-folder {
  background: var(--rsd-paper); color: var(--rsd-ink);
  border-radius: 0 8px 8px 8px;
  border: 1px solid rgba(212,160,23,0.4);
  min-height: 320px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.4);
}
.rsd-folder[hidden] { display: none !important; }
.rsd-folder-head {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem;
  padding: 0.65rem 0.9rem; background: #e6d3a8;
  font-family: var(--rsd-mono); font-size: 0.65rem; letter-spacing: 0.08em;
  text-transform: uppercase; color: #5a4630;
  border-bottom: 1px solid rgba(90,70,48,0.25);
}
.rsd-folder-body { padding: 1rem 1.1rem 1.25rem; }
.rsd-folder-body h2 {
  font-size: clamp(1.25rem, 4vw, 1.7rem); margin: 0 0 0.55rem; color: var(--rsd-ink);
}
.rsd-folder-body p { margin: 0 0 0.75rem; line-height: 1.5; font-size: 0.98rem; }
.rsd-quote {
  margin: 0.85rem 0;
  padding: 0.65rem 0.75rem;
  border-left: 4px solid var(--rsd-red);
  background: rgba(194,59,42,0.08);
  font-family: var(--rsd-mono); font-size: 0.82rem; color: #6b2a22;
}
.rsd-media {
  margin: 0.85rem 0;
  border: 1px solid rgba(90,70,48,0.3);
  border-radius: 6px; overflow: hidden; background: #111;
}
.rsd-media img, .rsd-media video {
  display: block; width: 100%; height: auto; max-height: 70dvh; background: #000;
}
.rsd-media figcaption, .rsd-cap {
  font-family: var(--rsd-mono); font-size: 0.68rem;
  padding: 0.55rem 0.7rem; background: #efe2c2; color: #5a4630;
}
.rsd-sticky {
  display: grid; gap: 0.55rem; margin-top: 0.85rem;
}
.rsd-note {
  background: #fff59d; color: #3d3410;
  padding: 0.75rem 0.85rem; border-radius: 2px;
  box-shadow: 2px 3px 0 rgba(0,0,0,0.12);
  font-size: 0.95rem; line-height: 1.4;
  transform: rotate(-0.6deg);
}
.rsd-note:nth-child(2) { background: #bbdefb; transform: rotate(0.8deg); }
.rsd-note:nth-child(3) { background: #f8bbd0; transform: rotate(-0.3deg); }
.rsd-note strong { display: block; font-family: var(--rsd-mono); font-size: 0.68rem; letter-spacing: 0.08em; margin-bottom: 0.25rem; }

.rsd-actions {
  display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.85rem;
}
@media (min-width: 560px) {
  .rsd-actions { flex-direction: row; flex-wrap: wrap; }
}
.rsd-folder-body {
  overflow-wrap: anywhere;
}
.rsd-media video {
  width: 100%; height: auto; max-height: min(70dvh, 520px);
}

.rsd-footer {
  margin-top: 2rem; padding: 1.5rem 1rem 2.5rem;
  border-top: 1px solid rgba(212,160,23,0.22);
  font-size: 0.85rem; color: #b8a48a; line-height: 1.5;
}
.rsd-footer a { color: var(--rsd-brass); }

@supports (padding: max(0px)) {
  .rsd-wrap, .rsd-top {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}
