:root { color-scheme: light; --green: #0f5132; --leaf: #e6f2dc; --ink: #16241b; --soft: #55655b; --line: #dce5dc; --red: #c8281e; }
* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
body { margin: 0 auto; max-width: 480px; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: #fff; color: var(--ink); font: 16px/1.4 'Plus Jakarta Sans', system-ui, sans-serif; }
h1, h2, p, dl, dd { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; min-height: 48px; }
button:disabled { opacity: .55; }
:focus-visible { outline: 3px solid #f2b705; outline-offset: 1px; }
input, select { width: 100%; height: 48px; padding: 0 10px; border: 1px solid #7b8a80; border-radius: 10px; background: #fff; }
.view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; }
.pad { padding: 12px 16px; }
header { padding: 10px 16px 12px; background: var(--green); color: #fff; }
header h1 { font-size: 16px; font-weight: 600; }
header .row + h1 { margin-top: 8px; }
header input, header select { width: auto; max-width: 100%; color: var(--ink); border: 0; font-weight: 600; }
#gear { margin-left: auto; }
#repCompany { height: 44px; margin-bottom: 8px; }
.big { font-size: 32px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.sums { display: flex; flex-wrap: wrap; gap: 2px 20px; font-size: 15px; }
.note { font-size: 14px; font-weight: 600; }
.icon { width: 44px; min-height: 44px; display: grid; place-items: center; background: none; font-size: 24px; }
.link { min-height: 44px; padding: 0 8px; background: none; text-decoration: underline; }
.foot { padding: 10px 16px; border-top: 1px solid var(--line); }
.red { flex: 1; width: 100%; background: var(--red); color: #fff; font-weight: 800; }
.danger { padding: 0 18px; background: #fff; border: 1px solid #b3211a; color: #b3211a; font-weight: 600; }
.plain { width: 100%; background: #fff; border: 1px solid var(--green); color: var(--green); font-weight: 600; }
[role=alert], .warn { color: #b3211a; font-weight: 600; }
.warn:not(:empty) { padding: 10px 16px; font-size: 14px; }
.empty { padding: 28px 16px; color: var(--soft); }

#login { justify-content: flex-end; gap: 12px; padding: 24px 24px 40px; background: var(--green); color: #fff; }
/* Takes only the space left over, so the keyboard never pushes the fields away. */
#login img { flex: 1 1 0; min-height: 0; width: calc(100% + 48px); margin: -24px -24px 8px; object-fit: cover; object-position: bottom; }
#login h1 { margin-bottom: 12px; font-size: 36px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
#login input { flex: none; color: var(--ink); }
#login [role=alert] { color: #ffd9d5; }
#login .red { flex: none; min-height: 56px; }

.item { display: block; width: 100%; padding: 10px 16px; border-bottom: 1px solid var(--line); border-radius: 0; background: #fff; text-align: left; }
.item > span { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.item > b { display: block; font-weight: 800; overflow-wrap: anywhere; }
.soft { color: var(--soft); }
.unsold { color: #b3211a; font-weight: 600; }

.edit header h1 { font-size: 20px; font-weight: 800; }
.edit label { font-size: 14px; }
.edit input, .edit select { font-size: 16px; }
fieldset { position: relative; margin: 12px 0 0; padding: 10px 12px 12px; border: 0; border-radius: 12px; background: #eef1ee; }
fieldset.sell { background: var(--leaf); }
legend { float: left; width: 100%; padding: 0; font-size: 18px; line-height: 32px; font-weight: 800; }
legend ~ * { clear: both; }
.grid { display: grid; grid-template-columns: 84px 84px minmax(0, 1fr); gap: 8px; }
.grid select { padding: 0 4px; }
.total { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 8px; align-items: center; margin-top: 10px; }
.total input { text-align: right; font-weight: 800; }
.later { position: absolute; top: 4px; right: 12px; display: flex; align-items: center; gap: 8px; height: 44px; font-weight: 600; }
.later input { width: 22px; height: 22px; accent-color: var(--green); }
#sellBox .row { margin-top: 10px; }
#split, .edit [role=alert], #splitNote:not(:empty) { margin-top: 10px; }
.stack { display: grid; gap: 14px; align-content: start; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chips label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 4px 12px; border: 1px solid #7b8a80; border-radius: 10px; background: #fff; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.chips label:has(:checked) { border-color: var(--green); background: var(--green); color: #fff; }
.chips input { flex: none; width: 20px; height: 20px; accent-color: #fff; }
.company { padding: 16px 16px 4px; font-size: 20px; font-weight: 800; overflow-wrap: anywhere; }

.tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.tabs button { min-height: 44px; border: 1px solid #fff; background: none; color: #fff; font-size: 15px; font-weight: 600; }
.tabs [aria-pressed=true] { background: #fff; color: var(--green); }
dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 16px; background: var(--leaf); }
dd { text-align: right; font-weight: 600; }

nav { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
nav button { min-height: 52px; border-radius: 0; background: #fff; color: var(--green); font-weight: 800; }
nav [aria-current=page] { background: var(--leaf); }

dialog { width: calc(100% - 48px); max-width: 320px; padding: 20px; border: 0; border-radius: 14px; color: var(--ink); }
dialog::backdrop { background: rgba(10, 30, 18, .6); }
dialog h2 { font-size: 20px; overflow-wrap: anywhere; }
dialog p { margin: 6px 0 16px; font-size: 15px; }
dialog form > div { display: grid; gap: 8px; }
dialog input { font-size: 16px; }

@media print {
  .noprint, nav, .tabs, .icon { display: none !important; }
  body, .view, .scroll { display: block; height: auto; max-width: none; overflow: visible; }
  header { background: none; color: #000; }
  .item { break-inside: avoid; }
}
