/* Tilly's Flow design system — brand from tillysempanadas.com:
   steel blue, mustard gold, warm brown, navy, cream. No Bootstrap.
   Fonts: Changa One (display), Outfit (UI), Yellowtail (script). */

:root {
    --cream: #fcfaf6;
    --cream-deep: #f3eee3;
    --blue: #8cb8c9;
    --blue-soft: #d9e8ef;
    --blue-deep: #5f93a8;
    --brown: #82422d;
    --brown-deep: #5f2f1f;
    --gold: #d8a512;
    --gold-deep: #b98c0e;
    --navy: #253883;
    --text: #333333;
    --muted: #7a736a;
    --line: #e4ddcf;
    --st-produced: #8a8375;
    --st-transit: #c08a0f;
    --st-freezer: #4c7f96;
    --st-sale: #3e7d3a;
    --ok-bg: #e8f0e2;
    --ok-tx: #2c4a28;
    --err-bg: #f6dfdb;
    --err-tx: #7a2c20;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Outfit', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text);
    background: var(--cream);
    font-size: 15.5px;
    line-height: 1.55;
    overflow-x: hidden;
}
a { color: var(--brown); text-decoration: underline; text-underline-offset: 2px; }
code, .mono { font-family: 'Courier New', Courier, monospace; font-weight: 700; font-size: .9em; }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.15; text-wrap: balance; }
h1 { font-family: 'Changa One', Impact, sans-serif; font-weight: 400; font-size: 1.9rem; letter-spacing: .02em; text-transform: uppercase; color: var(--brown); }
h2 { font-size: 1rem; font-weight: 700; color: var(--text); }
h3 { font-size: .95rem; font-weight: 700; }
p { margin: 0 0 1rem; }
.muted, .text-muted { color: var(--muted); }
.small { font-size: .85em; }
.script { font-family: 'Yellowtail', 'Brush Script MT', cursive; font-weight: 400; }
.eyebrow { font-size: .66rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--blue-deep); margin-bottom: .15rem; }
.danger, .text-danger { color: #a33025; }
.fw-bold { font-weight: 700; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 2px;
}

/* ---------- icons ---------- */
.ic { width: 1.15em; height: 1.15em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; }

/* ---------- shell: brown strip + blue header ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--cream); }
.strip { background: var(--brown); color: #fcfaf6; font-size: .72rem; display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 1.3rem; letter-spacing: .04em; }
.viewswitch { display: inline-flex; gap: .55rem; align-items: center; }
.viewswitch a { color: #fcfaf6; opacity: .65; text-decoration: none; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.viewswitch a:hover { opacity: 1; text-decoration: underline; }
.viewswitch a.on { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.langswitch { display: inline-flex; gap: .4rem; align-items: center; margin-left: auto; }
.langswitch a { color: #fcfaf6; opacity: .6; text-decoration: none; font-weight: 700; }
.langswitch a:hover { opacity: 1; }
.langswitch a.on { opacity: 1; text-decoration: underline; text-underline-offset: 3px; }
.app-header { background: var(--blue); display: flex; align-items: center; gap: 1.6rem; padding: .55rem 1.3rem; border-bottom: 2px solid var(--blue-deep); }
.logo { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; text-decoration: none; }
.logo .brandlogo { height: 40px; width: auto; flex-shrink: 0; display: block; }
.logo .wordmark { color: #fcfaf6; font-size: .6rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 600; line-height: 1.35; }
.logo .wordmark strong { display: block; font-family: 'Changa One', Impact, sans-serif; font-weight: 400; font-size: 1rem; letter-spacing: .08em; }

.topnav { display: flex; gap: 1.3rem; flex: 1; justify-content: center; flex-wrap: wrap; align-items: center; }
.topnav .nav-link { font-family: 'Changa One', Impact, sans-serif; font-weight: 400; font-size: .86rem; letter-spacing: .09em; text-transform: uppercase; color: #fcfaf6; background: none; border: none; cursor: pointer; padding: .3rem .1rem; border-bottom: 3px solid transparent; text-decoration: none; }
.topnav .nav-link:hover { color: #fff; border-bottom-color: rgba(252, 250, 246, .5); }
.topnav .nav-link.active { color: #fff; border-bottom-color: var(--gold); }
.topnav form { display: inline; }

.app-header .who { margin-left: auto; flex-shrink: 0; }
.app-header .who > span > a { color: #fcfaf6; font-size: .82rem; text-decoration: none; border: 1.5px solid rgba(252, 250, 246, .6); border-radius: 99px; padding: .25rem .8rem; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.app-header .who > span > a:hover { border-color: #fff; }
.who-menu { position: relative; }
.who-menu summary { list-style: none; cursor: pointer; color: #fcfaf6; font-size: .82rem; border: 1.5px solid rgba(252, 250, 246, .6); border-radius: 99px; padding: .25rem .8rem; display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; }
.who-menu summary::-webkit-details-marker { display: none; }
.who-menu summary:hover { border-color: #fff; }
.who-menu[open] summary { background: rgba(252, 250, 246, .18); }
.who-menu .menu { display: none; }
.who-menu[open] .menu { position: absolute; right: 0; top: calc(100% + 8px); background: #fff; border: 1.5px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(43, 40, 37, .18); min-width: 200px; padding: .35rem; display: flex; flex-direction: column; z-index: 60; }
.who-menu .menu a, .who-menu .menu button { display: flex; align-items: center; gap: .55rem; width: 100%; background: none; border: none; font: inherit; font-size: .9rem; font-weight: 500; color: var(--text); padding: .55rem .7rem; border-radius: 8px; cursor: pointer; text-align: left; text-decoration: none; }
.who-menu .menu a:hover, .who-menu .menu button:hover { background: var(--cream); }
.who-menu .menu form { display: contents; }

.content { padding: 1.4rem 1.5rem 2.8rem; max-width: 1020px; margin: 0 auto; width: 100%; flex: 1; }

/* ---------- bottom nav (phone) ---------- */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 2px solid var(--blue); display: none; align-items: stretch; justify-content: space-around; padding: .4rem .2rem calc(.55rem + env(safe-area-inset-bottom)); z-index: 40; }
.bn-item { background: none; border: none; font-family: 'Outfit', sans-serif; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: .14rem; color: var(--muted); font-size: .58rem; letter-spacing: .03em; min-width: 0; flex: 1; padding: .15rem 0; text-transform: uppercase; font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; }
.bn-item .ic { width: 22px; height: 22px; stroke-width: 1.8; }
.bn-item.active { color: var(--brown); }
.bn-item.active .ic { stroke-width: 2.4; }
.bn-scan { position: relative; top: -1.2rem; background: var(--gold); color: #fff; border: 4px solid var(--cream); border-radius: 50%; width: 64px; height: 64px; min-width: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px rgba(184, 140, 14, .45); gap: 0; }
.bn-scan .ic { width: 30px; height: 30px; }
.bn-scan.active { background: var(--gold-deep); color: #fff; }

@media (max-width: 767px) {
    .topnav { display: none; }
    .bottomnav { display: flex; }
    .content { padding: 1.05rem 1rem 6.6rem; }
    .strip { padding: .28rem 1rem; }
    /* The location line doesn't fit next to the view switcher on a phone. */
    .strip > span:first-child { display: none; }
    .strip { justify-content: flex-end; }
    .app-header { padding: .5rem 1rem; gap: .6rem; }
    .app-header .logo .wordmark { display: none; }
    .app-header .who .who-email { display: none; }
    .btnrow { flex-direction: column; }
    .btnrow .btn { width: 100%; }
}

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-family: 'Outfit', sans-serif; font-size: .92rem; font-weight: 600; padding: .52rem 1.15rem; border-radius: 9px; border: 1.5px solid var(--brown); cursor: pointer; text-decoration: none; line-height: 1.3; background: #fff; color: var(--brown); }
.btn:hover { background: var(--cream-deep); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-gold { background: var(--gold); border-color: var(--gold-deep); color: #fff; }
.btn-gold:hover { background: var(--gold-deep); }
.btn-navy { background: none; border-color: var(--navy); color: var(--navy); }
.btn-navy:hover { background: #eef0f8; }
.btn-ghost { border-color: var(--line); color: var(--muted); }
.btn-lg { padding: .75rem 1.4rem; font-size: 1.02rem; border-radius: 12px; }
.btn-sm { padding: .28rem .7rem; font-size: .8rem; border-radius: 7px; }
.w-100 { width: 100%; }
.btnrow { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.5rem; }

/* ---------- tabs (segmented control) ---------- */
.tabs { display: flex; gap: .3rem; background: var(--cream-deep); border: 1.5px solid var(--line); border-radius: 12px; padding: .3rem; margin-bottom: 1.2rem; max-width: 480px; }
.tabs .tab { flex: 1; background: none; border: none; font-family: 'Outfit', sans-serif; font-weight: 600; font-size: .88rem; padding: .48rem .6rem; border-radius: 9px; cursor: pointer; color: var(--muted); white-space: nowrap; }
.tabs .tab:hover { color: var(--text); }
.tabs .tab.on { background: #fff; color: var(--brown); box-shadow: 0 1px 3px rgba(43, 40, 37, .12); }
@media (max-width: 767px) { .tabs { max-width: 100%; } .tabs .tab { font-size: .82rem; padding: .48rem .4rem; } }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: .4rem 0 1rem; }

.refreshbar { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.ic.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ic.spin { animation: none; } }

/* History filters: search on its own row, dates + clear beneath.
   Desktop keeps them on one line; mobile stacks cleanly. */
.history-filters { display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: .6rem; align-items: end; margin-bottom: 1rem; }
.history-filters .f-search { grid-column: 1 / -1; }
.history-filters .f-clear .btn { width: 100%; }
@media (min-width: 768px) {
    .history-filters { grid-template-columns: 2fr 1fr 1fr auto; }
    .history-filters .f-search { grid-column: auto; }
}
@media (max-width: 767px) {
    /* One filter per line — date pickers are too wide to share a row on a phone. */
    .history-filters { grid-template-columns: 1fr; }
    .history-filters .f-search, .history-filters .f-clear { grid-column: 1 / -1; }
}

.install-card { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: var(--blue-soft); border: 1.5px solid var(--blue); border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1rem; max-width: 430px; }
.install-card strong { color: var(--brown); }

/* ---------- admin logs ---------- */
.log-list { display: flex; flex-direction: column; gap: .4rem; }
.log-item { background: #fff; border: 1.5px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: .5rem .7rem; font-size: .85rem; }
.log-item.warn { border-left-color: var(--st-transit); }
.log-item.err { border-left-color: #a33025; }
.log-item summary { cursor: pointer; display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap; list-style: none; }
.log-item summary::-webkit-details-marker { display: none; }
.log-lvl { font-weight: 700; font-size: .68rem; letter-spacing: .06em; }
.log-item.warn .log-lvl { color: var(--st-transit); }
.log-item.err .log-lvl { color: #a33025; }
.log-when { font-family: 'Courier New', monospace; font-size: .78rem; color: var(--muted); }
.log-cat { font-weight: 600; color: var(--blue-deep); }
.log-msg { flex: 1 1 100%; }
.log-ex { margin: .5rem 0 0; padding: .6rem; background: var(--cream-deep); border-radius: 6px; font-size: .72rem; overflow-x: auto; white-space: pre; }

/* ---------- overview bar chart ---------- */
.chart { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; margin-bottom: 1rem; }
.chart-item { padding: .38rem 0; border-bottom: 1px solid var(--line-soft, var(--line)); }
.chart-item:last-of-type { border-bottom: none; }
.chart-row { display: grid; grid-template-columns: minmax(72px, 32%) 1fr auto; align-items: center; gap: .7rem; }
.chart-sub { display: flex; flex-wrap: wrap; gap: .3rem .9rem; margin: .3rem 0 0 calc(32% + .7rem); font-size: .74rem; color: var(--muted); }
.chart-sub .cn { display: inline-flex; align-items: center; gap: .3rem; font-variant-numeric: tabular-nums; }
.chart-sub .cn i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.chart-sub .cn.produced i { background: var(--st-produced); }
.chart-sub .cn.transit i { background: var(--st-transit); }
.chart-sub .cn.freezer i { background: var(--st-freezer); }
@media (max-width: 767px) { .chart-sub { margin-left: 0; } }
.chart-label { font-size: .9rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-track { display: flex; height: 18px; background: var(--cream-deep); border-radius: 6px; overflow: hidden; }
.chart-bar { height: 100%; }
.chart-bar.produced { background: var(--st-produced); }
.chart-bar.transit { background: var(--st-transit); }
.chart-bar.freezer { background: var(--st-freezer); }
.chart-value { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem; min-width: 1.5ch; text-align: right; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .7rem; padding-top: .7rem; border-top: 1px solid var(--line); font-size: .72rem; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.chart-legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart-legend .sw.produced { background: var(--st-produced); }
.chart-legend .sw.transit { background: var(--st-transit); }
.chart-legend .sw.freezer { background: var(--st-freezer); }
/* Chart + table on desktop; chart only on mobile. */
@media (max-width: 767px) { .overview-table { display: none; } }

/* ---------- manage-boxes cards ---------- */
.box-list { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.box-item { background: #fff; border: 1.5px solid var(--line); border-radius: 12px; padding: .75rem .9rem; display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.box-info { flex: 1 1 60%; min-width: 0; }
.box-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.box-lot { font-size: 1rem; }
.box-sub { margin-top: .2rem; }
.box-action { flex: 0 0 auto; }
@media (max-width: 767px) { .box-action { flex: 1 1 100%; width: 100%; } }

/* ---------- production submit ---------- */
.prod-submit { display: flex; align-items: flex-end; gap: .8rem; margin-top: 1rem; }
.prod-submit .prod-date { flex: 0 0 auto; }
.prod-submit .prod-create { flex: 1; }
@media (max-width: 767px) {
    .prod-submit { flex-direction: column; align-items: stretch; }
    .prod-submit .prod-create { width: 100%; }
}

/* ---------- cards / notes / alerts ---------- */
.card { background: #fff; border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: 1.2rem; box-shadow: 0 1px 3px rgba(43, 40, 37, .05); }
.card.strong { border-color: var(--blue); box-shadow: 0 2px 8px rgba(95, 147, 168, .15); }
.card-body { padding: 1.05rem 1.15rem; }
.note { background: var(--blue-soft); border-left: 4px solid var(--blue-deep); border-radius: 8px; padding: .6rem .95rem; font-size: .83rem; color: #3c5a68; margin-bottom: 1.2rem; }
.alert { border-radius: 8px; padding: .6rem .95rem; margin-bottom: 1rem; font-size: .9rem; }
.alert-ok { background: var(--ok-bg); color: var(--ok-tx); border-left: 4px solid var(--st-sale); }
.alert-err { background: var(--err-bg); color: var(--err-tx); border-left: 4px solid #a33025; }
.alert-info { background: var(--blue-soft); color: #3c5a68; border-left: 4px solid var(--blue-deep); }

/* ---------- status chips ---------- */
.chip { display: inline-flex; align-items: center; gap: .4rem; border-radius: 99px; padding: .15rem .72rem; font-size: .73rem; font-weight: 600; white-space: nowrap; color: #fff; }
.chip.produced { background: var(--st-produced); }
.chip.transit { background: var(--st-transit); }
.chip.freezer { background: var(--st-freezer); }
.chip.sale { background: var(--st-sale); }
.chip.overdue { background: #a33025; }

/* ---------- stat tiles (Home dashboard) ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .7rem; margin: .6rem 0 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.stat-n { font-family: 'Changa One', Impact, sans-serif; font-size: 1.8rem; line-height: 1; color: var(--brown); }
.stat-l { font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.stat.warn { border-color: #a33025; }
.stat.warn .stat-n { color: #a33025; }

/* ---------- lifecycle track ---------- */
.track { display: flex; align-items: flex-start; gap: 0; margin: .3rem 0; flex-wrap: wrap; }
.track-step { flex: 1; min-width: 56px; display: flex; flex-direction: column; align-items: center; gap: .15rem; position: relative; text-align: center; }
.track-step::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.track-step:first-child::before { display: none; }
.track-step.on::before { background: var(--gold); }
.track-dot { width: 13px; height: 13px; border-radius: 50%; background: var(--line); z-index: 1; }
.track-step.on .track-dot { background: var(--gold); }
.track-step.now .track-dot { box-shadow: 0 0 0 3px rgba(216, 165, 18, .3); }
.track-lbl { font-size: .62rem; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--muted); }
.track-step.on .track-lbl { color: #2b2825; }
.track-when { font-size: .58rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- scan divider ---------- */
.scan-or { display: flex; align-items: center; gap: .6rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 600; margin: 1rem 0; }
.scan-or::before, .scan-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; margin-bottom: .9rem; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th { font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--blue-deep); font-weight: 700; padding: .65rem .85rem; border-bottom: 2px solid var(--blue); text-align: left; white-space: nowrap; background: #fff; }
.tbl td { padding: .58rem .85rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover td { background: var(--cream); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .actions { text-align: right; white-space: nowrap; }
.tbl tr.inactive td { color: var(--muted); }

/* ---------- forms ---------- */
.form-label { display: block; margin-bottom: .28rem; font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.form-control, .form-select { display: block; width: 100%; padding: .52rem .75rem; font-size: .95rem; border: 1.5px solid var(--line); border-radius: 9px; background: #fff; color: var(--text); font-family: inherit; }
.form-control:focus, .form-select:focus { border-color: var(--blue-deep); }
.uc, .text-uppercase { text-transform: uppercase; }
.row-g2 { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.row-g2 > div { min-width: 130px; }
.grow2 { flex: 2; } .grow1 { flex: 1; }
.input-group { display: flex; }
.input-group .form-control { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: none; }
.input-group .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.check { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-size: .9rem; }
.validation-message { color: #a33025; font-size: .8rem; display: block; margin-top: .15rem; }
.valid.modified:not([type=checkbox]) { border-color: var(--st-sale); }
.invalid { border-color: #a33025; }

/* ---------- lists ---------- */
.list-group { list-style: none; margin: 0 0 1.1rem; padding: 0; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; }
.list-group li { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .62rem .95rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-group li:last-child { border-bottom: none; }

/* ---------- login ---------- */
.login-screen { background: var(--blue-soft); margin: -1.4rem -1.5rem -2.8rem; padding: 2.2rem 1.5rem 3rem; min-height: calc(100vh - 8rem); }
.login-hero { text-align: center; margin-bottom: 1.5rem; }
.login-hero .brandlogo { display: block; height: 120px; width: auto; margin: 0 auto; }
.login-hero .tag { font-family: 'Changa One', Impact, sans-serif; text-transform: uppercase; letter-spacing: .1em; color: var(--brown); font-size: 1.15rem; margin-top: .4rem; }
.login-hero .sub { font-size: .62rem; letter-spacing: .26em; text-transform: uppercase; color: var(--blue-deep); margin-top: .25rem; }
.login-card { background: #fff; border: 1.5px solid var(--line); border-radius: 16px; padding: 1.4rem; max-width: 380px; margin: 0 auto; box-shadow: 0 6px 20px rgba(95, 147, 168, .18); }
@media (max-width: 767px) { .login-screen { margin: -1.05rem -1rem -6.6rem; padding: 1.8rem 1.3rem 7.5rem; } }

/* ---------- scan ---------- */
.scan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
#qr-reader { background: #20242a; border-radius: 16px; max-width: 430px; overflow: hidden; margin-bottom: 1rem; }
#qr-reader video { border-radius: 16px; }

/* ---------- offline banner / error ui ---------- */
#offline-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 2000; background: var(--brown-deep); color: #fff; text-align: center; padding: .5rem 1rem; font-weight: 600; }
#blazor-error-ui { color-scheme: light only; background: var(--gold); color: #2b2825; bottom: 0; box-shadow: 0 -1px 4px rgba(0, 0, 0, .2); display: none; left: 0; padding: .6rem 1.25rem .7rem; position: fixed; width: 100%; z-index: 1000; font-size: .9rem; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.blazor-error-boundary { background: var(--err-bg); color: var(--err-tx); padding: 1rem; border-radius: 8px; }
.blazor-error-boundary::after { content: "Something went wrong." }

h1:focus { outline: none; }

/* ---------- reconnect / auto-update overlay ---------- */
#components-reconnect-modal { display: none; position: fixed; inset: 0; z-index: 3000; background: rgba(43, 40, 37, .55); align-items: center; justify-content: center; }
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected { display: flex; }
#components-reconnect-modal .reconnect-box { display: flex; align-items: center; gap: .7rem; background: #fff; color: var(--text); border: 1.5px solid var(--line); border-radius: 12px; padding: .9rem 1.3rem; box-shadow: 0 10px 30px rgba(43, 40, 37, .3); font-size: .95rem; }
#components-reconnect-modal .reconnect-dot { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--blue); border-top-color: transparent; animation: spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { #components-reconnect-modal .reconnect-dot { animation: none; } }
