:root {
  --surface: rgb(14, 22, 43);
  --surface-variant: rgb(22, 33, 62);
  --surface-high: rgb(30, 44, 78);
  --on-surface: #e0e0e0;
  --on-surface-dim: #9e9e9e;
  --accent: rgb(73, 252, 255);
  --accent-dim: rgba(73, 252, 255, 0.15);
  --error: #ef5350;
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Roboto', sans-serif;
  background: var(--surface);
  color: var(--on-surface);
  min-height: 100vh;
  line-height: 1.5;
}

header {
  text-align: center;
  padding: 48px 24px 0px;
}

header h1 {
  font-size: 28px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

header h1 .material-icons {
  color: var(--accent);
  font-size: 32px;
}

.subtitle {
  color: var(--on-surface-dim);
  margin-top: 8px;
  font-size: 14px;
}

main {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

section {
  margin-top: 16px;
}

h2 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 4px;
}

h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

label {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface-dim);
  display: block;
  margin-bottom: 8px;
}

.input-row {
  display: flex;
  gap: 8px;
}

/* Per-dependency "Require this version or newer" toggle. Right-aligned and sized
   to the version column (half the id/version row, minus its 8px gap) so it sits
   directly under the version field and reads as belonging to it. */
.dep-version-min-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  width: calc(50% - 4px);
  margin-left: auto;
}

.dep-version-min-row input[type="checkbox"] {
  accent-color: var(--accent);
  flex-shrink: 0;
}

.dep-version-min-row label {
  font-size: 13px;
  color: var(--on-surface-variant);
  margin-bottom: 0;
  cursor: pointer;
}

input[type="url"] {
  flex: 1;
  padding: 12px 16px;
  background: var(--surface-variant);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  color: var(--on-surface);
  font-size: 14px;
  font-family: 'Roboto Mono', monospace;
  outline: none;
  transition: border-color 0.2s;
}

input[type="url"]:focus {
  border-color: var(--accent);
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: var(--surface);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.btn-primary:hover { opacity: 0.85; }

.btn-primary .material-icons { font-size: 18px; }

/* Muted button for secondary workflows (e.g. Load) — same footprint as
   btn-primary but without the bright accent fill. */
.btn-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--surface-high);
  color: var(--on-surface);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.btn-secondary .material-icons { font-size: 18px; }

.status-msg {
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

.status-msg.error { color: var(--error); }
.status-msg.success { color: var(--accent); }

/* These status lines only appear on error, so collapse them when empty. */
.drop-status:empty,
.dep-error:empty {
  display: none;
  min-height: 0;
  margin-top: 0;
}

.btn-toggle-data {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  background: transparent;
  border: none;
  color: var(--on-surface-dim);
  font-size: 13px;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-toggle-data:hover {
  color: var(--accent);
}

.btn-toggle-data .material-icons {
  font-size: 18px;
  transition: transform 0.2s;
}

.btn-toggle-data.expanded .material-icons {
  transform: rotate(180deg);
}

.version-data-display {
  background: var(--surface-variant);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 8px;
  color: var(--on-surface);
  font-family: 'Roboto Mono', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.style-picker {
  background: var(--surface-variant);
  padding: 16px 20px;
  border-radius: var(--radius);
}

.style-picker > label:first-child {
  margin-bottom: 12px;
}

.radio-group {
  display: flex;
  gap: 24px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--on-surface);
  font-size: 14px;
  margin-bottom: 0;
}

.radio-label input[type="radio"] {
  accent-color: var(--accent);
}

.color-swatches {
  display: flex;
  gap: 10px;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  padding: 0;
  outline: none;
}

.swatch:hover {
  transform: scale(1.15);
}

.swatch.selected {
  border-color: #fff;
}

.section-desc {
  color: var(--on-surface-dim);
  font-size: 13px;
  margin-bottom: 16px;
}

.badges-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface-variant);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
}

.badge-row img {
  flex-shrink: 0;
}

