:root {
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Noto Sans JP",Meiryo,sans-serif;
  color:#1d2b3c; background:#f3f5f8; font-size:14px; line-height:1.65;
  --nav:#15283b; --green:#248749; --red:#bc202c; --border:#dce3ea; --sidebar:226px;
}
* {box-sizing:border-box}
body {margin:0; min-width:0}
a {color:#176aaa; text-decoration:none; overflow-wrap:anywhere}
a:hover {text-decoration:underline}
button,.button {
  display:inline-flex; align-items:center; justify-content:center; gap:5px;
  background:var(--green); border:1px solid var(--green); color:white; border-radius:7px;
  padding:10px 17px; font:inherit; font-weight:650; cursor:pointer; text-decoration:none;
  white-space:normal; text-align:center; min-height:42px; max-width:100%; overflow-wrap:anywhere;
}
button:hover,.button:hover {background:#196936; color:white; text-decoration:none}
button:disabled {opacity:.5; cursor:not-allowed}
.secondary {background:white; color:#31475d; border-color:#cbd4dd}
.secondary:hover {background:#e9eff5; color:#14283c}
.small {padding:5px 10px; min-height:34px; font-size:12px}
.warning {background:#a9620a; border-color:#a9620a}
.muted {color:#64748a}
aside {
  position:fixed; inset:0 auto 0 0; width:var(--sidebar); background:var(--nav); color:#d9e4ef;
  display:flex; flex-direction:column; padding:26px 17px; z-index:5; overflow-y:auto;
}
.brand {display:flex; align-items:center; gap:13px; font-size:20px; font-weight:700; line-height:1.45}
.brand img {width:49px; height:49px; flex:none; object-fit:contain; background:#fff; border-radius:50%; padding:3px}
.brand small {font-size:12px; font-weight:400; letter-spacing:.08em}
aside .brand+nav {margin-top:30px}
aside nav a {display:block; color:#e0e9f0; padding:10px 14px; border-radius:6px; margin:4px 0}
aside nav a:hover {background:#253e56; text-decoration:none}
.logout {margin:20px 10px}
.logout button {font-size:12px; background:transparent; color:#d1deea; border-color:#647a8e}
.user {margin-top:auto; padding:18px 13px; border-top:1px solid #3a4b5b; overflow-wrap:anywhere}
.content {
  width:calc(100% - var(--sidebar)); max-width:1400px; min-width:0;
  margin-left:var(--sidebar); padding:28px 28px 20px;
}
.content>* {min-width:0; max-width:100%}
.auth {max-width:600px; margin:6vh auto; padding:24px}
.setup {max-width:900px; margin:30px auto; padding:24px}
.setup .brand {margin-bottom:30px}
.setup .brand img {width:60px; height:60px}
header {display:flex; justify-content:space-between; align-items:center; gap:16px; border-bottom:1px solid var(--border); padding-bottom:20px; margin-bottom:25px}
header>div {min-width:0}
h1,h2,h3,p,legend,summary {overflow-wrap:anywhere}
h1 {font-size:26px; letter-spacing:.02em; margin:3px 0 0; font-weight:750}
h2 {font-size:19px; margin:0 0 16px}
h3 {font-size:15px; margin:22px 0 10px}
.eyebrow {font-size:10px; letter-spacing:.1em; color:#73849a; overflow-wrap:anywhere}
.today {font-size:12px; color:#73849a; flex-shrink:0}
.lead {font-size:15px; color:#52657a; margin:0 0 20px}
.toolbar {display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:20px; flex-wrap:wrap}
.toolbar>* {min-width:0; max-width:100%}
.toolbar p {flex:1 1 250px}
.toolbar p,.toolbar h2 {margin:0}
.card {background:white; border:1px solid var(--border); border-radius:10px; padding:24px; margin:22px 0; box-shadow:0 2px 5px #132a4004; min-width:0}
.login {text-align:center; padding:36px 40px}
.login-logo {width:74px; height:74px; object-fit:contain}
.login label {text-align:left}
.login button {width:100%; margin:15px 0 20px}
.login p {margin-bottom:24px}
label {display:block; font-size:12px; color:#43566b; font-weight:600; margin:0 0 17px; min-width:0; overflow-wrap:anywhere}
input,select,textarea {
  display:block; width:100%; min-width:0; max-width:100%; border:1px solid #c4d0db;
  border-radius:6px; background:#fff; color:#172c40; font:inherit; font-size:14px;
  font-weight:400; min-height:42px; padding:9px 10px; margin-top:6px;
}
input:focus,select:focus,textarea:focus {outline:3px solid #bcdded; border-color:#438ab0; outline-offset:1px}
a:focus-visible,button:focus-visible,summary:focus-visible {outline:3px solid #55a2c4; outline-offset:2px}
.check {display:flex; align-items:center; gap:9px}
.check input {width:20px; height:20px; min-height:20px; flex:none; margin:0; accent-color:var(--green)}
.form-grid {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:0 21px}
.form-grid>* {min-width:0}
.filters {display:flex; flex-wrap:wrap; gap:16px; align-items:flex-end; background:white; border:1px solid var(--border); padding:17px 20px; border-radius:8px; margin-bottom:23px}
.filters label {margin:0; flex:1 1 180px}
.filters button {margin:0}
fieldset {min-width:0; border:1px solid var(--border); border-radius:7px; margin:18px 0; padding:17px 16px 0}
legend {padding:0 8px; font-weight:600; max-width:100%}
.table-wrap {width:100%; min-width:0; background:white; border:1px solid var(--border); border-radius:8px; margin:18px 0}
table {width:100%; max-width:100%; table-layout:fixed; border-collapse:collapse; font-size:13px}
th,td {padding:11px 10px; text-align:left; vertical-align:middle; border-bottom:1px solid #e9edf1; white-space:normal; overflow-wrap:anywhere; min-width:0}
th {background:#edf2f6; color:#4c6278; font-size:12px; line-height:1.5; letter-spacing:0}
tr:last-child td {border-bottom:0}
tr:hover td {background:#fafcfe}
td small {display:block; color:#7a8b9d; font-size:11px; margin-top:4px}
td input {max-width:100%; min-width:0}
td label {margin:0}
.cell-value {min-width:0; max-width:100%; overflow-wrap:anywhere}
.cell-label {display:none}
.num,.type-number {font-variant-numeric:tabular-nums}
.record-table .type-number {text-align:right}
.actions {display:flex; align-items:center; gap:8px; flex-wrap:wrap; min-width:0}
.actions>* {min-width:0; max-width:100%}
.actions form {margin:0}
.row-action {display:inline-flex; align-items:center; justify-content:center; min-height:36px; padding:4px 5px; text-decoration:underline; text-underline-offset:3px; font-size:12px}
.record-table .actions {gap:2px 7px}
.metrics {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; margin:24px 0}
.metrics>div {background:white; border:1px solid var(--border); border-left:4px solid var(--green); padding:19px 24px; border-radius:8px; color:#697d91; font-size:12px; min-width:0; overflow-wrap:anywhere}
.metrics strong {display:block; color:#18334a; font-size:28px; letter-spacing:.02em; font-weight:650; overflow-wrap:anywhere}
.metrics small {font-size:12px; margin-left:7px}
.notice {padding:15px 18px; background:#e9f7ef; color:#1d6137; border:1px solid #bedbc8; border-radius:7px; margin:18px 0; overflow-wrap:anywhere}
.notice.danger {background:#fff1ef; border-color:#efc6c2; color:#992e24}
.notice.warning {background:#fff6e7; border-color:#efd2a1; color:#875310}
.notice a {font-weight:700; margin:0 6px}
.badge {display:inline-block; max-width:100%; background:#e7f3ec; color:#24663f; padding:3px 7px; border-radius:12px; font-size:11px; white-space:normal; overflow-wrap:anywhere}
.badge.warn {background:#fff1d7; color:#8d5917}
.calc-summary {display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap; padding:18px 0}
.calc-summary>* {min-width:0; max-width:100%; overflow-wrap:anywhere}
.calc-summary strong {font-size:27px; color:var(--green)}
.calc-summary .invalid {color:#b33025}
.pagination {display:flex; justify-content:flex-end; align-items:center; flex-wrap:wrap; gap:8px; font-size:12px; color:#5f7388}
.pagination>span:first-child {margin-right:auto}
.pagination .page-disabled {padding:6px; color:#7a8998}
.tabs {display:flex; gap:7px; flex-wrap:wrap; margin-bottom:25px}
.tabs a {padding:7px 13px; background:white; border:1px solid var(--border); border-radius:20px; color:#50677c; font-size:12px; max-width:100%; overflow-wrap:anywhere}
.tabs .active {background:var(--nav); color:white}
details {min-width:0}
details summary {cursor:pointer; font-weight:600; white-space:normal}
details[open]>summary {margin-bottom:20px}
pre {white-space:pre-wrap; overflow-wrap:anywhere; max-width:100%; min-width:0; background:#f1f4f7; border-radius:6px; padding:14px; font-size:12px; text-align:left}
code {overflow-wrap:anywhere}
footer {margin:42px 0 15px; text-align:center; font-size:11px; color:#8090a0}
.print-button {margin:12px 0}
.back-link {font-size:13px; margin:-5px 0 20px}
/* Filters occupy their own grid, so native date/select controls cannot widen a table. */
.record-list {margin:22px 0 32px; scroll-margin-top:15px; min-width:0}
.list-toolbar {display:flex; align-items:flex-end; gap:10px; flex-wrap:wrap}
.list-toolbar label {margin:0; flex:0 1 auto}
.size-control {width:100px}
.sort-control {width:180px}
.direction-control {width:110px}
.list-count {margin-left:auto; align-self:center; font-variant-numeric:tabular-nums; overflow-wrap:anywhere}
.list-search {margin:14px 0; padding:0 16px; background:#fff; border:1px solid var(--border); border-radius:8px}
.list-search>summary {padding:11px 0; color:#354f65; font-size:13px; min-height:44px}
.list-search[open]>summary {margin-bottom:8px; border-bottom:1px solid var(--border)}
.filter-count {font-size:11px; color:#63798b; background:#eef3f7; border-radius:12px; margin-left:12px; padding:2px 9px}
.search-fields {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px 18px}
.search-field {margin:0; padding:0; border:0; min-width:0}
.search-field legend {padding:0; margin-bottom:7px; font-size:12px; color:#43566b}
.search-field input,.search-field select {margin:0; min-width:0; max-width:100%}
.range-filter {display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px}
.range-filter label {margin:0; font-size:11px; font-weight:400; min-width:0}
.range-filter label span {display:block; margin-bottom:4px}
.search-actions {display:flex; align-items:center; gap:10px; flex-wrap:wrap; padding:18px 0}
.search-actions span {font-size:12px; color:#64748a; overflow-wrap:anywhere}
.active-filters {display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin:10px 0; font-size:12px}
.active-filters>span {max-width:100%; border:1px solid #d6e3dc; background:#edf5f0; border-radius:5px; color:#336349; padding:3px 7px; overflow-wrap:anywhere}
.active-filters>a {padding:5px 8px}
.list-hint {color:#52677b; font-size:12px; margin:12px 0}
.record-list .table-wrap {margin-top:10px}
.column-label {display:block; overflow-wrap:anywhere}
.sort-controls {display:inline-flex; gap:3px; margin-top:6px; max-width:100%}
.sort-controls a {display:inline-flex; align-items:center; justify-content:center; width:25px; min-height:28px; color:#526b82; border:1px solid #c8d3de; border-radius:4px; background:#fff; font-size:10px}
.sort-controls a.selected {background:#17384e; color:white; border-color:#17384e}
.clickable-row {cursor:pointer}
.clickable-row:hover td,.clickable-row:focus td,.clickable-row:focus-within td {background:#edf7f1}
.clickable-row:focus {outline:2px solid #28799a; outline-offset:-2px}
a[data-row-primary] {font-weight:650; text-decoration:underline; text-underline-offset:3px}
.record-table col.col-primary {width:22%}
[data-list="machines"] col.col-order {width:6%}
[data-list="machines"] col.col-serial {width:8%}
[data-list="machines"] col.col-number {width:9%}
[data-list="machines"] col.col-location {width:18%}
[data-list="machines"] col.col-base {width:10%}
[data-list="machines"] col.col-staff {width:8%}
[data-list="machines"] col.col-status {width:7%}
[data-list="machines"] col.col-date {width:13%}
[data-list="machines"] col.col-counter {width:11%}
[data-list="machines"] col.col-actions {width:10%}
[data-list="histories"] col.col-id {width:8%}
[data-list="histories"] col.col-date {width:18%}
[data-list="histories"] col.col-location {width:26%}
[data-list="histories"] col.col-staff {width:12%}
[data-list="histories"] col.col-counter {width:13%}
[data-list="histories"] col.col-amount {width:14%}
[data-list="histories"] col.col-collection {width:9%}
.manual {max-width:970px}
.manual section {padding:25px; background:white; border:1px solid var(--border); border-radius:8px; margin:22px 0}
.manual p,.manual li {line-height:1.9}
.manual li {margin:10px 0}
.manual h2 {scroll-margin-top:20px}
.manual .note {border-left:3px solid var(--green); padding:10px 16px; background:#f1f8f3}
.csv-fields {display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:10px; padding:12px 0;}
.csv-fields label {display:flex; align-items:center; gap:8px; min-height:44px; padding:8px; background:#f3f6f9; border-radius:6px;}
.csv-fields input[type="checkbox"] {width:20px; height:20px; flex:0 0 20px; margin:0;}
[data-machine-csv] fieldset {min-width:0; border:1px solid var(--border); border-radius:6px; padding:12px;}
.manual .toc a {display:block; margin:8px 0; padding:8px 12px; color:#154e78; border-radius:6px; text-decoration:underline;}
.manual .toc a:hover {color:#103c5e; background:#e8f1f7;}
.manual .toc a:focus-visible {outline:3px solid #154e78; outline-offset:2px; background:#e8f1f7;}
/* Wide reports keep all non-empty fields readable on screen; print retains the original columns. */
@media screen {
  .report-table,.report-table tbody {display:block}
  .report-table thead {position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap}
  .report-table tbody tr {display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:0; padding:10px; border-bottom:1px solid var(--border)}
  .report-table tbody tr:last-child {border-bottom:0}
  .report-table td {display:block; border:0; padding:7px 10px; min-width:0}
  .report-table .cell-label {display:block; color:#64748a; font-size:11px; margin-bottom:4px}
  .report-table .cell-empty {display:none}
}
@media(min-width:1550px) {.search-fields {grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:1199px) {
  :root {--sidebar:195px}
  aside {padding:22px 10px}
  .content {padding:24px 20px}
  .form-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
  th,td {padding:9px 6px; font-size:12px}
  .search-fields {grid-template-columns:repeat(2,minmax(0,1fr))}
  .record-table .sort-controls {gap:1px}
  .record-table .sort-controls a {width:20px; min-height:26px; font-size:9px}
  .record-table .row-action {padding:3px 0}
}
@media(max-width:980px) and (min-width:761px) {
  .record-table th {font-size:11px}
  .record-table .sort-controls {flex-direction:column}
  .report-table tbody tr {grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:760px) {
  :root {--sidebar:0px; font-size:15px}
  aside {position:static; width:100%; padding:14px 14px 10px; overflow:visible}
  .brand {font-size:17px; gap:10px}
  .brand img {width:37px; height:37px}
  .brand small {font-size:11px}
  aside .brand+nav {margin-top:12px}
  aside nav {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); align-items:stretch; gap:6px; min-width:0}
  aside nav a {display:flex; justify-content:center; align-items:center; padding:7px 5px; margin:0; font-size:13px; min-height:44px; text-align:center; background:#253e56; white-space:normal}
  .logout {margin:0; display:flex; min-width:0}
  .logout button {width:100%; padding:7px 5px; min-height:44px; font-size:13px}
  .user {display:none}
  .content {width:100%; margin:0; padding:20px 14px; max-width:1400px}
  header {margin-bottom:18px; padding-bottom:14px}
  h1 {font-size:23px}
  h2 {font-size:18px}
  .eyebrow {font-size:9px; letter-spacing:.04em}
  .today {display:none}
  .lead {font-size:14px}
  .form-grid {grid-template-columns:minmax(0,1fr); gap:0}
  .card {padding:16px; margin:18px 0}
  .toolbar {align-items:flex-start; gap:12px}
  .toolbar p {flex-basis:100%}
  label {font-size:13px}
  input,select,textarea {font-size:16px; min-height:48px; padding:11px 10px; line-height:1.4}
  input[type="datetime-local"],input[type="date"],input[type="month"] {width:100%; max-width:100%; min-width:0; appearance:none; -webkit-appearance:none}
  input::-webkit-date-and-time-value {text-align:left}
  input[type="file"] {font-size:13px; padding:10px 5px}
  .check {min-height:44px}
  .check input {width:24px; height:24px; min-height:24px}
  button,.button {min-height:48px; font-size:15px; padding:11px 15px; touch-action:manipulation}
  .small {min-height:44px; font-size:14px; padding:8px 12px}
  .filters {padding:14px; gap:12px}
  .filters label {flex-basis:100%}
  .filters button {width:100%}
  .metrics {grid-template-columns:minmax(0,1fr); gap:8px}
  .metrics>div {display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 15px; font-size:12px}
  .metrics strong {font-size:22px; text-align:right}
  .metrics small {font-size:12px}
  .notice {padding:13px 14px}
  .list-toolbar {display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.45fr); gap:10px}
  .list-toolbar label {width:auto; font-size:12px}
  .list-count {grid-column:1/-1; margin:2px 0 0; font-size:13px}
  .list-apply {align-self:end}
  .list-search {padding:0 12px}
  .list-search>summary {padding:12px 0; min-height:48px; font-size:14px}
  .search-fields {grid-template-columns:minmax(0,1fr); gap:16px}
  .search-field legend {font-size:13px}
  .range-filter {gap:8px}
  .range-filter label {font-size:12px}
  .search-actions {display:grid; grid-template-columns:repeat(2,minmax(0,1fr))}
  .search-actions span {grid-column:1/-1}
  .active-filters {font-size:12px}
  .active-filters>a {min-height:44px; display:flex; align-items:center}
  .list-hint {font-size:13px}
  .record-list {margin-top:18px}
  .record-list .table-wrap,.table-wrap:has(.data-table) {border:0; background:transparent}
  .record-table,.record-table tbody,.data-table,.data-table tbody {display:block; width:100%}
  .record-table colgroup {display:none}
  .record-table thead .sort-controls {display:none}
  .record-table thead,.data-table thead {
    position:absolute; width:1px; height:1px; padding:0; margin:-1px;
    overflow:hidden; clip-path:inset(50%); white-space:nowrap;
  }
  .record-table tbody,.data-table tbody {display:grid; grid-template-columns:minmax(0,1fr); gap:14px}
  .record-table tbody tr,.data-table tbody tr {
    display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:0;
    border:1px solid var(--border); border-radius:9px; padding:10px;
    background:#fff; min-width:0;
  }
  .record-table td,.data-table td {display:block; min-width:0; max-width:100%; padding:8px 6px; font-size:14px; border:0; text-align:left}
  .record-table .cell-label,.data-table .cell-label {display:block; font-size:11px; color:#667d90; margin-bottom:4px; line-height:1.5}
  .record-table .cell-primary,.data-table .cell-heading {grid-column:1/-1; order:-1; padding-bottom:13px; margin-bottom:2px; border-bottom:1px solid #e7edf1}
  .record-table .cell-primary .cell-value,.data-table .cell-heading .cell-value {font-size:17px; font-weight:700; line-height:1.6}
  a[data-row-primary] {display:block; padding:4px 0; min-height:36px}
  .record-table .cell-actions {grid-column:1/-1; border-top:1px solid #e7edf1; margin-top:4px; padding-top:6px; padding-bottom:0}
  .record-table .cell-actions .cell-label {display:none}
  .record-table .actions {display:flex; gap:10px}
  .record-table .row-action {font-size:14px; padding:9px 12px; min-height:44px; text-decoration:underline; border-radius:5px}
  .record-table .cell-value {font-variant-numeric:tabular-nums}
  .badge {font-size:12px; padding:4px 9px}
  .record-table .empty-row,.data-table .empty-row {display:block}
  .counter-items tbody tr {padding:12px; border-color:#cadbd1; gap:0 4px}
  .counter-items td {padding:8px 4px}
  .counter-items td:nth-child(4),.counter-items td:nth-child(5) {background:#f3f8f5; border-radius:5px}
  .counter-items td:nth-child(4) .cell-label,.counter-items td:nth-child(5) .cell-label {font-size:12px; color:#355a44}
  .counter-items td:nth-child(6) {grid-column:1/-1; display:flex; align-items:center; justify-content:space-between; gap:10px; border-top:1px solid #e0e9e3; margin-top:8px}
  .counter-items td:nth-child(6) .cell-label {margin:0; font-size:12px}
  .counter-items input {width:100%; min-width:0; min-height:52px; font-size:20px; font-variant-numeric:tabular-nums; margin:0; padding:10px 8px}
  .counter-items .item-amount {font-size:20px; font-weight:650; color:var(--green)}
  #full-counter {font-size:20px; font-variant-numeric:tabular-nums}
  .counter-form>button {display:block; width:100%; min-height:54px; font-size:17px; margin-top:20px}
  .calc-summary {flex-direction:column; align-items:flex-start; gap:8px; padding:16px 0}
  .calc-summary strong {font-size:29px}
  #counter-check {font-size:13px; line-height:1.7}
  .pagination {justify-content:flex-start; gap:6px; font-size:13px}
  .pagination>span:first-child {width:100%}
  .pagination .button {flex:1 1 54px; padding:8px 6px; min-height:44px}
  .pagination .page-disabled {text-align:center; flex:1 1 54px; padding:10px 4px; min-height:44px}
  .tabs {gap:7px}
  .tabs a {min-height:44px; display:flex; align-items:center; font-size:13px; padding:8px 12px}
  .auth {padding:15px; margin:3vh auto}
  .login {padding:24px 18px}
  .setup {margin:10px auto; padding:15px}
  .manual section {padding:15px}
  .manual th,.manual td {font-size:12px; padding:9px 6px}
  .manual ul,.manual ol {padding-left:23px}
  .back-link a {display:inline-flex; min-height:44px; align-items:center}
  .report-table .cell-empty {display:none}
}
@media(max-width:430px) {
  .range-filter {grid-template-columns:minmax(0,1fr)}
  .counter-items td:nth-child(4),.counter-items td:nth-child(5) {grid-column:1/-1; margin-top:6px}
}
@media(max-width:359px) {
  .content {padding:17px 10px}
  .card {padding:12px}
  .search-actions {grid-template-columns:minmax(0,1fr)}
  .search-actions span {grid-column:auto}
  aside nav {gap:4px}
  aside nav a,.logout button {font-size:12px}
}
@media print {
  @page {size:A3 landscape; margin:10mm}
  body {background:white}
  aside,header,.print-button,footer,button,.list-toolbar,.list-search,.active-filters,.sort-controls,.pagination,.list-hint,.back-link {display:none!important}
  .content {width:100%; margin:0; padding:0; max-width:none}
  .table-wrap {width:100%; border:0; background:white}
  table {display:table!important; width:100%; table-layout:auto; font-size:9px}
  colgroup {display:table-column-group!important}
  thead {display:table-header-group!important; position:static!important; width:auto!important; height:auto!important; clip-path:none!important; margin:0!important; overflow:visible!important; white-space:normal!important}
  tbody {display:table-row-group!important}
  tr {display:table-row!important; break-inside:avoid}
  th,td {display:table-cell!important; padding:4px; white-space:normal; font-size:9px}
  .cell-label {display:none!important}
  .cell-value {font-size:9px!important; font-weight:400!important}
  .card {box-shadow:none}
  .notice {border:1px solid #888}
  .manual section {break-inside:avoid}
  .manual .toc {display:none}
}

/* 1.2: allocation pairs, calculated cash balances and master ordering. */
.client-allocations {display:grid; grid-template-columns:minmax(0,1fr); gap:0}
.client-allocation {display:grid; grid-template-columns:minmax(0,2fr) minmax(110px,1fr); gap:18px; align-items:start}
.cash-calculation {display:flex; flex-wrap:wrap; gap:12px 30px; padding:12px 16px; background:#edf5f0; border-radius:7px}
.cash-calculation p {margin:0}
.cash-calculation output {font-size:21px; font-weight:700; font-variant-numeric:tabular-nums}
.order-controls {display:flex; flex-wrap:wrap; gap:4px; margin-top:8px}
.order-controls[hidden] {display:none}
.order-controls button {font-size:14px; min-height:32px; padding:4px 6px; min-width:25px}
.order-controls .order-handle {cursor:grab; touch-action:none; user-select:none; min-width:64px}
.order-dragging td {background:#d8eddf!important}
.is-order-dragging,.is-order-dragging .order-handle {cursor:grabbing}
.record-table .order-dragging {outline:3px solid #17643c; outline-offset:-3px}
.record-table .order-dragging td {background:#c5ebd4!important; box-shadow:inset 0 3px #17643c,inset 0 -3px #17643c}
.order-handle[aria-pressed="true"] {background:#17643c; color:#fff; min-width:64px; font-weight:700}
.order-drag-banner {position:fixed; bottom:16px; left:50%; transform:translateX(-50%); z-index:100; max-width:calc(100vw - 32px); width:max-content; padding:12px 18px; margin:0; background:#123d29; color:#fff; border:2px solid #fff; border-radius:8px; box-shadow:0 3px 16px #0005; pointer-events:none; font-weight:700}
.order-drag-banner[hidden] {display:none}
.order-moved:not(.order-dragging) .cell-order {box-shadow:inset 4px 0 #17643c}
@media print {.order-drag-banner {display:none!important}}
.master-order-form {margin-top:12px}
.order-status {font-size:13px}
.month-picker {max-width:min(380px,calc(100% - 28px)); width:380px; border:1px solid var(--border); border-radius:12px; padding:22px; color:inherit}
.month-picker::backdrop {background:#15283b66}
.month-choices {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:16px 0}
.month-choices button {min-height:44px}
@media(max-width:760px) {
  .client-allocation {grid-template-columns:minmax(0,1fr); gap:0; padding:12px; border:1px solid var(--border); border-radius:8px; margin-bottom:12px}
  .order-controls button {min-height:44px; min-width:36px}
  .record-table .cell-order:has(.order-controls) {grid-column:1/-1}
}
@media print {.order-controls,.master-order-form,.month-picker {display:none!important}}
