@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&display=swap");

:root {
  color-scheme: light;
  --bg: #e8f1f8;
  --panel: #ffffff;
  --panel-soft: #f5f9fc;
  --line: #c7d9e8;
  --line-strong: #9dbbd3;
  --text: #10243f;
  --muted: #526579;
  --primary: #1f6fb8;
  --primary-dark: #0c4f8f;
  --primary-soft: #dceefc;
  --success: #12633a;
  --warning: #8a5a00;
  --danger: #a13b2b;
  font-family: "Noto Sans JP", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans JP", system-ui, sans-serif;
  font-size: 17px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 52px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 11px 18px;
  font-weight: 800;
  cursor: pointer;
}

button:disabled,
fieldset:disabled button,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.app-shell {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.main-input-grid {
  display: grid;
  gap: 14px;
}

.left-input-column {
  display: grid;
  gap: 14px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  fill: #d9ecfb;
  stroke: var(--primary-dark);
  stroke-width: 2.5;
}

.brand-name {
  color: var(--primary-dark);
  font-size: 28px;
  font-weight: 900;
}

.header-finish-button {
  min-width: 180px;
}

.date-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 10px;
}

.date-bar .section-kicker {
  align-self: center;
  margin: 0;
  color: var(--primary-dark);
  font-size: 15px;
}

.date-bar-field span {
  margin-bottom: 4px;
  font-size: 12px;
}

.date-bar-field {
  flex: 1 1 150px;
  min-width: 132px;
  min-inline-size: 0;
}

.date-bar-field input {
  min-height: 44px;
}

.date-bar .status-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 170px;
  min-height: 52px;
  padding-inline: 18px;
}

.date-bar button {
  flex: 1 1 150px;
  min-width: max-content;
  min-inline-size: 0;
}

.date-bar .header-finish-button {
  flex: 0 1 180px;
}

.date-bar button,
.date-bar .status-pill {
  white-space: nowrap;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin: 2px 0 0;
  font-size: 30px;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.section-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
  margin-bottom: 14px;
}

.panel-heading,
.action-row,
.dialog-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-heading {
  margin-bottom: 14px;
}

.panel-heading.compact {
  margin-bottom: 10px;
}

.status-pill {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary-dark);
  padding: 9px 12px;
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
}

.compact-status {
  padding: 7px 10px;
  font-size: 14px;
  font-weight: 800;
  background: #eef6fc;
}

.status-pill.unlocked {
  background: #fff8e6;
  color: var(--warning);
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

label span,
.locked-date span,
.time-panel span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 9px 11px;
}

select {
  min-height: 58px;
  font-weight: 800;
}

.product-field select {
  min-height: 84px;
  border-width: 2px;
  border-color: #78afd9;
  background: #f7fbff;
  padding: 16px 16px;
  font-size: 22px;
  font-weight: 900;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid #8ec6f3;
  outline-offset: 2px;
}

.line-panel-note {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 800;
}

.line-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.line-option {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "name badge";
  min-height: 72px;
  align-items: center;
  gap: 2px 10px;
  border-width: 2px;
  border-color: var(--line-strong);
  background: #fff;
  color: var(--text);
  padding: 12px;
  text-align: left;
}

.line-option .line-name {
  grid-area: name;
  margin: 0;
  color: inherit;
  font-size: 23px;
  font-weight: 900;
}

.line-option strong {
  grid-area: badge;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-soft);
  color: var(--muted);
  padding: 5px 9px;
  font-size: 13px;
  font-weight: 900;
}