.badge-row .badge-type {
  font-size: 13px;
  color: var(--on-surface-dim);
  min-width: 80px;
}

.badge-row .spacer { flex: 1; }

.btn-copy {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid var(--surface-high);
  border-radius: 6px;
  color: var(--on-surface-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-copy:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-copy:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-copy .material-icons { font-size: 16px; }

.btn-copy.copied {
  border-color: var(--accent);
  color: var(--accent);
}

/* Full-width copy button above the output box (avoids a lone right-aligned one). */
.btn-copy-block {
  width: 100%;
  justify-content: center;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.stack-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.stack-controls {
  background: var(--surface-variant);
  padding: 16px;
  border-radius: var(--radius);
}

.stack-controls h3 { margin-bottom: 12px; }

.header-config {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.header-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-line label {
  font-size: 13px;
  color: var(--on-surface);
  margin-bottom: 0;
  min-width: 65px;
  cursor: pointer;
}

.header-line input[type="checkbox"] {
  accent-color: var(--accent);
  flex-shrink: 0;
}

.header-text-input {
  flex: 1;
  min-width: 0;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--surface-high);
  border-radius: 4px;
  color: var(--on-surface);
  font-size: 12px;
  font-family: 'Roboto', sans-serif;
  outline: none;
  transition: border-color 0.2s, opacity 0.2s;
}

.header-text-input:focus {
  border-color: var(--accent);
}

.header-text-input:disabled {
  opacity: 0.4;
  cursor: default;
}

.stack-checkboxes {
  list-style: none;
}

.stack-checkboxes li {
  padding: 8px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: grab;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.15s;
  user-select: none;
}

.stack-checkboxes li:hover {
  background: var(--surface-high);
}

.stack-checkboxes li.dragging {
  opacity: 0.5;
  background: var(--accent-dim);
}

.stack-checkboxes li .material-icons.drag-handle {
  font-size: 18px;
  color: var(--on-surface-dim);
  cursor: grab;
}

.stack-checkboxes input[type="checkbox"] {
  accent-color: var(--accent);
}

.stack-preview-area {
  background: var(--surface-variant);
  padding: 16px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
}

.stack-preview-area h3 { margin-bottom: 12px; }

.stack-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  min-height: 60px;
}

.stack-preview img {
  display: block;
}

.bbcode-output {
  background: var(--surface-variant);
  border-radius: var(--radius);
  padding: 16px;
}

.bbcode-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  color: var(--on-surface);
  font-family: 'Roboto Mono', 'Consolas', monospace;
  font-size: 12px;
  padding: 12px;
  resize: vertical;
  outline: none;
}

textarea:focus {
  border-color: var(--accent);
}

/* ---- One-Click Install Link generator ---- */

.install-section code {
  font-family: 'Roboto Mono', 'Consolas', monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
}

.how-to {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 0;
}

.how-to li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--on-surface);
}

.how-to li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.how-to strong { color: var(--accent); font-weight: 500; }
.how-to em { color: var(--on-surface); font-style: normal; font-weight: 500; }
.how-to .opt { color: var(--on-surface-dim); font-size: 13px; }

.install-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

/* The left grid cell stacks two independent step cards (Your mod, Dependencies). */
.install-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-title {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 0;
}

/* Section heading row that can carry a trailing info-icon tooltip. */
.step-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Info icon whose tip bubble appears on hover/focus, replacing inline tips. */
.info-tip {
  display: inline-flex;
  align-items: center;
  color: var(--on-surface-dim);
  cursor: help;
  outline: none;
}

.info-tip:hover,
.info-tip:focus-visible { color: var(--accent); }

.info-tip > .material-icons { font-size: 20px; }

.info-tip-bubble {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface-high);
  border: 1px solid var(--accent-dim);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--on-surface);
  text-transform: none;
  letter-spacing: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
}

