:root {
  color-scheme: light;
  --bg: #f5f4ef;
  --surface: #ffffff;
  --surface-strong: #fdfbf6;
  --ink: #1f2428;
  --muted: #66706a;
  --line: #d8ddd4;
  --codex: #0c7c66;
  --codex-soft: #e4f4ef;
  --claude: #b24a32;
  --claude-soft: #f8e8e2;
  --accent: #2f5f86;
  --accent-soft: #e3edf4;
  --warn: #8d6b21;
  --warn-soft: #f8efd8;
  --shadow: 0 18px 48px rgba(31, 36, 40, 0.08);
  --radius: 8px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
}

a {
  color: inherit;
  overflow-wrap: anywhere;
}

code {
  font-family: var(--mono);
  font-size: 0.94em;
}

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: absolute;
  top: -64px;
  left: 16px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--ink);
  color: white;
  border-radius: var(--radius);
}

.skip-link:focus {
  top: 12px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 244, 239, 0.92);
  backdrop-filter: blur(14px);
}

.topbar > *,
.intro-band > *,
.control-band > *,
.comparison-row > *,
.card-grid > * {
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  width: min(100%, 720px);
  min-width: 0;
  gap: 12px;
}

.brand > div {
  min-width: 0;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid #1f2428;
  border-radius: var(--radius);
  background: var(--ink);
  color: white;
  font-weight: 800;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.77rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.08rem, 2.2vw, 1.45rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.topbar-meta span {
  min-height: 28px;
  min-width: 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.page-shell {
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 28px clamp(14px, 3vw, 40px) 42px;
}

.intro-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: center;
  padding: clamp(20px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.intro-copy h2 {
  max-width: 820px;
  margin-bottom: 10px;
  font-size: clamp(1.28rem, 3.2vw, 2rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.project-kicker {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin-bottom: 14px;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.intro-copy p {
  max-width: 920px;
  margin-bottom: 0;
  color: var(--muted);
}

.source-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  min-width: 0;
}

.intro-side {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.launcher-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}

.launcher-box p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.launcher-grid {
  display: grid;
  gap: 8px;
}

.launcher-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.source-strip a {
  min-height: 40px;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.source-strip a:hover {
  border-color: var(--accent);
}

.control-band {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 14px;
  align-items: end;
  margin-top: 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.search-field {
  display: grid;
  gap: 4px;
}

.search-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.search-field input,
.filter-row select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}

.search-field input {
  padding: 9px 12px;
}

.filter-row {
  display: grid;
  grid-template-columns: 130px 146px;
  gap: 8px;
}

.filter-row select {
  padding: 8px 10px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(84px, 1fr));
  min-height: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef1ec;
}

.segment {
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.segment:last-child {
  border-right: 0;
}

.segment.is-active {
  background: var(--ink);
  color: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.stat-block {
  min-height: 86px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-block span {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.stat-block p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.results {
  margin-top: 20px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 28px 0 10px;
}

.section-header h2 {
  margin: 0;
  font-size: 1.22rem;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.comparison-list {
  display: grid;
  gap: 10px;
}

.comparison-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(180px, 0.85fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.comparison-cell {
  min-width: 0;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.comparison-cell:last-child {
  border-right: 0;
}

.comparison-task {
  background: #fbfaf5;
}

.comparison-task h3 {
  margin-bottom: 6px;
  font-size: 1rem;
}

.comparison-task p,
.note-cell p,
.command-desc {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.tool-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
}

.copy-row.compact {
  gap: 6px;
}

.cmd-line {
  display: block;
  overflow-x: auto;
  padding: 8px 10px;
  border-radius: 6px;
  background: #20262b;
  color: #f6f7f7;
  line-height: 1.5;
  white-space: nowrap;
}

.copy-button {
  min-width: 68px;
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.copy-button.is-copied {
  border-color: var(--codex);
  background: var(--codex-soft);
  color: var(--codex);
}

.copy-button.copy-failed {
  border-color: var(--claude);
  background: var(--claude-soft);
  color: var(--claude);
}

.copy-row + .command-desc {
  margin-top: 9px;
}

.secondary-command {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.secondary-command span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.secondary-command .cmd-line {
  background: #eef1ec;
  color: var(--ink);
}

.codex-cell .tool-label {
  color: var(--codex);
}

.claude-cell .tool-label {
  color: var(--claude);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.badge.same {
  background: var(--codex-soft);
  color: var(--codex);
}

.badge.similar {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.codex-only {
  background: var(--codex-soft);
  color: var(--codex);
}

.badge.claude-only {
  background: var(--claude-soft);
  color: var(--claude);
}

.note-cell {
  background: #fafbfa;
}

.note-cell strong {
  display: block;
  margin-bottom: 6px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.command-card {
  display: grid;
  align-content: start;
  min-height: 164px;
  padding: 15px;
  border: 1px solid var(--line);
  border-left-width: 5px;
  border-radius: var(--radius);
  background: var(--surface);
}

.command-card.codex {
  border-left-color: var(--codex);
}

.command-card.claude {
  border-left-color: var(--claude);
}

.command-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.empty-state {
  padding: 32px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  text-align: center;
}

.footer {
  padding: 18px clamp(18px, 4vw, 48px) 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.footer p {
  width: min(1480px, 100%);
  margin: 0 auto;
}

@media (max-width: 1120px) {
  .control-band {
    grid-template-columns: 1fr;
  }

  .segmented-control,
  .filter-row {
    width: 100%;
  }

  .comparison-row {
    grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  }

  .note-cell {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
  }

  .comparison-cell:nth-child(3) {
    border-right: 0;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .intro-band {
    grid-template-columns: 1fr;
  }

  .segmented-control {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segment {
    min-height: 42px;
    border-bottom: 1px solid var(--line);
  }

  .segment:nth-child(2n) {
    border-right: 0;
  }

  .segment:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .filter-row,
  .stats-grid,
  .card-grid,
  .copy-row {
    grid-template-columns: 1fr;
  }

  .comparison-row {
    grid-template-columns: 1fr;
  }

  .comparison-cell {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .comparison-cell:last-child {
    border-bottom: 0;
  }

  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
