@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap");

/* Styling follows the "Daniel Standard" design system: white space, deep teal, one orange thing to do. */
:root {
  --teal-deep: #0f4c5c; --teal-deeper: #0a3743; --teal: #3a9aae; --teal-soft: #e8f3f6; --teal-wash: #f4f9fa;
  --orange: #f2a33a; --orange-dark: #c97f1c; --orange-soft: #fdf1df; --on-orange: #3a2405;
  --bg: #ffffff; --card: #ffffff; --ink: #1d2b30; --muted: #5b6b70; --line: #d5e4e8; --line-soft: #e8f0f2;
  --danger: #b4412e; --danger-soft: #fbeae6; --success: #2b7a4b; --success-soft: #e6f4ec;
  --space-2xs: 0.35rem; --space-xs: 0.7rem; --space-sm: 1rem; --space-md: 1.5rem; --space-lg: 3rem;
  --gutter: 16px; --page-max: 1180px; --card-min: 260px;
  --radius-sm: 9px; --radius: 14px; --radius-modal: 16px; --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(15, 76, 92, 0.08); --shadow: 0 8px 24px rgba(15, 76, 92, 0.14);
  --ring: 0 0 0 3px rgba(58, 154, 174, 0.45);
  --opacity-disabled: 0.55; --opacity-closed: 0.6;
  --font-display: "Poppins", system-ui, sans-serif; --font-body: "Source Sans 3", system-ui, sans-serif;
  --fill: var(--teal-deep); --fill-hover: var(--teal-deeper); --on-fill: #fff; --on-orange-soft: var(--on-orange);
  --topbar-bg: rgba(255,255,255,.96); --backdrop: rgba(10, 55, 67, .45);
  color-scheme: light;
}

/* Dark mode: same brand, inverted surfaces. Text pairs keep at least 4.5:1. */
:root[data-theme="dark"] {
  --teal-deep: #9ad7e3; --teal-deeper: #c3e9f0; --teal: #5cb8cb; --teal-soft: #1b3a42; --teal-wash: #13252a;
  --orange-dark: #f5b75e; --orange-soft: #3b2c14; --on-orange-soft: #f8c47a;
  --bg: #0e191c; --card: #152428; --ink: #e2eef0; --muted: #9db2b7; --line: #2a4148; --line-soft: #1f3338;
  --danger: #f39a87; --danger-soft: #3d201b; --success: #79d6a1; --success-soft: #16352a;
  --fill: #2f8ea2; --fill-hover: #3aa3b8; --on-fill: #04161b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4); --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  --ring: 0 0 0 3px rgba(92, 184, 203, 0.55);
  --topbar-bg: rgba(14, 25, 28, .94); --backdrop: rgba(0, 0, 0, .6);
  color-scheme: dark;
}
html { font-size: 17px; }
@media (max-width: 640px) { html { font-size: 16px; } }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); line-height: 1.55; }
h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--teal-deep); line-height: 1.25; margin: 0; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.1rem; }
.small { font-size: 0.85rem; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: var(--space-2xs); font: 600 0.95rem/1.3 var(--font-body); padding: 0.55rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); color: var(--teal-deep); cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover { border-color: var(--teal); background: var(--teal-wash); }
.btn:focus-visible, .icon-btn:focus-visible, .input:focus, .tab:focus-visible, .subtab:focus-visible { outline: none; box-shadow: var(--ring); }
.btn.primary { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }
.btn.primary:hover { background: var(--fill-hover); border-color: var(--fill-hover); }
.btn.accent { background: var(--orange); border-color: var(--orange); color: var(--on-orange); }
.btn.accent:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: var(--on-orange); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn.link { border-color: transparent; background: none; padding-left: .3rem; padding-right: .3rem; }
.btn.link:hover { text-decoration: underline; background: none; }
.btn.small { font-size: 0.85rem; padding: 0.35rem 0.7rem; }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: var(--opacity-disabled); cursor: default; }
.icon-btn { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: var(--radius-sm); border: 0; background: none; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--teal-wash); color: var(--teal-deep); }
.icon-btn.on { color: var(--orange-dark); }