.line-option.selected {
  border-color: var(--primary-dark);
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.line-option.selected strong {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
}

.locked-date {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 8px 12px;
}

.locked-date strong {
  display: block;
  color: var(--primary-dark);
  font-size: 21px;
}

.condition-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.product-field {
  flex: 1 1 100%;
  min-width: 0;
}

.expiry-field {
  flex: 1 1 180px;
  min-width: 0;
}

.compact-toggle {
  flex: 1 1 220px;
}

.condition-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.bulk-no-fields { display: grid; gap: 8px; }
.bulk-no-entry { display: flex; align-items: center; gap: 8px; }
.bulk-no-entry input { width: 7rem; min-height: 42px; }
.bulk-no-list { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; }
.bulk-no-tag { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-soft); padding: 3px 7px 3px 10px; font-weight: 700; }
.bulk-no-remove { min-width: 24px; min-height: 24px; border: 0; border-radius: 999px; padding: 0; background: transparent; color: var(--muted); font-size: 18px; line-height: 1; }
.bulk-no-remove:hover:not(:disabled) { background: #fff; color: var(--danger); }

.pallet-setting-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.pallet-setting-status {
  margin: 0;
  font-size: 0.88rem;
}

.pallet-setting-status.is-missing {
  color: #b42318;
  font-weight: 700;
}

.pallet-setting-status.is-complete {
  color: #17653a;
}

.pallet-setting-product {
  font-weight: 700;
}

.pallet-setting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.pallet-setting-grid section {
  display: grid;
  gap: 8px;
}

.pallet-setting-grid h3 {
  margin: 0;
  font-size: 1rem;
}

.pallet-setting-grid label {
  display: grid;
  gap: 4px;
}

body.input-page .pallet-setting-dialog { width: min(760px, calc(100% - 32px)); }
body.input-page .pallet-setting-dialog-header { display: grid; gap: 8px; margin-bottom: 20px; }
body.input-page .pallet-setting-dialog-header h2 { margin: 0; color: var(--primary-dark); }
body.input-page .pallet-setting-dialog-header > p { margin: 0; color: var(--muted); }
body.input-page .pallet-setting-product { display: grid; gap: 3px; padding: 13px 12px; border: 1px solid #bfd3e3; border-radius: 6px; background: #f4f8fc; }
body.input-page .pallet-setting-product > span { color: var(--muted); font-size: 12px; font-weight: 800; line-height: 1.2; }
body.input-page .pallet-setting-product > strong { color: var(--primary-dark); font-size: 18px; line-height: 1.35; }
body.input-page .pallet-setting-number-input.is-keypad-active { border: 2px solid #226a9e; background: #e2f2fc; box-shadow: 0 0 0 4px rgb(79 137 180 / 24%); }
body.input-page .pallet-setting-number-input:focus,
body.input-page .pallet-setting-number-input:focus-visible { outline: 0; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .pallet-setting-grid { gap: 12px; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .pallet-setting-grid section { gap: 10px; border: 1px solid #d5e2ec; border-radius: 6px; background: #f8fbfd; padding: 16px; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .pallet-setting-grid h3 { color: var(--primary-dark); font-size: 16px; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .pallet-setting-grid label { gap: 3px; color: var(--muted); font-size: 13px; font-weight: 800; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .pallet-setting-number-input { min-height: 64px; box-sizing: border-box; color: var(--primary-dark); font-size: 25px; font-weight: 900; text-align: center; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .pallet-setting-grid section > strong { margin-top: 3px; color: var(--primary-dark); font-size: 19px; line-height: 1.35; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .dialog-actions { margin-top: 10px; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .dialog-actions { align-items: end; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .dialog-actions button { min-height: 66px; }
body.input-page .pallet-setting-dialog.numeric-keypad-open #palletSettingCancelButton { min-width: 140px; }
body.input-page .pallet-setting-dialog.numeric-keypad-open #palletSettingSaveButton { width: calc((100% - 12px) / 2); min-width: 0; font-size: 22px; font-weight: 900; }
body.input-page .pallet-setting-dialog #palletSettingMessage:empty { display: none; min-height: 0; margin: 0; padding: 0; }
body.input-page .pallet-setting-dialog-form { display: block; }
body.input-page .pallet-setting-dialog.numeric-keypad-open { width: min(1148px, calc(100vw - 32px)); box-sizing: border-box; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .pallet-setting-dialog-form { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: stretch; }
body.input-page .pallet-setting-dialog-content { min-width: 0; }
body.input-page .pallet-setting-keypad-host { min-width: 0; box-sizing: border-box; border-left: 1px solid var(--line); background: #f7fbfe; padding: 12px; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .pallet-setting-keypad-host > .numeric-keypad { position: static; inset: auto; z-index: auto; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: 0; background: transparent; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .pallet-setting-keypad-host .numeric-keypad-panel { width: 100%; box-sizing: border-box; }
body.input-page .pallet-setting-dialog.numeric-keypad-open .pallet-setting-keypad-host .numeric-keypad-header { display: none; }

@media (max-width: 640px) {
  .pallet-setting-actions,
  .pallet-setting-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
}

@media (max-width: 899px) {
  body.input-page .pallet-setting-dialog.numeric-keypad-open .pallet-setting-dialog-form { grid-template-columns: 1fr; }
  body.input-page .pallet-setting-keypad-host { border-top: 1px solid var(--line); border-left: 0; }
}

.toggle-switch-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 12px 14px;
  cursor: pointer;
}

.switch-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.switch-ui {
  position: relative;
  display: inline-flex;
  flex: 0 0 76px;
  width: 76px;
  height: 38px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #7d91a4;
  box-shadow: 0 1px 3px rgb(0 20 40 / 20%);
  transition:
    transform 0.16s ease,
    background-color 0.16s ease;
}

.switch-input:checked + .switch-ui {
  border-color: var(--primary);
  background: var(--primary);
}

.switch-input:checked + .switch-ui::after {
  transform: translateX(38px);
  background: #fff;
}

.switch-input:focus-visible + .switch-ui {
  outline: 3px solid #8ec6f3;
  outline-offset: 2px;
}

.switch-input:disabled + .switch-ui {
  background: #eef3f7;
  border-color: #b8c9d8;
}

.switch-input:disabled + .switch-ui::after {
  background: #8ca0b2;
}

.switch-input:disabled:checked + .switch-ui {
  background: #a7c8e5;
  border-color: #8eb7d8;
}

.switch-text {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
}

.main-entry-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.1fr) minmax(
      220px,
      0.8fr
    );
  gap: 16px;
  align-items: stretch;
}

.entry-unavailable-note {
  margin: 0 0 14px;
  border: 1px solid #bfd5e8;
  border-radius: 6px;
  background: #f1f7fc;
  color: var(--primary-dark);
  padding: 14px 16px;
  font-size: 19px;
  font-weight: 900;
}

.hero-input,
.supporter-toggle {
  min-height: 156px;
}

.hero-input {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 14px;
}

.hero-input span {
  font-size: 18px;
}

.hero-input input {
  min-height: 82px;
  border-width: 2px;
  font-size: 42px;
  font-weight: 900;
  text-align: center;
}

.hero-input small {
  display: block;
  min-height: 24px;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 800;
}

.case-input {
  border-color: #86bce7;
  background: #f0f8ff;
}

.supporter-toggle {
  min-height: 177px;
  height: 100%;
  justify-content: center;
  align-items: center;
}

.supporter-toggle .switch-text {
  font-size: 21px;
}

.time-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.time-panel div {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 12px;
}

.time-panel strong {
  display: block;
  color: var(--primary-dark);
  font-size: 22px;
}

.large-action {
  flex: 1;
  min-height: 82px;
  margin-top: 16px;
  font-size: 24px;
}

.primary-button,
.start-button {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.primary-button:hover:not(:disabled),
.start-button:hover:not(:disabled) {
  background: var(--primary-dark);
}

.save-button {
  background: var(--primary-dark);
  color: #fff;
  border-color: var(--primary-dark);
}

.save-button:hover:not(:disabled) {
  background: #083f73;
}

.quiet-button {
  background: #eef6fc;
  color: var(--primary-dark);
  border-color: var(--line-strong);
}

.record-actions .quiet-button.selected,
.record-actions .quiet-button[aria-pressed="true"] {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  color: #fff;
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.sub-fields {
  display: grid;
  grid-template-columns: minmax(180px, 0.5fr) minmax(360px, 1.5fr);
  gap: 14px;
  align-items: end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.note-field textarea {
  min-height: 52px;
  height: 52px;
  resize: vertical;
  overflow-y: auto;
}

.message {
  display: flex;
  align-items: center;
  min-height: 82px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f7fbfe;
  padding: 18px 18px;
  font-size: 23px;
  font-weight: 900;
}

.message:empty {
  visibility: hidden;
}

.message.success {
  color: var(--success);
  border-color: #aed8bf;
  background: #f0faf4;
}

.message.warning {
  color: var(--warning);
  border-color: #e7cc8c;
  background: #fff9e8;
}

.message.error {
  color: var(--danger);
  border-color: #e2b4aa;
  background: #fff4f2;
}

.list-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.list-panel {
  padding: 0;
  margin-top: 14px;
}

.list-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 66px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.list-disclosure summary::-webkit-details-marker {
  display: none;
}

.summary-action {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #eef6fc;
  color: var(--primary-dark);
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}

.list-disclosure[open] .summary-action {
  background: var(--primary-soft);
}

.list-disclosure[open] .summary-action::before {
  content: "一覧を閉じる";
}

.list-disclosure[open] .summary-action {
  font-size: 0;
}

.list-disclosure[open] .summary-action::before {
  font-size: 14px;
}

.list-content {
  border-top: 1px solid var(--line);
  padding: 12px 18px 18px;
}

.list-action-row {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-size: 15px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 9px;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #e5f2fb;
  color: var(--primary-dark);
  font-weight: 900;
}

tbody tr:nth-child(even) {
  background: #f7fbfe;
}

.empty-row {
  color: var(--muted);
  font-weight: 700;
}

.detail-button {
  min-height: 42px;
  padding: 8px 13px;
  background: #eef6fc;
  color: var(--primary-dark);
  border-color: var(--line-strong);
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shipment-button {
  min-height: 42px;
  padding: 8px 10px;
  border-color: var(--line-strong);
  background: #f0faf4;
  color: var(--success);
  font-weight: 900;
}

.shipment-button.not-allowed {
  border-color: #e7cc8c;
  background: #fff9e8;
  color: var(--warning);
}

.app-dialog {
  width: min(760px, calc(100% - 32px));
  border: 0;
  border-radius: 6px;
  padding: 22px;
  color: var(--text);
  box-shadow: 0 18px 54px rgb(0 30 60 / 28%);
}

.app-dialog::backdrop {
  background: rgb(5 25 45 / 52%);
}

body.input-page .detail-dialog {
  width: min(1148px, calc(100% - 24px));
  height: min(706px, calc(100vh - 24px));
  height: min(706px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: hidden;
}

body.input-page .detail-dialog-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.input-page .detail-dialog-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #f4f8fc;
  padding: 12px 16px 10px;
}

body.input-page .detail-dialog-header h2 {
  margin: 0;
}

body.input-page .detail-dialog-header-content {
  min-width: 0;
}

body.input-page .detail-dialog-product {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  margin: 6px 0 0;
}

body.input-page .detail-dialog-product dt,
body.input-page .detail-dialog-product dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}

body.input-page .detail-dialog-product dt {
  flex: 0 0 auto;
  color: var(--muted);
  font-weight: 800;
}

body.input-page .detail-dialog-product dd {
  min-width: 0;
  color: var(--primary-dark);
  font-weight: 900;
  overflow-wrap: anywhere;
}

body.input-page .detail-dialog-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 7px 0 0;
}

body.input-page .detail-dialog-summary > div {
  display: flex;
  gap: 4px;
  min-width: 0;
}

body.input-page .detail-dialog-summary dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

body.input-page .detail-dialog-summary dd {
  min-width: 0;
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

body.input-page .detail-dialog-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}

body.input-page .detail-content-scroll {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px;
}

body.input-page .detail-content-scroll .detail-list {
  margin: 12px 0;
  gap: 8px;
}

body.input-page .detail-keypad-pane {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: #f7fbfe;
  padding: 12px;
}

body.input-page .detail-keypad-pane[hidden] {
  display: none;
}

body.input-page .detail-dialog-footer {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  background: #f4f8fc;
  padding: 10px 16px;
}

.detail-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

body.input-page .detail-section {
  display: grid;
  gap: 8px;
  min-width: 0;
}

body.input-page .detail-section h3 {
  margin: 0;
  color: var(--primary-dark);
  font-size: 15px;
}

body.input-page .detail-manufacturing-section {
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

body.input-page .detail-manufacturing-section h3 {
  grid-column: auto;
}

body.input-page .detail-dialog .detail-item {
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border-color: var(--line);
  background: var(--panel-soft);
}

body.input-page .detail-dialog .detail-item dd {
  min-width: 0;
}

body.input-page .detail-dialog .detail-edit-item input:not([type="checkbox"]),
body.input-page .detail-dialog .detail-edit-item textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: left;
}

body.input-page .detail-dialog #detailExpiryDate {
  width: 100%;
  inline-size: 100%;
  max-width: 100%;
  max-inline-size: 100%;
  min-width: 0;
  min-inline-size: 0;
  box-sizing: border-box;
  padding: 9px 11px;
  text-align: left;
}

body.input-page .detail-dialog #detailExpiryDate::-webkit-date-and-time-value,
body.input-page .detail-dialog #detailExpiryDate::-webkit-datetime-edit {
  padding: 0;
  text-align: left;
}

body.input-page .detail-dialog .detail-edit-toggle {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

body.input-page .detail-dialog .detail-bulk-no-value {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

body.input-page .detail-dialog .detail-bulk-no-list-label {
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

body.input-page .detail-dialog #detailBulkNoList {
  min-width: 0;
  min-height: 0;
  align-items: center;
}

body.input-page .detail-dialog .bulk-no-tag {
  min-height: 42px;
  border-color: var(--line-strong);
  background: var(--panel-soft);
  color: var(--text);
  padding: 6px 10px;
}

body.input-page .detail-dialog .bulk-no-empty {
  color: var(--muted);
  font-weight: 700;
}

body.input-page .detail-field-error {
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 800;
}

body.input-page .detail-other-reason {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

body.input-page .detail-other-reason[hidden] {
  display: none;
}


body.input-page .detail-edit-locked-notice {
  margin: 0 0 12px;
  border: 1px solid #c8d7e5;
  border-radius: 6px;
  background: #eef5fb;
  padding: 10px 12px;
  color: #294969;
  font-size: 14px;
  font-weight: 700;
}

body.input-page .detail-cancel-panel {
  margin: 0 0 12px;
  border: 1px solid #d8aaa4;
  border-radius: 6px;
  background: #fff8f7;
  padding: 12px;
}

body.input-page .detail-cancel-panel h3,
body.input-page .detail-cancel-panel p {
  margin: 0;
}

body.input-page .detail-cancel-panel h3 {
  color: #8d4035;
  font-size: 16px;
}

body.input-page .detail-cancel-panel > p {
  margin-top: 8px;
  color: #4f5968;
  font-size: 14px;
  line-height: 1.5;
}

body.input-page .detail-cancel-panel .detail-cancel-help {
  color: #76544e;
  font-size: 13px;
}

body.input-page .detail-cancel-field {
  display: block;
  margin-top: 12px;
}

body.input-page .detail-cancel-field > span {
  display: block;
  margin-bottom: 6px;
  color: #4b3632;
  font-size: 14px;
  font-weight: 800;
}

body.input-page .detail-cancel-field textarea {
  min-height: 104px;
  border-color: #cba39c;
  line-height: 1.5;
}

body.input-page .detail-cancel-error {
  margin: 10px 0 0;
  color: #a12f26;
  font-size: 14px;
  font-weight: 800;
}

body.input-page .detail-cancel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

body.input-page .detail-cancel-button,
body.input-page .detail-cancel-confirm-button {
  border-color: #bd665c;
  color: #9b3b32;
}

body.input-page .detail-cancel-confirm-button {
  background: #b94337;
  color: #fff;
}

body.input-page .detail-cancel-panel .record-actions .quiet-button {
  min-height: 44px;
}

.detail-item {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-soft);
  padding: 10px 12px;
}

.detail-item dt {
  color: var(--muted);
  font-weight: 900;
}

.detail-item dd {
  margin: 0;
  font-weight: 700;
  white-space: pre-wrap;
}

.detail-edit-item dd {
  min-width: 0;
}

.detail-edit-item input,
.detail-edit-item textarea {
  min-height: 44px;
}

.detail-edit-toggle {
  width: fit-content;
  min-height: 44px;
  padding: 6px 10px;
}

@media (min-width: 900px) {
  body {
    font-size: 15px;
  }

  button {
    min-height: 44px;
    padding: 8px 12px;
  }

  .app-shell {
    width: 100%;
    padding: 10px;
  }

  .app-header {
    display: grid;
    grid-template-columns: minmax(300px, 0.82fr) minmax(480px, 1.18fr);
    align-items: stretch;
    margin-bottom: 8px;
    gap: 10px;
  }

  .brand {
    gap: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-name {
    font-size: 26px;
  }

  h2 {
    font-size: 18px;
  }

  .section-kicker {
    margin-bottom: 2px;
    font-size: 12px;
  }

  .header-finish-button {
    min-width: 132px;
  }

  .date-bar {
    display: grid;
    grid-template-columns:
      minmax(0, 1fr) minmax(0, 0.78fr) minmax(0, 0.76fr)
      minmax(0, 0.82fr);
    align-items: end;
    gap: 6px;
    padding: 8px;
  }

  .date-bar .section-kicker {
    display: none;
    font-size: 12px;
  }

  .date-bar-field span {
    margin-bottom: 3px;
    font-size: 11px;
  }

  .date-bar-field input,
  .date-bar button,
  .date-bar .status-pill {
    height: 44px;
    min-height: 42px;
  }

  .date-bar-field {
    flex: initial;
    min-width: 0;
  }

  .date-bar button {
    flex: initial;
    min-width: 0;
    padding-inline: 8px;
    font-size: clamp(12px, 1.45vw, 15px);
  }

  .date-bar .status-pill {
    flex: initial;
    min-width: 0;
    padding-inline: 12px;
    font-size: clamp(11px, 1.35vw, 13px);
  }

  .date-bar .header-finish-button {
    flex: initial;
    min-width: 0;
  }

  .main-input-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 12px;
    align-items: stretch;
  }

  .left-input-column {
    display: grid;
    grid-template-rows: auto auto;
    align-content: start;
    gap: 10px;
    min-width: 0;
  }

  .line-panel {
    display: flex;
    flex-direction: column;
  }

  .line-panel .line-list {
    align-content: start;
    flex: 1 1 auto;
  }

  .pallet-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .pallet-panel #entryFields {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
  }

  .panel {
    margin-bottom: 10px;
    padding: 10px;
  }

  .main-input-grid .panel {
    margin-bottom: 0;
  }

  .panel-heading {
    margin-bottom: 7px;
    gap: 10px;
  }

  .condition-panel .panel-heading {
    margin-bottom: 4px;
  }

  .compact-status,
  .status-pill {
    padding: 6px 8px;
    font-size: 13px;
  }

  label span,
  .locked-date span,
  .time-panel span {
    margin-bottom: 4px;
    font-size: 12px;
  }

  input,
  select,
  textarea {
    min-height: 42px;
    padding: 7px 9px;
  }

  select {
    min-height: 46px;
  }

  .product-field select {
    min-height: 74px;
    padding: 13px 14px;
    font-size: 19px;
  }

  .line-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .line-option {
    position: relative;
    grid-template-columns: 1fr;
    grid-template-areas: "name";
    align-content: center;
    min-height: 54px;
    height: 54px;
    padding: 7px 42px 7px 9px;
    overflow: hidden;
  }

  .line-option .line-name {
    overflow: hidden;
    font-size: 17px;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .line-option strong {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .locked-date {
    min-height: 44px;
    padding: 6px 8px;
  }

  .locked-date strong {
    font-size: 15px;
  }

  .condition-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    align-items: stretch;
  }

  .condition-panel {
    display: flex;
    flex-direction: column;
    align-self: start;
  }

  .condition-panel fieldset {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: flex-start;
  }

  .product-field {
    min-width: 0;
  }

  .expiry-field {
    min-width: 0;
  }

  .compact-toggle {
    min-width: 0;
  }

  .condition-help {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.35;
  }

  .toggle-switch-card {
    min-height: 58px;
    padding: 12px 14px;
    gap: 12px;
  }

  .expiry-field input,
  .compact-toggle {
    min-height: 58px;
  }

  .switch-ui {
    flex: 0 0 clamp(52px, 7vw, 60px);
    width: clamp(52px, 7vw, 60px);
    height: 30px;
  }

  .switch-ui::after {
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
  }

  .switch-input:checked + .switch-ui::after {
    transform: translateX(30px);
  }

  .switch-text {
    font-size: clamp(12px, 1.45vw, 14px);
  }

  .entry-unavailable-note {
    margin-bottom: 8px;
    padding: 10px 12px;
    font-size: 14px;
  }

  .main-entry-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.15fr);
    gap: 14px;
  }

  .supporter-toggle {
    grid-column: 1 / -1;
  }

  .hero-input,
  .supporter-toggle {
    min-height: 124px;
    padding: 12px;
  }

  .hero-input span {
    font-size: 15px;
  }

  .hero-input input {
    min-height: 62px;
    font-size: 34px;
  }

  .hero-input small {
    min-height: 16px;
    margin-top: 3px;
    font-size: 11px;
  }

  .supporter-toggle {
    min-height: 66px;
    justify-content: flex-start;
  }

  .supporter-toggle .switch-text {
    font-size: 16px;
  }

  .time-panel {
    gap: 14px;
    margin-top: 14px;
  }

  .time-panel div {
    padding: 12px;
  }

  .time-panel strong {
    font-size: 17px;
  }

  .large-action {
    min-height: 84px;
    margin-top: 16px;
    font-size: 23px;
  }

  .sub-fields {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-top: 16px;
    padding-top: 14px;
  }

  .note-field textarea {
    min-height: 42px;
    height: 42px;
  }

  .message {
    min-height: 88px;
    margin-top: 12px;
    padding: 16px 16px;
    font-size: 20px;
  }

  .list-disclosure summary {
    min-height: 54px;
    padding: 10px 12px;
  }

  .list-content {
    padding: 10px 12px 12px;
  }
}

@media (max-width: 1100px) {
  html,
  body {
    overflow-y: auto;
  }

  body {
    font-size: 16px;
  }

  button,
  input,
  select,
  textarea {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .app-shell {
    width: 100%;
    padding: 10px;
  }

  .app-header {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 10px;
  }

  .brand {
    min-width: 0;
  }

  .brand-name {
    font-size: clamp(24px, 4vw, 34px);
    line-height: 1.2;
  }

  .date-bar {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
  }

  .date-bar .section-kicker {
    display: block;
    align-self: start;
  }

  .date-bar-field,
  .date-bar button,
  .date-bar .status-pill,
  .date-bar .header-finish-button {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .date-bar-field input {
    max-width: 100%;
  }

  .date-bar .status-pill {
    justify-content: center;
    white-space: normal;
  }

  .main-input-grid,
  .left-input-column {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
    min-width: 0;
  }

  .panel,
  .line-panel,
  .condition-panel,
  .pallet-panel {
    min-width: 0;
    margin-bottom: 0;
  }

  .panel {
    padding: 12px;
  }

  .panel-heading {
    margin-bottom: 8px;
  }

  .line-panel,
  .line-panel .line-list,
  .condition-panel,
  .condition-panel fieldset,
  .pallet-panel,
  .pallet-panel #entryFields {
    display: block;
    flex: none;
  }

  .line-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .line-option {
    min-width: 0;
    min-height: 54px;
  }

  .condition-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    min-width: 0;
  }

  .product-field,
  .expiry-field,
  .compact-toggle {
    min-width: 0;
    width: 100%;
  }

  .product-field select,
  .expiry-field input {
    max-width: 100%;
  }

  .product-field select {
    min-height: 66px;
    font-size: clamp(18px, 3vw, 22px);
  }

  .expiry-field input,
  .compact-toggle,
  .toggle-switch-card {
    min-height: 58px;
  }

  .toggle-switch-card {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
  }

  .main-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: stretch;
    min-width: 0;
  }

  .supporter-toggle {
    grid-column: 1 / -1;
    min-height: 64px;
  }

  .hero-input,
  .supporter-toggle {
    min-width: 0;
    padding: 12px;
  }

  .hero-input input {
    max-width: 100%;
  }

  .time-panel,
  .action-row,
  .sub-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
  }

  .large-action {
    width: 100%;
    margin-top: 10px;
  }

  .sub-fields {
    grid-template-columns: 1fr;
    margin-top: 12px;
    padding-top: 12px;
  }

  .message {
    min-height: 72px;
    margin-top: 10px;
    padding: 14px;
    font-size: clamp(18px, 3vw, 22px);
  }

  .list-panel {
    margin-top: 10px;
  }
}

@media (max-width: 760px) {
  .app-header,
  .panel-heading,
  .action-row,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .condition-grid,
  .main-entry-grid,
  .main-input-grid,
  .time-panel,
  .sub-fields {
    display: grid;
    grid-template-columns: 1fr;
  }

  .app-shell {
    padding: 12px;
  }

  h1 {
    font-size: 26px;
  }

  .hero-input input {
    font-size: 38px;
  }

  .header-finish-button {
    width: 100%;
  }
}

/* =========================================================
   iPad practical final override
   実機iPad Safari用の最終調整
========================================================= */
@media (min-width: 900px) and (max-width: 1366px) {
  html,
  body {
    overflow-y: auto;
  }

  .app-shell {
    width: 100%;
    max-width: 100%;
    padding: 10px;
  }

  /* ヘッダーはタイトル1段、製造日バー1段に分離する */
  .app-header {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
    margin-bottom: 10px;
  }

  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
  }

  .brand-name {
    font-size: 26px;
    line-height: 1.2;
    white-space: nowrap;
  }

  /* 製造日バー：4分割ではなく、入力欄＋ボタン群として扱う */
  .date-bar {
    display: grid;
    grid-template-columns:
      minmax(340px, 1.6fr)
      minmax(170px, 0.8fr)
      minmax(170px, 0.8fr)
      minmax(190px, 0.9fr);
    gap: 8px;
    align-items: end;
    min-width: 0;
    padding: 8px;
  }

  .date-bar .section-kicker {
    display: none;
  }

  .date-bar-field,
  .date-bar button,
  .date-bar .status-pill,
  .date-bar .header-finish-button {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .date-bar-field {
    overflow: hidden;
  }

  .date-bar-field input[type="date"] {
    display: block;
    width: 100%;
    height: 44px;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    text-align: center;
  }

  .date-bar button,
  .date-bar .status-pill {
    height: 44px;
    min-height: 44px;
    padding: 8px 10px;
    white-space: nowrap;
  }

  /* 本体は実務用2カラム */
  .main-input-grid {
    display: grid;
    grid-template-columns: minmax(420px, 0.9fr) minmax(520px, 1.1fr);
    gap: 12px;
    align-items: start;
    min-width: 0;
  }

  .left-input-column {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-width: 0;
  }

  .panel {
    margin-bottom: 0;
    padding: 10px;
  }

  /* ライン選択 */
  .line-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .line-option {
    min-width: 0;
    min-height: 54px;
    height: 54px;
  }

  /* 製品条件：3項目を同じ幅にそろえる */
  .condition-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
  }

  .product-field,
  .expiry-field,
  .compact-toggle {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .product-field select,
  .expiry-field input[type="date"],
  .toggle-switch-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .product-field select {
    height: 76px;
    min-height: 76px;
    padding: 12px 10px;
    font-size: 20px;
  }

  .expiry-field input[type="date"] {
    display: block;
    height: 56px;
    min-height: 56px;
    padding: 8px 10px;
    -webkit-appearance: none;
    appearance: none;
  }

  .toggle-switch-card {
    display: flex;
    min-height: 56px;
    padding: 8px 10px;
    align-items: center;
  }

  /* パレット登録側：現状OKなので2カラム維持 */
  .main-entry-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
  }

  .hero-input,
  .supporter-toggle {
    min-width: 0;
    min-height: auto;
    padding: 10px;
  }

  .hero-input input {
    width: 100%;
    max-width: 100%;
    min-height: 56px;
    font-size: 30px;
    box-sizing: border-box;
  }

  .supporter-toggle {
    grid-column: 1 / -1;
    min-height: 56px;
  }

  .time-panel,
  .action-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .large-action {
    width: 100%;
    min-height: 64px;
    margin-top: 10px;
    font-size: 20px;
  }

  .sub-fields {
    display: grid;
    grid-template-columns: minmax(130px, 0.6fr) minmax(220px, 1.4fr);
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
  }

  .message {
    min-height: 56px;
    margin-top: 10px;
    padding: 10px 12px;
    font-size: 18px;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

/* =========================================================
   iPad practical final tuning
   赤字指摘箇所の最終調整
========================================================= */
@media (min-width: 900px) and (max-width: 1366px) {
  /* 1. 製造日入力欄の日付文字を大きくする */
  .date-bar-field input[type="date"] {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
  }

  /* 2. 左右カラムの下端をそろえる */
  .main-input-grid {
    align-items: stretch;
  }

  .left-input-column {
    align-self: stretch;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .condition-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .condition-panel fieldset {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
  }

  .condition-grid {
    flex: 1 1 auto;
    align-content: start;
  }

  /* ライン選択セクションを少しだけ大きくする */
  .line-option {
    min-height: 62px;
    height: 62px;
  }

  .line-list {
    gap: 10px;
  }

  /* 製品選択欄を実務上見やすい高さに戻す */
  .product-field select {
    height: 82px;
    min-height: 82px;
    font-size: 20px;
    padding: 14px 12px;
  }

  /* 賞味期限欄と仕掛品トグルを同じ幅にそろえる */
  .expiry-field,
  .compact-toggle,
  .expiry-field input[type="date"],
  .toggle-switch-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .expiry-field input[type="date"] {
    height: 56px;
    min-height: 56px;
    font-size: 18px;
  }

  .toggle-switch-card {
    min-height: 56px;
  }
}

@media (min-width: 900px) and (max-width: 1366px) {
  .line-list {
    max-height: 150px;
    overflow-y: auto;
    padding-right: 2px;
  }
}

/* =========================================================
   未確定状態の強調表示
========================================================= */

/* 製造日セクション：製造日未確定 */
.status-pill.unlocked {
  color: #b42318;
  background: #fff1f0;
  border-color: #f08a80;
  font-weight: 900;
}

/* パレット登録セクション下部：未確定時メッセージ */
.message.warning {
  color: #b42318;
  background: #fff1f0;
  border-color: #f08a80;
  font-weight: 900;
}

@media (min-width: 900px) and (max-width: 1366px) {
  .date-bar .status-pill.unlocked {
    font-size: 16px;
    line-height: 1.2;
  }

  .message.warning {
    font-size: 19px;
  }
}

/* =========================================================
   iPad small final tuning
   賞味期限文字サイズ・登録者ID/備考の上下位置調整
========================================================= */
@media (min-width: 900px) and (max-width: 1366px) {
  /* 1. 賞味期限欄の文字サイズを製造日入力欄に合わせる */
  .expiry-field input[type="date"] {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
  }

  /* 2. 登録者ID欄とその他・備考欄の上下位置をそろえる */
  .sub-fields {
    align-items: start;
  }

  .sub-fields label {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .sub-fields input,
  .sub-fields textarea {
    height: 52px;
    min-height: 52px;
    box-sizing: border-box;
  }
}

/* =========================================================
   Pallet action buttons layout
   ========================================================= */

.pallet-panel .action-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.pallet-panel .action-row .large-action {
  width: 100%;
  margin-top: 0;
}

.pallet-panel .action-row .save-button {
  grid-column: 1 / -1;
}

/* =========================================================
   Popup numeric keypad
   ========================================================= */

.numeric-keypad {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  background: rgb(17 36 53 / 18%);
}

.numeric-keypad[aria-hidden="true"] {
  display: none;
}

.numeric-keypad-panel {
  width: min(360px, 100%);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 16px 36px rgb(17 36 53 / 22%);
  padding: 14px;
}

.numeric-keypad-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.numeric-keypad-header strong {
  color: var(--text);
  font-size: 18px;
}

.numeric-keypad-draft {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  border: 1px solid #a9c5dc;
  border-radius: 6px;
  background: #eef6fc;
  padding: 10px 12px;
  text-align: right;
}

.numeric-keypad-draft[hidden] {
  display: none;
}

.numeric-keypad-draft > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.numeric-keypad-draft > strong {
  min-height: 34px;
  color: var(--primary-dark);
  font-size: 30px;
  line-height: 1.15;
}

.numeric-keypad-draft > p {
  margin: 0;
  color: #a12f26;
  font-size: 14px;
  font-weight: 800;
}

.numeric-keypad-draft.is-pallet-setting > .numeric-keypad-draft-context { min-height: 1.35em; font-size: 17px; line-height: 1.35; }
.numeric-keypad-draft.is-pallet-setting > .numeric-keypad-draft-field { min-height: 1.35em; font-size: 20px; line-height: 1.35; }

.numeric-keypad-draft > p.is-complete { color: var(--muted); }

.numeric-keypad-close,
.numeric-keypad-done,
.numeric-keypad-grid button {
  min-height: 58px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #f7fbfe;
  color: var(--text);
  font-size: 24px;
  font-weight: 900;
}

.numeric-keypad-close {
  min-height: 42px;
  padding: 0 14px;
  font-size: 16px;
}

.numeric-keypad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.numeric-keypad-grid button:active,
.numeric-keypad-done:active,
.numeric-keypad-close:active {
  background: #dff0fb;
}

.numeric-keypad-grid button[data-keypad-action] {
  font-size: 18px;
}

.numeric-keypad-done {
  width: 100%;
  margin-top: 10px;
  background: var(--primary);
  color: #ffffff;
}

body.input-page .detail-dialog.numeric-keypad-open .detail-dialog-main {
  grid-template-columns: minmax(0, 1fr) 360px;
}

body.input-page .detail-dialog.numeric-keypad-open .detail-keypad-pane > .numeric-keypad {
  position: static;
  inset: auto;
  z-index: auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  background: transparent;
}

body.input-page .detail-dialog.numeric-keypad-open .detail-keypad-pane .numeric-keypad-panel {
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 899px) {
  body.input-page .detail-dialog {
    height: auto;
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  body.input-page .detail-dialog-layout {
    display: block;
    height: auto;
    overflow: visible;
  }

  body.input-page .detail-content-scroll {
    overflow: visible;
  }

  body.input-page .detail-dialog.numeric-keypad-open .detail-dialog-main {
    display: block;
    overflow: visible;
  }

  body.input-page .detail-dialog.numeric-keypad-open .detail-keypad-pane {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  body.input-page .detail-dialog.numeric-keypad-open .detail-keypad-pane > .numeric-keypad {
    height: auto;
  }
}

/* v0.11B input-screen prototype: input-page scoped only */
body.input-page {
  background: #f6f7f9;
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Yu Gothic UI", Meiryo, sans-serif;
}

body.input-page .app-shell.input-page {
  width: min(1280px, 100%);
  padding: 10px 14px 18px;
}

body.input-page #authMessage[hidden] {
  display: none;
}

body.input-page .input-header {
  display: grid;
  grid-template-columns: minmax(220px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

body.input-page .input-header .brand-mark {
  width: 34px;
  height: 34px;
}

body.input-page .input-header .brand-name {
  color: #172c4d;
  font-size: 22px;
}

body.input-page .input-header #currentUser {
  margin: 2px 0 0;
  color: #5b6472;
  font-size: 13px;
}

body.input-page .input-operation-bar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
  border-color: #b8c0cb;
  border-radius: 0;
  background: #fff;
  padding: 6px;
}

body.input-page .input-operation-bar .section-kicker {
  display: none;
}

body.input-page .input-operation-bar .date-bar-field {
  flex: 0 1 150px;
}

body.input-page .input-operation-bar .date-bar-field span {
  display: none;
}

body.input-page .input-operation-bar input,
body.input-page .input-operation-bar button,
body.input-page .input-operation-bar .status-pill,
body.input-page .input-operation-bar a {
  min-height: 40px;
  padding: 7px 10px;
  font-size: 14px;
}

body.input-page .input-operation-bar .date-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 1 190px;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  border-radius: 4px;
  box-sizing: border-box;
  padding: 6px 10px;
  text-align: center;
  white-space: nowrap;
}

body.input-page .input-operation-bar .date-status.unlocked {
  border-color: #d8ba69;
  background: #fff8e5;
  color: #855b00;
}

body.input-page .input-operation-bar .date-status.is-locked {
  border-color: #9bc9ad;
  background: #edf8f0;
  color: #17613a;
}

body.input-page .input-operation-bar .header-finish-button {
  flex: 0 0 auto;
  min-width: 0;
}

body.input-page .input-operation-bar .header-finish-button:disabled {
  color: #4f5968;
  background: #f1f3f5;
  border-color: #c8ced6;
}

body.input-page .input-operation-bar .header-finish-button:not(:disabled) {
  color: #243b57;
  background: #ffffff;
  border-color: #9da8b6;
  opacity: 1;
}

body.input-page .input-operation-bar a.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #9dbbd3;
  border-radius: 6px;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: normal;
  text-decoration: none;
  vertical-align: middle;
}

body.input-page .list-panel {
  margin-top: 10px;
  border: 1px solid #b8c0cb;
  border-radius: 3px;
  background: #fff;
  padding: 0;
}

body.input-page .list-disclosure summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  box-sizing: border-box;
  background: #f1f3f6;
  padding: 8px 10px;
  cursor: pointer;
}

body.input-page .list-disclosure[open] summary {
  border-bottom: 1px solid #b8c0cb;
}

body.input-page .list-panel h2 {
  color: #172c4d;
  font-size: 16px;
}

body.input-page .list-panel .list-summary {
  margin: 2px 0 0;
  font-size: 12px;
}

body.input-page .list-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

body.input-page .list-header-actions .quiet-button {
  min-height: 38px;
  padding: 6px 10px;
  white-space: nowrap;
}

body.input-page .list-disclosure:not([open]) #reloadListButton {
  display: none;
}

body.input-page .list-content {
  border-top: 0;
  padding: 8px;
}

body.input-page .list-line-filter {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

body.input-page .list-line-option {
  min-width: 0;
  min-height: 38px;
  border: 1px solid #9da8b6;
  border-radius: 4px;
  background: #fff;
  color: #243b57;
  padding: 5px 6px;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

body.input-page .list-line-option.selected {
  border-color: #183d6c;
  background: #183d6c;
  color: #fff;
}

body.input-page .record-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
}

body.input-page .record-table .list-col-date { width: 11%; }
body.input-page .record-table .list-col-line { width: 5%; }
body.input-page .record-table .list-col-product { width: 32%; }
body.input-page .record-table .list-col-pallet { width: 7%; }
body.input-page .record-table .list-col-case { width: 6%; }
body.input-page .record-table .list-col-expiry { width: 11%; }
body.input-page .record-table .list-col-time { width: 7%; }
body.input-page .record-table .list-col-detail { width: 7%; }
body.input-page .record-table .list-col-shipment { width: 7%; }

body.input-page .record-table th,
body.input-page .record-table td {
  box-sizing: border-box;
  padding: 7px 5px;
  font-size: 13px;
  vertical-align: middle;
}

body.input-page .record-table th {
  background: #edf0f4;
  color: #172c4d;
  font-size: 12px;
  white-space: nowrap;
}

body.input-page .record-table th:not(:nth-child(3)),
body.input-page .record-table td:not(:nth-child(3)) {
  text-align: center;
}

body.input-page .record-table th:nth-child(3),
body.input-page .record-table td:nth-child(3) {
  text-align: left;
}

body.input-page .record-table .list-line-cell,
body.input-page .record-table .list-time-cell,
body.input-page .record-table .list-detail-cell,
body.input-page .record-table .list-shipment-cell {
  white-space: nowrap;
}

body.input-page .record-table .list-product-cell {
  overflow-wrap: anywhere;
  word-break: break-word;
}

body.input-page .record-table .list-product-code,
body.input-page .record-table .list-product-name {
  display: block;
}

body.input-page .record-table .list-product-code {
  color: #172c4d;
  font-weight: 800;
}

body.input-page .record-table .list-product-name {
  margin-top: 2px;
  color: #4f5968;
  font-size: 16px;
  line-height: 1.35;
}

body.input-page .record-table .detail-button,
body.input-page .record-table .shipment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 5px 7px;
  font-size: 12px;
  white-space: nowrap;
}

body.input-page .input-operation-bar #lockDateButton,
body.input-page .input-operation-bar .header-finish-button,
body.input-page .input-operation-bar a.quiet-button {
  height: 44px;
  min-height: 44px;
}

body.input-page .line-option:disabled {
  cursor: not-allowed;
  border-color: #c8ced6;
  background: #f1f3f5;
  color: #6a7482;
  opacity: 1;
}

body.input-page .line-option:disabled strong {
  border-color: #c8ced6;
  background: #e7ebef;
  color: #6a7482;
}

body.input-page .panel {
  border-color: #b8c0cb;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
}

body.input-page .panel-heading {
  align-items: center;
  margin: -10px -10px 10px;
  border-bottom: 1px solid #cbd1d8;
  background: #f1f3f6;
  padding: 8px 10px;
}

body.input-page .panel-heading h2 {
  color: #172c4d;
  font-size: 16px;
}

body.input-page .line-panel {
  margin-bottom: 10px;
  padding: 10px;
}

body.input-page .line-panel-note {
  font-size: 12px;
}

body.input-page .line-list {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

body.input-page .line-option {
  grid-template-columns: 1fr auto;
  grid-template-areas: "name badge";
  min-height: 48px;
  height: 48px;
  border-width: 1px;
  border-radius: 4px;
  padding: 6px 8px;
}

body.input-page .line-option .line-name {
  font-size: 18px;
}

body.input-page .line-option strong {
  border-radius: 3px;
  padding: 3px 5px;
  font-size: 10px;
}

body.input-page .line-option.selected {
  border-color: #183d6c;
  background: #183d6c;
  color: #fff;
}

body.input-page .line-option.selected strong {
  border-color: #fff;
  background: #fff;
  color: #183d6c;
}

body.input-page .input-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
  gap: 10px;
  align-items: stretch;
}

body.input-page .condition-panel,
body.input-page .pallet-panel {
  min-width: 0;
  margin-bottom: 0;
  padding: 10px;
}

body.input-page .condition-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.58fr);
  gap: 10px;
  align-items: end;
}

body.input-page .product-field {
  grid-column: 1 / -1;
}

body.input-page .product-select-control {
  position: relative;
  width: 100%;
}

body.input-page .pallet-setting-warning-icon {
  position: absolute;
  right: 48px;
  top: 50%;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  min-width: 26px;
  height: 26px;
  margin: 0;
  color: #b42318;
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

body.input-page .pallet-setting-warning-icon[hidden] {
  display: none;
}

body.input-page .product-field select {
  min-height: 54px;
  border-width: 1px;
  border-radius: 4px;
  background: #fff;
  padding: 8px 10px;
  font-size: 17px;
}

body.input-page .expiry-field input,
body.input-page .compact-toggle {
  min-height: 50px;
}

body.input-page .toggle-switch-card,
body.input-page .hero-input,
body.input-page .time-panel div {
  border-color: #b8c0cb;
  border-radius: 4px;
  background: #f8f9fb;
  box-shadow: none;
}

body.input-page .compact-toggle {
  padding: 7px 10px;
}

body.input-page .switch-ui {
  flex-basis: 58px;
  width: 58px;
  height: 30px;
}

body.input-page .switch-ui::after {
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
}

body.input-page .switch-input:checked + .switch-ui::after {
  transform: translateX(24px);
}

body.input-page .switch-text {
  font-size: 15px;
}

body.input-page .condition-help {
  margin-top: 8px;
  font-size: 12px;
}

body.input-page #usesWipGuide {
  color: #526579;
  font-weight: 800;
}

body.input-page .pallet-setting-actions {
  grid-column: 1 / -1;
  border-top: 1px solid #d5d9df;
  padding-top: 8px;
}

body.input-page .pallet-setting-actions .quiet-button {
  min-height: 38px;
  padding: 6px 9px;
  font-size: 13px;
}

body.input-page .main-entry-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.input-page .hero-input,
body.input-page .supporter-toggle {
  min-height: 0;
  padding: 9px;
}

body.input-page .hero-input input {
  min-height: 56px;
  border-width: 1px;
  border-radius: 4px;
  font-size: 30px;
}

body.input-page .hero-input span {
  font-size: 14px;
}

body.input-page .hero-input small {
  min-height: 16px;
  margin-top: 3px;
  font-size: 11px;
}

body.input-page .supporter-toggle {
  grid-column: 1 / -1;
  min-height: 48px;
  justify-content: flex-start;
}

body.input-page .time-panel {
  gap: 8px;
  margin-top: 8px;
}

body.input-page .time-panel div {
  padding: 7px 9px;
}

body.input-page .time-panel strong {
  font-size: 16px;
}

body.input-page .pallet-panel .action-row {
  gap: 8px;
  margin-top: 8px;
}

body.input-page .large-action {
  min-height: 52px;
  margin-top: 0;
  font-size: 18px;
}

body.input-page .save-action-row .save-button {
  width: 100%;
}

body.input-page .entry-feedback-actions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

body.input-page .entry-feedback-actions .action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
}

