/* Stores only. The shared look (colours, fonts, header, panels, forms, buttons, lists,
   dialogs, footer, phone layout, ghost loading) is in portal.css, the same file the other
   group tools use. Keep portal.css identical in every tool. */

input[type=tel], input[type=time], input[type=search], input[type=url] {
  width: 100%; border: 1px solid var(--line); background: var(--ground); border-radius: 6px; padding: 8px 10px; font-size: .95rem;
  text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink); height: 40px; line-height: 1.2; font-family: inherit;
}
input[type=time] { -webkit-appearance: none; appearance: none; display: block; }
input[type=file] { font-size: .9rem; max-width: 100%; }
@media (max-width: 760px) { input[type=tel], input[type=time], input[type=search], input[type=url] { font-size: 16px; padding: 10px 12px; height: 44px; } }
.top nav.tabs { margin-left: auto; }
.panel.stack > h2, .panel.stack > p { margin: 0; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pre { white-space: pre-wrap; }
.outside-note { color: var(--warn); font-weight: 600; font-size: .85rem; }
.bad-text { color: var(--bad); }
ul.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.panel + .panel, .two + .panel, .panel + .two, .item-head + .panel, .item-head + .two, .cards + .panel { margin-top: 18px; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78em; font-weight: 600; color: var(--muted); background: var(--ground); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; white-space: nowrap; vertical-align: middle; }
h2 .code { font-size: .55em; }
.sec { font-size: 1.05rem; margin: 22px 0 10px; }
.sec0 { font-size: 1.05rem; margin: 0 0 10px; }
h4.day { margin: 14px 0 6px; font-size: .9rem; color: var(--muted); }
.crumbs { margin: 0 0 10px; font-size: .9rem; color: var(--muted); }
.crumbs a { color: var(--accent); }
.panel-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.panel-head h2, .panel-head h3 { margin: 0; }
.page-head { margin-bottom: 14px; align-items: flex-start; }
.page-head h2 { margin: 0 0 4px; }
.page-head p { margin: 0; max-width: 70ch; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.two > .panel { margin: 0; }
@media (max-width: 860px) { .two { grid-template-columns: 1fr; } }
.warn-panel { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: color-mix(in srgb, var(--warn-soft) 55%, var(--surface)); }
tr.faded td, li.faded { opacity: .55; }
tr.focus td { background: var(--accent-soft); }

/* The search box: big, and first. */
.search-panel { display: grid; gap: 12px; }
.search-box { position: relative; display: block; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { height: 56px; font-size: 1.15rem; padding-left: 48px; padding-right: 70px; border-radius: 10px; background: var(--surface); border: 2px solid var(--line); }
.search-box input:focus { border-color: var(--accent); outline: none; }
.search-box .linkbtn { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
.search-box.small input { height: 46px; font-size: 1rem; }
@media (max-width: 760px) { .search-box input { height: 52px; font-size: 17px; } }
.filters .spacer { flex: 1; }
.result-count { margin: 14px 2px 8px; }

/* Result cards: photo, name and code, and where it lives in large type. */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
@media (max-width: 760px) { .cards { grid-template-columns: 1fr; gap: 8px; } }
a.card { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: start; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; }
a.card:hover, a.card:focus-visible { border-color: var(--accent); box-shadow: 0 1px 0 var(--accent); outline: none; }
.thumb { width: 84px; height: 84px; border-radius: 8px; object-fit: cover; background: var(--ground); display: grid; place-items: center; color: var(--muted); }
.thumb.place { color: var(--accent); background: var(--accent-soft); }
.tiny { width: 44px; height: 44px; border-radius: 6px; object-fit: cover; background: var(--ground); display: inline-grid; place-items: center; color: var(--muted); vertical-align: middle; }
.tiny svg { width: 22px; height: 22px; }
.cbody { display: grid; gap: 5px; min-width: 0; }
.ctitle { font-weight: 700; font-size: 1.02rem; line-height: 1.25; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.why { width: 100%; font-size: .78rem; color: var(--muted); }
.trail { display: inline-flex; gap: 6px; align-items: flex-start; color: var(--ink); font-weight: 600; line-height: 1.3; }
.trail svg { flex: none; color: var(--accent); margin-top: 1px; }
.trail a { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--muted); }
.trail a:hover { color: var(--accent); }
.trail .chev { color: var(--muted); margin: 0 5px; font-weight: 400; }
.trail .spot { font-weight: 400; color: var(--muted); }
.trail.none { color: var(--muted); font-weight: 400; }
a.card .trail { font-size: 1rem; }

/* Browsing */
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
a.room { display: grid; gap: 2px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
a.room:hover { border-color: var(--accent); }
a.room strong { font-family: var(--font-display); font-size: 1.02rem; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.room-grid > .panel { margin: 0; }
.room-grid h3 a { color: var(--ink); text-decoration: none; }
ul.tree { margin: 10px 0; padding-left: 18px; }
ul.tree ul { padding-left: 18px; }
ul.tree li { margin: 4px 0; }
ul.tree.cats .acts { display: inline-flex; gap: 8px; margin-left: 8px; }

/* An item */
.item-head { display: grid; grid-template-columns: minmax(220px, 340px) 1fr; gap: 22px; align-items: start; }
@media (max-width: 760px) { .item-head { grid-template-columns: 1fr; gap: 14px; } }
.gallery { display: grid; gap: 8px; }
.main-photo { padding: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); cursor: zoom-in; aspect-ratio: 4 / 3; display: block; width: 100%; }
.main-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.main-photo.none { cursor: default; display: grid; place-items: center; align-content: center; gap: 6px; color: var(--muted); background: var(--ground); }
.main-photo.none svg { width: 48px; height: 48px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.thumbs button { padding: 0; border: 1px solid var(--line); border-radius: 7px; background: none; cursor: pointer; }
label.upload { cursor: pointer; justify-self: start; }
.item-main { display: grid; gap: 12px; }
.item-name { margin: 0; font-size: 1.6rem; line-height: 1.15; }
.where-box { display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.where-box .trail { font-size: 1.15rem; }
.where-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--accent); }
.item-btns { margin-top: 2px; }
dl.facts { margin: 0; display: grid; gap: 8px; }
dl.facts div { display: grid; grid-template-columns: 140px 1fr; gap: 10px; }
dl.facts dt { color: var(--muted); font-size: .88rem; }
dl.facts dd { margin: 0; }
@media (max-width: 520px) { dl.facts div { grid-template-columns: 1fr; gap: 0; } }
.dlg-sub { font-size: .95rem; margin: 14px 0 4px; }
.docs li { overflow-wrap: anywhere; }
.photo-edit { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.pe { display: grid; gap: 4px; justify-items: start; font-size: .82rem; }
.pe .tiny { width: 72px; height: 72px; }
.photo-dlg { width: min(1000px, calc(100vw - 32px)); }
.photo-dlg img { display: block; max-width: 100%; max-height: 75vh; margin: 0 auto 12px; border-radius: 8px; }
#dlg { width: min(720px, calc(100vw - 32px)); }
label.f.wide { grid-column: 1 / -1; }
.linkbtn.pic { padding: 0; }

/* Bookings */
.blist { gap: 0; }
a.brow { display: grid; grid-template-columns: 220px 1fr auto; grid-template-areas: "when title state" "when what state"; gap: 2px 14px; padding: 10px 6px; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.blist li:first-child a.brow { border-top: 0; }
a.brow:hover { background: var(--ground); }
.bwhen { grid-area: when; font-weight: 600; font-size: .92rem; }
.btitle { grid-area: title; }
.bwhat { grid-area: what; }
.bstate { grid-area: state; align-self: center; }
@media (max-width: 760px) { a.brow { grid-template-columns: 1fr auto; grid-template-areas: "when state" "title state" "what what"; } }
.hist li { font-size: .9rem; }
table.kit td:first-child { width: 52px; }
.slot { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; padding: 10px 0; border-top: 1px solid var(--line); }
.slot:first-child { border-top: 0; padding-top: 0; }
.slot .f { flex: 1 1 260px; }
.dt { display: grid; grid-template-columns: 1fr 120px; gap: 6px; }
ul.lines li.line, ul.hits li { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
ul.lines li.clash { border-color: var(--bad); background: color-mix(in srgb, var(--bad-soft) 60%, var(--surface)); }
ul.hits li { align-items: center; }
.lbody { min-width: 0; }
.lctl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
label.qty { display: inline-flex; gap: 6px; align-items: center; font-size: .9rem; }
label.qty input { width: 80px; height: 36px; }
.unit-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.uchip { display: inline-flex; gap: 4px; align-items: center; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .82rem; cursor: pointer; }
.uchip.on { background: var(--accent-soft); border-color: var(--accent); }
.uchip.busy { opacity: .5; text-decoration: line-through; cursor: not-allowed; }
.uchip input { margin: 0; }
details.probs summary { cursor: pointer; font-weight: 600; margin: 6px 0; }
.prob { padding: 8px 0; border-top: 1px solid var(--line); }

/* Labels */
.labels-layout { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 18px; align-items: start; }
.labels-layout > .panel { margin: 0; }
@media (max-width: 900px) { .labels-layout { grid-template-columns: 1fr; } }
.lpick { max-height: 60vh; overflow: auto; display: grid; gap: 4px; padding-right: 4px; }
.lpick h4 { margin: 10px 0 2px; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.lunits { display: flex; flex-wrap: wrap; gap: 4px 14px; padding-left: 26px; }
.preview { overflow: auto; display: grid; gap: 16px; justify-items: start; padding: 4px; }
.preview .sheet { zoom: .62; box-shadow: 0 1px 6px rgba(0, 0, 0, .18); }
@media (max-width: 760px) { .preview .sheet { zoom: .4; } }
.sheet { position: relative; background: #fff; color: #000; flex: none; overflow: hidden; }
.sheet .cell { position: absolute; box-sizing: border-box; padding: 2mm 2.5mm; overflow: hidden; }
.preview .sheet .cell { outline: 1px dashed #d6d6d6; }
.lbl { display: flex; gap: 2.5mm; align-items: center; height: 100%; font-family: "Public Sans", Arial, sans-serif; }
.lbl .qr { height: 100%; aspect-ratio: 1; flex: none; }
.lbl .lt { display: grid; gap: .8mm; min-width: 0; align-content: center; }
.lcode { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 4.2mm; letter-spacing: .02em; }
.lname { font-size: 3.1mm; font-weight: 600; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lsub { font-size: 2.5mm; color: #333; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.lown { font-size: 2.2mm; color: #444; }
.lbl.mini { gap: 1.5mm; }
.lbl.mini .lcode { font-size: 3mm; }
.lbl.mini .lname { font-size: 2.2mm; -webkit-line-clamp: 2; }
.lbl.big { flex-direction: column; justify-content: center; text-align: center; gap: 4mm; }
.lbl.big .qr { height: auto; width: 70mm; }
.lbl.big .lcode { font-size: 9mm; }
.lbl.big .lname { font-size: 6mm; }
.lbl.big .lsub { font-size: 4mm; }
.lbl.big .lown { font-size: 3.5mm; }
#printArea { display: none; }
@media print {
  body.printing-labels > *:not(#printArea) { display: none !important; }
  body.printing-labels { background: #fff !important; margin: 0; padding: 0; }
  body.printing-labels #printArea { display: block; }
  #printArea .sheet { page-break-after: always; break-after: page; }
  #printArea .sheet:last-child { page-break-after: auto; break-after: auto; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* The scanned-label page for people who aren't signed in */
.found-code strong { font-family: ui-monospace, Menlo, Consolas, monospace; }

/* Ghost loading: cards shaped like search results */
.sk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 18px; }
.sk-cards > .panel { margin: 0; display: grid; grid-template-columns: 84px 1fr; gap: 12px; }
.sk-cards .sk-pic { width: 84px; height: 84px; }
.sk-input.tall { height: 56px; }
#views a:not(.btn, .card, .room, .brow), .crumbs a { color: var(--accent); }
.trail a { color: inherit !important; }
input[type=search]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
#view-manage > .seg { margin-bottom: 16px; }
/* The link colour above must not reach the Manage switcher: keep portal.css's .seg colours. */
#views .seg a { color: var(--muted); }
#views .seg a[aria-current="page"] { color: var(--accent-ink); }

/* Put away checklist */
.pa-progress { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }
.pa-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.pa-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .2s; }
.pa-progress strong { white-space: nowrap; font-size: .95rem; }
.pa-group { padding-top: 14px; padding-bottom: 6px; }
.pa-group h3 { margin-bottom: 6px; }
.pa-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.pa-group h3 + .pa-row { border-top: 0; }
.pa-row input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; margin: 0; }
.pa-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pa-row.done .pa-text > span:first-child { text-decoration: line-through; color: var(--muted); }
.pa-row.done .tiny { opacity: .5; }
.pa-qty { font-weight: 700; white-space: nowrap; }
.pa-outs li { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.pa-outs li:first-child { border-top: 0; }
@media print { .pa-progress, #paClear { display: none; } }

/* Bookings calendar */
.bk-seg { margin: 0 0 16px; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav h3 { min-width: 150px; text-align: center; }
.cal-item select { min-width: 220px; }
.cal-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 12px; font-size: .82rem; }
.cal-key span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; box-sizing: border-box; }
.cal-chip.soft { background: var(--accent-soft); color: var(--accent); }
.cal-chip.warn { background: var(--warn-soft); color: var(--warn); }
.cal-chip.good { background: var(--good-soft); color: var(--good); }
.dot.soft { background: var(--accent-soft); border: 2px solid var(--accent); }
.dot.warn { background: var(--warn-soft); border: 2px solid var(--warn); }
.dot.good { background: var(--good-soft); border: 2px solid var(--good); }
.dot.bad, .cal-chip.bad { background: var(--bad); color: var(--surface); }
.dot.muted, .cal-chip.muted { background: var(--ground); color: var(--muted); }
.dot.muted { border: 2px solid var(--line); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal-dow { padding: 6px 8px; font-size: .75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--ground); }
.cal-day { min-height: 104px; padding: 4px 4px 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.other { background: var(--ground); }
.cal-day.other .cal-num { color: var(--muted); }
.cal-day.sel { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-num { align-self: flex-start; border: 0; background: none; font: inherit; font-weight: 700; font-size: .85rem; color: var(--ink); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; padding: 0; }
.cal-num:hover { background: var(--accent-soft); }
.cal-day.today .cal-num { background: var(--accent); color: var(--accent-ink); }
#views a.cal-chip { display: block; font-size: .76rem; font-weight: 600; line-height: 1.3; padding: 2px 6px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
#views a.cal-chip.soft { color: var(--accent); }
#views a.cal-chip.warn { color: var(--warn); }
#views a.cal-chip.good { color: var(--good); }
#views a.cal-chip.bad { color: var(--surface); }
#views a.cal-chip.muted { color: var(--muted); }
.cal-chip .t { font-variant-numeric: tabular-nums; opacity: .85; }
.cal-more { font-size: .76rem; align-self: flex-start; padding: 0 4px; }
.cal-dayview { margin-top: 16px; }
.cal-agenda { display: none; }
.cal-agenda h4.is-today { color: var(--accent); }
@media (max-width: 760px) {
  .cal-grid, .cal-dayview, .cal-key { display: none; }
  .cal-agenda { display: block; margin-top: 8px; }
  .cal-head { flex-direction: column; align-items: stretch; }
  .cal-nav { justify-content: space-between; }
  .cal-item select { width: 100%; min-width: 0; }
}
