:root {
  --bg: #f5f6f7;
  --panel: #ffffff;
  --soft: #fafafa;
  --muted-bg: #eef1f3;
  --text: #20262e;
  --muted: #606a75;
  --line: #d9dee5;
  --line-strong: #c8ced7;
  --dark: #222b36;
  --green: #46852d;
  --green-dark: #3a7025;
  --red: #b42318;
  --red-soft: #fef3f2;
  --blue-soft: #eff6ff;
  --shadow: 0 8px 25px rgba(20, 30, 45, .06);
  --radius: 10px;
  --container: 1120px;
  --wide: 1360px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: Inter, "Noto Sans JP", "Yu Gothic UI", "Hiragino Sans", Meiryo, sans-serif;
  line-height: 1.65;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
pre, code { font-family: "Cascadia Code", Consolas, monospace; }
pre { margin: 0; overflow: auto; }

.container, .wide-container { width: min(calc(100% - 40px), var(--container)); margin: 0 auto; }
.wide-container { width: min(calc(100% - 40px), var(--wide)); }

.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 750; }
.brand-mark { width: 38px; height: 38px; border-radius: 9px; background: var(--dark); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.top-nav { display: flex; align-items: center; gap: 20px; }
.top-nav a, .nav-button { text-decoration: none; color: var(--muted); font-weight: 650; background: none; border: 0; padding: 7px 0; cursor: pointer; }
.top-nav a:hover, .top-nav a.active, .nav-button:hover { color: var(--text); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -.02em; }
h1 { margin: 0 0 16px; font-size: clamp(38px, 6vw, 58px); }
h2 { margin: 0 0 11px; font-size: 29px; }
h3 { margin: 0 0 8px; font-size: 20px; }
p { margin: 0 0 12px; }
.eyebrow { margin-bottom: 9px; color: var(--muted); font-size: 13px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.page-lead, .hero-copy, .section-heading p, .page-title p { color: var(--muted); }

.button { min-height: 44px; padding: 0 17px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); text-decoration: none; font-weight: 720; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.button:hover { background: #f9fafb; }
.button.primary { background: var(--dark); color: #fff; border-color: var(--dark); }
.button.primary:hover { background: #111820; }
.button.danger { color: var(--red); border-color: #f0b5af; background: #fff; }
.button.small { min-height: 35px; padding: 0 11px; font-size: 13px; }
.button.disabled { pointer-events: none; opacity: .55; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }

.home-hero { padding: 58px 0 40px; }
.home-hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(330px, .8fr); gap: 30px; align-items: start; }
.hero-copy { max-width: 760px; font-size: 17px; }
.terminal-card, .plain-card, .release-summary, .docs-nav, .docs-body, .download-box, .selected-download, .all-assets-section, .admin-card, .login-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.terminal-card { overflow: hidden; }
.terminal-title { padding: 12px 15px; border-bottom: 1px solid var(--line); background: var(--soft); font-weight: 700; }
.terminal-card pre, .docs-body pre { padding: 17px; background: #fff; white-space: pre-wrap; }
.section { padding: 34px 0 46px; }
.section-muted { background: var(--muted-bg); }
.section-heading { margin-bottom: 20px; }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plain-card { padding: 22px; }
.plain-card p { color: var(--muted); margin: 0; }
.release-summary { padding: 22px; display: flex; justify-content: space-between; gap: 22px; align-items: center; }
.status-badge { display: inline-flex; padding: 4px 9px; border-radius: 999px; background: #eaf5e4; color: #377021; font-size: 12px; font-weight: 750; margin-bottom: 9px; }

.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.docs-nav { padding: 16px; position: sticky; top: 18px; }
.docs-nav a { display: block; color: var(--muted); text-decoration: none; padding: 8px 4px; }
.docs-nav a:hover { color: var(--text); }
.docs-body { padding: 30px; }
.docs-body section { margin-top: 34px; scroll-margin-top: 16px; }
.docs-body pre { border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }

.download-main { padding: 35px 0 52px; }
.page-title { margin-bottom: 20px; }
.page-title h1 { font-size: clamp(35px, 5vw, 48px); margin-bottom: 8px; }
.download-box, .selected-download, .all-assets-section { padding: 24px; }
.download-box + .selected-download, .selected-download + .all-assets-section { margin-top: 18px; }
.control-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; align-items: end; }
label { display: flex; flex-direction: column; gap: 6px; }
label > span { color: var(--muted); font-size: 13px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); padding: 10px 12px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #87909c; box-shadow: 0 0 0 3px rgba(52, 64, 79, .09); }
textarea { resize: vertical; }
.notice-bar { margin-top: 17px; padding: 11px 13px; border-radius: 6px; background: var(--green); color: #fff; display: flex; gap: 9px; font-size: 14px; }
.install-command { margin-top: 15px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.install-command-head, .install-command-foot { padding: 11px 13px; background: #f8f9fa; color: var(--muted); border-bottom: 1px solid var(--line); }
.install-command-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 650; }
.install-command-head button { border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 7px 10px; cursor: pointer; color: var(--text); font-weight: 650; }
.install-command pre { padding: 19px; min-height: 245px; background: #fff; white-space: pre-wrap; line-height: 1.75; }
.install-command-foot { border-top: 1px solid var(--line); border-bottom: 0; }
.small-note { color: var(--muted); margin: 12px 0 0; }
.selected-download { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 25px; }
.download-button { min-width: 300px; background: var(--green); border-color: var(--green); color: #fff; }
.download-button:hover { background: var(--green-dark); }
.asset-meta { margin: 18px 0 0; display: grid; gap: 8px; }
.asset-meta div { display: grid; grid-template-columns: 135px minmax(0, 1fr); gap: 12px; }
.asset-meta dt { color: var(--muted); }
.asset-meta dd { margin: 0; word-break: break-all; }
.all-assets-section h2 { margin-bottom: 17px; }
.asset-table-wrap { overflow-x: auto; }
.asset-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.asset-table th, .asset-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.asset-table th { color: var(--muted); background: #f8f9fa; }
.asset-table tr:last-child td { border-bottom: 0; }
.asset-table a { color: #315e1f; font-weight: 700; }

.message { padding: 12px 14px; border-radius: 7px; margin-bottom: 16px; background: var(--blue-soft); color: #24466f; border: 1px solid #cbdff9; }
.message.error { background: var(--red-soft); color: var(--red); border-color: #f5c4bf; }
.message.success { background: #edf8e9; color: #376d24; border-color: #c9e8bb; }

.admin-page { background: #f1f3f5; }
.login-panel { width: min(480px, 100%); margin: 34px auto; padding: 28px; }
.login-panel h1 { font-size: 34px; }
.stack-form { display: grid; gap: 13px; }
.admin-heading { display: flex; justify-content: space-between; gap: 18px; align-items: start; margin-bottom: 20px; }
.admin-heading h1 { font-size: 40px; margin-bottom: 6px; }
.admin-heading p { color: var(--muted); }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.stats-grid article { background: #fff; border: 1px solid var(--line); border-radius: 9px; padding: 16px; }
.stats-grid span { display: block; color: var(--muted); font-size: 13px; }
.stats-grid strong { display: block; margin-top: 4px; font-size: 28px; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.admin-card { padding: 22px; }
.two-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.three-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
progress { width: 100%; }
.releases-card { margin-top: 18px; }
.card-heading { display: flex; justify-content: space-between; gap: 15px; align-items: center; margin-bottom: 15px; }
.release-list { display: grid; gap: 13px; }
.release-admin-item { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.release-admin-head { padding: 14px; display: flex; justify-content: space-between; gap: 16px; align-items: start; background: #f8f9fa; border-bottom: 1px solid var(--line); }
.release-admin-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.release-admin-title h3 { margin: 0; }
.badge { display: inline-flex; padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 750; background: #e9edf2; color: #47515d; }
.badge.published { background: #eaf5e4; color: #376e23; }
.badge.nightly { background: #fff4db; color: #805c11; }
.release-admin-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.release-admin-body { padding: 14px; }
.release-notes { color: var(--muted); white-space: pre-wrap; }
.admin-asset-list { margin-top: 12px; display: grid; gap: 7px; }
.admin-asset-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 10px; background: #fafafa; border: 1px solid var(--line); border-radius: 7px; }
.admin-asset-row small { display: block; color: var(--muted); }
.not-found { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.not-found h1 { font-size: 80px; }
.site-footer { background: #fff; border-top: 1px solid var(--line); }
.footer-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.footer-inner a { color: var(--muted); }

@media (max-width: 1050px) {
  .home-hero-grid, .docs-layout, .selected-download { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .control-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .docs-nav { position: static; }
  .download-button { min-width: 0; width: 100%; }
}
@media (max-width: 820px) {
  .admin-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .container, .wide-container { width: min(calc(100% - 24px), var(--wide)); }
  .header-inner, .footer-inner { flex-direction: column; align-items: flex-start; justify-content: center; padding: 14px 0; }
  .top-nav { flex-wrap: wrap; gap: 14px; }
  .home-hero { padding-top: 36px; }
  .control-grid, .two-fields, .three-fields { grid-template-columns: 1fr; }
  .download-box, .selected-download, .all-assets-section, .admin-card, .docs-body { padding: 17px; }
  .install-command-head, .admin-heading, .release-admin-head { flex-direction: column; align-items: flex-start; }
  .install-command pre { min-height: 190px; }
  .asset-meta div { grid-template-columns: 1fr; gap: 2px; }
  .stats-grid { grid-template-columns: 1fr; }
  .admin-asset-row { grid-template-columns: 1fr; }
}