/* Pills */
.pill { display: inline-block; font: 700 0.78rem/1.2 var(--font-body); letter-spacing: .03em; text-transform: uppercase; padding: .2rem .6rem; border-radius: var(--radius-pill); background: var(--teal-soft); color: var(--teal-deep); }
.pill.orange { background: var(--orange-soft); color: var(--on-orange-soft); }
.pill.green { background: var(--success-soft); color: var(--success); }
.pill.grey { background: var(--line-soft); color: var(--muted); }

/* Tabs */
.tabs { display: flex; gap: var(--space-2xs); border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { display: inline-flex; align-items: center; gap: .45rem; font: 600 0.98rem/1.3 var(--font-body); color: var(--muted); padding: .7rem .9rem; border: 0; border-bottom: 3px solid transparent; background: none; cursor: pointer; white-space: nowrap; }
.tab i { color: var(--teal); }
.tab.active { color: var(--teal-deep); border-bottom-color: var(--orange); }
.subtabs { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }
.subtab { font: 600 0.9rem/1.3 var(--font-body); padding: .4rem .95rem; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--card); color: var(--teal-deep); cursor: pointer; }
.subtab.active { background: var(--fill); border-color: var(--fill); color: var(--on-fill); }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.1rem 1.2rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr)); gap: var(--space-sm); width: 100%; }
.item-card { padding: 0; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.item-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.item-card.closed { opacity: var(--opacity-closed); }
.item-card .photo { aspect-ratio: 4 / 3; background: var(--teal-wash); display: grid; place-items: center; color: var(--teal); font-size: 2.6rem; }
.item-card .body { padding: .9rem 1.1rem; display: flex; flex-direction: column; gap: .4rem; }
.item-card .desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.item-card .foot { display: flex; align-items: center; gap: var(--space-2xs); padding: 0 1.1rem .9rem; }
.item-card .foot .spacer { flex: 1; }
.row-card { display: flex; align-items: center; gap: var(--space-sm); }
.row-card .tile { flex: none; width: 42px; height: 42px; border-radius: var(--radius-sm); background: var(--teal-soft); color: var(--teal-deep); display: grid; place-items: center; }
.row-card .main { flex: 1; min-width: 0; }
.row-card.pinned, .card.pinned { border-left: 4px solid var(--orange); }
.pinned-label { font: 700 0.75rem/1 var(--font-body); letter-spacing: .03em; text-transform: uppercase; color: var(--orange-dark); }
.tool-card { display: flex; flex-direction: column; gap: .5rem; text-decoration: none; color: inherit; }
.tool-card .tile { width: 48px; height: 48px; border-radius: var(--radius-sm); display: grid; place-items: center; color: var(--on-fill); background: var(--fill); }
.tool-card:nth-child(3n+2) .tile { background: var(--teal); }
.tool-card:nth-child(3n+3) .tile { background: var(--orange); color: var(--on-orange); }

/* Notices, empty states */
.notice { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--teal-soft); color: var(--teal-deep); }
.notice.success { background: var(--success-soft); color: var(--success); }
.notice.warn { background: var(--orange-soft); color: var(--on-orange-soft); }
.notice.error { background: var(--danger-soft); color: var(--danger); }
.empty { border: 2px dashed var(--line); background: var(--teal-wash); border-radius: var(--radius); padding: var(--space-lg) var(--space-md); text-align: center; color: var(--muted); }
.empty i { display: block; font-size: 2rem; color: var(--teal); margin-bottom: .6rem; }

/* Forms */
.field { display: flex; flex-direction: column; gap: .3rem; }
.field label { font: 600 0.9rem/1.4 var(--font-body); color: var(--teal-deep); }
.input { width: 100%; box-sizing: border-box; font: 400 1rem/1.4 var(--font-body); color: var(--ink); background: var(--card); padding: .55rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
textarea.input { min-height: 7rem; resize: vertical; }
.form-hint { font-size: 0.85rem; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-sm); }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; }
.form-actions { display: flex; justify-content: flex-end; gap: var(--space-2xs); }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--success); }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* Modal, toast */
.backdrop { background: var(--backdrop); padding: var(--space-md); display: grid; place-items: center; width: 100%; box-sizing: border-box; }
.modal { position: relative; background: var(--card); border-radius: var(--radius-modal); box-shadow: var(--shadow); padding: var(--space-md); width: 100%; max-width: 560px; box-sizing: border-box; display: flex; flex-direction: column; gap: var(--space-sm); }
.modal.wide { max-width: 860px; }
.modal .close { position: absolute; top: .8rem; right: .8rem; }
.modal p { margin: 0; }
.toast { display: inline-block; background: var(--fill); color: var(--on-fill); font-weight: 700; padding: .6rem 1.2rem; border-radius: var(--radius-pill); box-shadow: var(--shadow); }
.toast.error { background: var(--danger); }