body.input-page .entry-feedback-actions .large-action {
  width: 100%;
}

body.input-page .running-condition {
  display: grid;
  grid-template-columns: 0.55fr 1.55fr repeat(3, minmax(0, 0.7fr)) auto;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #9da8b6;
  border-radius: 4px;
  background: #9da8b6;
}

body.input-page .running-condition[hidden] {
  display: none;
}

body.input-page .running-condition div {
  min-width: 0;
  background: #f8f9fb;
  padding: 6px 8px;
}

body.input-page .running-condition-title {
  grid-column: 1 / -1;
  margin: 0;
  padding: 8px 10px;
  background: #e7f1fa;
  color: #183d6c;
  font-size: 14px;
  font-weight: 900;
}

body.input-page .running-cancel-cell {
  background: #fff;
}

body.input-page .running-condition span,
body.input-page .running-condition strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.input-page .running-condition span {
  color: #5b6472;
  font-size: 11px;
  font-weight: 700;
}

body.input-page .running-condition strong {
  margin-top: 2px;
  color: #172c4d;
  font-size: 14px;
}

body.input-page .message {
  min-height: 46px;
  margin-top: 8px;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 15px;
}

body.input-page .message.warning {
  color: #855b00;
  border-color: #d8ba69;
  background: #fff8e5;
}

