:root {
  color-scheme: dark;
  --page: #101214;
  --page-elevated: #171a1d;
  --panel: #1b2024;
  --panel-soft: #20262a;
  --line: #343c42;
  --line-strong: #4d5961;
  --text: #f2f4f5;
  --muted: #aeb7bb;
  --subtle: #77838a;
  --mint: #74d8c6;
  --mint-ink: #0c2825;
  --amber: #efba63;
  --danger: #ef7875;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background: var(--page);
  color: var(--text);
  line-height: 1.45;
}
button, select, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.language-switch { display: grid; grid-template-columns: repeat(2, 1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: #151a1d; }
.language-option { min-width: 42px; padding: 7px 10px; cursor: pointer; color: var(--muted); background: transparent; border: 0; font-size: 11px; font-weight: 800; line-height: 1; }
.language-option + .language-option { border-left: 1px solid var(--line); }
.language-option:hover { color: var(--text); background: var(--panel-soft); }
.language-option.is-selected,
.language-option[aria-pressed="true"] { color: var(--mint-ink); background: var(--mint); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }

main { flex: 1 0 auto; overflow: hidden; }
.workspace { position: relative; max-width: 1220px; margin: 0 auto; padding: 22px 30px 50px; }
.top-actions { position: absolute; top: 22px; right: 30px; z-index: 1; }
.workspace-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 16px; }
.eyebrow { margin: 0 0 9px; color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 800px; margin-bottom: 10px; font-size: clamp(30px, 4vw, 48px); line-height: 1.05; letter-spacing: 0; }
.template-status { display: inline-flex; align-items: center; gap: 9px; flex: 0 0 auto; margin-right: 8px; }
.mod-version { color: var(--subtle); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); }
.template-status.is-ready .status-dot { background: var(--mint); }
.template-status.is-problem .status-dot { background: var(--danger); }

.builder-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .72fr); border: 1px solid var(--line); background: var(--page-elevated); }
.builder-panel { min-width: 0; border-right: 1px solid var(--line); }
.panel-section { padding: 28px 30px; border-bottom: 1px solid var(--line); }
.panel-section:last-child { border-bottom: 0; }
.section-heading { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.step-number { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; background: var(--panel-soft); color: var(--mint); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 11px; font-weight: 700; }
.section-heading h2 { margin-bottom: 3px; font-size: 16px; }
.section-heading p { margin-bottom: 0; color: var(--muted); font-size: 13px; }
.inline-extension-link { padding: 0; cursor: pointer; color: var(--mint); background: transparent; border: 0; border-bottom: 1px solid currentColor; font: inherit; line-height: inherit; }
.inline-extension-link:hover { color: var(--text); }
.inline-extension-link:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; border-bottom-color: transparent; }

.mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode-option { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 13px; cursor: pointer; text-align: left; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 6px; transition: border-color .15s, background-color .15s, color .15s; }
.mode-option:hover { border-color: var(--line-strong); color: var(--text); }
.mode-option.is-selected { color: var(--text); background: #1d292a; border-color: var(--mint); }
.mode-icon { display: grid; place-items: center; flex: 0 0 auto; width: 28px; height: 28px; border-radius: 5px; background: var(--panel-soft); color: var(--mint); font-weight: 800; }
.mode-icon.qol { color: var(--amber); }
.mode-option > span:last-child { min-width: 0; flex: 1 1 auto; }
.mode-option strong, .mode-option small { display: block; overflow-wrap: anywhere; white-space: normal; }
.mode-option strong { font-size: 14px; }
.mode-option small { margin-top: 2px; color: var(--subtle); font-size: 12px; }
.qol-panel { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; padding: 13px; border-left: 2px solid var(--amber); background: #27231b; }
.qol-panel[hidden] { display: none; }
.qol-panel-copy { display: grid; gap: 2px; font-size: 13px; }
.qol-panel-copy strong { color: var(--text); }
.qol-panel-copy span { color: var(--muted); font-size: 12px; }
.qol-panel-copy small { max-width: 420px; margin-top: 4px; color: var(--subtle); font-size: 11px; line-height: 1.35; }
.qol-panel-copy .qol-setting { color: var(--amber); font-weight: 750; }
.branch-options { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; }
.branch-option { padding: 7px 10px; cursor: pointer; color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 4px; font-size: 12px; }
.branch-option.is-selected { color: #1b1913; background: var(--amber); border-color: var(--amber); font-weight: 750; }
.branch-option:disabled { cursor: not-allowed; opacity: .5; }

.drop-zone { display: flex; align-items: center; gap: 14px; padding: 17px; cursor: pointer; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #181d20; transition: background-color .15s, border-color .15s; }
.drop-zone:hover, .drop-zone.is-dragging { border-color: var(--mint); background: #1b2728; }
.drop-zone.has-file { border-style: solid; border-color: var(--mint); }
.upload-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 5px; background: var(--panel-soft); color: var(--mint); font-size: 26px; font-weight: 300; line-height: 1; }
.drop-copy { display: grid; gap: 1px; min-width: 0; }
.drop-copy strong { font-size: 14px; }
.drop-copy small { color: var(--muted); font-size: 12px; }
.file-button { margin-left: auto; flex: 0 0 auto; padding: 7px 10px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--text); font-size: 12px; }
.export-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 0 0; color: var(--muted); font-size: 12px; }
.export-summary[hidden] { display: none; }
.extension-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 18px; padding: 13px; border: 1px solid var(--line); border-radius: 6px; background: #151a1d; }
.extension-cta.is-highlighted { animation: extension-highlight 1.35s ease-out; }
.extension-cta strong, .extension-cta span { display: block; }
.extension-cta strong { margin-bottom: 2px; font-size: 13px; }
.extension-cta span { color: var(--muted); font-size: 12px; }
.extension-buttons { display: flex; flex: 0 0 auto; gap: 7px; }
.extension-button { padding: 7px 10px; border: 1px solid var(--mint); border-radius: 4px; color: var(--mint); font-size: 12px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.extension-button:hover { color: var(--mint-ink); background: var(--mint); }
@keyframes extension-highlight { 0%, 45% { border-color: var(--mint); box-shadow: 0 0 0 3px rgb(101 226 189 / 18%); } 100% { border-color: var(--line); box-shadow: none; } }
.community-export { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 12px; padding: 11px 13px; border-top: 1px solid var(--line); }
.community-export[hidden] { display: none; }
.community-export strong, .community-export span { display: block; }
.community-export strong { margin-bottom: 2px; font-size: 13px; }
.community-export span { color: var(--muted); font-size: 12px; }
.install-panel .community-export { margin-top: auto; }
.install-panel .priority-note { margin-top: 12px; }
.summary-file { overflow: hidden; color: var(--text); text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.icon-button { width: 25px; height: 25px; padding: 0; cursor: pointer; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 4px; font-size: 18px; line-height: 1; }
.icon-button:hover { color: var(--text); border-color: var(--line-strong); }

.action-section { background: #15191c; }
.privacy-note { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 16px; color: var(--muted); font-size: 12px; }
.lock-icon { margin-top: 4px; color: var(--mint); font-size: 8px; }
.build-button { width: 100%; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; cursor: pointer; color: var(--mint-ink); background: var(--mint); border: 0; border-radius: 6px; font-weight: 800; line-height: 1.2; transition: filter .15s, transform .15s; }
.build-button:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.build-button:disabled { cursor: not-allowed; color: #71817f; background: #344442; }
.button-arrow { font-size: 20px; line-height: 1; }
.build-status { min-height: 18px; margin: 10px 0 0; color: var(--subtle); font-size: 12px; }
.build-status.is-success { color: var(--mint); }
.build-status.is-error { color: var(--danger); }

.install-panel { display: flex; flex-direction: column; padding: 28px 26px; background: #14181b; }
.install-panel-head { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.install-panel-head h2 { margin-bottom: 0; font-size: 19px; }
.install-list { display: grid; gap: 21px; padding: 25px 0; margin: 0; list-style: none; }
.install-list li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
.install-list li > span { display: grid; place-items: center; width: 22px; height: 22px; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--mint); font-size: 11px; font-weight: 750; }
.install-list strong { display: block; margin-bottom: 4px; font-size: 13px; }
.install-list p { margin-bottom: 0; color: var(--muted); font-size: 12px; }
.priority-note { margin-top: auto; padding: 13px; border: 1px solid #635635; border-radius: 6px; background: #27251d; }
.priority-label { display: block; margin-bottom: 8px; color: var(--amber); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.priority-note code { color: var(--text); font-size: 12px; }
.priority-arrow { padding: 0 4px; color: var(--amber); }
.priority-note p { margin: 9px 0 0; color: var(--muted); font-size: 11px; }

.showcase { display: grid; grid-template-columns: minmax(220px, .52fr) minmax(0, 1fr); grid-template-areas: "copy primary" "secondary primary"; align-items: start; column-gap: clamp(28px, 5vw, 70px); row-gap: 18px; width: min(1220px, calc(100% - 60px)); margin: 0 auto; padding: 44px 0 56px; border-top: 1px solid var(--line); }
.showcase-copy { grid-area: copy; padding-top: 12px; }
.showcase-kicker { display: block; margin-bottom: 9px; color: var(--mint); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.showcase h2 { max-width: 320px; margin-bottom: 9px; font-size: clamp(24px, 3vw, 34px); line-height: 1.12; }
.showcase p { max-width: 290px; margin-bottom: 0; color: var(--muted); font-size: 14px; }
.showcase-secondary-list { display: grid; grid-area: secondary; gap: 12px; width: 100%; }
.showcase-secondary { width: 100%; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #08090a; }
.showcase-image-button { display: block; width: 100%; padding: 0; cursor: pointer; background: transparent; border: 0; }
.showcase-image-button img { display: block; width: 100%; height: auto; }
.showcase-image-button:focus-visible { outline: 2px solid var(--mint); outline-offset: -2px; }
.showcase-figure { grid-area: primary; width: min(100%, 760px); margin: 0; justify-self: end; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #08090a; box-shadow: 0 18px 40px rgb(0 0 0 / 26%); }
.showcase-figure img { display: block; width: 100%; height: auto; }

.image-lightbox { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 64px 28px 28px; overflow: hidden; background: rgb(3 4 5 / 94%); cursor: default; }
.image-lightbox[hidden] { display: none; }
.image-lightbox-image { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; cursor: default; transform: translate(0, 0) scale(1); transform-origin: center; }
.image-lightbox-close { position: absolute; top: 18px; right: 22px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer; color: var(--text); background: #161b1ee8; border: 1px solid var(--line-strong); border-radius: 5px; font-size: 25px; line-height: 1; }
.image-lightbox-close > span { display: block; transform: translateY(-3px); }
.image-lightbox-close:hover { color: var(--mint); border-color: var(--mint); }
.image-lightbox-close:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
body.is-lightbox-open { overflow: hidden; }

/* Site navigation and section views */
.site-shell { width: min(1220px, calc(100% - 60px)); margin: 0 auto; padding: 20px 0 56px; }
.site-toolbar { display: grid; grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr); align-items: center; gap: 20px; min-height: 52px; margin-bottom: 34px; }
.brand-button { display: inline-flex; align-items: center; justify-self: start; gap: 9px; padding: 5px 0; cursor: pointer; color: var(--text); background: transparent; border: 0; }
.brand-button img { width: 28px; height: 28px; }
.brand-button strong { font-size: 18px; }
.brand-button .template-status { margin: 0 0 0 2px; }
.site-tabs { display: flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: #15191c; }
.site-tab { padding: 8px 14px; cursor: pointer; color: var(--muted); background: transparent; border: 0; border-radius: 4px; font-size: 12px; font-weight: 750; white-space: nowrap; }
.site-tab:hover { color: var(--text); background: var(--panel-soft); }
.site-tab.is-selected { color: var(--mint-ink); background: var(--mint); }
.site-toolbar .language-switch { justify-self: end; }
.tab-view[hidden] { display: none; }
.tab-view { min-height: 560px; }
.view-heading { max-width: 680px; margin-bottom: 28px; }
.view-heading h1 { margin-bottom: 9px; font-size: clamp(29px, 4vw, 43px); }
.view-heading > p { max-width: 620px; margin-bottom: 0; color: var(--muted); font-size: 14px; }

/* Overview */
.overview-hero { display: grid; grid-template-columns: minmax(300px, .85fr) minmax(430px, 1.15fr); align-items: center; gap: clamp(34px, 6vw, 82px); min-height: 500px; }
.overview-copy h1 { max-width: 590px; margin-bottom: 17px; font-size: clamp(40px, 5.4vw, 68px); line-height: 1.02; }
.overview-copy > p { max-width: 520px; margin-bottom: 0; color: var(--muted); font-size: 16px; }
.overview-points { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.overview-points span { padding: 5px 8px; color: var(--muted); background: #171c1f; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; font-weight: 700; }
.overview-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 27px; }
.primary-action, .secondary-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; cursor: pointer; border-radius: 5px; font-size: 13px; font-weight: 800; line-height: 1.2; text-align: center; }
.primary-action { position: relative; min-width: 188px; padding-inline: 38px; color: var(--mint-ink); background: var(--mint); border: 1px solid var(--mint); }
.primary-action span:last-child { position: absolute; right: 15px; top: 50%; transform: translateY(-52%); font-size: 17px; line-height: 1; }
.primary-action:hover { background: #91e5d6; }
.secondary-action { color: var(--text); background: transparent; border: 1px solid var(--line-strong); }
.secondary-action:hover { border-color: var(--mint); color: var(--mint); }
.overview-extension { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; max-width: 520px; margin-top: 17px; color: var(--subtle); font-size: 12px; }
.overview-extension span { flex: 0 0 100%; }
.overview-extension a, .transfer-extension-link { color: var(--mint); text-decoration: underline; text-decoration-color: rgb(116 216 198 / 45%); text-underline-offset: 3px; }
.overview-extension a:hover, .transfer-extension-link:hover { color: var(--text); text-decoration-color: currentColor; }
.overview-featured { margin: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #08090a; box-shadow: 0 24px 55px rgb(0 0 0 / 30%); }
.overview-featured img { display: block; width: 100%; max-height: 540px; object-fit: contain; object-position: center; }
.overview-tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 36px 0 18px; }
.overview-tools.has-gamebanana { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.overview-tool-link[hidden] { display: none; }
.overview-tools button, .overview-tool-link { display: grid; gap: 4px; padding: 19px 20px; cursor: pointer; text-align: left; text-decoration: none; color: var(--text); background: var(--page-elevated); border: 1px solid var(--line); border-radius: var(--radius); }
.overview-tools button:hover, .overview-tool-link:hover { border-color: var(--mint); background: #1a2425; }
.overview-tools strong { font-size: 15px; }
.overview-tools span { color: var(--muted); font-size: 12px; }
.overview-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.overview-gallery .showcase-secondary { display: flex; align-items: center; min-height: 150px; }
.feature-showcase { padding: 58px 0; border-top: 1px solid var(--line); }
.feature-heading { max-width: 760px; }
.feature-heading h2, .controls-heading h2 { margin-bottom: 10px; font-size: clamp(28px, 4vw, 42px); line-height: 1.08; }
.feature-heading p, .controls-heading p { max-width: 700px; margin-bottom: 0; color: var(--muted); font-size: 15px; }
.feature-media { margin: 28px 0 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #08090a; box-shadow: 0 20px 45px rgb(0 0 0 / 24%); }
.feature-media img { display: block; width: 100%; height: auto; }
.feature-media-topbar { padding: 18px 0; background: #24180e; }
.controls-showcase { padding: 58px 0 8px; border-top: 1px solid var(--line); }
.controls-heading { max-width: 760px; margin-bottom: 28px; }
.control-feature-manager { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr); align-items: center; gap: 0; margin-bottom: 14px; }
.control-feature-manager > div, .control-feature-manager figure { width: min(100%, 784px); }
.control-feature-manager figure { margin: 0; }
.controls-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .75fr); gap: 14px; align-items: stretch; }
.control-feature { display: flex; flex-direction: column; min-width: 0; padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--page-elevated); }
.control-feature h3 { margin: 0 0 7px; font-size: 18px; }
.control-feature p { margin: 0; color: var(--muted); font-size: 13px; }
.control-feature figure { margin: 22px 0 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 6px; background: #08090a; }
.control-feature-manager figure { margin-top: 16px; }
.control-feature-profile figure { margin-top: 22px; }
.control-feature img { display: block; width: 100%; height: auto; }
.matchlist-showcase { display: grid; grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr); align-items: center; gap: 34px; padding: 58px 0 8px; border-top: 1px solid var(--line); }
.matchlist-copy h2 { margin-bottom: 10px; font-size: clamp(25px, 3.4vw, 36px); line-height: 1.08; }
.matchlist-copy p { margin: 0; color: var(--muted); font-size: 14px; }
.matchlist-media { margin: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #08090a; box-shadow: 0 20px 45px rgb(0 0 0 / 24%); }
.matchlist-media img { display: block; width: 100%; height: auto; }

/* Transfer */
.transfer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.task-panel { min-width: 0; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--page-elevated); }
.task-direction { display: inline-block; margin-bottom: 12px; color: var(--mint); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.task-panel h2 { margin-bottom: 8px; font-size: 20px; }
.task-panel > p:not(.build-status) { min-height: 60px; margin-bottom: 20px; color: var(--muted); font-size: 13px; }
.task-panel .drop-zone { min-height: 74px; }
.build-button.compact { display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 190px; min-height: 42px; margin-top: 16px; padding: 0 14px; text-align: center; }
.field-label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.code-input { width: 100%; height: 48px; padding: 0 14px; color: var(--text); background: #101518; border: 1px solid var(--line-strong); border-radius: 5px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 20px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
.code-input:focus { border-color: var(--mint); outline: 0; box-shadow: 0 0 0 2px rgb(116 216 198 / 13%); }
.code-result { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--mint); border-radius: 5px; background: #172422; }
.code-result[hidden] { display: none; }
.code-result code { flex: 1; color: var(--text); font-size: 21px; font-weight: 800; letter-spacing: .18em; }
.code-result button { padding: 6px 9px; cursor: pointer; color: var(--mint); background: transparent; border: 1px solid var(--mint); border-radius: 4px; font-size: 11px; font-weight: 750; }
.data-notice { display: flex; gap: 12px; margin-top: 14px; padding: 14px 16px; color: var(--muted); border-left: 2px solid var(--mint); background: #161c1e; font-size: 12px; }
.data-notice strong { flex: 0 0 auto; color: var(--text); }
.secondary-link { margin-top: 12px; font-size: 12px; }
.install-builder-grid { align-items: stretch; }
.legal-page { width: min(820px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 64px; }
.legal-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 40px; }
.legal-brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-size: 18px; font-weight: 800; text-decoration: none; }
.legal-brand img { width: 28px; height: 28px; }
.legal-back { color: var(--mint); font-size: 13px; text-decoration: none; }
.legal-document { padding: clamp(24px, 5vw, 48px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--page-elevated); }
.legal-document h1 { font-size: clamp(30px, 5vw, 46px); }
.legal-document h2 { margin: 30px 0 8px; font-size: 17px; }
.legal-document p, .legal-document li { color: var(--muted); font-size: 14px; }
.legal-document li + li { margin-top: 6px; }
.legal-document a { color: var(--mint); }
.legal-updated { color: var(--subtle); font-size: 12px; }
.legal-language { margin-top: 46px; padding-top: 36px; border-top: 1px solid var(--line); }

footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex: 0 0 auto; width: 100%; max-width: 1220px; margin: 0 auto; padding: 22px 30px 34px; color: var(--subtle); font-size: 12px; }
.footer-legal { display: flex; gap: 13px; color: var(--subtle); font-size: 12px; }
.footer-legal a:hover { color: var(--mint); }
.footer-identity { display: flex; align-items: center; gap: 10px; }
.footer-contacts { display: flex; gap: 6px; }
.contact-button { position: relative; display: grid; place-items: center; width: 28px; height: 28px; padding: 0; cursor: pointer; color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 4px; }
.contact-button:hover { color: var(--mint); border-color: var(--mint); }
.contact-button svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.contact-button::after { content: attr(data-tooltip); position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 260px; padding: 6px 8px; pointer-events: none; opacity: 0; color: var(--text); background: #252c30; border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: 0 6px 18px rgb(0 0 0 / 32%); font-size: 11px; line-height: 1.2; white-space: nowrap; }
.contact-button:hover::after, .contact-button:focus-visible::after { opacity: 1; }
.site-toast { position: fixed; z-index: 150; left: 50%; bottom: 24px; transform: translate(-50%, 10px); padding: 10px 14px; pointer-events: none; opacity: 0; color: var(--text); background: #252c30; border: 1px solid var(--mint); border-radius: 5px; box-shadow: 0 12px 30px rgb(0 0 0 / 38%); font-size: 12px; font-weight: 700; transition: opacity .14s, transform .14s; }
.site-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 820px) {
  .site-shell { width: calc(100% - 40px); padding-top: 16px; }
  .site-toolbar { grid-template-columns: 1fr auto; gap: 12px; margin-bottom: 26px; }
  .site-tabs { grid-column: 1 / -1; grid-row: 2; justify-content: center; }
  .site-toolbar .language-switch { grid-column: 2; grid-row: 1; }
  .overview-hero { grid-template-columns: 1fr; min-height: 0; }
  .overview-copy h1 { font-size: clamp(38px, 9vw, 58px); }
  .overview-featured { max-width: 680px; }
  .feature-showcase, .controls-showcase, .matchlist-showcase { padding-top: 44px; padding-bottom: 44px; }
  .control-feature-manager, .matchlist-showcase { grid-template-columns: 1fr; }
  .control-feature-manager { gap: 0; }
  .control-feature-manager figure { margin-top: 16px; }
  .controls-grid { grid-template-columns: 1fr; }
  .control-feature-profile figure { margin-top: 22px; }
  .transfer-grid { grid-template-columns: 1fr; }
  .task-panel > p:not(.build-status) { min-height: 0; }
  .workspace { padding: 58px 20px 34px; }
  .top-actions { top: 20px; right: 20px; }
  .workspace-heading { display: block; }
  .template-status { margin: 20px 0 0; }
  .builder-grid { grid-template-columns: 1fr; }
  .builder-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .install-panel { min-height: auto; }
  .priority-note { margin-top: 0; }
  .showcase { width: min(100% - 40px, 760px); grid-template-columns: 1fr; grid-template-areas: "copy" "primary" "secondary"; gap: 22px; padding: 36px 0 42px; }
  .showcase-copy { padding-top: 0; }
  .showcase p { max-width: 480px; }
  .showcase-secondary-list { max-width: 520px; }
  .showcase-figure { justify-self: start; }
  .image-lightbox { padding: 58px 14px 14px; }
  .image-lightbox-close { top: 12px; right: 14px; }
  footer { width: calc(100% - 40px); margin: 0 auto; padding-left: 0; padding-right: 0; }
}

@media (max-width: 520px) {
  .site-shell { width: calc(100% - 28px); padding-bottom: 34px; }
  .brand-button .mod-version, .brand-button .template-status { display: none; }
  .site-tabs { width: 100%; overflow-x: auto; justify-content: flex-start; }
  .site-tab { flex: 1 0 auto; padding-inline: 11px; }
  .overview-copy h1 { font-size: 39px; }
  .overview-points { gap: 6px; }
  .feature-media { margin-top: 20px; }
  .feature-media-topbar { padding: 8px 0; }
  .feature-media-topbar .showcase-image-button { overflow: hidden; }
  .feature-media-topbar img { position: relative; left: 50%; width: 820px; max-width: none; transform: translateX(-50%); }
  .control-feature { padding: 16px; }
  .overview-tools, .overview-gallery { grid-template-columns: 1fr; }
  .overview-tools.has-gamebanana { grid-template-columns: 1fr; }
  .task-panel { padding: 21px 17px; }
  .build-button.compact { width: 100%; }
  .data-notice { display: grid; }
  .workspace { padding-left: 14px; padding-right: 14px; }
  .top-actions { right: 14px; }
  .panel-section { padding: 22px 18px; }
  .mode-switch { grid-template-columns: 1fr; }
  .qol-panel { display: block; }
  .branch-options { justify-content: flex-start; margin-top: 10px; }
  .drop-zone { align-items: flex-start; flex-wrap: wrap; }
  .file-button { margin-left: 48px; }
  .export-summary { grid-template-columns: minmax(0, 1fr) auto; }
  .summary-file { grid-column: span 2; }
  .extension-cta { display: block; }
  .extension-buttons { margin-top: 10px; }
  .community-export { display: block; }
  .community-export .extension-button { display: inline-block; margin-top: 10px; }
  .install-panel { padding: 24px 18px; }
  .showcase { width: calc(100% - 28px); padding-top: 30px; }
  footer { display: grid; width: calc(100% - 28px); gap: 8px; }
}