/* Tables */
.table-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; width: 100%; }
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap th { background: var(--teal-wash); text-align: left; font: 700 0.78rem/1.2 var(--font-body); letter-spacing: .03em; text-transform: uppercase; color: var(--teal-deep); padding: .7rem .9rem; }
.table-wrap td { padding: .65rem .9rem; border-top: 1px solid var(--line-soft); }
.table-wrap td:last-child, .table-wrap th:last-child { text-align: right; }

/* Layout helpers */
.ds-col { display: flex; flex-direction: column; gap: var(--space-xs); }
.field-group { display: flex; flex-direction: column; gap: .3rem; }

/* App layout */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .inner, main { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); box-sizing: border-box; }
.topbar .inner { display: flex; align-items: center; gap: var(--space-sm); min-height: 64px; }
.topbar .spacer, .section-head .spacer, .toolbar .spacer { flex: 1; }
.topnav { border-bottom: 0; align-self: stretch; align-items: stretch; }
.topnav .tab { text-decoration: none; }
.usermenu { display: flex; align-items: center; gap: var(--space-2xs); }
.usermenu { position: relative; }
.user-pill { display: inline-flex; align-items: center; gap: .55rem; padding: .25rem .7rem .25rem .25rem; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.user-pill:hover { border-color: var(--teal); background: var(--teal-wash); }
.user-pill:focus-visible, .menu-item:focus-visible, .seg-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.user-pill .user-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; text-align: left; }
.user-pill .user-text strong { font-size: .92rem; color: var(--teal-deep); max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-pill .user-text .small { font-size: .75rem; }
.user-pill .chev { font-size: .75rem; color: var(--muted); }
.avatar.sm { width: 32px; height: 32px; font-size: .8rem; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: .4rem; display: flex; flex-direction: column; gap: .15rem; z-index: 20; }
.menu-head { display: flex; flex-direction: column; padding: .5rem .6rem .6rem; border-bottom: 1px solid var(--line-soft); margin-bottom: .2rem; overflow-wrap: anywhere; }
.menu-head strong { color: var(--teal-deep); }
.menu-section { padding: .4rem .6rem .6rem; border-bottom: 1px solid var(--line-soft); margin-bottom: .2rem; }
.menu-label { font: 700 0.75rem/1.2 var(--font-body); letter-spacing: .03em; text-transform: uppercase; color: var(--muted); margin-bottom: .4rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--teal-wash); }
.seg-btn { font: 600 .88rem/1.2 var(--font-body); border: 0; border-radius: var(--radius-pill); padding: .4rem .6rem; background: none; color: var(--muted); cursor: pointer; display: inline-flex; gap: .4rem; align-items: center; justify-content: center; }
.seg-btn.on { background: var(--fill); color: var(--on-fill); }
.menu-item { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 6px; border: 0; background: none; font: 600 .95rem/1.3 var(--font-body); color: var(--teal-deep); text-decoration: none; cursor: pointer; text-align: left; width: 100%; }
.menu-item:hover { background: var(--teal-wash); }
.menu-item i { width: 1.1rem; text-align: center; color: var(--teal); }
.menu-item.danger, .menu-item.danger i { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger-soft); }
.site-tools { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }
.move-panel { display: flex; flex-direction: column; gap: var(--space-sm); border-left: 4px solid var(--orange); }
.wordmark { font: 700 1.35rem/1.1 var(--font-display); color: var(--teal-deep); text-decoration: none; white-space: nowrap; }
.tagline { display: block; font: 600 0.75rem/1.2 var(--font-body); color: var(--teal); }
main { padding-top: var(--space-md); padding-bottom: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-sm); }
a { color: var(--teal-deep); }
h3 { margin-top: var(--space-xs); }
.section-head, .toolbar { display: flex; align-items: center; gap: var(--space-xs); flex-wrap: wrap; }
.crumbs { font-size: .95rem; }
.crumbs a { text-decoration: none; font-weight: 600; }
.pill.red { background: var(--danger-soft); color: var(--danger); }
a.pill { text-decoration: none; }
.orange-text { color: var(--orange-dark); }
.danger-text { color: var(--danger); }
.btn.big { font-size: 1.05rem; padding: .8rem 1.3rem; }
a.btn { text-decoration: none; }
[hidden] { display: none !important; }

