:root {
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #17253c;
    background: #f4f6f9;
    font-synthesis: none;
    --card: #fff;
    --line: #dce3ed;
    --muted: #4c5d74;
    --blue: #233f91;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.48; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select, summary { cursor: pointer; }
button, input, select, .refresh { min-height: 44px; }
button, input, select, .refresh { border: 1px solid #bac7d8; border-radius: .7rem; }
input, select { width: 100%; color: inherit; background: var(--card); padding: .55rem .75rem; }
select {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 16px) 53%, calc(100% - 11px) 53%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
    padding-right: 1.55rem;
}
button, .refresh { background: var(--card); color: var(--blue); padding: .55rem .85rem; font-weight: 650; }
button:hover, .refresh:hover { background: #edf2ff; }
:focus-visible { outline: 3px solid #5479ed; outline-offset: 3px; }
h1 { font-size: clamp(1.65rem, 5vw, 2.2rem); margin: 0; letter-spacing: -.04em; line-height: 1.12; }
p { margin: 0; }

.mark { display: grid; width: 2.25rem; height: 2.25rem; border-radius: .75rem; place-items: center; background: #1d326c; color: #fff; font-weight: 800; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner, .dashboard { width: min(100%, 53rem); margin: auto; padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right)); }
.topbar-inner, .brand, .heading { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.topbar-inner { padding-block: max(.65rem, env(safe-area-inset-top)) .65rem; }
.brand { font-weight: 700; font-size: .94rem; }
.text-button { border-color: transparent; font-size: .88rem; padding-inline: .5rem; }
.dashboard { padding-block: 1.5rem max(2rem, env(safe-area-inset-bottom)); }
.heading { margin-bottom: 1.1rem; }
.heading p { margin-top: .3rem; font-size: .88rem; color: var(--muted); }
.refresh { display: inline-flex; align-items: center; text-decoration: none; white-space: nowrap; font-size: .89rem; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; margin-bottom: 1.25rem; }
.summary > a { display: grid; background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: .75rem 1rem; color: inherit; text-decoration: none; }
.summary > a:hover { border-color: #8ea6dc; }
.summary > a[aria-current="page"] { border-color: #3d5bb1; background: #edf2ff; box-shadow: inset 0 0 0 1px #3d5bb1; }
.summary span { color: var(--muted); font-weight: 600; font-size: .94rem; }
.summary strong { font-size: 1.85rem; font-variant-numeric: tabular-nums; line-height: 1.25; }
.new-total { color: #235f48; }
.filters { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .6rem; margin-bottom: 1rem; }
.filters label, .search, .login-fields label { display: grid; gap: .3rem; min-width: 0; font-weight: 620; }
.filters label { font-size: .88rem; }
.filters select, .search input, .login-fields input { font-size: 1rem; font-weight: 400; }
.search { margin-bottom: .85rem; font-size: .92rem; }
.empty, .message { border: 1px solid var(--line); border-radius: .85rem; padding: .85rem 1rem; background: var(--card); }
.message { margin: .75rem 0; background: #fdf2da; border-color: #e7cb8a; color: #5c410f; }
.message ul { padding-left: 1.15rem; margin: .35rem 0 0; }
.order-list { display: grid; gap: .55rem; }
.order { background: var(--card); border: 1px solid var(--line); border-radius: .88rem; }
.order summary { display: flex; align-items: center; justify-content: space-between; gap: .65rem; padding: .7rem .85rem; list-style: none; }
.order summary::-webkit-details-marker { display: none; }
.order summary::after { content: ''; flex: 0 0 .42rem; height: .42rem; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); margin: 0 .18rem .2rem .15rem; }
.order[open] summary::after { transform: rotate(225deg); margin-bottom: -.2rem; }
.order-identity, .order-meta { display: grid; gap: .2rem; }
.order-identity { flex: 1; }
.order-identity strong { font-size: 1.075rem; font-variant-numeric: tabular-nums; user-select: text; }
.order-identity span, time { color: var(--muted); font-size: .88rem; }
.order-meta { justify-items: end; }
.status { font-size: .88rem; line-height: 1.3; padding: .2rem .55rem; border-radius: 2rem; font-weight: 700; white-space: nowrap; }
.status-1 { color: #19533d; background: #dff2e7; }
.status-2 { color: #263e89; background: #e7edff; }
.products { border-top: 1px solid var(--line); padding: .35rem .85rem; margin: 0; list-style: none; }
.products li { display: flex; align-items: center; gap: .75rem; padding-block: .5rem; }
.products li + li { border-top: 1px solid var(--line); }
.products li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.products strong { white-space: nowrap; }
.product-image { flex: 0 0 auto; width: 70px; height: 70px; object-fit: contain; border: 1px solid var(--line); border-radius: .55rem; background: var(--card); }
.password-settings { margin-top: 1.1rem; padding: .7rem .85rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--card); }
.password-settings summary { color: var(--blue); font-weight: 650; }
.password-settings .login-fields { max-width: 24rem; }

.login { width: min(calc(100% - 2rem), 27rem); margin: max(3rem, 12vh) auto 2rem; padding: clamp(1.15rem, 5vw, 2rem); background: var(--card); border: 1px solid var(--line); border-radius: 1.15rem; }
.login .mark { margin-bottom: .9rem; }
.login-fields { display: grid; gap: .95rem; margin-top: 1.35rem; }
.setup { width: min(calc(100% - 2rem), 36rem); }
.setup > p { margin-top: .8rem; color: var(--muted); }
.setup fieldset { min-width: 0; margin: 0; border: 1px solid var(--line); border-radius: .75rem; padding: .8rem; }
.setup legend { font-weight: 750; }
.setup fieldset label + label, .setup details { margin-top: .65rem; }
.setup summary { min-height: 44px; padding-block: .6rem; color: var(--blue); }
.setup .message { padding-left: 2rem; }
.primary { background: #263f91; border-color: #263f91; color: #fff; }
.primary:hover { background: #1d326c; }

@media (max-width: 25rem) {
    .brand { font-size: .85rem; }
}

@media (max-width: 21rem) {
    .heading { align-items: start; flex-direction: column; }
}
