:root {
  --ink: #171614;
  --muted: #65635e;
  --paper: #f3eadb;
  --panel: #fffaf0;
  --line: #ded2c0;
  --dark: #151413;
  --red: #b73828;
  --gold: #b98536;
  --teal: #168d84;
  --white: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(21, 20, 19, 0.06), rgba(185, 133, 54, 0.08) 42%, rgba(243, 234, 219, 1)),
    var(--paper);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, Arial, sans-serif;
  line-height: 1.55;
}

a { color: inherit; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 14px 24px;
  color: var(--white);
  background: rgba(18, 16, 14, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--gold);
}

.brand {
  display: inline-grid;
  gap: 2px;
  text-decoration: none;
}

.brand strong {
  font-size: 22px;
}

.brand span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 13px;
  font-weight: 800;
}

nav a {
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 60px;
}

.brand-visual {
  position: relative;
  min-height: clamp(420px, 58vh, 640px);
  overflow: hidden;
  color: var(--white);
  background: var(--dark);
}

.brand-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.04) contrast(1.05);
}

.brand-visual-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 9, 8, 0.92) 0%, rgba(10, 9, 8, 0.7) 36%, rgba(10, 9, 8, 0.22) 72%),
    linear-gradient(0deg, rgba(10, 9, 8, 0.86) 0%, rgba(10, 9, 8, 0.08) 44%, rgba(10, 9, 8, 0.32) 100%);
}

.brand-visual-copy {
  position: relative;
  z-index: 2;
  display: grid;
  align-content: center;
  width: min(760px, calc(100% - 40px));
  min-height: clamp(360px, 50vh, 560px);
  margin-left: max(24px, calc((100vw - 1180px) / 2));
  margin-right: auto;
  padding: 44px 0 70px;
}

.brand-visual-copy .kicker {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.brand-visual-copy h1 {
  margin: 0;
  font-size: clamp(72px, 12vw, 156px);
  line-height: 0.86;
}

.brand-name {
  margin: 10px 0 14px;
  color: #f6dca4;
  font-size: clamp(26px, 4vw, 52px);
  font-weight: 900;
}

.brand-visual-copy p:not(.kicker):not(.brand-name) {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(16px, 2vw, 22px);
  font-weight: 800;
}

.brand-visual-rail {
  position: absolute;
  z-index: 3;
  right: max(24px, calc((100vw - 1180px) / 2));
  bottom: 22px;
  left: max(24px, calc((100vw - 1180px) / 2));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.brand-visual-rail article {
  min-height: 92px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(17, 15, 13, 0.72);
  backdrop-filter: blur(10px);
}

.brand-visual-rail span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}

.brand-visual-rail strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  line-height: 1.35;
}

.front-band {
  padding: 34px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
}

.front-grid,
.register-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.82fr) minmax(0, 1.18fr);
  gap: 38px;
  align-items: start;
}

.front-grid p,
.section-note,
.front-tiles p,
.front-register p,
.scan-card p {
  color: var(--muted);
}

.front-section {
  padding: 58px 0;
}

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

.front-tiles article {
  min-height: 238px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 14px 34px rgba(42, 31, 20, 0.07);
}

.front-tiles span {
  display: block;
  margin-bottom: 32px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.front-tiles p {
  margin-bottom: 0;
  font-size: 14px;
}

.front-register {
  margin: 0 calc(50% - 50vw);
  padding: 60px max(20px, calc((100vw - 1180px) / 2));
  color: var(--white);
  background: var(--dark);
}

.front-register .eyebrow {
  color: #83dbd0;
}

.front-register h2 {
  max-width: 760px;
}

.front-register p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.76);
}

.scan-card img {
  display: block;
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  object-position: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: #25211d;
}

.scan-card p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.front-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 12px;
  font-size: 42px;
  line-height: 1.08;
}

h2 {
  margin-bottom: 12px;
  font-size: 24px;
}

h3 {
  margin: 18px 0 6px;
  font-size: 16px;
}

.hero-panel,
.detail-hero,
.page-title {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.96);
  box-shadow: 0 18px 50px rgba(42, 31, 20, 0.08);
}

.page-title {
  display: block;
  margin-bottom: 16px;
}

.hero-panel p,
.detail-hero p,
.page-title p,
.muted {
  color: var(--muted);
}