.info-tip:hover .info-tip-bubble,
.info-tip:focus .info-tip-bubble,
.info-tip:focus-within .info-tip-bubble {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Each tip line shows a lightbulb glyph beside a single text block. */
.info-tip-bubble .tip-line {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.info-tip-bubble .tip-line .material-icons {
  font-size: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

.install-controls,
.install-output-area {
  background: var(--surface-variant);
  padding: 16px 20px;
  border-radius: var(--radius);
}

/* The "Your mod" section is itself a file drop target; ring it while dragging. */
.install-controls {
  transition: background 0.2s, box-shadow 0.2s;
}

.install-controls.dragover {
  background: var(--surface-high);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.install-output-area h3 { margin-bottom: 12px; }

.install-controls input[type="url"] {
  width: 100%;
}

.install-divider {
  border: none;
  border-top: 1px solid var(--surface-high);
  margin: 18px 0;
}

.label-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--on-surface-dim);
}

.install-preview {
  font-size: 12px;
  margin-top: 6px;
  min-height: 16px;
  font-family: 'Roboto Mono', 'Consolas', monospace;
  word-break: break-word;
}

.install-preview.ok { color: var(--accent); }
.install-preview.neutral { color: var(--on-surface-dim); }
.install-preview.warn { color: #ffca28; }

.install-deps {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Affordance for adding a .version / mod_info.json file. The mod and per-dep
   zones are browse-only (their surrounding section/card handles drops); the
   Dependencies "add" zone also accepts drops directly (see .dragover below). */
.version-dropzone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1.5px dashed var(--surface-high);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
}

.version-dropzone:hover,
.version-dropzone:focus-visible {
  border-color: var(--accent);
  outline: none;
}

/* Only drop-target zones (the Dependencies "add" zone) get this while dragging. */
.version-dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.version-dropzone .material-icons {
  font-size: 28px;
  color: var(--accent);
  flex-shrink: 0;
}

.version-dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.version-dropzone-text strong { color: var(--on-surface); font-weight: 500; }
.version-dropzone-sub { font-size: 12px; color: var(--on-surface-dim); }

/* Slim variant used inside each dependency card. */
.version-dropzone.compact {
  padding: 8px 10px;
  gap: 8px;
}

.version-dropzone.compact .material-icons { font-size: 20px; }
.version-dropzone.compact .version-dropzone-sub { font-size: 11px; }

/* Material-style filled text field with a floating label. The label names what
   goes in the box; the example placeholder appears only on focus. */
.md-field { position: relative; width: 100%; }

.md-field input {
  width: 100%;
  padding: 20px 14px 7px;
  background: var(--surface-variant);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  color: var(--on-surface);
  font-size: 14px;
  font-family: 'Roboto', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}

.md-field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.md-field input:focus { border-color: var(--accent); }

.md-field label {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--on-surface-dim);
  font-size: 14px;
  pointer-events: none;
  transition: top 0.15s, font-size 0.15s, color 0.15s, transform 0.15s;
}

.md-field input:focus + label,
.md-field input:not(:placeholder-shown) + label {
  top: 7px;
  transform: none;
  font-size: 11px;
}

/* Only the active field's label takes the accent color; a filled-but-unfocused
   label stays muted. */
.md-field input:focus + label { color: var(--accent); }

/* Hide the example placeholder until the field is focused. */
.md-field input::placeholder { color: transparent; }
.md-field input:focus::placeholder { color: var(--on-surface-dim); }

.input-row .md-field { flex: 1; min-width: 0; }

/* Shared card for the main mod and each dependency. Also a file drop target. */
.install-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  padding: 12px;
  transition: border-color 0.2s, background 0.2s;
}

.install-card.dragover {
  border-color: var(--accent);
  background: var(--accent-dim);
}

/* Card spacing is handled by the flex gap, so drop children's own top margins. */
.install-card > * { margin-top: 0; }

/* The resolved-name label only takes space once it has content. */
.install-card .install-preview { margin-bottom: 0; }
.install-card .install-preview:empty { display: none; }

.install-dep-top {
  display: flex;
  gap: 8px;
  align-items: center;
}

.install-dep-top .md-field { flex: 1; min-width: 0; }

.btn-remove-dep {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  color: var(--on-surface-dim);
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
  transition: all 0.2s;
}

.btn-remove-dep:hover { border-color: var(--error); color: var(--error); }
.btn-remove-dep .material-icons { font-size: 18px; }

.btn-add-dep {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 9px 16px;
  background: var(--surface-high);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  color: var(--on-surface);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-add-dep:hover { border-color: var(--accent); color: var(--accent); }
.btn-add-dep .material-icons { font-size: 18px; }

/* Quick-add chips for the common libraries most mods depend on. Each fills a new
   dependency row with that library's link and mod id; an "added" chip marks one
   already in the list. */
.dep-quick-add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.dep-quick-label {
  color: var(--on-surface-dim);
  font-size: 13px;
}

.dep-lib-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dep-lib-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px 5px 8px;
  background: var(--surface-variant);
  border: 1px solid var(--surface-high);
  border-radius: 999px;
  color: var(--on-surface);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.dep-lib-chip:hover { border-color: var(--accent); color: var(--accent); }
.dep-lib-chip .material-icons { font-size: 16px; }

/* Already in the dependency list: show a check and a quieter, settled look. The
   chip still works — clicking scrolls to the existing row rather than adding it. */
.dep-lib-chip.added {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}

.install-formats { flex-wrap: wrap; gap: 16px; }

.install-badge-preview {
  min-height: 24px;
  display: flex;
  align-items: center;
}

.install-badge-preview img { display: block; }

/* Badge style picker — each option shows the badge it produces. */
.style-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.style-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 8px;
  background: var(--surface-variant);
  border: 2px solid var(--surface-high);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s;
}

.style-option:hover { transform: translateY(-1px); }

/* A radio dot to the left marks the active option; both badges stay fully
   visible and the card border stays neutral. */
.style-option::before {
  content: '';
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--on-surface-dim);
  transition: border-color 0.2s, background 0.2s;
}