/* Home */
.hero { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; background: var(--teal-wash); }
.hero-main { flex: 1; min-width: 220px; }
.searchbar { display: flex; gap: var(--space-2xs); width: 100%; max-width: 640px; }
.toolbar .searchbar { max-width: 360px; }
.site-card { display: flex; flex-direction: column; gap: var(--space-xs); transition: transform .2s, box-shadow .2s; }
.site-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.site-link { text-decoration: none; color: inherit; }
.site-stats { display: flex; gap: var(--space-2xs); flex-wrap: wrap; }
a.row-card { text-decoration: none; color: inherit; }
a.row-card:hover { box-shadow: var(--shadow); border-color: var(--teal); }
.avatar { flex: none; width: 42px; height: 42px; border-radius: 50%; background: var(--fill); color: var(--on-fill); display: grid; place-items: center; font-weight: 700; }

/* Site page */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm); }
.stat { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; font: inherit; color: var(--muted); cursor: pointer; text-align: left; }
.stat .num { font: 700 1.8rem/1.1 var(--font-display); color: var(--teal-deep); }
.stat .num.orange-text { color: var(--orange-dark); }
.stat .num.danger-text { color: var(--danger); }
.stat.on { border-color: var(--teal-deep); box-shadow: inset 0 0 0 1px var(--teal-deep); }
.building { display: flex; flex-direction: column; gap: var(--space-xs); }
.building h3 i { color: var(--teal); }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--teal-wash); }
tr.closed td { opacity: var(--opacity-closed); }
.table-wrap td a { text-decoration: none; }
.table-wrap td:last-child, .table-wrap th:last-child { text-align: left; }

/* Asset page */
.where { display: flex; gap: var(--space-sm); align-items: center; }
.where .tile, .move-step .step-num { flex: none; width: 48px; height: 48px; border-radius: var(--radius-sm); background: var(--fill); color: var(--on-fill); display: grid; place-items: center; font: 700 1.3rem var(--font-display); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-sm); margin: 0; }
.facts dt { font: 700 0.78rem/1.2 var(--font-body); letter-spacing: .03em; text-transform: uppercase; color: var(--teal-deep); }
.facts dd { margin: .2rem 0 0; }
.history { display: flex; flex-direction: column; gap: var(--space-xs); }
.history-row { display: grid; grid-template-columns: 170px 1fr; gap: var(--space-xs); padding-bottom: var(--space-xs); border-bottom: 1px solid var(--line-soft); }
.history-row:last-child { border-bottom: 0; padding-bottom: 0; }

