/* Kokura Shogi Center colours and public form typography. */
:root {
  --ink: #1e2b41;
  --muted: #495971;
  --brand: #779eec;
  --on-brand: #132540;
  --accent: #2c58a0;
  --accent-hover: #234780;
  --line: #d4e0f2;
  --paper: #f7faff;
}

body {
  font: 16px/1.65 "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}

a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #165582; outline-offset: 3px; }

.wrap { width: min(100% - 36px, 1060px); }
.masthead { background: var(--brand); border-bottom: 3px solid #437aec; color: var(--on-brand); }
.masthead .wrap { gap: 4px 16px; min-height: 58px; padding-block: 12px; }
.masthead .wrap > a { color: var(--on-brand); letter-spacing: .06em; }
.masthead nav { gap: 4px 12px; }
.masthead nav a { color: var(--on-brand); font-size: .82rem; }
main.wrap { min-height: 0; padding-block: 0 24px; }

.hero {
  padding: 24px 0 12px;
  background: none;
  border: 0;
  border-radius: 0;
}
.hero h1 { font-size: clamp(1.4rem, 3vw, 2rem); line-height: 1.3; margin: 3px 0 8px; }
.hero p { margin: 0; }
.eyebrow { color: var(--accent); font-size: .84rem; letter-spacing: .08em; }
.categories, .actions { gap: 8px; margin-block: 12px; }
.categories a { padding: 4px 10px; border-radius: 7px; }
.group { margin-top: 20px; }
.group > h2 { font-size: 1.25rem; line-height: 1.45; margin-bottom: 8px; }
.card-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr)); gap: 12px; }
.card-grid:has(.card:only-child) { grid-template-columns: minmax(0, 610px); }
.card, .sheet { border-radius: 12px; padding: 21px; min-width: 0; }
.card h3 { font-size: 1.15rem; line-height: 1.45; margin-bottom: 6px; }
.card p { margin-bottom: 8px; overflow-wrap: anywhere; }

