
:root { color-scheme: light; --ink: #39323f; --muted: #655d6b; --accent: #70518d; --line: #ded8e8; --soft: #f7f5fa; }
* { box-sizing: border-box; }
body { max-width: 760px; margin: 32px auto; padding: 0 16px; background: #fff; color: var(--ink); font: 16px/1.6 system-ui, sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #513766; }
header { margin-bottom: 24px; }
header > p:first-child { margin: 0 0 20px; font-size: 14px; }
h1 { margin: 0 0 6px; color: #443650; font-size: 32px; line-height: 1.2; }
header > p:last-child { margin: 0; color: var(--muted); }
p { margin: 0 0 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.notice { margin: 0 0 20px; padding: 16px; border: 1px solid #e8ddc5; border-radius: 10px; background: #faf7ef; }
.notice h2 { margin: 0 0 8px; color: #65512d; font-size: 15px; }
.notice p { font-size: 14px; }
.notice p:last-child { margin-bottom: 0; }
#form { margin-top: 24px; }
.form-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
label { display: block; margin: 0 0 8px; font-size: 14px; font-weight: 600; }
select, textarea { display: block; width: 100%; max-width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fcfbfd; color: var(--ink); }
select { min-height: 44px; font: inherit; }
textarea { resize: vertical; font: 14px/1.6 ui-monospace, monospace; }
textarea[readonly] { background: var(--soft); }
#help { margin: 10px 0 16px; color: var(--muted); font-size: 14px; }
button { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); color: #493a57; font: inherit; font-size: 14px; cursor: pointer; }
button:hover:not(:disabled) { background: #eee8f5; border-color: #b8a5c9; }
button:disabled { opacity: .55; cursor: not-allowed; }
#submit { padding: 10px 20px; background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
#submit:hover:not(:disabled) { background: #5d4078; border-color: #5d4078; }
.examples { margin-top: 20px; }
.examples-title { margin: 0 0 8px; color: var(--muted); font-size: 13px; }
.example-buttons, .result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#status { margin: 20px 0; color: var(--muted); font-size: 14px; }
#status:empty { display: none; }
#status:not(:empty) { padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); }
#status.ok { color: #335b3c; border-color: #d4e2d7; background: #f3f8f4; }
#status.error { color: #8f3038; border-color: #ecd4d7; background: #fcf4f5; }
#result { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.notice-small { margin-bottom: 20px; color: var(--muted); font-size: 14px; }
table#fields { width: 100%; margin-bottom: 20px; border-collapse: collapse; table-layout: fixed; }
table#fields caption { margin-bottom: 10px; text-align: left; font-size: 15px; font-weight: 600; }
table#fields .ai-column { width: 3rem; }
table#fields .meaning-column { width: 28%; }
table#fields .length-column { width: 4rem; }
table#fields th, table#fields td { padding: 8px; border: 1px solid var(--line); text-align: left; vertical-align: top; font: 13px/1.6 ui-monospace, monospace; overflow-wrap: anywhere; }
table#fields th { background: var(--soft); color: #493a57; font-weight: 600; }
table#fields .cell-meaning { font-family: system-ui, sans-serif; }
table#fields .cell-value { white-space: pre-wrap; }
table#fields .cell-ai, table#fields .cell-length { white-space: nowrap; }
#barcode { display: block; max-width: 100%; height: auto; margin: 20px 0 12px; image-rendering: pixelated; }
.result-actions { margin-top: 16px; }
a[aria-disabled="true"] { pointer-events: none; opacity: .55; cursor: default; text-decoration: none; }
.clipboard-helper { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; }
footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
footer p { margin: 0; }
@media (max-width: 520px) {
    body { margin: 24px auto; }
    .form-options { grid-template-columns: 1fr; gap: 14px; }
    table#fields th, table#fields td { padding: 6px 4px; }
}
.format-guide { margin: 20px 0; border: 1px solid #ded8e8; border-radius: 10px; background: #fff; }
.format-guide > summary { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 10px; background: #f7f5fa; color: #443650; font-weight: 600; line-height: 1.4; cursor: pointer; list-style: none; }
.format-guide > summary::-webkit-details-marker { display: none; }
.format-guide > summary::before { content: ''; flex: 0 0 7px; width: 7px; height: 7px; border-right: 2px solid #79628e; border-bottom: 2px solid #79628e; transform: rotate(-45deg); }
.format-guide[open] > summary { border-radius: 10px 10px 0 0; border-bottom: 1px solid #ded8e8; }
.format-guide[open] > summary::before { transform: rotate(45deg); }
.format-guide > summary:hover { background: #efebf5; }
.format-guide > summary:focus-visible { outline-color: #79628e; }
.format-guide-content { padding: 16px; }
.format-card { padding: 14px; background: #faf9fc; border: 1px solid #e9e5ee; border-radius: 8px; }
.format-card + .format-card { margin-top: 12px; }
.format-card h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; font-size: 15px; }
.format-badge { font: 12px/1.5 ui-monospace, monospace; font-weight: 600; color: #695279; background: #eee8f5; padding: 2px 7px; border-radius: 4px; }
.format-sequence { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0; font-size: 14px; line-height: 1.6; }
.format-sequence code { font: 600 13px/1.6 ui-monospace, monospace; color: #5e4773; background: #eee8f5; padding: 2px 6px; border-radius: 4px; }
.format-field { color: #444; }
.format-plus { color: #8c8394; }
.format-sequence .format-gs { color: #775820; background: #fff0cf; }
.format-limits { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 20px 0 16px; }
.format-limits dt { margin-bottom: 4px; font-size: 13px; color: #6a6270; }
.format-limits dd { margin: 0; font-size: 15px; font-weight: 600; color: #39323f; }
.format-guide-note { border-top: 1px solid #e9e5ee; padding-top: 12px; }
.format-guide-note p { margin: 0; font-size: 13px; line-height: 1.6; color: #655d6b; }
.format-guide-note p + p { margin-top: 6px; }
@media (max-width: 520px) {
    .format-guide > summary { padding: 14px; font-size: 15px; }
    .format-guide-content { padding: 12px; }
    .format-card { padding: 12px; }
    .format-limits { grid-template-columns: 1fr; gap: 10px; }
    .format-limits > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
    .format-limits dt { margin: 0; }
}
