:root {
  --ink: #1b2233;
  --mute: #56607a;
  --blue: #2f5fb3;
  --blue-deep: #23478a;
  --ground: #f4f6fb;
  --panel: #ffffff;
  --line: #d8deeb;
  --warn: #8a4b00;
  --sans: 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans TC', 'Noto Sans KR', system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); font-weight: 500; color: var(--ink); background: var(--ground); line-height: 1.7; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.site-header { background: var(--panel); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-size: 20px; font-weight: 900; letter-spacing: 0.04em; color: var(--blue-deep); }
.langs { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; background: var(--ground); border-radius: 10px; }
.langs button { min-height: 40px; padding: 6px 12px; font: inherit; font-size: 13px; color: var(--ink); background: none; border: 0; border-radius: 6px; cursor: pointer; }
.langs button:hover { background: var(--panel); }
.langs button[aria-pressed='true'] { font-weight: 700; color: #fff; background: var(--blue-deep); }

.intro { display: flex; flex-direction: column; gap: 8px; padding: 40px 0 28px; }
.intro h1 { font-size: clamp(26px, 4vw, 36px); font-weight: 900; line-height: 1.3; }
.note { font-size: 13px; color: var(--mute); }
.note.warn { color: var(--warn); font-weight: 700; }
.hint { font-size: 12px; color: var(--mute); }

.layout { display: flex; flex-wrap: wrap-reverse; gap: 24px; align-items: flex-start; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.form-panel { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.preview-panel { flex: 1.25 1 440px; min-width: 0; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }

.tabs { display: flex; gap: 4px; }
.tabs button { min-height: 44px; padding: 8px 16px; font: inherit; font-size: 14px; color: var(--mute); background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer; }
.tabs button[aria-selected='true'] { font-weight: 700; color: var(--blue-deep); border-bottom-color: var(--blue-deep); }
.card-frame { border-radius: 6px; overflow: hidden; box-shadow: 0 6px 24px rgba(27, 34, 51, 0.16); background: #fff; }
.card-frame canvas { display: block; width: 100%; height: auto; aspect-ratio: 255.118 / 153.071; }

.downloads { display: flex; flex-direction: column; gap: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.downloads h3 { font-size: 16px; font-weight: 700; }
.download-buttons { display: flex; flex-wrap: wrap; gap: 10px; }

.btn { min-height: 44px; padding: 10px 18px; font: inherit; font-size: 14px; font-weight: 700; color: var(--blue-deep); background: var(--panel); border: 2px solid var(--blue-deep); border-radius: 8px; cursor: pointer; }
.btn:hover { background: #e9effa; }
.btn-primary { color: #fff; background: var(--blue-deep); }
.btn-primary:hover { background: var(--blue); border-color: var(--blue); }
.btn-small { align-self: flex-start; min-height: 40px; padding: 6px 14px; font-size: 13px; border-width: 1px; }
.btn-icon { min-width: 40px; padding: 6px; font-size: 18px; line-height: 1; }
.btn[disabled] { opacity: 0.55; cursor: default; }

.field { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.field-row { display: flex; flex-wrap: wrap; gap: 14px; }
.field label, .group legend { font-size: 13px; font-weight: 700; }
input[type='text'], select { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; font-size: 16px; color: var(--ink); background: #fff; border: 1px solid #8b95ad; border-radius: 8px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; font-weight: 700; }
.check input { width: 20px; height: 20px; }
.group { margin: 0; padding: 14px 16px 16px; border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 12px; }
.group legend { padding: 0 6px; }
#contacts { display: flex; flex-direction: column; gap: 10px; }
.contact-row { display: flex; gap: 8px; align-items: center; }
.contact-row select { flex: 0 0 132px; width: 132px; }
.contact-row input { flex: 1 1 auto; min-width: 0; }

.about { display: flex; flex-direction: column; gap: 10px; max-width: 760px; padding: 56px 0 80px; }
.about h2 { font-size: 20px; font-weight: 900; }

@media (max-width: 860px) {
  .preview-panel { position: static; }
}
@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .panel { padding: 18px; }
  .contact-row { flex-wrap: wrap; }
  .contact-row select { flex: 1 1 100%; width: 100%; }
}