.button {
  min-height: 40px;
  padding: 7px 14px;
  border-color: var(--accent);
  border-radius: 7px;
  background: var(--accent);
  font-size: .91rem;
}
.button:hover { background: var(--accent-hover); }
.button.secondary { color: var(--accent); border-color: #a2b6d9; }
.button.secondary:hover { background: #edf4ff; }
.state { padding: 3px 9px; border-radius: 6px; background: #e9f0fc; color: #344e74; font-size: .78rem; }

main.wrap:has(> .sheet) { width: min(100% - 16px, 700px); }
.back { margin-block: 8px; font-size: .875rem; }
.sheet, .sheet.profile-sheet {
  width: 100%;
  margin: 12px auto 0;
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 4px 18px #1a3f7710;
  font: 16px/1.7 "Yu Gothic Medium", Meiryo, "Noto Sans JP", "Yu Gothic", sans-serif;
}
.sheet h1, .sheet.profile-sheet h1 {
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #e6efff;
  color: var(--on-brand);
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.6;
  line-break: strict;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.sheet .heading-phrase { display: inline-block; max-width: 100%; }
.sheet h2 { font-size: 18px; margin: 8px 0; }
.sheet .description {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
  line-break: strict;
  margin: 0 0 18px;
  padding: 0 4px;
}
.sheet > .state { margin: 0 4px 12px; }
.sheet .field.form-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.sheet .field.form-row, .sheet .form-group > .form-row {
  display: grid;
  grid-template-columns: minmax(0, 32fr) minmax(0, 68fr);
  margin: 0 0 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  line-break: strict;
}
.sheet .form-legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
.sheet .field .form-label {
  background: #f0f5ff;
  color: #253d5e;
  border-radius: 9px 0 0 9px;
  margin: 0;
  padding: 14px;
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.sheet .form-entry { padding: 13px 16px; min-width: 0; overflow-wrap: anywhere; }
.sheet label, .sheet legend { font-size: 16px; }
.sheet label { font-weight: 400; }
.sheet .required { color: #972a42; font-size: .75em; white-space: nowrap; }
.sheet input:not([type=checkbox], [type=radio]), .sheet select, .sheet textarea {
  min-width: 0;
  min-height: 44px;
  border-color: #7b8da8;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 2px 0;
  font-size: 16px;
  line-height: 1.5;
}
.sheet input[type=text] { width: min(100%, 320px); }
.sheet input[type=email] { width: min(100%, 368px); }
.sheet .form-entry > input + label { margin-top: 8px; }
.sheet textarea { width: 100%; }
.sheet select { padding-right: 26px; }
.sheet select[autocomplete=address-level1] { width: min(100%, 280px); }
.sheet input[type=number] { width: min(100%, 76px); }
.sheet .check { gap: 8px; margin: 0; align-items: flex-start; }
.sheet .check input:is([type=checkbox], [type=radio]) {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: .25em 0 0;
  padding: 0;
  accent-color: var(--accent);
}
.sheet .profile-choices { gap: 0; }
.sheet .form-entry .check { min-height: 38px; padding-block: 5px; cursor: pointer; }
.sheet .profile-help { color: var(--muted); font-size: .9375rem; margin: 8px 0 2px; line-height: 1.65; }
.sheet .profile-parts { gap: 8px; }
.sheet .profile-name label { flex: 0 1 136px; min-width: 0; }
.sheet .profile-name label input { margin-top: 6px; }
.sheet .profile-number { flex-wrap: nowrap; }
.sheet .profile-number label { flex: 0 1 72px; min-width: 0; }
.sheet .profile-number input { text-align: center; padding-inline: 6px; }
.sheet .profile-postcode {
  display: grid;
  grid-template-columns: auto minmax(48px, 64px) auto minmax(54px, 72px) auto;
  justify-content: start;
}
.sheet .profile-parts label input { width: 100%; }
.sheet .profile-address { gap: 6px; }
.sheet .profile-address input[autocomplete=address-level2] { width: min(100%, 264px); }
.sheet .profile-address input:is([autocomplete=address-line1], [autocomplete=address-line2]) {
  width: min(100%, 328px);
}
.sheet .profile-address button {
  font-size: .875rem;
  min-height: 44px;
  padding: 5px 9px;
}
.sheet .profile-order { padding-block: 6px; }
.sheet .profile-quantity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.sheet .profile-order input[type=number] { width: min(100%, 76px); }
.sheet .profile-quantity input[type=number] { flex: 0 0 76px; width: 76px; }
.sheet :is(.profile-order-amount, .profile-subtotal) output {
  display: inline-block;
  width: 84px;
  max-width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: #f7faff;
  font-size: .95rem;
  line-height: 1.5;
  text-align: right;
}
.sheet .profile-order-amount { white-space: nowrap; }
.sheet .profile-subtotal output { width: 96px; }
.sheet .privacy { margin: 18px 4px 0; }
.sheet .actions { justify-content: center; gap: 10px 16px; margin: 16px 0 0; }
.sheet form button[name=step] { min-height: 46px; padding: 10px 14px; border-radius: 9px; font-size: 16px; font-weight: 700; line-height: 1.45; }
.sheet form button[name=step]:not(.secondary) { width: min(100%, 400px); }
.sheet form > button[value=preview] { display: flex; margin: 18px auto 0; }
.sheet .details { margin-inline: 0; gap: 8px 16px; }
.sheet .success { background: #edf3eb; border: 1px solid #ccddc7; color: #254f34; }

@media (max-width: 620px) {
  .wrap { width: calc(100% - 24px); }
  .hero { padding-top: 18px; }
  .card { padding: 15px; }
  .button { min-height: 44px; }
  .sheet, .sheet.profile-sheet { padding: 10px; }
  .sheet .field.form-row, .sheet .form-group > .form-row { grid-template-columns: minmax(0, 1fr); }
  .sheet .field .form-label { padding: 8px 12px; border-radius: 9px 9px 0 0; }
  .sheet .form-entry { padding: 10px 12px 12px; }
  .sheet .form-entry .check { min-height: 44px; padding-block: 7px; }
  .sheet .privacy { min-height: 44px; }
  .sheet .profile-name { flex-wrap: nowrap; }
}

@media (max-width: 380px) {
  .sheet .profile-postcode { grid-template-columns: auto minmax(48px, 64px) auto minmax(54px, 72px); }
  .sheet .profile-postcode button { grid-column: 2 / -1; justify-self: start; }
}
