/* ============================================================================
   Specimen page layout.
   Structure only — every value comes from the direction's own design system,
   so each specimen is rendered IN the system it documents.
   ========================================================================== */

body { background: var(--bg); }
#spec { min-height: 100vh; display: flex; flex-direction: column; }

.spec-head {
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
  position: sticky; top: 0; z-index: 20;
}
.spec-head-inner { max-width: 1180px; margin: 0 auto; padding: var(--sp-6) var(--sp-5) 0; }
.spec-nav {
  display: flex; align-items: center; gap: var(--sp-1);
  margin-top: var(--sp-5); overflow-x: auto; padding-bottom: 2px;
}
.spec-nav a {
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md) var(--r-md) 0 0;
  font-size: var(--fs-12); color: var(--text-2); white-space: nowrap;
  border: 1px solid transparent; border-bottom: 0;
}
.spec-nav a:hover { color: var(--text); background: var(--surface); border-color: var(--line-soft); }

.spec-main { flex: 1; max-width: 1180px; width: 100%; margin: 0 auto; padding: var(--sp-7) var(--sp-5) var(--sp-9); }
.spec-main section { margin-bottom: var(--sp-9); scroll-margin-top: 190px; }
.spec-main section > h2 {
  padding-bottom: var(--sp-3); margin-bottom: var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.spec-lede { color: var(--text-2); font-size: var(--fs-13); max-width: 76ch; margin-bottom: var(--sp-5); line-height: var(--lh-body); }
.spec-note { margin-top: var(--sp-3); max-width: 72ch; }
.spec-block { margin-bottom: var(--sp-6); }
.spec-block:last-child { margin-bottom: 0; }
.spec-block > h3 { margin-bottom: var(--sp-2); }

.spec-list { display: flex; flex-direction: column; gap: var(--sp-2); font-size: var(--fs-12); color: var(--text-2); }
.spec-list li { padding-left: var(--sp-4); position: relative; }
.spec-list li::before {
  content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 1px; background: var(--accent);
}

.spec-table { border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }

.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }
.swatch {
  display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto;
  gap: 2px var(--sp-3); align-items: center;
  padding: var(--sp-2); border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--surface);
}
.sw-chip { grid-row: span 2; width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.sw-name { font-size: var(--fs-11); align-self: end; overflow-wrap: anywhere; }
.sw-val { font-size: var(--fs-11); align-self: start; overflow-wrap: anywhere; }

.spec-rows { display: flex; flex-direction: column; gap: var(--sp-2); }
.spec-row { display: flex; align-items: center; gap: var(--sp-3); font-size: var(--fs-12); }
.ruler { height: 12px; border-radius: 2px; background: var(--accent-soft); border-left: 2px solid var(--accent); }
.radbox { width: 34px; height: 34px; flex: none; background: var(--surface-3); border: 1px solid var(--line-strong); }
.hbox { width: 76px; flex: none; border-radius: var(--r-md); background: var(--accent-soft); border: 1px solid var(--accent-line); }

.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--sp-2); margin-top: var(--sp-3); }
.icon-cell {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-2); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  background: var(--surface); color: var(--text-2); min-width: 0;
}
.icon-cell:hover { color: var(--accent); border-color: var(--accent-line); }
.icon-cell .t-micro { max-width: 100%; }

.shelldiagram {
  display: flex; gap: 4px; margin-top: var(--sp-3); height: 96px;
  border: 1px solid var(--line); border-radius: var(--r-md); padding: 4px; background: var(--bg-sunken);
}
.shelldiagram .sd {
  display: grid; place-items: center; border-radius: var(--r-sm);
  font-size: var(--fs-11); color: var(--text-3); background: var(--surface-2); border: 1px dashed var(--line);
}
.shelldiagram .rail { width: 46px; }
.shelldiagram .nav { width: 132px; }
.shelldiagram .ops { width: 118px; }
.shelldiagram .main { flex: 1; background: var(--surface); color: var(--text-2); border-style: solid; }

.spec-foot {
  display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap;
  padding: var(--sp-5); border-top: 1px solid var(--line);
  max-width: 1180px; width: 100%; margin: 0 auto;
  font-size: var(--fs-12); color: var(--text-3);
}
.spec-foot a { color: var(--text-2); }
.spec-foot a:hover { color: var(--accent); }

@media (max-width: 900px) {
  .spec-head-inner .row { flex-direction: column; }
  .grid.c2 { grid-template-columns: minmax(0, 1fr); }
}