body.input-page .message.error {
  color: #a13b2b;
  border-color: #e2b4aa;
  background: #fff4f2;
}

body.input-page .message.success {
  color: #12633a;
  border-color: #aed8bf;
  background: #f0faf4;
}

body.input-page .app-shell.input-page[data-input-state="in-progress"] .condition-panel {
  display: none;
}

body.input-page .app-shell.input-page[data-input-state="in-progress"] .input-workspace {
  grid-template-columns: 1fr;
}

body.input-page .app-shell.input-page[data-input-state="in-progress"] #entryFields {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 8px 10px;
}

body.input-page .app-shell.input-page[data-input-state="in-progress"] .main-entry-grid {
  grid-column: 2;
  grid-row: 2;
}

body.input-page .app-shell.input-page[data-input-state="in-progress"] .save-context {
  grid-column: 1;
  grid-row: 2;
}

body.input-page .app-shell.input-page[data-input-state="in-progress"] .time-panel {
  display: none;
}

body.input-page .app-shell.input-page[data-input-state="in-progress"] .start-action-row {
  display: none;
}

body.input-page .app-shell.input-page[data-input-state="in-progress"] #startButton,
body.input-page .app-shell.input-page[data-input-state="ready"] #cancelStartButton,
body.input-page .app-shell.input-page[data-input-state="saved"] #cancelStartButton,
body.input-page .app-shell.input-page[data-input-state="date-unlocked"] #cancelStartButton {
  display: none;
}