.check-ok,
.check-missing {
  display: inline-flex;
  margin-bottom: 12px;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.check-ok {
  color: #0f5f56;
  background: #e6f7f1;
}

.check-missing {
  color: #8c2c1f;
  background: #fae7df;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--white);
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: var(--white);
  border-color: var(--red);
  background: var(--red);
}

.button.secondary {
  color: var(--dark);
  background: #f0e3cf;
}

.button.secondary.glass {
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.text-link {
  color: var(--red);
  font-weight: 900;
  text-decoration: none;
}

.stats,
.section-grid,
.detail-grid,
.payload-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

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

.stats article,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 14px 34px rgba(42, 31, 20, 0.07);
}

.stats article {
  min-height: 110px;
  padding: 18px;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.stats strong {
  display: block;
  margin-top: 18px;
  font-size: 34px;
}

.section-grid,
.detail-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
}

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

.wide-panel {
  margin-top: 14px;
}

.panel {
  padding: 18px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
}

.case-table {
  display: grid;
  gap: 8px;
}

.case-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 150px;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.case-row:last-child {
  border-bottom: 0;
}

.case-row span,
.case-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.case-row small {
  display: block;
  margin-top: 2px;
  color: var(--teal);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.api-list,
.facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.api-list div,
.facts div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

code,
pre {
  font-family: Consolas, "Courier New", monospace;
}

pre {
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border-radius: 6px;
  color: #f7f0df;
  background: #151413;
  font-size: 12px;
  white-space: pre-wrap;
}

.form-panel {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.form-panel.compact {
  margin-top: 14px;
}

.form-steps {
  display: grid;
  gap: 16px;
}

.form-step {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.form-step:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.form-step-head {
  margin-bottom: 12px;
}

.form-step-head h2 {
  margin-bottom: 4px;
  font-size: 20px;
}

.form-step-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fffdf9;
  font: inherit;
  font-weight: 500;
}

.checkbox-field {
  display: flex;
  gap: 8px;
  align-items: center;
}

.checkbox-field input {
  width: auto;
  min-height: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.status-card {
  min-width: 220px;
  padding: 16px;
  border-radius: 8px;
  color: var(--white);
  background: var(--dark);
}

.status-card span,
.status-card small {
  display: block;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
}

.status-card strong {
  display: block;
  margin: 8px 0;
  font-size: 24px;
}

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

.event-list article {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.event-list span {
  color: var(--muted);
  font-size: 12px;
}

.event-list strong {
  display: block;
}

.event-list p {
  margin-bottom: 0;
  color: var(--muted);
}

.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.chat-main {
  min-width: 0;
}

.chat-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.chat-bubble {
  max-width: 760px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.chat-bubble.user {
  margin-left: auto;
  border-color: rgba(22, 141, 132, 0.45);
  background: #f2fbf8;
}

.chat-bubble.system {
  background: #fffaf0;
}

.chat-bubble strong {
  display: block;
  margin-bottom: 4px;
}

.chat-bubble p {
  margin-bottom: 0;
}

.chat-bubble .button {
  margin-top: 10px;
}

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

.mini-list article {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.mini-list article:last-child {
  border-bottom: 0;
}

.mini-list p {
  margin: 3px 0 0;
  color: var(--muted);
}

.assistant-title h1 {
  max-width: 840px;
}

.assistant-structure {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.assistant-structure .panel {
  min-height: 156px;
}

.assistant-structure span {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--white);
  background: var(--dark);
  font-size: 12px;
  font-weight: 900;
}

.assistant-structure p,
.assistant-list,
.notice {
  color: var(--muted);
}

.assistant-layout {
  align-items: start;
}

.assistant-form .field ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.assistant-form .field li label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ink);
  font-weight: 600;
}

.assistant-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.notice {
  margin: 14px 0 0;
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  background: #fff6e8;
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 850px) {
  .app-header,
  .hero-panel,
  .detail-hero,
  .chat-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .brand-visual {
    min-height: 620px;
  }

  .brand-visual-copy {
    min-height: 410px;
    width: min(100% - 28px, 760px);
    margin: 0 auto;
    padding-top: 34px;
  }

  .brand-visual-shade {
    background:
      linear-gradient(180deg, rgba(10, 9, 8, 0.82) 0%, rgba(10, 9, 8, 0.44) 48%, rgba(10, 9, 8, 0.94) 100%);
  }

  .brand-visual-rail {
    right: 14px;
    bottom: 14px;
    left: 14px;
    grid-template-columns: 1fr;
  }

  .stats,
  .section-grid,
  .detail-grid,
  .payload-grid,
  .form-grid,
  .front-grid,
  .register-grid,
  .front-tiles,
  .assistant-structure {
    grid-template-columns: 1fr;
  }

  .case-row,
  .api-list div,
  .facts div {
    grid-template-columns: 1fr;
  }

  main {
    width: min(100% - 24px, 1180px);
  }
}
