:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
    color: #1f2937;
    background: #f4f7f6;
}

body { margin: 0; }
a { color: #087f5b; }
.container { width: min(90%, 42rem); margin: 12vh auto; padding: 2rem; background: #fff; border-radius: 1rem; box-shadow: 0 1rem 3rem rgb(15 23 42 / 8%); }
.eyebrow { color: #087f5b; font-size: .75rem; font-weight: 700; letter-spacing: .12em; }
h1 { margin: .4rem 0 1rem; font-size: clamp(1.7rem, 5vw, 2.6rem); }
.status { margin-top: 2rem; border-top: 1px solid #dfe7e4; }
.status div { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid #dfe7e4; }
.status dt { font-weight: 700; }
.status dd { margin: 0; color: #087f5b; }
.button, button { display: inline-block; border: 0; border-radius: .55rem; padding: .75rem 1rem; color: #fff; background: #087f5b; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.brand { color: #15201d; font-weight: 800; text-decoration: none; }
.auth-card { width: min(calc(100% - 2rem), 28rem); box-sizing: border-box; margin: 8vh auto; padding: 2rem; background: #fff; border-radius: 1rem; box-shadow: 0 1rem 3rem rgb(15 23 42 / 8%); }
.auth-card h1 { font-size: 1.8rem; }
label { display: grid; gap: .4rem; margin-bottom: 1rem; font-weight: 700; }
label span { color: #63716d; font-size: .78rem; font-weight: 400; }
input, textarea, select { box-sizing: border-box; width: 100%; border: 1px solid #b8c5c1; border-radius: .5rem; padding: .7rem; background: #fff; color: #1f2937; font: inherit; }
textarea { resize: vertical; }
.error, .field-error { color: #a61b1b; }
.error { border: 1px solid #f1b4b4; border-radius: .5rem; padding: .8rem; background: #fff1f1; }
.field-error { font-size: .8rem; font-weight: 500; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem max(1rem, calc((100% - 70rem) / 2)); background: #fff; border-bottom: 1px solid #dfe7e4; }
.admin-header nav { display: flex; align-items: center; gap: 1rem; }
.admin-header nav form { margin: 0; }
.link-button { padding: 0; color: #087f5b; background: transparent; font-weight: 500; text-decoration: underline; }
.admin-main { width: min(calc(100% - 2rem), 70rem); margin: 2rem auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-heading h1 { margin: 0; }
.page-heading-meta { margin: .35rem 0 0; color: #63716d; }
.export-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.panel { padding: 1.5rem; background: #fff; border-radius: .8rem; box-shadow: 0 .3rem 1rem rgb(15 23 42 / 6%); }
.empty-state { text-align: center; }
.flash { padding: .8rem 1rem; border-radius: .5rem; }
.flash-success { color: #075c42; background: #dff6ed; }
.flash-error { color: #a61b1b; background: #fff1f1; border: 1px solid #f1b4b4; }
.flash-error span { display: block; margin-top: .25rem; }
.status-badge { display: inline-block; padding: .3rem .65rem; border-radius: 99rem; font-size: .8rem; font-weight: 800; }
.status-active { color: #075c42; background: #dff6ed; }
.status-upcoming { color: #744c00; background: #fff3cc; }
.status-ended { color: #4b5563; background: #e5e7eb; }
.status-paused { color: #991b1b; background: #fee2e2; }
.summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.summary-four { grid-template-columns: repeat(4, 1fr); margin-bottom: 1.25rem; }
.summary div { padding: 1rem; background: #f4f7f6; border-radius: .5rem; }
.summary dt { font-size: .8rem; font-weight: 700; }
.summary dd { margin: .35rem 0 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.25rem; }
.form-grid .wide { grid-column: 1 / -1; }
.deadline-reference { align-self: start; display: grid; gap: .4rem; padding: .7rem 1rem; border-radius: .5rem; background: #f4f7f6; }
.deadline-reference span { color: #63716d; font-size: .78rem; }
.input-clear-row { display: flex; align-items: center; gap: .5rem; color: inherit; font-size: 1rem; font-weight: 400; }
.input-clear-row input { min-width: 0; }
.input-clear-row button { flex: 0 0 auto; white-space: nowrap; }
fieldset { margin: 0 0 1rem; border: 1px solid #b8c5c1; border-radius: .6rem; padding: 1rem; }
.checkbox { display: flex; align-items: center; }
.checkbox input { width: auto; }
.table-wrap { overflow-x: auto; background: #fff; border-radius: .8rem; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem; border-bottom: 1px solid #dfe7e4; text-align: left; vertical-align: top; }
th { font-size: .78rem; }
.recovery-key { overflow-wrap: anywhere; padding: 1rem; border: 2px solid #087f5b; border-radius: .5rem; background: #effaf6; font-size: 1rem; white-space: pre-wrap; }
.secondary { color: #075c42; background: #e1f1eb; }
.danger { color: #fff; background: #b42318; }
.small { padding: .45rem .65rem; font-size: .85rem; }
button:disabled { cursor: not-allowed; opacity: .35; }
.spot-list { display: grid; gap: 1rem; }
.spot-card { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem; }
.spot-inactive { opacity: .72; }
.spot-order, .spot-actions, .qr-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.spot-order { flex-direction: column; }
.spot-order form, .spot-actions form, .qr-actions form { margin: 0; }
.spot-details h2 { margin: .45rem 0; }
.notice { margin-top: 1.25rem; border-left: .3rem solid #087f5b; }
.notice-text { padding: 1rem; background: #e1f1eb; border-radius: .5rem; }
.warning-text { padding: 1rem; color: #6b4600; background: #fff4d6; border: 1px solid #d98a00; border-radius: .5rem; }
.demo-banner, .demo-input-warning, .demo-disabled { padding: 1rem; color: #6b4600; background: #fff4d6; border: 1px solid #d98a00; border-radius: .5rem; }
.demo-banner { margin: 0 0 1.25rem; }
.demo-banner p { margin: .45rem 0 0; }
.demo-input-warning, .demo-disabled { margin: 1rem 0; }
.scanner-warning { margin: 1.5rem 0; padding: 1rem 1.1rem; color: #6b4600; background: #fff4d6; border: 2px solid #d98a00; border-radius: .7rem; }
.scanner-warning h2 { margin: 0 0 .7rem; font-size: 1.25rem; }
.scanner-warning p { margin: .55rem 0; line-height: 1.65; }
.qr-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(18rem, .8fr); gap: 1.25rem; align-items: start; }
.qr-panel { text-align: center; }
.qr-image { display: block; width: min(100%, 28rem); margin: 0 auto; }
.qr-url { overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .82rem; }
.qr-actions { justify-content: center; }
.participant-header { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem max(1rem, calc((100% - 48rem) / 2)); background: #fff; border-bottom: 1px solid #dfe7e4; }
.participant-main { width: min(calc(100% - 2rem), 48rem); margin: 1.5rem auto 4rem; }
.participant-hero { margin-bottom: 1.5rem; }
.participant-period { margin: 1rem 0; }
.participant-period div { display: grid; gap: .35rem; }
.participant-period dt { color: #63716d; font-size: .82rem; font-weight: 800; }
.participant-period dd { margin: 0; font-weight: 700; }
.completion { margin-top: 1.25rem; padding: 1rem; color: #075c42; background: #dff6ed; border: 2px solid #46a985; border-radius: .8rem; }
.completion h2 { margin-top: 0; }
.application-status { margin: 1rem 0; }
.application-status dt { color: #477265; font-size: .82rem; font-weight: 800; }
.application-status dd { margin: .25rem 0 0; overflow-wrap: anywhere; font-size: 1.15rem; font-weight: 900; letter-spacing: .04em; }
.application-deadline { display: flex; flex-wrap: wrap; gap: .35rem .75rem; align-items: baseline; }
.application-deadline span { font-weight: 700; }
.stamp-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.stamp-card { position: relative; min-height: 8rem; overflow: hidden; padding: 1rem; background: #fff; border: 2px dashed #b8c5c1; border-radius: .8rem; }
.stamp-card h3 { margin: .45rem 0; }
.stamp-acquired { border-style: solid; border-color: #46a985; background: #effaf6; }
.spot-number { color: #63716d; font-size: .8rem; font-weight: 800; }
.stamp-mark { position: absolute; right: .7rem; bottom: .5rem; display: grid; place-items: center; width: 4rem; height: 4rem; color: #b42318; border: .25rem double #b42318; border-radius: 50%; font-weight: 900; transform: rotate(-12deg); opacity: .82; }
.spot-result { text-align: center; }
.spot-result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .75rem; }
.result-message { padding: 1rem; border-radius: .6rem; font-weight: 800; }
.result-success { color: #075c42; background: #dff6ed; }
.result-notice { color: #744c00; background: #fff3cc; }
.result-error { color: #991b1b; background: #fee2e2; }
.notice-list { padding-left: 1.4rem; line-height: 1.8; }
.application-number { padding: 1rem; background: #effaf6; border: 2px solid #087f5b; border-radius: .5rem; font-family: ui-monospace,monospace; font-size: 1.35rem; font-weight: 800; letter-spacing: .08em; text-align: center; }
.maintenance-section { margin-bottom: 1.25rem; }
.maintenance-section h2 { margin-top: 0; }
.restore-confirmation { border: 2px solid #b42318; }
.install-main { width: min(calc(100% - 2rem), 52rem); margin: 3rem auto 5rem; }
.install-main > .brand { display: inline-block; margin-bottom: 1rem; }
.install-section { margin-top: 1.25rem; }
.install-section h2 { margin-top: 0; }
.install-status { display: grid; grid-template-columns: repeat(2, 1fr); }
.install-status div { padding-right: 1rem; }
.install-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.install-cancel-form { margin-top: .75rem; }
.trademark-notice { margin-top: 2rem; color: #63716d; font-size: .72rem; line-height: 1.6; text-align: center; }
@media (max-width: 48rem) {
    .admin-header, .admin-header nav { align-items: flex-start; flex-direction: column; }
    .form-grid, .summary { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
    .input-clear-row { align-items: stretch; flex-direction: column; }
    .spot-card, .qr-layout { grid-template-columns: 1fr; }
    .spot-order { flex-direction: row; }
    .stamp-grid { grid-template-columns: 1fr; }
    .install-status { grid-template-columns: 1fr; }
}
