:root {
    --navy: #0b1628;
    --navy-soft: #172841;
    --amber: #ffc107;
    --page: #eef2f6;
    --line: #d7dee7;
    --green: #16734a;
    --green-soft: #e4f5ec;
    --empty-soft: #fff4cf;
}

body {
    background: var(--page);
    color: #152238;
    min-height: 100vh;
}

.app-header {
    background: var(--navy);
    box-shadow: 0 3px 14px rgba(0, 0, 0, .2);
}

.brand-link { color: #fff; display: flex; flex-direction: column; line-height: 1.05; text-decoration: none; }
.brand-kicker { color: #aebbd0; font-size: .68rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.brand-title { font-size: 1.15rem; font-weight: 750; }
.header-user { color: #c4cfdf; font-size: .82rem; font-weight: 700; }
.page-shell { max-width: 980px; padding-bottom: 6.5rem; padding-top: 2rem; }
.page-heading { margin-bottom: 1.5rem; }
.page-heading h1 { font-size: clamp(1.7rem, 5vw, 2.35rem); font-weight: 750; margin-bottom: .25rem; }
.page-heading p { color: #64748b; margin: 0; }
.eyebrow { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .12em; margin-bottom: .35rem; text-transform: uppercase; }

.hero-card {
    align-items: center;
    background: linear-gradient(130deg, var(--navy), var(--navy-soft));
    border-radius: 1rem;
    color: #fff;
    display: flex;
    gap: 2rem;
    justify-content: space-between;
    overflow: hidden;
    padding: clamp(1.5rem, 5vw, 2.5rem);
}
.hero-card .eyebrow { color: #fbd55c; }
.hero-card h2 { font-size: clamp(1.5rem, 5vw, 2rem); font-weight: 750; }
.hero-card p { color: #c4cfdf; margin-bottom: 0; }
.hero-action { flex: 0 0 auto; font-weight: 750; min-height: 52px; }

.history-list { display: grid; gap: .75rem; }
.history-record { align-items: center; display: grid; gap: .6rem; grid-template-columns: minmax(0, 1fr) auto; }
.history-record form { margin: 0; }
.history-delete { min-height: 42px; }
.history-card {
    align-items: center; background: #fff; border: 1px solid var(--line); border-radius: .85rem;
    color: inherit; display: grid; gap: 1rem; grid-template-columns: 50px 1fr auto; padding: 1rem;
    text-decoration: none; transition: border-color 120ms ease, transform 120ms ease;
}
.history-card:hover { border-color: #8aa5c5; color: inherit; transform: translateY(-1px); }
.history-date { align-items: center; background: #e8eef6; border-radius: .65rem; display: flex; flex-direction: column; padding: .45rem; }
.history-date strong { font-size: 1.2rem; line-height: 1; }
.history-date span { color: #596b82; font-size: .7rem; font-weight: 750; text-transform: uppercase; }
.history-main { display: flex; flex-direction: column; min-width: 0; }
.history-meta { color: #66758a; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-chevron { color: #718096; font-size: 2rem; }
.status-pill { border-radius: 999px; display: inline-flex; font-size: .72rem; font-weight: 750; padding: .28rem .55rem; white-space: nowrap; }
.status-pill.completed { background: var(--green-soft); color: #11613e; }
.status-pill.in-progress { background: var(--empty-soft); color: #775b00; }
.form-card { border: 0; max-width: 620px; }
.welcome-tip-backdrop { align-items: center; background: rgba(6, 15, 29, .72); display: flex; inset: 0; justify-content: center; padding: 1rem; position: fixed; z-index: 1100; }
.welcome-tip-dialog { background: #fff; border-radius: 1rem; box-shadow: 0 24px 70px rgba(0, 0, 0, .32); max-height: calc(100vh - 2rem); max-width: 520px; overflow-y: auto; padding: clamp(1.4rem, 5vw, 2.25rem); width: 100%; }
.welcome-tip-dialog h2 { font-weight: 800; }
.welcome-tip-dialog p { color: #52657d; }
.ei-tip-demo { background: #eef4fa; border: 1px solid #cbd9e8; border-radius: .75rem; display: grid; gap: .45rem; padding: 1rem; }
.ei-tip-demo label { color: #52657d; font-size: .78rem; font-weight: 800; text-transform: uppercase; }
.ei-tip-demo input { background: #fff; color: #11613e; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.ei-tip-demo span { color: #64748b; font-size: .78rem; }

.check-topbar { align-items: end; display: flex; gap: 1.5rem; justify-content: space-between; margin-bottom: 1rem; }
.back-link { color: #49627f; display: inline-block; font-size: .9rem; margin-bottom: .5rem; text-decoration: none; }
.progress-counter { align-items: baseline; display: flex; flex: 0 0 auto; gap: .35rem; }
.progress-counter strong { font-size: 2rem; line-height: 1; }
.progress-counter span { color: #65758a; font-size: .82rem; }
.blank-guidance { background: var(--empty-soft); border: 1px solid #e6cd73; border-radius: .55rem; color: #654f08; font-size: .86rem; font-weight: 700; margin-bottom: .4rem; padding: .65rem .8rem; }
.save-message { color: #64748b; font-size: .76rem; min-height: 1.4rem; text-align: right; }
.save-message.error { color: #b42318; font-weight: 700; }
.save-message.saving { color: #7a5d00; }

.section-heading { align-items: center; display: flex; margin: 1.25rem 0 .55rem; }
.section-heading::after { background: #cbd5e1; content: ''; flex: 1; height: 1px; margin-left: .75rem; }
.section-heading span { color: #58687d; font-size: .78rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.stand-row {
    align-items: center; background: #fff; border: 2px solid transparent; border-radius: .8rem;
    box-shadow: 0 2px 5px rgba(15, 31, 52, .06); display: grid; gap: .55rem;
    grid-template-columns: minmax(72px, .65fr) minmax(140px, 1.7fr) 28px; margin-bottom: .55rem; padding: .6rem;
}
.stand-row.is-registered { background: var(--green-soft); border-color: #a8d8be; }
.stand-row.is-stand-closed { background: #f1f5f9; border-color: #94a3b8; }
.stand-row.is-multiple { align-items: start; }
.stand-row.is-multiple .stand-label, .stand-row.is-multiple .completion-mark { margin-top: .75rem; }
.stand-label { font-size: .95rem; font-weight: 800; overflow-wrap: anywhere; }
.registration-input { background: #fff; border: 1px solid #aeb9c7; border-radius: .55rem; font-size: 1rem; font-weight: 700; min-height: 48px; min-width: 0; padding: .65rem .7rem; text-transform: uppercase; width: 100%; }
.registration-input:focus { border-color: #3577bd; box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .18); outline: 0; }
.stand-entry-fields { display: grid; gap: .45rem; min-width: 0; }
.multi-registration-editor { display: grid; gap: .45rem; }
.multi-registration-summary { align-items: center; display: flex; flex-wrap: wrap; font-size: .75rem; gap: .4rem .75rem; justify-content: space-between; }
.multi-registration-count { color: #11613e; font-weight: 850; }
.multi-registration-list { display: grid; gap: .4rem; }
.multi-registration-row { align-items: center; display: grid; gap: .4rem; grid-template-columns: minmax(0, 1fr) 42px; }
.multi-registration-input { background: #fff; border: 1px solid #aeb9c7; border-radius: .55rem; font-size: 1rem; font-weight: 700; min-height: 46px; min-width: 0; padding: .6rem .7rem; text-transform: uppercase; width: 100%; }
.multi-registration-input:focus { border-color: #3577bd; box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .18); outline: 0; }
.multi-registration-remove { align-items: center; background: #fff; border: 1px solid #cbd5e1; border-radius: .55rem; color: #8f2931; display: flex; font-size: 1.4rem; justify-content: center; min-height: 46px; }
.multi-registration-remove:hover, .multi-registration-remove:focus { background: #fff1f2; border-color: #d99097; }
.multi-registration-add { justify-self: start; }
.registration-input.is-duplicate, .multi-registration-input.is-duplicate { background: #fff7ed; border-color: #e07a19; }
.duplicate-warning { color: #9a4c08; display: none; font-size: .75rem; font-weight: 750; }
.duplicate-warning.is-visible { display: block; }
.door-closed-option, .stand-closed-option { align-items: center; color: #52657d; display: flex; font-size: .82rem; font-weight: 800; gap: .45rem; margin: 0; min-height: 32px; }
.door-closed-option .form-check-input, .stand-closed-option .form-check-input { height: 1.2rem; margin: 0; width: 1.2rem; }
.completion-mark { color: #8a98a9; font-size: 1.25rem; font-weight: 850; text-align: center; }
.is-registered .completion-mark { color: var(--green); }
.finish-dock { background: rgba(238, 242, 246, .94); bottom: 0; left: 0; padding: .75rem max(1rem, env(safe-area-inset-right)) calc(.75rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); position: fixed; right: 0; z-index: 10; }
.finish-dock .container-xl { max-width: 980px; }
.finish-dock .btn { font-weight: 800; min-height: 54px; }

.summary-card, .detail-list { border: 0; }
.summary-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, 1fr); }
.summary-grid div { display: flex; flex-direction: column; }
.summary-grid span { color: #6b7a8e; font-size: .75rem; text-transform: uppercase; }
.summary-total { background: var(--green-soft); border-radius: .55rem; color: #11613e; font-weight: 800; margin-top: 1.25rem; padding: .8rem; text-align: center; }
.detail-list { overflow: hidden; }
.detail-section { background: var(--navy); color: #fff; font-size: .75rem; font-weight: 800; letter-spacing: .1em; padding: .7rem 1rem; text-transform: uppercase; }
.detail-row { align-items: center; border-bottom: 1px solid #e2e8f0; display: flex; justify-content: space-between; min-height: 52px; padding: .65rem 1rem; }
.detail-row:last-child { border-bottom: 0; }
.detail-values { align-items: flex-end; display: flex; flex-direction: column; gap: .35rem; }
.registration-value { color: #11613e; font-weight: 850; text-align: right; white-space: pre-line; }
.empty-value { background: var(--empty-soft); border-radius: .35rem; color: #725b0b; font-size: .75rem; font-weight: 850; padding: .3rem .5rem; }
.door-value { border-radius: .35rem; font-size: .72rem; font-weight: 850; padding: .25rem .45rem; text-transform: uppercase; }
.door-value.open { background: #fee2e2; color: #991b1b; }
.door-value.closed { background: var(--green-soft); color: #11613e; }
.stand-closed-value { background: #e2e8f0; border-radius: .35rem; color: #334155; font-size: .72rem; font-weight: 850; padding: .25rem .45rem; text-transform: uppercase; }
.stand-order-list { display: grid; gap: .5rem; list-style: none; margin: 0; padding: 0 0 5rem; }
.stand-order-item { align-items: center; background: #fff; border: 1px solid var(--line); border-radius: .7rem; display: grid; gap: .65rem; grid-template-columns: 34px minmax(110px, 1fr) auto auto; min-height: 58px; padding: .5rem .65rem; }
.stand-order-position { background: #e8eef6; border: 0; border-radius: .4rem; color: #52657d; font-size: .72rem; font-weight: 800; height: 32px; padding: .15rem; text-align: center; width: 34px; }
.stand-setting-options { display: flex; flex-wrap: wrap; gap: .45rem .8rem; }
.location-setting-option { align-items: center; color: #52657d; display: flex; font-size: .78rem; font-weight: 750; gap: .4rem; margin: 0; white-space: nowrap; }
.location-setting-option .form-check-input { flex: 0 0 auto; height: 1.15rem; margin: 0; width: 1.15rem; }
.stand-order-actions { display: flex; gap: .35rem; }
.stand-order-actions .btn { font-size: 1rem; font-weight: 800; min-height: 38px; min-width: 42px; }
.personal-order-item { grid-template-columns: 34px minmax(110px, 1fr) auto; }
.settings-save-dock { background: rgba(238, 242, 246, .95); bottom: 0; left: 0; padding: .75rem max(1rem, env(safe-area-inset-right)) calc(.75rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); position: fixed; right: 0; z-index: 10; }
.settings-save-dock .container-xl { max-width: 980px; }

@media (max-width: 600px) {
    .page-shell { padding-left: .75rem; padding-right: .75rem; padding-top: 1.25rem; }
    .hero-card { align-items: stretch; flex-direction: column; gap: 1.25rem; }
    .hero-action { width: 100%; }
    .check-topbar { align-items: flex-start; }
    .progress-counter { align-items: flex-end; flex-direction: column; gap: 0; }
    .progress-counter strong { font-size: 1.7rem; }
    .stand-row { gap: .5rem; grid-template-columns: 70px minmax(120px, 1fr) 24px; padding: .5rem; }
    .stand-label { font-size: .84rem; }
    .registration-input { font-size: 16px; padding-left: .5rem; padding-right: .5rem; }
    .multi-registration-input { font-size: 16px; padding-left: .5rem; padding-right: .5rem; }
    .completion-mark { font-size: 1.05rem; }
    .summary-grid { grid-template-columns: repeat(2, 1fr); }
    .stand-order-item { grid-template-columns: 32px minmax(88px, 1fr) auto; }
    .stand-setting-options { grid-column: 2 / 4; }
    .stand-order-actions { grid-column: 3; grid-row: 1; }
}
