:root{
  --bg: #f5f7ff;
  --bg2:#eef2ff;
  --card: rgba(255,255,255,.88);
  --card-strong: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --border: rgba(15,23,42,.12);

  --primary:#1d4ed8;
  --primary2:#0ea5e9;
  --accent:#14b8a6;
  --danger:#dc2626;

  --shadow: 0 18px 44px rgba(2,6,23,.12);
  --shadow2: 0 10px 26px rgba(2,6,23,.10);
  --r: 18px;
  --r2: 14px;
  --focus: rgba(29,78,216,.18);

  --container: 1040px;
}

*{ box-sizing: border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0;
  min-height:100vh;
  color:var(--text);
  background:
    radial-gradient(900px 520px at 14% -10%, rgba(29,78,216,.16), transparent 60%),
    radial-gradient(900px 520px at 96% 0%, rgba(14,165,233,.14), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg2));
  font-family: "Zen Kaku Gothic New", "Meiryo UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", "Noto Sans JP", system-ui, -apple-system, "Segoe UI",
    "Yu Gothic", "Meiryo", sans-serif;
  font-feature-settings: "palt";
  font-kerning: normal;
  line-height:1.7;
}

a{ color: var(--primary); text-decoration:none; }
a:hover{ text-decoration: underline; }

.container{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

.skip-link{
  position:absolute; left:-9999px; top:12px; z-index:100;
  padding:10px 12px; border-radius:999px;
  background: var(--card-strong);
  color: var(--text);
  border:1px solid var(--border);
  box-shadow: var(--shadow2);
}
.skip-link:focus{ left: 16px; }

/* Header */
.site-header{
  position: sticky;
  top:0;
  z-index:50;
  background: rgba(255,255,255,.80);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow2);
}
.site-header::after{
  content:"";
  position:absolute;
  left:0; right:0; bottom:-1px;
  height:2px;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  opacity:.95;
}
.header-inner{
  display:flex;
  align-items:center;
  gap:12px;
  padding: 12px 0;
  /* 重要：折り返しを防ぎ、ナビは横スクロールへ */
  flex-wrap: nowrap;
}

.site-title{
  flex: 0 0 auto;
  min-width: 0;
}
.site-title a{
  display:flex;
  align-items:center;
  gap:10px;
  color: var(--text);
  text-decoration:none;
}
.site-title a:hover{ text-decoration:none; }

.site-mark{
  width:34px; height:34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  color:#fff;
  font-weight:900;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: 0 14px 26px rgba(29,78,216,.20);
  flex: 0 0 auto;
}
.site-name{
  font-weight: 900;
  letter-spacing: .01em;
  white-space: nowrap;
}
.site-tagline{
  font-size: 11px;
  color: rgba(71,85,105,.85);
  font-weight: 700;
  letter-spacing: .12em;
  margin-left: 44px; /* align under name after icon */
  margin-top: 2px;
  white-space: nowrap;
}

/* ✅ ナビを「切れない・横スライドできる」ようにする */
.nav{
  flex: 1 1 auto;     /* 残り幅を使う（= 幅が確定する） */
  min-width: 0;       /* これが無いと縮まず、切れる原因になる */
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  padding: 2px 2px;
  margin-left: auto;
  scrollbar-gutter: stable both-edges;
}
.nav a{
  flex: 0 0 auto;     /* 文字を縮めず、必要ならスクロールさせる */
  white-space: nowrap;
  color: rgba(71,85,105,.92);
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  border: 1px solid transparent;
  transition: background .12s ease, border-color .12s ease, transform .12s ease, color .12s ease;
}
.nav a:hover{
  text-decoration:none;
  background: rgba(29,78,216,.06);
  border-color: rgba(29,78,216,.18);
  color: var(--text);
  transform: translateY(-1px);
}
.nav a[aria-current="page"]{
  background: rgba(29,78,216,.08);
  border-color: rgba(29,78,216,.25);
  color: var(--text);
}

/* スクロールバー（見える方が「横に動く」ことが伝わりやすい） */
.nav::-webkit-scrollbar{ height: 6px; }
.nav::-webkit-scrollbar-thumb{
  background: rgba(15,23,42,.18);
  border-radius: 999px;
}
.nav::-webkit-scrollbar-track{
  background: transparent;
}

/* Main */
.main{ padding: 26px 0 52px; }

h1{
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 12px;
}
h2{
  font-size: 18px;
  margin: 26px 0 10px;
  padding-left: 10px;
  border-left: 6px solid rgba(29,78,216,.55);
}
hr{
  border:0;
  border-top:1px solid var(--border);
  margin:20px 0;
}
.muted{ color: var(--muted); }

/* Notice / alert */
.notice,.alert{
  border: 1px solid var(--border);
  border-left-width: 6px;
  border-radius: var(--r);
  padding: 10px 12px;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(2,6,23,.04);
}
.notice{
  border-left-color: var(--accent);
  background: rgba(20,184,166,.10);
}
.alert{
  border-left-color: var(--primary2);
  background: rgba(14,165,233,.10);
}
.alert-danger{
  border-left-color: var(--danger);
  border-color: rgba(220,38,38,.22);
  background: rgba(220,38,38,.08);
}