/* Move app */
.move-step { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.move-step .main { flex: 1; min-width: 200px; }
.move-step p { margin: .2rem 0 0; }
.done { text-align: center; display: flex; flex-direction: column; gap: var(--space-xs); align-items: center; padding: var(--space-lg) var(--space-md); }
.done-icon { font-size: 3rem; color: var(--success); }
.scanner { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18%; border: 3px solid var(--orange); border-radius: var(--radius); box-shadow: 0 0 0 999px rgba(0,0,0,.25); }

/* Placement pickers with inline "add new" */
.form-grid.placement { grid-template-columns: repeat(4, 1fr); }
.inline-new { display: flex; gap: var(--space-2xs); align-items: center; flex-wrap: wrap; margin-top: .35rem; padding: .5rem; border: 1px dashed var(--teal); border-radius: var(--radius-sm); background: var(--teal-wash); }
.inline-new .input { flex: 1 1 140px; min-width: 0; }
@media (max-width: 900px) { .form-grid.placement { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .form-grid.placement { grid-template-columns: 1fr; } }

/* Include-the-trash toggle: an icon button that stays pressed while on */
.trash-toggle { position: relative; flex: none; display: inline-grid; place-items: center; width: 2.75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card); color: var(--muted); cursor: pointer; transition: background-color .15s, border-color .15s, color .15s; }
.trash-toggle:hover { border-color: var(--teal); background: var(--teal-wash); color: var(--teal-deep); }
.trash-toggle input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.trash-toggle:has(input:focus-visible) { box-shadow: var(--ring); }
.trash-toggle:has(input:checked) { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
#results { transition: opacity .15s; }
#results.busy { opacity: .55; }

/* Modal */
.backdrop.fixed { position: fixed; inset: 0; z-index: 30; overflow-y: auto; align-items: start; padding-top: 6vh; }
#toast-area { position: fixed; bottom: var(--space-md); left: 50%; transform: translateX(-50%); z-index: 40; }

/* Sign in */
.totp-qr { width: 200px; height: 200px; margin: 0 auto; }
.totp-qr svg { width: 100%; height: 100%; display: block; }
.totp-key { font-size: .95rem; letter-spacing: .04em; color: var(--teal-deep); word-break: break-all; }
.signin { max-width: 420px; margin: 8vh auto 0; display: flex; flex-direction: column; gap: var(--space-sm); padding: var(--space-md); border-radius: 18px; box-shadow: var(--shadow); width: 100%; box-sizing: border-box; }

@media (max-width: 640px) {
  .form-grid.three, .stat-row { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .stat .num { font-size: 1.4rem; }
  .stat span:last-child { font-size: .8rem; }
  .hide-sm, .tagline { display: none; }
  .history-row { grid-template-columns: 1fr; gap: 0; }
  .topbar .inner { gap: var(--space-2xs); }
  .topnav .tab { padding: .7rem .55rem; }
  .wordmark { font-size: 1.1rem; }
}
.form-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 640px) { .form-grid.three { grid-template-columns: 1fr; } }

/* Print sheets: A4, 3 x 7 labels of 63.5 x 38.1 mm (Avery L7160 layout) */
.print-controls { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; }
.sheets { display: flex; flex-direction: column; gap: var(--space-md); align-items: center; }
.sheet { color-scheme: light; color: #000; width: 210mm; height: 297mm; box-sizing: border-box; padding: 15.15mm 7.25mm 0; display: grid; grid-template-columns: repeat(3, 63.5mm); grid-auto-rows: 38.1mm; column-gap: 2.5mm; background: #fff; box-shadow: var(--shadow); }
.label { background: #fff; box-sizing: border-box; padding: 3mm; display: flex; gap: 2.5mm; align-items: center; overflow: hidden; outline: 1px dashed #d5e4e8; border-radius: 2mm; }
.label .qr { flex: none; width: 30mm; height: 30mm; }
.label .qr svg { width: 100%; height: 100%; display: block; }
.label .text { min-width: 0; display: flex; flex-direction: column; gap: .6mm; font-family: var(--font-body); color: #000; }
.label .ltitle { font: 700 11pt/1.1 var(--font-display); word-break: break-all; }
.label .l1 { font-size: 8pt; line-height: 1.15; max-height: 2.3em; overflow: hidden; }
.label .l2, .label .l3 { font-size: 7pt; color: #333; }
.label.room .ltitle { font-size: 13pt; }
@page { size: A4; margin: 0; }
@media print {
  body.printing { background: #fff; }
  body.printing main { padding: 0; max-width: none; }
  .print-controls, #toast-area { display: none !important; }
  .sheets { gap: 0; }
  .sheet { box-shadow: none; page-break-after: always; break-after: page; }
  .label { outline: 0; }
}

/* Spacing pass: give sections room to breathe */
main { gap: var(--space-md); }
main > .section-head + .stat-row, main > .crumbs + .section-head { margin-top: calc(var(--space-sm) - var(--space-md)); }
#tab-body, #results { display: flex; flex-direction: column; gap: var(--space-md); }
#tab-body > .building + .building { padding-top: var(--space-md); border-top: 1px solid var(--line-soft); }
.building { gap: var(--space-sm); }
.section-head h3, .building h3 { margin-top: 0; }
.section-head + .table-wrap, .section-head + .grid, .section-head + .empty, h3 + .grid, h3 + .table-wrap, h3 + .small, h3 + .empty, h3 + .small + .table-wrap, h3 + .small + .grid { margin-top: calc(var(--space-sm) - var(--space-md)); }
.history-row { padding-bottom: var(--space-sm); }
.history { gap: var(--space-sm); }
.form-hint { margin-top: .25rem; }
.form-actions { margin-top: var(--space-xs); }
@media (max-width: 640px) { main { gap: var(--space-sm); } }

.row-actions { display: flex; gap: var(--space-2xs); justify-content: flex-end; flex-wrap: wrap; }