.style-option.selected::before {
  border-color: var(--accent);
  background: radial-gradient(var(--accent) 0 4px, transparent 5px);
}

.style-option img { display: block; max-width: 100%; height: auto; }

/* ---- Launcher page (open.html) ---- */

.launcher-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.launcher {
  width: 100%;
  max-width: 460px;
}

.launcher-card {
  background: var(--surface-variant);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius);
  padding: 40px 32px;
  text-align: center;
}

.launcher-icon {
  font-size: 48px;
  color: var(--accent);
}

.launcher-logo {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto;
}

.launcher-card h1 {
  font-size: 22px;
  font-weight: 500;
  margin-top: 12px;
}

.launcher-subtitle {
  color: var(--on-surface-dim);
  font-size: 14px;
  margin-top: 8px;
  min-height: 20px;
}

.btn-launch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  padding: 8px 16px;
  background: transparent;
  color: var(--on-surface-dim);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}

.btn-launch:hover { border-color: var(--accent); color: var(--accent); }

.btn-launch .material-icons { font-size: 18px; }

.launcher-malformed {
  margin-top: 20px;
  color: var(--error);
  font-size: 14px;
}

.launcher-malformed .material-icons { font-size: 36px; }

.launcher-fallback {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-high);
}

.fallback-q { font-size: 14px; color: var(--on-surface); }

.fallback-note {
  position: relative; /* positioning context for the info-tip bubble */
  margin-top: 6px;
  font-size: 12px;
  color: var(--on-surface-variant);
}

/* The inline info icon next to a fallback note is smaller than the form's. */
.fallback-note .info-tip {
  vertical-align: middle;
}

.fallback-note .info-tip > .material-icons {
  font-size: 15px;
}

.fallback-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  color: var(--on-surface);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.2s;
}

.fallback-link:hover { border-color: var(--accent); color: var(--accent); }
.fallback-link .material-icons { font-size: 18px; }

.dep-fallback {
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
}

.dep-fallback-label {
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--on-surface);
  margin-bottom: 12px;
}

.dep-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.dep-item {
  display: flex;
  flex-direction: column;
}