/* Hero */
.hero{
  border:1px solid rgba(29,78,216,.16);
  background: rgba(255,255,255,.82);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: 0 1px 0 rgba(2,6,23,.04);
}
.cta-row{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.check-list{ padding-left:1.2em; margin: 10px 0 0; }
.check-list li{ margin: 6px 0; }

/* Cards */
.card-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.card{
  display:block;
  background: var(--card);
  border:1px solid var(--border);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: 0 1px 0 rgba(2,6,23,.04);
  transition: transform .08s ease, box-shadow .08s ease, border-color .08s ease;
  text-decoration:none;
}
.card:hover{
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(29,78,216,.35);
  text-decoration:none;
}
.card-title{
  font-weight: 900;
  margin-bottom: 4px;
  color: var(--text);
}
.card-desc{
  color: var(--muted);
  font-size: 14px;
}
.badge{
  display:inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: rgba(20,184,166,.14);
  color: #0f766e;
  margin-left: 8px;
}

/* Buttons */
.button{
  display:inline-block;
  border:0;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 900;
  cursor:pointer;
  color:#fff;
  background: linear-gradient(90deg, var(--primary), var(--primary2));
  box-shadow: 0 10px 18px rgba(29,78,216,.18);
}
.button:hover{ filter: brightness(1.02); }
.button.danger{ background: linear-gradient(90deg, #ef4444, #f97316); }

.button-link{
  display:inline-block;
  border: 1px solid rgba(29,78,216,.35);
  border-radius: 12px;
  padding: 9px 12px;
  font-weight: 900;
  color: var(--primary);
  background: rgba(255,255,255,.90);
  text-decoration:none;
}
.button-link:hover{
  background: rgba(29,78,216,.06);
  text-decoration:none;
}
.button-sm{
  padding: 8px 10px;
  border-radius: 12px;
  font-weight: 850;
  font-size: 13px;
}

/* Tables */
.table-wrap{
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow:auto;
  background: var(--card);
  box-shadow: 0 1px 0 rgba(2,6,23,.04);
}
table{
  width:100%;
  border-collapse: collapse;
  min-width: 720px;
}
thead th{
  text-align:left;
  background: rgba(29,78,216,.06);
  padding: 10px 10px;
  font-weight: 900;
  border-bottom: 1px solid var(--border);
}
tbody td{
  padding: 10px 10px;
  border-top: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:nth-child(even){ background: rgba(2,6,23,.02); }
tbody tr:hover{ background: rgba(29,78,216,.05); }

/* sample tables (home / samples) */
.table-sample{ table-layout: fixed; min-width: 0; }
.table-sample th:nth-child(1),
.table-sample td:nth-child(1){ width: 130px; }
.table-sample th:nth-child(2),
.table-sample td:nth-child(2){ width: 110px; }

/* Forms */
form{ margin-top: 12px; }
.form{ max-width: 760px; }
.field{ margin-bottom: 12px; }
.field label{
  display:block;
  font-weight: 850;
  margin-bottom: 6px;
  color: var(--muted);
}
.field input,.field select,.field textarea{
  width:100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
}
.field textarea{ resize: vertical; }
.field input:focus,.field select:focus,.field textarea:focus{
  outline:none;
  border-color: rgba(29,78,216,.65);
  box-shadow: 0 0 0 4px var(--focus);
}

/* Filter bar */
.filter-bar{
  display:flex;
  gap: 12px;
  align-items:center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: rgba(255,255,255,.85);
  box-shadow: 0 1px 0 rgba(2,6,23,.04);
  margin: 12px 0 16px;
}
.filter-form{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
}
.filter-form label{
  font-weight: 850;
  color: var(--muted);
}
.filter-form select{ min-width: 170px; }
.filter-actions{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
}

/* Gallery */
.gallery{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0 6px;
}
.gallery figure{
  margin:0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow:hidden;
  box-shadow: 0 1px 0 rgba(2,6,23,.04);
}
.gallery img{
  width:100%;
  height: 180px;
  object-fit: cover;
  display:block;
  background: #f1f5f9;
}
.gallery figcaption{
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

/* Footer */
.site-footer{
  padding: 22px 0 30px;
  color: var(--muted);
}
.site-footer .container{
  background: rgba(255,255,255,.85);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 12px 16px;
  box-shadow: 0 1px 0 rgba(2,6,23,.04);
}

/* Mobile tune */
@media (max-width: 640px){
  h1{ font-size: 24px; }

  .header-inner{ padding: 10px 0; }
  .site-mark{ width: 30px; height: 30px; border-radius: 11px; }
  .site-tagline{ display:none; }

  /* タイトルが長い場合にナビを圧迫しすぎないよう省略 */
  .site-name{
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav a{ font-size: 13px; padding: 7px 10px; }

  /* テーブルは横スクロール前提 */
  table{ min-width: 900px; }
  .table-sample{ min-width: 720px; }
}