body.input-page .app-shell.input-page[data-input-state="in-progress"] #cancelStartButton {
  min-height: 40px;
  padding: 6px 12px;
  font-size: 14px;
}

body.input-page .app-shell.input-page[data-input-state="ready"] .save-context,
body.input-page .app-shell.input-page[data-input-state="ready"] .save-action-row,
body.input-page .app-shell.input-page[data-input-state="ready"] .time-panel,
body.input-page .app-shell.input-page[data-input-state="saved"] .save-context,
body.input-page .app-shell.input-page[data-input-state="saved"] .save-action-row,
body.input-page .app-shell.input-page[data-input-state="saved"] .time-panel,
body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .save-context,
body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .save-action-row,
body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .time-panel {
  display: none;
}

body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .supporter-toggle,
body.input-page .app-shell.input-page[data-input-state="ready"] .supporter-toggle,
body.input-page .app-shell.input-page[data-input-state="saved"] .supporter-toggle {
  display: none;
}

body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-panel {
  border-color: #72a987;
}

body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-panel .panel-heading {
  background: #eef8f1;
}

@media (min-width: 900px) {
  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .condition-panel,
  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .pallet-panel,
  body.input-page .app-shell.input-page[data-input-state="ready"] .condition-panel,
  body.input-page .app-shell.input-page[data-input-state="ready"] .pallet-panel,
  body.input-page .app-shell.input-page[data-input-state="saved"] .condition-panel,
  body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-panel {
    box-sizing: border-box;
    border: 1px solid #9da8b6;
    border-radius: 3px;
    padding: 0;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .condition-panel > .panel-heading,
  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .pallet-panel > .panel-heading,
  body.input-page .app-shell.input-page[data-input-state="ready"] .condition-panel > .panel-heading,
  body.input-page .app-shell.input-page[data-input-state="ready"] .pallet-panel > .panel-heading,
  body.input-page .app-shell.input-page[data-input-state="saved"] .condition-panel > .panel-heading,
  body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-panel > .panel-heading {
    box-sizing: border-box;
    min-height: 38px;
    margin: 0;
    border-bottom: 1px solid #9da8b6;
    padding: 8px 10px;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .condition-panel > #conditionFields,
  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .pallet-panel > #entryFields,
  body.input-page .app-shell.input-page[data-input-state="ready"] .condition-panel > #conditionFields,
  body.input-page .app-shell.input-page[data-input-state="ready"] .pallet-panel > #entryFields,
  body.input-page .app-shell.input-page[data-input-state="saved"] .condition-panel > #conditionFields,
  body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-panel > #entryFields {
    box-sizing: border-box;
    min-width: 0;
    padding: 10px;
  }

  body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-panel {
    border-color: #72a987;
  }
}

@media (max-width: 899px) {
  body.input-page .input-header,
  body.input-page .input-workspace {
    grid-template-columns: 1fr;
  }

  body.input-page .input-operation-bar {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  body.input-page .input-operation-bar .date-bar-field,
  body.input-page .input-operation-bar button,
  body.input-page .input-operation-bar .date-status,
  body.input-page .input-operation-bar a {
    flex: 1 1 140px;
  }

  body.input-page .list-disclosure summary {
    grid-template-columns: minmax(0, 1fr);
  }

  body.input-page .list-header-actions {
    justify-content: flex-end;
  }

  body.input-page .record-table {
    min-width: 860px;
  }

  body.input-page .line-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] #entryFields {
    grid-template-columns: 1fr;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .recorder-row,
  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-row {
    grid-template-columns: max-content minmax(0, 1fr);
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .recorder-row #editPersonnelCandidatesButton,
  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-row #addBulkNoButton,
  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-row #bulkNoInput,
  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-row #bulkNoList {
    grid-column: 2;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-row .bulk-no-list-label {
    grid-column: 1;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .main-entry-grid,
  body.input-page .app-shell.input-page[data-input-state="in-progress"] .save-context,
  body.input-page .app-shell.input-page[data-input-state="in-progress"] .entry-feedback-actions .save-action-row {
    grid-column: 1;
    grid-row: auto;
  }

  body.input-page .running-condition {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  body.input-page .line-list,
  body.input-page .condition-grid,
  body.input-page .main-entry-grid,
  body.input-page .running-condition {
    grid-template-columns: 1fr;
  }

  body.input-page .product-field,
  body.input-page .supporter-toggle {
    grid-column: auto;
  }
}

@media (min-width: 900px) and (max-width: 1200px) {
  body.input-page .app-shell.input-page {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 8px;
    box-sizing: border-box;
  }

  body.input-page .input-header {
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  body.input-page .input-header .brand,
  body.input-page .input-operation-bar,
  body.input-page .input-workspace,
  body.input-page .condition-panel,
  body.input-page .pallet-panel {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.input-page .input-header .brand-name {
    font-size: 20px;
  }

  body.input-page .input-operation-bar {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, 1.35fr) minmax(0, 0.5fr) minmax(0, 0.75fr);
    gap: 4px;
    padding: 4px;
  }

  body.input-page .input-operation-bar .date-bar-field,
  body.input-page .input-operation-bar button,
  body.input-page .input-operation-bar .status-pill,
  body.input-page .input-operation-bar a {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-inline-size: 0;
    box-sizing: border-box;
    padding: 6px 5px;
    font-size: 12px;
    white-space: nowrap;
  }

  body.input-page .input-operation-bar a.quiet-button {
    font-size: 12px;
  }

  body.input-page .input-operation-bar #lockDateButton,
  body.input-page .input-operation-bar .header-finish-button,
  body.input-page .input-operation-bar .date-status {
    font-size: 16px;
  }

  body.input-page .input-operation-bar .date-bar-field {
    overflow: hidden;
  }

  body.input-page .input-operation-bar {
    --operation-control-height: 44px;
    align-items: center;
  }

  body.input-page .input-operation-bar .date-bar-field {
    display: flex;
    align-items: stretch;
  }

  body.input-page .input-operation-bar input,
  body.input-page .input-operation-bar button,
  body.input-page .input-operation-bar .status-pill,
  body.input-page .input-operation-bar a {
    height: var(--operation-control-height);
    min-height: var(--operation-control-height);
    box-sizing: border-box;
  }

  body.input-page .input-operation-bar input[type="date"] {
    padding-block: 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 42px;
    text-align: center;
  }

  body.input-page .input-operation-bar input[type="date"]::-webkit-date-and-time-value,
  body.input-page .input-operation-bar input[type="date"]::-webkit-datetime-edit {
    padding: 0;
    line-height: 42px;
    text-align: center;
  }

  body.input-page .input-operation-bar button,
  body.input-page .input-operation-bar .status-pill,
  body.input-page .input-operation-bar a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
  }

  body.input-page .input-operation-bar #lockDateButton.is-locked[disabled] {
    border-color: #b8c0cb;
    background: #eef1f4;
    color: #4f5968;
    opacity: 1;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .condition-panel > #conditionFields,
  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .pallet-panel > #entryFields,
  body.input-page .app-shell.input-page[data-input-state="ready"] .condition-panel > #conditionFields,
  body.input-page .app-shell.input-page[data-input-state="ready"] .pallet-panel > #entryFields,
  body.input-page .app-shell.input-page[data-input-state="saved"] .condition-panel > #conditionFields,
  body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-panel > #entryFields {
    padding: 8px;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .expiry-field input,
  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .compact-toggle,
  body.input-page .app-shell.input-page[data-input-state="ready"] .expiry-field input,
  body.input-page .app-shell.input-page[data-input-state="ready"] .compact-toggle,
  body.input-page .app-shell.input-page[data-input-state="saved"] .expiry-field input,
  body.input-page .app-shell.input-page[data-input-state="saved"] .compact-toggle {
    height: 52px;
    min-height: 52px;
    box-sizing: border-box;
  }

  body.input-page .app-shell.input-page[data-input-state="ready"] .expiry-field input[type="date"],
  body.input-page .app-shell.input-page[data-input-state="saved"] .expiry-field input[type="date"] {
    padding-block: 0;
    font-size: 18px;
    line-height: 50px;
    text-align: center;
  }

  body.input-page .app-shell.input-page[data-input-state="ready"] .expiry-field input[type="date"]::-webkit-date-and-time-value,
  body.input-page .app-shell.input-page[data-input-state="ready"] .expiry-field input[type="date"]::-webkit-datetime-edit,
  body.input-page .app-shell.input-page[data-input-state="saved"] .expiry-field input[type="date"]::-webkit-date-and-time-value,
  body.input-page .app-shell.input-page[data-input-state="saved"] .expiry-field input[type="date"]::-webkit-datetime-edit {
    padding: 0;
    line-height: 50px;
    text-align: center;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .compact-toggle,
  body.input-page .app-shell.input-page[data-input-state="ready"] .compact-toggle,
  body.input-page .app-shell.input-page[data-input-state="saved"] .compact-toggle {
    align-items: center;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .pallet-setting-actions,
  body.input-page .app-shell.input-page[data-input-state="ready"] .pallet-setting-actions,
  body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-setting-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .pallet-setting-status,
  body.input-page .app-shell.input-page[data-input-state="ready"] .pallet-setting-status,
  body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-setting-status {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 38px;
    border: 1px solid #c8d1dc;
    border-radius: 5px;
    box-sizing: border-box;
    background: #f5f7fa;
    padding: 7px 9px;
    color: #4f5968;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.input-page .app-shell.input-page[data-input-state="ready"] .pallet-setting-status.is-complete,
  body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-setting-status.is-complete {
    border-color: #b9d8c4;
    background: #f0f8f2;
    color: #17653a;
    font-size: 14px;
    font-weight: 800;
  }

  body.input-page .app-shell.input-page[data-input-state="ready"] .pallet-setting-status.is-missing,
  body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-setting-status.is-missing {
    border-color: #e58b87;
    background: #fff1f0;
    color: #b42318;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .pallet-setting-actions .quiet-button,
  body.input-page .app-shell.input-page[data-input-state="ready"] .pallet-setting-actions .quiet-button,
  body.input-page .app-shell.input-page[data-input-state="saved"] .pallet-setting-actions .quiet-button {
    justify-self: end;
    min-height: 38px;
    box-sizing: border-box;
    white-space: nowrap;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] #startButton,
  body.input-page .app-shell.input-page[data-input-state="ready"] #startButton,
  body.input-page .app-shell.input-page[data-input-state="saved"] #startButton {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .start-action-row #startButton,
  body.input-page .app-shell.input-page[data-input-state="ready"] .start-action-row #startButton,
  body.input-page .app-shell.input-page[data-input-state="saved"] .start-action-row #startButton {
    min-height: 62px;
  }

  body.input-page .input-operation-bar input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-inline-size: 0;
    box-sizing: border-box;
    padding-inline: 4px;
    font-size: 13px;
  }

  body.input-page .input-workspace {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
    gap: 8px;
  }

  body.input-page .condition-panel,
  body.input-page .pallet-panel {
    padding: 8px;
  }

  body.input-page .condition-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.72fr);
    gap: 8px;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .main-entry-grid,
  body.input-page .app-shell.input-page[data-input-state="ready"] .main-entry-grid,
  body.input-page .app-shell.input-page[data-input-state="saved"] .main-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    flex: 1 1 auto;
    min-height: 0;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .main-entry-grid .hero-input,
  body.input-page .app-shell.input-page[data-input-state="ready"] .main-entry-grid .hero-input,
  body.input-page .app-shell.input-page[data-input-state="saved"] .main-entry-grid .hero-input {
    display: grid;
    grid-template-rows: auto minmax(64px, 1fr) auto;
    min-height: 148px;
    padding: 12px;
    align-items: center;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .main-entry-grid .hero-input input,
  body.input-page .app-shell.input-page[data-input-state="ready"] .main-entry-grid .hero-input input,
  body.input-page .app-shell.input-page[data-input-state="saved"] .main-entry-grid .hero-input input {
    min-height: 84px;
    box-sizing: border-box;
    font-size: 38px;
    align-self: center;
  }

  body.input-page .app-shell.input-page[data-input-state="date-unlocked"] .case-input input,
  body.input-page .app-shell.input-page[data-input-state="ready"] .case-input input,
  body.input-page .app-shell.input-page[data-input-state="saved"] .case-input input {
    background: #f4f6f8;
    color: #4f5968;
    opacity: 1;
  }

  body.input-page .condition-grid > *,
  body.input-page .main-entry-grid > *,
  body.input-page .line-option,
  body.input-page .line-option .line-name {
    min-width: 0;
  }

  body.input-page .line-list {
    gap: 4px;
  }

  body.input-page .line-option {
    min-height: 46px;
    height: 46px;
    padding: 5px 6px;
  }

  body.input-page .line-option .line-name {
    font-size: 17px;
  }

  body.input-page .line-option strong {
    padding: 2px 4px;
    font-size: 9px;
    white-space: nowrap;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .pallet-panel > .panel-heading {
    display: none;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] #entryFields {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    grid-template-areas:
      "entry-values save-context";
    align-items: stretch;
    gap: 12px 14px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .running-condition {
    grid-template-columns: minmax(66px, 0.42fr) minmax(300px, 2.35fr) minmax(120px, 0.72fr) minmax(112px, 0.65fr) minmax(94px, 0.52fr) minmax(116px, 0.62fr);
    align-items: stretch;
    gap: 0;
    margin-bottom: 14px;
    border-color: #b8c8d7;
    border-radius: 0;
    background: #fff;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .running-condition div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 56px;
    padding: 8px 10px;
    background: #f4f8fc;
    border-left: 1px solid #b8c8d7;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .running-condition-title {
    display: flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    background: #dcebf7;
    font-size: 16px;
    border-bottom: 1px solid #b8c8d7;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .running-condition div:nth-of-type(1) {
    border-left: 0;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .running-condition div:nth-of-type(1),
  body.input-page .app-shell.input-page[data-input-state="in-progress"] .running-condition div:nth-of-type(3),
  body.input-page .app-shell.input-page[data-input-state="in-progress"] .running-condition div:nth-of-type(4),
  body.input-page .app-shell.input-page[data-input-state="in-progress"] .running-condition div:nth-of-type(5) {
    align-items: center;
    text-align: center;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .running-cancel-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: #fff;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .running-condition span {
    font-size: 12px;
    font-weight: 800;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .running-condition strong {
    margin-top: 4px;
    font-size: 16px;
    font-weight: 900;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] #cancelStartButton {
    width: 100%;
    min-height: 56px;
    margin: 0;
    padding: 9px 12px;
    border-color: #d7a7a0;
    background: #fff7f5;
    color: #8d4035;
    font-size: 15px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .save-context {
    display: grid;
    grid-area: save-context;
    align-content: start;
    gap: 8px;
    min-width: 0;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .save-input-row {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px solid #dce4ec;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .save-input-label {
    margin: 0;
    color: #172c4d;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .recorder-row {
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr) auto;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] #editPersonnelCandidatesButton {
    min-height: 44px;
    padding: 7px 10px;
    font-size: 13px;
    white-space: nowrap;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] #recorderCandidateMessage {
    margin: 0;
    grid-column: 2 / -1;
    font-size: 13px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] #recorderCandidateMessage[hidden] {
    display: none;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] #recorderCandidateButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] #recorderCandidateButtons .quiet-button {
    min-height: 44px;
    padding: 8px 12px;
    font-size: 14px;
    white-space: nowrap;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-row {
    display: grid;
    grid-template-columns: 136px 100px auto max-content minmax(0, 1fr);
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-row #bulkNoInput {
    width: 100px;
    min-width: 0;
    min-height: 44px;
    padding: 7px 9px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-row #addBulkNoButton {
    min-height: 44px;
    padding: 7px 12px;
    font-size: 14px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-list-label {
    margin: 0;
    color: #526579;
    font-size: 13px;
    font-weight: 800;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
    min-height: 44px;
    align-items: center;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-tag {
    padding: 4px 6px 4px 9px;
    font-size: 14px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-remove {
    min-width: 28px;
    min-height: 28px;
    margin-left: 2px;
    font-size: 17px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .bulk-no-empty {
    color: #6a7482;
    font-size: 14px;
    font-weight: 700;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .note-row {
    display: grid;
    grid-template-columns: 136px minmax(0, 1fr);
    align-items: center;
    gap: 6px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .note-row #productionNote {
    min-height: 46px;
    height: 46px;
    box-sizing: border-box;
    padding: 10px 12px;
    line-height: 24px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .main-entry-grid {
    grid-area: entry-values;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 0.84fr);
    align-self: stretch;
    align-items: stretch;
    gap: 10px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .hero-input,
  body.input-page .app-shell.input-page[data-input-state="in-progress"] .supporter-toggle {
    min-height: 148px;
    padding: 12px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .hero-input {
    display: grid;
    grid-template-rows: auto minmax(64px, 1fr) auto;
    align-items: center;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .hero-input span {
    font-size: 12px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .hero-input input {
    min-height: 64px;
    font-size: 32px;
    align-self: center;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .hero-input small {
    min-height: 20px;
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.35;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .case-input small {
    white-space: nowrap;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .supporter-toggle {
    grid-column: auto;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .supporter-toggle .switch-ui {
    flex-basis: 46px;
    width: 46px;
    height: 24px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .supporter-toggle .switch-ui::after {
    width: 16px;
    height: 16px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .supporter-toggle .switch-input:checked + .switch-ui::after {
    transform: translateX(18px);
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .supporter-toggle .switch-text {
    font-size: 12px;
    white-space: nowrap;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .entry-feedback-actions > .message {
    min-height: 52px;
    margin: 0;
    padding: 10px 12px;
    font-size: 14px;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .entry-feedback-actions > .message:empty {
    display: none;
  }

  body.input-page .app-shell.input-page[data-input-state="in-progress"] .save-action-row .save-button {
    min-height: 62px;
    font-size: 18px;
  }
}

body.input-page .layout-debug-panel {
  position: fixed;
  right: 8px;
  bottom: 8px;
  z-index: 9999;
  width: min(40vw, 360px);
  max-width: calc(100vw - 16px);
  max-height: 50vh;
  box-sizing: border-box;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  padding: 8px;
  font: 12px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
  pointer-events: none;
}

body.input-page .layout-debug-panel strong {
  display: block;
  margin-bottom: 4px;
}

body.input-page .layout-debug-panel pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

body.input-page .layout-debug-controls {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 6px;
  pointer-events: auto;
}

body.input-page .layout-debug-copy-button,
body.input-page .layout-debug-manual-close {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 4px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  padding: 6px 10px;
  font: 700 12px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  touch-action: manipulation;
  pointer-events: auto;
}

body.input-page .layout-debug-copy-temporary {
  position: absolute;
  inset: 8px;
  z-index: 1;
  width: calc(100% - 16px);
  height: 40px;
  box-sizing: border-box;
  opacity: 0.01;
  pointer-events: auto;
}

body.input-page .layout-debug-manual-copy {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  padding-top: 8px;
  pointer-events: auto;
}

body.input-page .layout-debug-manual-copy p {
  margin: 0 0 6px;
  font: 12px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.input-page .layout-debug-manual-text {
  display: block;
  width: 100%;
  min-height: 108px;
  max-height: 30vh;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 3px;
  background: #ffffff;
  color: #111111;
  padding: 6px;
  font: 12px/1.35 ui-monospace, SFMono-Regular, Consolas, monospace;
  pointer-events: auto;
  touch-action: manipulation;
}

body.input-page .layout-debug-manual-close {
  display: block;
  margin: 6px 0 0 auto;
}
