html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1000px 520px at 20% 0%, #1b2a6b20, transparent 60%), var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

#app {
  min-height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  box-sizing: border-box;
  display: grid;
  gap: 14px;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.panel {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px;
}

h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: .2px;
}

.sub {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.controls {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.18);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
}

.btn:hover {
  background: rgba(255,255,255,.10);
}

.url {
  flex: 1 1 340px;
  min-width: 220px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.18);
  color: var(--text);
  border-radius: 12px;
  padding: 10px;
  outline: none;
}

.status {
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--muted);
  font-size: 12px;
  white-space: pre-wrap;
  line-height: 1.4;
}

.frameWrap {
  min-height: 520px;
  height: clamp(520px, calc(100vh - 250px), 1400px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#archiveFrame {
  width: 100%;
  min-height: 0;
  height: 100%;
  flex: 1 1 auto;
  border: 0;
  border-radius: 12px;
  background: rgba(0,0,0,.2);
}

.faq details {
  margin-top: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.faq summary {
  cursor: pointer;
}

#dropOverlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
  background: rgba(0,0,0,.45);
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}

#dropOverlay.active {
  display: flex;
}

.dropCard {
  border: 2px dashed rgba(255,255,255,.40);
  border-radius: 20px;
  padding: 24px;
  background: rgba(0,0,0,.25);
  color: var(--text);
  min-width: min(90vw, 520px);
  text-align: center;
}

@media (max-width: 980px) {
  #app {
    padding: 12px;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .frameWrap {
    height: clamp(420px, calc(100vh - 300px), 1200px);
    min-height: 420px;
  }
}

html.hide-url-ui #urlInput,
html.hide-url-ui #loadUrlBtn {
  display: none !important;
}

html.hide-drop-ui #dropOverlay {
  display: none !important;
}