.dep-links .dep-link {
  margin-top: 0;
  justify-content: center;
}

.get-trios {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  text-align: center;
}

.get-trios-icon {
  font-size: 28px;
  color: var(--accent);
}

.get-trios-text {
  font-size: 14px;
  color: var(--on-surface);
  margin: 6px 0 14px;
  line-height: 1.5;
}

.get-trios-text a { color: var(--accent); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover { background: var(--accent); color: var(--surface); }
.btn-secondary .material-icons { font-size: 18px; }

.launcher-footer {
  margin-top: 20px;
  padding: 18px 20px;
  background: var(--surface-variant);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
  color: var(--on-surface-dim);
  text-align: center;
}

.launcher-footer p { margin: 0; }
.launcher-footer p + p { margin-top: 10px; }
.launcher-footer a { color: var(--accent); }

.launcher-footer-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
}

.launcher-card code {
  font-family: 'Roboto Mono', 'Consolas', monospace;
  font-size: 0.92em;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---- FAQ ---- */

.faq-section {
  margin-top: 40px;
}

.faq-heading {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 16px;
}

.faq-item {
  background: var(--surface-variant);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.faq-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
  transition: color 0.2s;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary:hover { color: var(--accent); }

.faq-item summary::after {
  content: '\e5cf'; /* Material Icons expand_more */
  font-family: 'Material Icons';
  font-size: 20px;
  color: var(--on-surface-dim);
  flex-shrink: 0;
  transition: transform 0.2s;
}

.faq-item[open] summary::after { transform: rotate(180deg); }

.faq-answer {
  padding: 0 16px 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--on-surface-dim);
}

.faq-answer a { color: var(--accent); }

.faq-answer em { font-style: normal; font-weight: 500; color: var(--on-surface); }

.faq-answer code {
  font-family: 'Roboto Mono', 'Consolas', monospace;
  font-size: 0.9em;
  background: var(--surface);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---- Site footer ---- */

.site-footer {
  border-top: 1px solid var(--surface-high);
  margin-top: 8px;
  padding: 28px 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 18px;
}

.footer-label {
  font-size: 13px;
  color: var(--on-surface-dim);
}

.site-footer a,
.footer-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--on-surface-dim);
  font-size: 13px;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.2s;
}

.site-footer a:hover,
.footer-link-btn:hover { color: var(--accent); }

.site-footer .material-icons { font-size: 16px; }

.footer-tools a { font-weight: 500; color: var(--on-surface); }
.footer-tools a:hover { color: var(--accent); }

.footer-meta { color: var(--on-surface-dim); }

/* ---- Licenses dialog ---- */

.license-dialog {
  /* Restore the centering the global `* { margin: 0 }` reset strips from <dialog>. */
  margin: auto;
  width: min(640px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  padding: 0;
  background: var(--surface-variant);
  color: var(--on-surface);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius);
  overflow: hidden;
}

.license-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

.license-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--surface-high);
}

.license-dialog-head h2 {
  font-size: 16px;
  font-weight: 500;
}

.license-close {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--on-surface-dim);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.license-close:hover { color: var(--accent); }

.license-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  max-height: calc(100vh - 64px - 57px);
}

.license-body section + section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--surface-high);
}

.license-body h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--on-surface);
  text-transform: none;
  letter-spacing: 0;
}

.license-tag {
  font-size: 12px;
  font-weight: 400;
  color: var(--on-surface-dim);
}

.license-note {
  font-size: 13px;
  color: var(--on-surface-dim);
  margin-top: 4px;
}

.license-note a { color: var(--accent); }

.license-body pre {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--surface-high);
  border-radius: var(--radius-sm);
  font-family: 'Roboto Mono', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.6;
  color: var(--on-surface-dim);
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 600px) {
  .stack-layout {
    grid-template-columns: 1fr;
  }
  .install-layout {
    grid-template-columns: 1fr;
  }
  .radio-group {
    flex-direction: column;
    gap: 8px;
  }
}
