/* Stock, sales channels, repeating bills and the keys: what these screens
   need beyond the shared styles. Loaded after shell.css. */

/* ---------- phones: five places in the bar, and New above it ---------- */
.tabbar div { grid-template-columns: repeat(5, minmax(0, 1fr)); padding: 0 4px; }
.tabbar a { font-size: 10.5px; }
.tabbar .tab-new { position: absolute; right: 2px; bottom: calc(100% + 12px); width: 54px; height: 54px; box-shadow: 0 6px 16px rgba(22, 23, 26, 0.22); }
/* a screen with its own bar of actions at the foot keeps that corner to itself */
body:has(.stickybar) .tabbar .tab-new, body:has(dialog[open]) .tabbar .tab-new { display: none; }

/* ---------- a form laid out the way Tally lays one out ---------- */
.tform { gap: 8px; }
.tform .trow { display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr); align-items: center; gap: 10px; }
.tform .trow > span { font-size: 13.5px; color: var(--muted); }
.tform .trow > span::after { content: ":"; }
.tform h3 { margin: 10px 0 0; padding-top: 12px; border-top: 1px dashed var(--dash); font-size: 13px; font-weight: 500; color: var(--ink); }
.tform .tnote { margin: -2px 0 2px 142px; }
.tform .tnew { display: grid; gap: 8px; }
.tform .tvalue { font-family: var(--mono); font-weight: 500; letter-spacing: -0.03em; font-size: 15px; }
.tform .pill.wide { margin-top: 8px; }
.keys-hint { display: none; text-align: center; }
.keys-hint i { font-style: normal; margin: 0 4px; color: var(--faint); }
@media (max-width: 519px) {
  .tform .trow { grid-template-columns: minmax(0, 104px) minmax(0, 1fr); }
  .tform .tnote { margin-left: 0; }
}
@media (min-width: 1000px) { .keys-hint { display: block; } }

/* ---------- keys ---------- */
kbd { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 7px; font: 500 12px/1 var(--mono); letter-spacing: -0.02em; color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1px rgba(31, 32, 35, 0.18), 0 1px 0 rgba(31, 32, 35, 0.18); }
kbd + kbd { margin-left: 3px; }
.keys { display: grid; gap: 12px; align-items: start; }
.key-list { display: grid; }
.key-row { display: grid; grid-template-columns: minmax(0, 132px) minmax(0, 1fr); gap: 12px; align-items: center; padding: 9px 0; font-size: 13.5px; line-height: 1.4; }
.key-row + .key-row { border-top: 1px dashed var(--dash); }
.key-row .caps { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.key-row .caps i { font-style: normal; font-size: 11.5px; color: var(--faint); margin: 0 2px; }
@media (min-width: 1000px) { .keys { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }

/* ---------- pack sizes ---------- */
.pack-grid { display: grid; gap: 12px; align-items: start; }
.pack-bar { display: flex; height: 10px; margin: 2px 0 8px; border-radius: 999px; overflow: hidden; background: rgba(31, 32, 35, 0.07); }
.pack-bar i { background: color-mix(in srgb, var(--c-stock) 35%, #fff); }
.pack-bar b { background: var(--c-stock); }
.pack-lines { display: grid; }
.pack-line { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 12px; align-items: center; padding: 10px 0; }
.pack-line + .pack-line { border-top: 1px dashed var(--dash); }
.pack-line b { display: block; font-weight: 500; font-size: 14px; overflow-wrap: anywhere; }
.pack-line small { display: block; font-size: 12.5px; color: var(--muted); }
.pack-line .field { text-align: right; font-family: var(--mono); }
.inset.tally { padding: 4px 14px; }
.line small { display: block; font-size: 12.5px; color: var(--muted); }
a.line { color: inherit; }
a.line:hover > span:first-child { color: var(--ink); }
@media (min-width: 900px) { .pack-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 1500px) { .pack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- warehouses, bins, names ---------- */
.field.bin { width: 118px; height: 34px; font-family: var(--mono); font-size: 13px; letter-spacing: -0.02em; }
table.data td .field { display: inline-block; }
.move-line { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 8px; }
.move-line [data-qty] { text-align: right; font-family: var(--mono); }
.name-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 64px auto; gap: 6px; margin-top: 10px; }
.name-add .pill { height: 38px; }
@media (max-width: 519px) { .name-add { grid-template-columns: 1fr 1fr; } }
.field.file { padding: 9px 12px; height: auto; font-size: 14px; }
.col-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .col-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }

/* ---------- analysis ---------- */
.grade { display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 10px; font: 600 13px/1 var(--sans); background: var(--t-plain); color: var(--c-plain); }
.grade.g-A { background: var(--green-bg); color: var(--green-ink); }
.grade.g-B { background: var(--yellow-bg); color: var(--yellow-ink); }
td .grade { width: 26px; height: 26px; border-radius: 8px; font-size: 12px; }
.row-meta.wrap { white-space: normal; }

/* ---------- repeating bills ---------- */
.entry.off-soft .entry-name > span:first-child, .entry.off-soft .entry-amt { color: var(--muted); }
.row.pick-bill { cursor: pointer; }
.row.pick-bill[aria-pressed="true"] { background: #fff; box-shadow: inset 0 0 0 2px var(--ink); }
button.entry { font: inherit; color: inherit; cursor: pointer; }

/* ---------- a bill printed from its own sheets: each fills a page, edge to edge ---------- */
@page sheet { size: A4; margin: 0; }
@media print {
  #print.pages { page: sheet; padding: 0; }
  #print.pages img { display: block; width: 210mm; height: 296.6mm; break-after: page; }
  #print.pages img:last-child { break-after: auto; }
}

/* ---------- printing a list ---------- */
@media print { #print .p-top + table { margin-top: 0; } }

/* ---------- the document that goes with a message ---------- */
.attached { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--hair); }
.attached > svg { flex: none; color: var(--c-sales); }
.attached > div { flex: 1; min-width: 0; }
.attached b { display: block; font-weight: 500; font-size: 14px; }
.attached small { display: block; font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a long file name is cut short, never allowed to widen the sheet */
#shareForm { grid-template-columns: minmax(0, 1fr); }
.attached { min-width: 0; }
