:root {
  --page-bg: #f2ede4;
  --page-accent: #e4ddd3;
  --panel-bg: #fbfaf8;
  --panel-border: #c9c1b6;
  --text-main: #1d1d1d;
  --text-muted: #6a645d;
  --control-bg: #ffffff;
  --control-bg-active: #e8f4ff;
  --control-bg-active-end: #d7ebff;
  --control-shadow: #ece6dd;
  --control-border: #beb6aa;
  --disabled-bg: #efefef;
  --button-ink: #19365d;
  --home-button-start: #f7f4ef;
  --home-button-end: #eadfce;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 32%),
    linear-gradient(180deg, #f7f4ef 0%, var(--page-bg) 62%, #eee5d8 100%);
}

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

.page-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.app-screen {
  width: min(1160px, 100%);
}

.app-screen[hidden] {
  display: none;
}

.home-panel,
.order-panel,
.modify-panel,
.history-panel {
  width: 100%;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--panel-bg));
  box-shadow:
    0 20px 45px rgba(87, 72, 51, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.home-panel {
  padding: 36px 34px 30px;
}

.store-selection-panel {
  padding: 36px 34px 30px;
}

.platform-home-panel {
  padding: 32px 34px 30px;
  display: grid;
  gap: 22px;
}

.platform-home-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.platform-home-header__copy {
  display: grid;
  gap: 8px;
}

.platform-home-header__copy h1,
.platform-home-header__copy p {
  margin: 0;
}

.platform-home-header__copy h1 {
  font-size: 24px;
  white-space: nowrap;
}

.platform-home-header__meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.platform-home-header__meta p {
  margin: 0;
  color: var(--text-muted);
}

.platform-home-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.platform-stat-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px 18px 16px;
  border: 1px solid var(--control-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #f0e8dc 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 8px 18px rgba(76, 63, 39, 0.07);
}

.platform-stat-card h3,
.platform-stat-card p {
  margin: 0;
}

.platform-stat-card h3 {
  font-size: 16px;
  color: var(--text-muted);
}

.platform-stat-card__value {
  font-size: 34px;
  font-weight: 800;
  color: var(--button-ink);
}

.platform-stat-card__note {
  font-size: 13px;
  color: var(--text-muted);
}

.platform-home-actions {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 18px;
}

.platform-home-button {
  min-height: 148px;
  font-size: 28px;
  letter-spacing: 2px;
}

.platform-home-digest {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.platform-history-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}

.platform-history-multi {
  min-height: 132px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.platform-history-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.platform-history-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.platform-history-tab {
  min-width: 120px;
}

.platform-history-tab--active {
  border-color: #7aa8d9;
  background: linear-gradient(180deg, #f7fbff 0%, #dceeff 100%);
}

.platform-history-section {
  display: grid;
  gap: 14px;
}

.platform-history-placeholder {
  padding: 18px 16px;
  border: 1px dashed var(--control-border);
  background: linear-gradient(180deg, #fffdf8 0%, #f2ebe0 100%);
  color: var(--text-muted);
}

.auth-panel {
  width: min(460px, 100%);
  margin: 0 auto;
  padding: 34px 32px 28px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), var(--panel-bg));
  box-shadow:
    0 20px 45px rgba(87, 72, 51, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.home-header {
  display: grid;
  gap: 8px;
  margin-bottom: 24px;
  text-align: center;
}

.home-header h1 {
  margin: 0;
  font-size: 40px;
}

.home-kicker,
.home-note {
  margin: 0;
}

.home-kicker {
  font-size: 16px;
  color: var(--text-muted);
  letter-spacing: 4px;
}

.home-note {
  font-size: 16px;
  color: var(--text-muted);
}

.home-kitchen-summary-bar {
  background: #f0f4f8;
  border: 1px solid #d8e2ec;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.home-kitchen-summary-bar:hover,
.home-kitchen-summary-bar:focus-visible {
  background: #e3ebf3;
  border-color: #b8c9dc;
  outline: none;
}

.home-kitchen-summary-bar:active {
  background: #dbe6f0;
}

.home-kitchen-summary-text {
  margin: 0;
  font-size: 14px;
  color: #333;
  text-align: center;
  line-height: 1.5;
}

.home-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.home-subactions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 22px;
  margin-top: 18px;
}

.home-sub-button {
  min-width: 0;
}

.home-subactions__spacer {
  min-height: 1px;
}

.auth-form {
  display: grid;
  gap: 16px;
}

.auth-checkbox {
  justify-self: start;
}

.auth-message {
  min-height: 22px;
  margin: 0;
  color: #8f4e1d;
}

.auth-button {
  height: 58px;
}

.home-big-button {
  min-height: 220px;
  border: 1px solid var(--control-border);
  background: linear-gradient(180deg, var(--home-button-start) 0%, var(--home-button-end) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 8px 20px rgba(76, 63, 39, 0.08);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--button-ink);
  cursor: pointer;
}

.home-big-button:hover:not(:disabled) {
  filter: brightness(0.99);
}

.home-big-button:disabled {
  color: #8d877d;
  cursor: not-allowed;
}

.store-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

.store-selection-actions {
  margin-top: 20px;
}

.store-card {
  display: grid;
  gap: 10px;
  width: 100%;
  min-height: 180px;
  padding: 22px 20px 18px;
  border: 1px solid var(--control-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), #f3ece2 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 10px 24px rgba(76, 63, 39, 0.08);
  text-align: left;
  color: var(--button-ink);
  cursor: pointer;
}

.store-card h3,
.store-card p {
  margin: 0;
}

.store-card h3 {
  font-size: 26px;
  line-height: 1.2;
}

.store-card p {
  color: var(--text-muted);
  font-size: 15px;
}

.store-card--active {
  border-color: #7aa8d9;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 10px 24px rgba(76, 63, 39, 0.08),
    0 0 0 3px rgba(136, 184, 232, 0.18);
}

.store-card--disabled-store {
  border-color: #c9b49a;
  background: linear-gradient(180deg, #f8f4ee 0%, #ebe0d2 100%);
}

.store-card--empty {
  min-height: 120px;
  cursor: default;
}

.store-card__badge {
  justify-self: start;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(25, 54, 93, 0.08);
  color: var(--button-ink);
  font-size: 13px;
  font-weight: 700;
}

.store-card__warning {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(123, 92, 51, 0.12);
  color: #6f5530 !important;
  font-weight: 700;
}

.order-panel {
  padding: 22px 24px 16px;
}

.order-form {
  display: grid;
  gap: 24px;
}

.toolbar {
  display: grid;
  width: 100%;
  grid-template-columns: 108px 128px 136px 128px;
  gap: 18px 14px;
  align-items: end;
  justify-content: start;
}

.content-grid {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.left-panel,
.right-panel {
  display: grid;
  gap: 16px;
}

.right-panel {
  gap: 18px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  text-align: center;
}

.field--button label {
  visibility: hidden;
}

.field--stack {
  gap: 8px;
}

.field--stack label {
  visibility: hidden;
}

.panel-homebar {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.action-button--home {
  width: 112px;
  min-width: 112px;
  height: 40px;
}

.screen-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.editor-topbar {
  margin-bottom: 18px;
}

.screen-topbar-spacer {
  grid-column: 1;
  width: 112px;
  min-width: 112px;
  min-height: 40px;
}

.editor-reset-slot {
  display: flex;
  align-items: center;
}

#editorSecondaryButton {
  width: 112px;
  min-width: 112px;
  height: 40px;
}

.screen-topbar-right {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  justify-self: end;
  margin-right: 18px;
}

.editor-topbar .queue-display {
  width: 122px;
  min-width: 122px;
  min-height: 40px;
}

.screen-topbar-copy {
  grid-column: 2;
}

.editor-nav-single {
  display: grid;
  justify-content: flex-end;
}

.queue-display {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 6px;
  border: 1px solid var(--control-border);
  background: linear-gradient(180deg, #fff6cf 0%, #f3df9d 100%);
  color: var(--button-ink);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0;
}

input,
select,
textarea,
.action-button,
.confirm-button {
  width: 100%;
  border: 1px solid var(--control-border);
  background: linear-gradient(180deg, var(--control-bg) 0%, #f4eee7 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 1px 0 var(--control-shadow);
  color: var(--text-main);
}

input:not(:disabled),
select:not(:disabled),
textarea:not(:disabled) {
  background: linear-gradient(180deg, var(--control-bg-active) 0%, var(--control-bg-active-end) 100%);
}

input:not(:disabled):focus,
select:not(:disabled):focus,
textarea:not(:disabled):focus {
  outline: none;
  border-color: #8ebae6;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.98),
    0 0 0 2px rgba(147, 197, 253, 0.28);
}

input,
select,
.action-button {
  height: 40px;
  padding: 0 12px;
}

textarea {
  min-height: 72px;
  padding: 10px 12px;
  resize: none;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: var(--disabled-bg);
  color: #9c968e;
}

.action-button,
.confirm-button {
  cursor: pointer;
}

.action-button:hover,
.confirm-button:hover {
  filter: brightness(0.985);
}

.action-button:disabled,
.confirm-button:disabled {
  color: #8d877d;
  cursor: not-allowed;
  background: linear-gradient(180deg, #efebe5 0%, #e5ded2 100%);
  filter: none;
}

.action-button--mini {
  height: 30px;
  font-size: 14px;
}

.mode-box,
.side-dish-box,
.option-box {
  display: grid;
  gap: 12px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.checkbox-label input {
  width: 20px;
  height: 20px;
  margin: 0;
}

.mode-box h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
}

.side-dish-box {
  gap: 8px;
  padding-top: 2px;
}

.quantity-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
}

.qty-select {
  width: 62px;
  padding: 0 8px;
}

.option-box {
  gap: 8px;
  padding-top: 2px;
}

.flavor-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.protein-row {
  display: grid;
  grid-template-columns: 0 repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
  overflow: visible;
}

.protein-label {
  width: 52px;
  padding-bottom: 8px;
  font-size: 20px;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
  transform: translateX(calc(-100% - 10px));
}

.footer-grid {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 260px;
  gap: 14px;
  align-items: center;
}

.footer-actions {
  display: grid;
  gap: 8px;
  align-self: stretch;
}

.footer-test-button {
  height: 34px;
  font-size: 15px;
}

.remark-label {
  font-size: 18px;
  font-weight: 800;
  text-align: right;
}

.confirm-button {
  height: 78px;
  font-size: 24px;
  color: var(--button-ink);
  letter-spacing: 2px;
  font-family: "STSong", "SimSun", serif;
}

#editorScreen .order-panel,
#modifyEditorScreen .order-panel {
  padding-bottom: 4px;
}

#editorScreen .order-form,
#modifyEditorScreen .order-form {
  gap: 12px;
}

#editorScreen .content-grid,
#modifyEditorScreen .content-grid {
  gap: 16px;
}

#modifyEditorScreen .toolbar {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#editorScreen .footer-grid,
#modifyEditorScreen .footer-grid {
  grid-template-columns: 310px minmax(0, 1fr) 296px;
  gap: 8px 14px;
  align-items: start;
  margin-top: -24mm;
}

#editorScreen .option-box,
#editorScreen .footer-grid {
  transform: translateX(-1em);
}

#editorScreen .footer-grid {
  transform: translateX(0);
}

#editorScreen .remark-label,
#modifyEditorScreen .remark-label {
  grid-column: 1;
  align-self: start;
  padding-top: 0;
  text-align: right;
}

#editorScreen #remark,
#modifyEditorScreen #modifyRemark {
  grid-column: 2;
  min-height: 84px;
  align-self: start;
}

#editorScreen .footer-actions,
#modifyEditorScreen .footer-actions {
  grid-column: 3;
  align-self: stretch;
  display: flex;
  align-items: flex-start;
}

#editorScreen #confirmPot,
#modifyEditorScreen #modifyConfirmPot {
  height: 84px;
}

.modify-panel,
.history-panel {
  padding: 22px 24px 18px;
  display: grid;
  gap: 18px;
}

.staff-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.platform-account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.platform-account-layout > .history-section,
.platform-account-layout > .logic-card,
.platform-account-side {
  min-width: 0;
}

.platform-account-side {
  display: grid;
  gap: 18px;
}

.platform-account-side > * {
  min-width: 0;
}

.platform-store-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}

.platform-store-toolbar__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.platform-store-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 18px;
  align-items: start;
}

.platform-store-editor {
  display: grid;
  gap: 14px;
}

.printer-management-toolbar {
  grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr));
}

.printer-management-layout {
  margin-top: 18px;
}

.side-dish-printer-management {
  margin-top: 18px;
}

.printer-management-editor {
  display: grid;
  gap: 14px;
}

.printer-management-checkbox-line {
  padding: 10px 12px;
  border: 1px solid rgba(190, 182, 170, 0.92);
  background: linear-gradient(180deg, #fffdf8 0%, #f4ede3 100%);
}

.printer-management-checkbox-line span {
  font-weight: 600;
}

.printer-management-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#printerManagementScreen .record-table td:last-child {
  min-width: 230px;
  white-space: normal;
}

#printerManagementScreen .record-table td:last-child .action-button--mini,
#printerManagementScreen .record-table td:last-child .action-button {
  width: auto;
  min-width: 76px;
  margin: 4px 6px 4px 0;
}

.platform-store-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.field--full {
  grid-column: 1 / -1;
}

.staff-editor {
  display: grid;
  gap: 14px;
}

.platform-user-editor,
.platform-binding-editor {
  display: grid;
  gap: 14px;
}

.platform-user-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.staff-form-grid {
  display: grid;
  gap: 14px;
}

.staff-permission-box {
  display: grid;
  gap: 12px;
}

.staff-permission-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.staff-permission-grid {
  display: grid;
  gap: 10px;
}

.staff-form-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.staff-form-actions--single {
  grid-template-columns: minmax(0, 1fr);
}

.staff-layout .action-button--mini {
  width: auto;
  min-width: 82px;
}

.platform-account-layout .action-button--mini {
  width: auto;
  min-width: 82px;
}

.platform-binding-editor__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.platform-binding-editor__head h3 {
  margin: 0;
}

.platform-user-store-box {
  padding: 14px 16px;
  border: 1px solid rgba(135, 118, 89, 0.18);
  border-radius: 12px;
  background: rgba(255, 251, 244, 0.9);
}

.platform-user-store-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 108px;
  gap: 12px;
  align-items: center;
}

.platform-user-store-list {
  display: grid;
  gap: 10px;
}

.platform-user-store-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(190, 182, 170, 0.92);
  background: linear-gradient(180deg, #fffdf8 0%, #f4ede3 100%);
}

.platform-user-store-option__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.platform-user-store-option__title {
  font-weight: 700;
  word-break: break-all;
}

.platform-user-store-option__meta {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.35;
}

.platform-user-store-item--inactive {
  border-style: dashed;
}

.platform-user-store-item--inactive .platform-user-store-option__title {
  color: #8a551b;
}

.platform-user-store-remove-button {
  width: auto;
  min-width: 86px;
}

#platformAccountLayout #platformUserEditorTitle {
  line-height: 1.1;
  word-break: break-all;
}

.record-table__row--selected {
  background: rgba(221, 237, 255, 0.78);
}

.record-table__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.record-table__status--active {
  background: rgba(78, 158, 84, 0.14);
  color: #2d6d33;
}

.record-table__status--inactive {
  background: rgba(168, 111, 48, 0.16);
  color: #8a551b;
}

.record-row--wait-call {
  background: rgba(250, 213, 79, 0.62);
}

.record-row--kitchen-locked {
  background: rgba(214, 58, 58, 0.3);
}

.record-row--takeout-box {
  background: rgba(207, 232, 255, 0.82);
}

.record-table__row--small-fish {
  background: #f4a7bc;
}

.record-table__row--small-fish td {
  color: #3f1020;
}

.record-table__row--portion-pot {
  background: #dff3df;
}

.record-table__row--portion-pot td {
  color: var(--text-main);
}

.record-table__row--price-impact {
  background: #c8a5ff;
}

.record-table__row--price-impact td {
  color: #2b124f;
  font-weight: 700;
}

.record-table__cell--price-changed {
  color: #d00000 !important;
  font-weight: 800;
}

#modifyRecordTableWrap,
#historyRecordTableWrap {
  max-height: calc(100dvh - 260px);
  overflow: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

#modifyRecordTableWrap .record-table,
#historyRecordTableWrap .record-table {
  border-collapse: separate;
  border-spacing: 0;
}

#modifyRecordTableWrap .record-table th,
#historyRecordTableWrap .record-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #efe4d4;
}

.record-row.record-row--wait-call:hover,
.record-row.record-row--wait-call:focus {
  background: rgba(250, 213, 79, 0.74);
}

.record-row--kitchen-locked td {
  color: #7f1010;
  font-weight: 700;
}

.record-row.record-row--kitchen-locked:hover,
.record-row.record-row--kitchen-locked:focus {
  background: rgba(214, 58, 58, 0.38);
}

.kitchen-status-checkbox {
  width: 18px;
  height: 18px;
}

.kitchen-availability-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 12px;
}

.kitchen-availability-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  min-width: 142px;
  padding: 6px 10px;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: #fffdf8;
  color: var(--text-main);
  user-select: none;
}

.kitchen-availability-toggle input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.kitchen-availability-toggle__text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.kitchen-availability-toggle__status {
  min-width: 36px;
  color: #126b3a;
  font-size: 13px;
  text-align: right;
}

.kitchen-availability-toggle--sold-out {
  border-color: #c94b4b;
  background: #fff6f3;
}

.kitchen-availability-toggle--sold-out .kitchen-availability-toggle__status {
  color: #a71818;
}

.kitchen-availability-toggle--disabled {
  opacity: 0.72;
}

.kitchen-status-detail {
  min-width: 220px;
  white-space: normal;
  text-align: left !important;
  line-height: 1.32;
}

.kitchen-status-col--toggle,
.kitchen-status-col--index,
.kitchen-status-col--queue {
  width: 44px;
  min-width: 44px;
}

.kitchen-status-col--toggle {
  width: 38px;
  min-width: 38px;
}

.kitchen-status-col--index {
  width: 36px;
  min-width: 36px;
}

.kitchen-status-col--queue {
  width: 40px;
  min-width: 40px;
}

#kitchenStatusTableWrap .record-table th:nth-child(4),
#kitchenStatusTableWrap .record-table td:nth-child(4) {
  width: 72px;
  min-width: 72px;
  padding-left: 5px;
  padding-right: 5px;
}

#kitchenStatusTableWrap .record-table th:nth-child(5),
#kitchenStatusTableWrap .record-table td:nth-child(5) {
  width: 82px;
  min-width: 82px;
  padding-left: 5px;
  padding-right: 5px;
}

#kitchenStatusTableWrap .record-table th:nth-child(-n + 5),
#kitchenStatusTableWrap .record-table td:nth-child(-n + 5) {
  padding-left: 4px;
  padding-right: 4px;
  font-size: 13px;
}

#kitchenStatusTableWrap .record-table td:nth-child(1),
#kitchenStatusTableWrap .record-table td:nth-child(2),
#kitchenStatusTableWrap .record-table td:nth-child(3),
#kitchenStatusTableWrap .record-table td:nth-child(4),
#kitchenStatusTableWrap .record-table td:nth-child(5) {
  font-size: 13px;
}

.logic-grid {
  display: grid;
  gap: 18px;
}

.logic-card {
  padding: 18px 18px 16px;
  border: 1px solid var(--control-border);
  background: linear-gradient(180deg, #fffdf8 0%, #f2ebe0 100%);
}

.logic-card h3,
.logic-card__note {
  margin: 0;
}

.logic-card h3 {
  margin-bottom: 14px;
  font-size: 22px;
}

.logic-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.logic-readonly-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.logic-readonly-grid > div {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--control-border);
  background: rgba(255, 255, 255, 0.72);
}

.logic-readonly-grid span {
  color: var(--text-muted);
  font-size: 13px;
}

.logic-readonly-grid strong {
  font-size: 16px;
  font-weight: 700;
}

.logic-rule-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}

.logic-card__note {
  margin-top: 14px;
  color: var(--text-muted);
}

.logic-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modify-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.modify-toolbar-right {
  display: grid;
  grid-template-columns: repeat(2, 112px);
  gap: 12px;
  align-items: center;
  justify-self: end;
  margin-right: 18px;
}

.history-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.modify-toolbar-actions {
  display: flex;
  gap: 12px;
  justify-self: start;
}

.screen-topbar-copy,
.modify-toolbar-copy,
.history-toolbar-copy {
  display: grid;
  gap: 6px;
  text-align: center;
  min-width: 0;
  justify-self: center;
}

.screen-topbar-copy h2,
.screen-topbar-copy p,
.modify-toolbar-copy h2,
.modify-toolbar-copy p,
.history-toolbar-copy h2,
.history-toolbar-copy p {
  margin: 0;
}

.screen-topbar-copy h2,
.modify-toolbar-copy h2,
.history-toolbar-copy h2 {
  font-size: 28px;
}

.screen-topbar-copy p,
.modify-toolbar-copy p,
.history-toolbar-copy p {
  color: var(--text-muted);
}

.modify-page-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  min-width: 112px;
  min-height: 40px;
  border: 1px solid var(--control-border);
  background: linear-gradient(180deg, #fffdf8 0%, #f0e6d8 100%);
  font-weight: 700;
}

.modify-toolbar > .modify-page-box {
  justify-self: end;
  margin-right: 18px;
}

.modify-table-wrap {
  overflow: auto;
  border: 1px solid var(--control-border);
  background: #fffdf8;
}

.record-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.record-table th,
.record-table td {
  padding: 10px 12px;
  border: 1px solid #d9d0c5;
  font-size: 14px;
  white-space: nowrap;
  text-align: center;
}

.record-table th {
  position: sticky;
  top: 0;
  background: #efe4d4;
  z-index: 1;
}

.fish-sales-report-table-wrap {
  max-height: 410px;
  overflow-y: auto;
}

.fish-sales-report-filters {
  grid-template-columns: minmax(180px, 220px) auto;
  justify-content: start;
}

.fish-sales-report-month-field {
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
}

.fish-sales-report-month-field label {
  text-align: left;
}

.fish-sales-report-table-wrap .record-table {
  min-width: 430px;
}

.fish-sales-report-table-wrap .record-table th,
.fish-sales-report-table-wrap .record-table td {
  padding: 5px 4px;
  font-size: 12px;
}

.fish-sales-report-table-wrap .record-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 1;
  background: #f7ead8;
  font-weight: 700;
}

.record-row {
  cursor: pointer;
}

.record-row:hover,
.record-row:focus {
  background: #eef6ff;
  outline: none;
}

.record-row--readonly {
  cursor: not-allowed;
  color: #7f776f;
}

.record-row--readonly:hover,
.record-row--readonly:focus {
  background: #f4efe7;
}

.record-table__empty {
  padding: 24px 12px;
  color: var(--text-muted);
}

.modify-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modify-summary {
  margin: 0;
  color: var(--text-muted);
}

.modify-pagination {
  display: flex;
  gap: 12px;
}

.modify-page-button,
.modify-toolbar-button {
  width: 112px;
  min-width: 112px;
}

.modify-toolbar-button--pagebox {
  height: 40px;
}

.history-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.history-record-filters {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
}

.history-meal-summary-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.history-meal-summary-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 10px 14px;
  min-height: auto;
  padding: 12px 14px;
  border: 1px solid #ddd4c7;
  background: linear-gradient(180deg, #fffdf8 0%, #f4ecdf 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.96),
    0 4px 10px rgba(76, 63, 39, 0.04);
}

.history-meal-summary-card h4,
.history-meal-summary-card p {
  margin: 0;
}

.history-meal-summary-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
}

.history-meal-summary-card__value {
  font-size: 17px;
  font-weight: 700;
  color: var(--button-ink);
  text-align: right;
}

.history-stage-stats-filters input,
.history-stage-stats-filters select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.history-section {
  display: grid;
  gap: 12px;
}

.history-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.history-section-head__copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.history-section-head h3,
.history-section-head p {
  margin: 0;
}

.history-section-head p {
  color: var(--text-muted);
}

.history-color-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 10px;
  border: 1px solid #d9d0c5;
  background: #fffdf8;
  color: var(--text-main);
  font-size: 13px;
  line-height: 1.35;
}

.history-color-legend__item,
.history-color-legend__priority {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.history-color-legend__priority {
  color: var(--text-muted);
}

.history-color-legend__swatch {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(58, 43, 26, 0.24);
  flex: 0 0 auto;
}

.history-color-legend__swatch--price {
  background: #c8a5ff;
}

.history-color-legend__swatch--small-fish {
  background: #f4a7bc;
}

.history-color-legend__swatch--portion {
  background: #dff3df;
}

.history-color-legend__swatch--takeout {
  background: rgba(207, 232, 255, 0.82);
}

.history-color-legend__swatch--normal {
  background: #fffdf8;
}

.fish-stock-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
}

.fish-stock-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.fish-stock-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-soft);
}

.fish-stock-card h4,
.fish-stock-card p {
  margin: 0;
}

.fish-stock-card h4 {
  font-size: 15px;
  color: var(--text-main);
}

.fish-stock-card__value {
  font-size: 20px;
  font-weight: 700;
  color: var(--button-ink);
}

.fish-stock-card__value.is-negative {
  color: #c53030;
}

.fish-stock-card__meta {
  display: grid;
  gap: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.fish-stock-operation-pagination {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.fish-stock-operation-pagination__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.fish-stock-operation-page-button.is-active {
  border-color: var(--button-bg);
  background: var(--button-bg);
  color: var(--button-text);
}

.fish-stock-operation-pagination__summary {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.fish-prediction-reasoning-button {
  justify-self: start;
  width: 104px;
  min-width: 0;
  max-width: 100%;
  padding: 0 6px;
  font-size: 12px;
}

.fish-prediction-reasoning-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  width: min(720px, 92vw);
  max-height: min(80dvh, 720px);
}

.fish-prediction-reasoning-dialog__text {
  min-height: 280px;
  max-height: 62dvh;
  margin: 0;
  padding: 14px 16px;
  overflow-y: auto;
  border: 1px solid var(--control-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-main);
  font: inherit;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

.fish-stock-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fish-stock-action-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: var(--surface-soft);
}

.fish-stock-action-panel h4 {
  margin: 0;
  font-size: 15px;
}

.fish-stock-input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.fish-stock-input-grid label {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.fish-stock-input-grid input {
  min-width: 0;
}

.fish-prediction-filters {
  grid-template-columns: minmax(120px, 0.7fr) minmax(120px, 0.7fr) minmax(220px, 1.4fr) auto;
}

.fish-prediction-filters .field,
.fish-prediction-manual .field {
  min-width: 0;
}

.fish-prediction-manual {
  grid-template-columns: repeat(3, minmax(120px, 1fr)) minmax(180px, 1.2fr) auto;
}

.platform-user-list-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 260px) repeat(3, auto);
  align-items: end;
  justify-content: start;
  gap: 10px;
}

.platform-user-list-toolbar .field {
  min-width: 0;
}

.platform-user-list-toolbar select {
  width: 100%;
}

@media (max-width: 720px) {
  .platform-user-list-toolbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .platform-user-list-toolbar .field {
    grid-column: 1 / -1;
  }
}

.print-dialog__dispatch {
  display: grid;
  gap: 10px;
  width: 100%;
  padding: 10px 12px 2px;
}

.print-dialog__dispatch-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.print-dialog__dispatch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.print-dialog__dispatch-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}

.print-dialog__dispatch-option input {
  width: 18px;
  height: 18px;
}

.dialog-backdrop[hidden] {
  display: none;
}

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(35, 42, 52, 0.28);
}

.dialog-panel {
  width: min(420px, 100%);
  padding: 22px 20px 18px;
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, #ffffff 0%, #f5f0e8 100%);
  box-shadow:
    0 22px 40px rgba(44, 45, 52, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.dialog-title {
  margin: 0 0 14px;
  font-size: 24px;
  text-align: center;
}

.dialog-message {
  margin: 0;
  min-height: 54px;
  font-size: 18px;
  line-height: 1.55;
  text-align: center;
}

.missing-field-name {
  color: #d71920;
  font-weight: 800;
}

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

.dialog-button {
  height: 42px;
}

.report-backdrop {
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(27, 31, 39, 0.48);
}

.report-dialog {
  display: grid;
  gap: 14px;
  width: min(980px, 100%);
}

.report-sheet {
  display: grid;
  gap: 18px;
  padding: 22px 24px 20px;
  border: 1px solid var(--panel-border);
  background: #ffffff;
  box-shadow: 0 20px 42px rgba(22, 22, 22, 0.22);
}

.report-sheet__header {
  display: grid;
  gap: 6px;
}

.report-sheet__header h2,
.report-sheet__header p,
.report-sheet__footer p {
  margin: 0;
}

.report-sheet__header h2 {
  font-size: 30px;
}

.report-sheet__header p,
.report-sheet__footer p {
  color: var(--text-muted);
}

.report-sheet__summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.report-sheet__summary-card {
  display: grid;
  gap: 6px;
  padding: 14px 14px 12px;
  border: 1px solid #ddd4c7;
  background: linear-gradient(180deg, #fffdf8 0%, #f4ecdf 100%);
}

.report-sheet__summary-card h3,
.report-sheet__summary-card p {
  margin: 0;
}

.report-sheet__summary-card h3 {
  font-size: 15px;
  color: var(--text-muted);
}

.report-sheet__summary-value {
  font-size: 30px;
  font-weight: 800;
  color: var(--button-ink);
}

.report-sheet__table-wrap {
  overflow: auto;
  border: 1px solid #d9d0c5;
}

.report-sheet__table {
  width: 100%;
  border-collapse: collapse;
}

.report-sheet__table th,
.report-sheet__table td {
  padding: 10px 12px;
  border: 1px solid #ddd4c7;
  text-align: center;
  font-size: 14px;
}

.report-sheet__table th {
  background: #efe4d4;
}

.report-sheet__table tfoot td {
  font-weight: 800;
  background: #f8f2e8;
}

.report-dialog__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.report-dialog__dispatch {
  padding: 0;
}

.history-print-table-wrap {
  width: min(80mm, 100%);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #ddd4c7;
}

.history-print-brand {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #3f3a33;
  text-align: center;
}

.report-sheet__table--history-print {
  table-layout: fixed;
}

.report-sheet__table--history-print th,
.report-sheet__table--history-print td {
  padding: 8px 6px;
  font-size: 11px;
  line-height: 1.15;
  text-align: left;
  white-space: nowrap;
  word-break: keep-all;
}

.report-sheet__table--history-print th {
  background: #efe4d4;
  white-space: nowrap;
}

.report-sheet__table--history-print th:nth-child(1),
.report-sheet__table--history-print td:nth-child(1),
.report-sheet__table--history-print th:nth-child(2),
.report-sheet__table--history-print td:nth-child(2) {
  width: 8%;
}

.report-sheet__table--history-print th:nth-child(3),
.report-sheet__table--history-print td:nth-child(3) {
  width: 22%;
}

.report-sheet__table--history-print th:nth-child(4),
.report-sheet__table--history-print td:nth-child(4) {
  width: 14%;
}

.report-sheet__table--history-print th:nth-child(5),
.report-sheet__table--history-print td:nth-child(5) {
  width: 10%;
}

.report-sheet__table--history-print th:nth-child(6),
.report-sheet__table--history-print td:nth-child(6) {
  width: 38%;
}

.report-sheet__table--history-print tbody td {
  border-top: none;
  border-left: none;
  border-right: none;
  border-bottom: 1px dashed #c7bbad;
}

#historyRecordPrintDialog .report-sheet__footer {
  display: grid;
  gap: 2px;
}

#historyRecordPrintDialog .report-sheet__footer p {
  margin: 0;
  font-size: 10px;
  line-height: 1.1;
  color: #3f3a33;
}

#historyRecordPrintDialog #historyRecordPrintStatsTitle {
  font-weight: 700;
}

#historyRecordPrintDialog #historyRecordPrintStatsLineOne,
#historyRecordPrintDialog #historyRecordPrintStatsLineTwo {
  font-size: 11px;
}

#historyRecordPrintDialog.report-backdrop {
  align-items: flex-start;
  overflow: auto;
  background: #f8f3eb !important;
  isolation: isolate;
}

body[data-history-print-preview-open="true"] #historyScreen {
  visibility: hidden;
}

body[data-print-mode="history-report"] #historyScreen {
  display: none !important;
}

#historyRecordPrintDialog .report-sheet__header {
  text-align: center;
  gap: 4px;
}

#historyRecordPrintDialog .report-dialog__dispatch,
#historyRecordPrintDialog .report-dialog__actions {
  width: min(80mm, 100%);
  margin: 0 auto;
}

.report-sheet__table--history th:nth-child(1),
.report-sheet__table--history td:nth-child(1),
.report-sheet__table--history th:nth-child(2),
.report-sheet__table--history td:nth-child(2),
.report-sheet__table--history th:nth-child(3),
.report-sheet__table--history td:nth-child(3),
.report-sheet__table--history th:nth-child(4),
.report-sheet__table--history td:nth-child(4),
.report-sheet__table--history th:nth-child(6),
.report-sheet__table--history td:nth-child(6) {
  width: 72px;
  min-width: 72px;
}

.report-sheet__table--history th:nth-child(5),
.report-sheet__table--history td:nth-child(5) {
  min-width: 120px;
}

.report-sheet__table--history th:nth-child(7),
.report-sheet__table--history td:nth-child(7) {
  min-width: 130px;
}

.print-backdrop {
  align-items: flex-start;
  justify-content: flex-start;
  padding: 2mm 0 0 2mm;
  background: rgba(27, 31, 39, 0.36);
}

.print-dialog {
  display: grid;
  gap: 14px;
  width: auto;
}

.print-ticket {
  position: relative;
  display: flex;
  box-sizing: border-box;
  flex-direction: column;
  width: 80mm;
  height: 116mm;
  min-height: 116mm;
  padding: 2.4mm 2.4mm 14mm 2.4mm;
  border: 1px solid #9f9f9f;
  background: #ffffff;
  box-shadow: 0 18px 35px rgba(22, 22, 22, 0.22);
  color: #111111;
}

.print-ticket__store-name {
  position: absolute;
  top: 2.4mm;
  left: 6mm;
  right: 6mm;
  margin: 0;
  text-align: center;
  font-size: 6.6mm;
  font-weight: 500;
  color: #3f3a33;
  line-height: 1.1;
  letter-spacing: 0;
}

.print-ticket--test-queue-inline .print-ticket__store-name {
  font-size: 5.6mm;
  line-height: 1.05;
}

.print-ticket__footer {
  position: absolute;
  left: 59mm;
  right: 2mm;
  bottom: 1.9mm;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0;
  padding-top: 0;
}

.print-ticket__footer[hidden] {
  display: none !important;
}

.print-ticket__footer strong {
  display: inline-block;
  font-size: 12pt;
  color: #0c2445;
  line-height: 1;
  transform: none;
}
.print-ticket__badge {
  position: absolute;
  top: 2mm;
  left: 2mm;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 7mm;
  height: 7mm;
  border: 0.5mm solid #b14c4c;
  border-radius: 999px;
  color: #b14c4c;
  font-size: 4mm;
  font-weight: 800;
}

.print-ticket--modify .print-ticket__badge {
  left: auto;
  right: 2mm;
}

.print-ticket__tag[hidden] {
  display: none;
}

.print-ticket__tag {
  margin: 0.2mm 0 0 43mm;
  font-size: 3.8mm;
  color: #6b5343;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.print-ticket__header,
.print-ticket__body {
  display: grid;
  gap: 2mm;
}

.print-ticket__header {
  padding-top: 13.8mm;
  gap: 1.5mm;
}

.print-ticket__headline,
.print-ticket__pot,
.print-ticket__side,
.print-ticket__remark {
  margin: 0;
  line-height: 1.22;
}

.print-ticket__headline {
  font-size: 14pt;
  font-weight: 400;
}

.print-ticket__pot {
  font-size: 16pt;
  font-weight: 500;
}

.print-ticket__side,
.print-ticket__remark {
  font-size: 14pt;
}

.print-ticket__headline-key,
.print-ticket__headline-weight {
  font-weight: 400;
}

.print-ticket__headline-value,
.print-ticket__headline-fish {
  font-weight: 800;
}

.print-ticket__body {
  margin-top: 1.8mm;
}

.print-ticket__flavor-layout--split {
  display: grid;
  grid-template-rows: 18mm 21mm auto;
  gap: 0;
}

.print-ticket__flavor-top,
.print-ticket__flavor-divider-slot,
.print-ticket__flavor-bottom {
  display: grid;
  align-content: start;
}

.print-ticket__flavor {
  display: grid;
  gap: 1mm;
  margin-bottom: 2.2mm;
  border-top: 0.35mm solid #111111;
  padding-top: 0.6mm;
}

.print-ticket__flavor--divider {
  border-top: 0.35mm solid #111111;
  padding-top: 0.6mm;
  margin-top: 0;
}

.print-ticket__flavor-label {
  font-size: 16pt;
  margin: 0;
}

.print-ticket__flavor-main {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  gap: 3mm;
  align-items: baseline;
}

.print-ticket__flavor-name {
  font-size: 22pt;
  font-weight: 800;
  margin: 0;
  line-height: 1;
}

.print-ticket__ingredient {
  font-size: 14pt;
  font-weight: 700;
  margin: 0;
  line-height: 1.05;
}

.print-ticket__detail {
  margin: 0;
  font-size: 14pt;
  line-height: 1.08;
}

.print-ticket__changed {
  font-style: italic;
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: #b14c4c;
  text-underline-offset: 3px;
}

.print-ticket__remark[hidden] {
  display: none;
}

.print-ticket__remark {
  margin-top: 1.2mm;
  padding-top: 0;
  padding-bottom: 0;
  border-top: 0.35mm solid #111111;
  padding-top: 0.6mm;
}

.print-ticket__meta {
  position: absolute;
  left: 2mm;
  bottom: 2.4mm;
  display: grid;
  width: 52mm;
  gap: 0;
  justify-items: start;
}

.print-ticket__meta::before {
  content: none;
  position: absolute;
  left: 0;
  top: -5.6mm;
  width: 74mm;
  border-top: 0.35mm dashed #111111;
}

.print-ticket__orderer,
.print-ticket__time {
  margin: 0;
  font-size: 9pt;
  line-height: 0.95;
}

.print-ticket__footer {
  position: absolute;
  left: 2mm;
  right: 2mm;
  bottom: 1.2mm;
  display: grid;
  grid-template-columns: 1fr;
  justify-items: stretch;
  gap: 0.6mm;
  padding-top: 0;
}

.print-ticket__footer strong {
  display: inline-block;
  font-size: 14pt;
  color: #0c2445;
  line-height: 1;
  transform: none;
  justify-self: end;
}

.print-ticket__barcode {
  width: 100%;
  display: grid;
  justify-items: start;
  gap: 0;
  justify-self: stretch;
  margin-top: 0.5mm;
}

.print-ticket__barcode-svg {
  width: 42mm;
  max-width: 100%;
}

.print-ticket__barcode svg {
  display: block;
  width: 100%;
  height: 13mm;
}

.print-ticket__barcode-text {
  margin: 0;
  font-size: 7pt;
  line-height: 0.95;
  color: #111111;
  letter-spacing: 0.2px;
}

.print-ticket__healing {
  width: 100%;
  max-width: 100%;
  margin-top: 0.4mm;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-align: left;
  font-size: 7pt;
  line-height: 1.1;
  color: #111111;
}

.print-ticket__healing p {
  margin: 0;
}

.kitchen-status-scan-input {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.kitchen-status-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 1020;
  min-width: 180px;
  max-width: calc(100vw - 32px);
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(18, 26, 38, 0.92);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%) translateY(-8px);
  opacity: 0;
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}

.kitchen-status-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.print-dialog__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  width: 80mm;
}

.print-dialog__actions .action-button {
  min-width: 0;
  padding: 0 6px;
  font-size: 13px;
}

@media print {
  @page {
    size: 80mm 116mm;
    margin: 0;
  }

  html,
  body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  body > * {
    display: none !important;
  }

  .print-dialog__actions,
  .report-dialog__actions {
    display: none !important;
  }

  .print-dialog__dispatch {
    display: none !important;
  }

  body[data-print-mode="ticket"] #printPreviewDialog,
  body[data-print-mode="modify-ticket"] #modifyPrintPreviewDialog,
  body[data-print-mode="report"] #platformHistoryReportDialog,
  body[data-print-mode="history-report"] #historyRecordPrintDialog {
    display: block !important;
  }

  body[data-print-mode="ticket"] #printPreviewDialog,
  body[data-print-mode="modify-ticket"] #modifyPrintPreviewDialog {
    position: static !important;
    inset: auto;
    padding: 0;
    margin: 0;
    background: #ffffff;
    width: 80mm;
    min-width: 80mm;
    max-width: 80mm;
    height: 116mm;
    min-height: 116mm;
    max-height: 116mm;
    overflow: hidden;
    page-break-after: avoid;
    break-after: avoid-page;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog {
    position: static !important;
    inset: auto;
    padding: 0;
    margin: 0;
    background: #ffffff;
    width: 80mm;
    min-width: 80mm;
    max-width: 80mm;
    overflow: visible;
    page-break-after: avoid;
    break-after: avoid-page;
  }

  body[data-print-mode="ticket"] #printPreviewDialog .print-dialog,
  body[data-print-mode="modify-ticket"] #modifyPrintPreviewDialog .print-dialog {
    display: block !important;
    width: 80mm;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog .report-dialog {
    display: block !important;
    width: 80mm;
    margin: 0;
    padding: 0;
  }

  .print-dialog {
    display: block;
    width: 80mm;
    margin: 0;
    padding: 0;
  }

  .print-ticket {
    box-shadow: none;
    border: none;
    width: 80mm;
    height: 116mm;
    min-height: 116mm;
    max-height: 116mm;
    margin: 0;
    padding-left: 2mm;
    padding-right: 2mm;
    overflow: hidden;
    page-break-after: avoid;
    break-after: avoid-page;
  }

  body[data-print-mode="report"] #platformHistoryReportDialog {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    background: #ffffff;
  }

  .report-dialog {
    width: 100%;
  }

  .report-sheet {
    width: 100%;
    min-height: auto;
    padding: 0;
    border: none;
    box-shadow: none;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog .report-sheet {
    width: 80mm;
    min-height: auto;
    padding: 2mm;
    border: none;
    box-shadow: none;
    gap: 0.6mm;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog .report-sheet__header {
    gap: 0.4mm;
    text-align: center;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog .history-print-brand {
    font-size: 11pt;
    line-height: 1;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog .report-sheet__header h2 {
    font-size: 10.5pt;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog .report-sheet__header p,
  body[data-print-mode="history-report"] #historyRecordPrintDialog .report-sheet__footer p {
    font-size: 7.5pt;
    color: #111111;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog #historyRecordPrintStatsTitle {
    font-size: 8pt;
    font-weight: 700;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog #historyRecordPrintStatsLineOne,
  body[data-print-mode="history-report"] #historyRecordPrintDialog #historyRecordPrintStatsLineTwo {
    font-size: 7.5pt;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog #historyRecordPrintOperatorText,
  body[data-print-mode="history-report"] #historyRecordPrintDialog #historyRecordPrintGeneratedText {
    font-size: 6.5pt;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog #historyRecordPrintFootnote {
    display: none;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog .history-print-table-wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    overflow: hidden;
    border: none;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog .report-sheet__table--history-print th,
  body[data-print-mode="history-report"] #historyRecordPrintDialog .report-sheet__table--history-print td {
    padding: 0.8mm 0.6mm;
    font-size: 7pt;
    line-height: 1.05;
    color: #111111;
    text-align: left;
    white-space: nowrap;
    word-break: keep-all;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog .report-sheet__table--history-print th {
    background: transparent;
    border-top: 0.35mm solid #111111;
    border-left: none;
    border-right: none;
    border-bottom: 0.35mm solid #111111;
    white-space: nowrap;
  }

  body[data-print-mode="history-report"] #historyRecordPrintDialog .report-sheet__table--history-print tbody td {
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 0.35mm dashed #111111;
  }
}

@media (max-width: 1180px) {
  .toolbar {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .page-shell {
    padding: 14px;
  }

  .home-actions,
  .home-subactions,
  .platform-home-actions,
  .platform-home-stats,
  .platform-home-digest,
  .platform-history-filters,
  .platform-history-actions,
  .printer-management-toolbar,
  .screen-topbar,
  .toolbar,
  .content-grid,
  .footer-grid,
  .staff-layout,
  .platform-account-layout,
  .printer-management-layout,
  .modify-toolbar,
  .history-toolbar,
  .modify-footer,
  .history-filters,
  .logic-form-grid {
    grid-template-columns: 1fr;
  }

  .modify-toolbar-actions {
    flex-wrap: wrap;
  }

  #modifyScreen .modify-toolbar {
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 10px 12px;
    align-items: center;
  }

  #modifyScreen .modify-toolbar-actions {
    grid-column: 1;
    grid-row: 1;
    flex-wrap: nowrap;
  }

  #modifyScreen .modify-toolbar-copy {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  #modifyScreen .modify-toolbar-right {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: 76px 96px;
    gap: 8px;
    justify-self: end;
    margin-right: 0;
  }

  #modifyScreen .modify-toolbar-button {
    width: 96px;
    min-width: 96px;
    padding: 0 8px;
  }

  #modifyScreen .modify-page-box {
    width: 76px;
    min-width: 76px;
    font-size: 13px;
  }

  .screen-topbar-spacer {
    display: none;
  }

  .screen-topbar-right {
    grid-column: auto;
    margin-right: 0;
  }

  .screen-topbar-copy,
  .history-toolbar-copy {
    grid-column: auto;
  }

  #historyScreen .history-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px 6px;
    align-items: start;
  }

  #historyScreen .history-filters > .field:nth-child(-n + 4) {
    min-width: 0;
  }

  #historyScreen .history-filters > .field:nth-child(-n + 4) label {
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
  }

  #historyScreen .history-filters > .field:nth-child(-n + 4) select {
    min-width: 0;
    padding: 0 8px;
    font-size: 14px;
  }

  #historyScreen .history-filters > .field--button {
    grid-column: 1 / -1;
  }

  #historyScreen .history-filters > .field--button .action-button {
    width: 100%;
  }

  #historyRecordTableHead th,
  #historyRecordTableBody td {
    padding: 8px 6px;
    font-size: 12px;
  }

  #historyRecordTableHead th:nth-child(-n + 6),
  #historyRecordTableBody td:nth-child(-n + 6) {
    padding-left: 4px;
    padding-right: 4px;
  }

  #historyRecordTableHead th:nth-child(1),
  #historyRecordTableBody td:nth-child(1) {
    width: 36px;
    min-width: 36px;
  }

  #historyRecordTableHead th:nth-child(2),
  #historyRecordTableBody td:nth-child(2) {
    width: 40px;
    min-width: 40px;
  }

  #historyRecordTableHead th:nth-child(3),
  #historyRecordTableBody td:nth-child(3),
  #historyRecordTableHead th:nth-child(4),
  #historyRecordTableBody td:nth-child(4) {
    width: 42px;
    min-width: 42px;
  }

  #historyRecordTableHead th:nth-child(5),
  #historyRecordTableBody td:nth-child(5) {
    width: 50px;
    min-width: 50px;
  }

  #historyRecordTableHead th:nth-child(6),
  #historyRecordTableBody td:nth-child(6) {
    width: 52px;
    min-width: 52px;
  }

  #historyRecordTableHead th:nth-child(6) {
    white-space: normal;
    line-height: 1.15;
  }

  .print-dialog__dispatch {
    padding-left: 0;
    padding-right: 0;
  }

  #printerManagementScreen .printer-management-toolbar {
    grid-template-columns: 1fr;
  }

  #printerManagementScreen #printerManagementStoreField {
    grid-column: auto;
  }

  .modify-page-box {
    width: 100%;
  }

  .history-section-head {
    display: grid;
    gap: 6px;
  }

  .history-section-head #historyRecordPrintButton {
    width: 100%;
  }

  .home-big-button {
    min-height: 60px;
    font-size: 20px;
    letter-spacing: 2px;
  }

  .platform-home-button {
    min-height: 60px;
    font-size: 18px;
    letter-spacing: 1px;
  }

  .remark-label,
  .protein-label {
    text-align: left;
  }

  .modify-footer {
    display: grid;
  }

  .logic-footer {
    display: grid;
  }

  #staffScreen .history-toolbar-copy {
    justify-self: stretch;
    text-align: left;
  }

  #staffScreen .screen-topbar-right {
    justify-self: stretch;
  }

  #staffScreen #staffBackHomeButton {
    width: 100%;
    min-width: 0;
  }

  #platformStoreScreen .history-toolbar-copy {
    justify-self: stretch;
    text-align: left;
  }

  #platformStoreScreen .screen-topbar-right {
    justify-self: stretch;
  }

  #platformStoreScreen #platformStoreBackHomeButton {
    width: 100%;
    min-width: 0;
  }

  .platform-store-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .platform-store-toolbar__actions {
    grid-column: 1 / -1;
  }

  .platform-store-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  #modifyRecordTableWrap {
    max-height: calc(100dvh - 250px);
  }

  #historyRecordTableWrap {
    max-height: calc(100dvh - 330px);
  }

  .page-shell {
    padding: 12px;
  }

  .home-panel,
  .store-selection-panel,
  .platform-home-panel,
  .auth-panel,
  .order-panel,
  .modify-panel,
  .history-panel {
    padding: 18px 16px 14px;
  }

  .flavor-row,
  .protein-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .protein-label {
    grid-column: 1 / -1;
    width: auto;
    padding-bottom: 0;
    text-align: left;
    transform: none;
  }

  .field label,
  .mode-box h2,
  .remark-label {
    text-align: left;
  }

  .home-header h1 {
    font-size: 32px;
  }

  #staffScreen .screen-topbar {
    gap: 10px;
  }

  #staffScreen .history-toolbar-copy {
    gap: 4px;
  }

  #staffScreen .history-toolbar-copy h2 {
    font-size: 24px;
  }

  #platformAccountLayout {
    gap: 14px;
  }

  #platformAccountLayout #platformUserEditorTitle {
    font-size: 24px;
  }

  #platformAccountLayout .staff-form-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  #platformAccountLayout .platform-user-form-grid,
  #platformAccountLayout .platform-user-store-controls,
  #platformAccountLayout .platform-user-store-item {
    grid-template-columns: minmax(0, 1fr);
  }

  #platformAccountLayout #platformUserAddStoreButton,
  #platformAccountLayout .platform-user-store-remove-button {
    width: 100%;
    min-width: 0;
  }

  #platformAccountLayout .record-table th,
  #platformAccountLayout .record-table td {
    padding: 9px 10px;
    font-size: 13px;
  }

  #platformAccountLayout .record-table td:last-child {
    min-width: 208px;
    white-space: normal;
  }

  #platformAccountLayout .record-table td:last-child .action-button--mini {
    width: auto;
    min-width: 76px;
    margin: 4px 6px 4px 0;
  }

  #platformStoreScreen .screen-topbar {
    gap: 10px;
  }

  #platformStoreScreen .history-toolbar-copy {
    gap: 4px;
  }

  #platformStoreScreen .history-toolbar-copy h2 {
    font-size: 24px;
  }

  #platformStoreScreen .platform-store-toolbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  #platformStoreScreen .platform-store-toolbar__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  #platformStoreScreen #platformStoreCreateButton {
    grid-column: 1 / -1;
  }

  #platformStoreScreen .platform-store-layout {
    gap: 14px;
  }

  #printerManagementScreen .platform-store-layout {
    gap: 14px;
  }

  #platformStoreScreen .platform-store-form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  #printerManagementScreen .platform-store-form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  #platformStoreScreen .staff-form-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  #printerManagementScreen .staff-form-actions,
  #printerManagementScreen .printer-management-action-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #platformStoreScreen .record-table th,
  #platformStoreScreen .record-table td {
    padding: 9px 10px;
    font-size: 13px;
  }

  #printerManagementScreen .record-table th,
  #printerManagementScreen .record-table td {
    padding: 9px 10px;
    font-size: 13px;
  }

  #platformStoreScreen .record-table td:last-child {
    min-width: 220px;
    white-space: normal;
  }

  #printerManagementScreen .record-table td:last-child {
    min-width: 208px;
  }

  #platformStoreScreen .record-table td:last-child .action-button--mini {
    width: auto;
    min-width: 76px;
    margin: 4px 6px 4px 0;
  }
}

@media (max-width: 720px) {
  .fish-prediction-reasoning-dialog {
    width: 92vw;
    max-height: 82dvh;
    padding: 18px 14px 14px;
  }

  .fish-prediction-reasoning-dialog__text {
    min-height: 52dvh;
    max-height: 62dvh;
    padding: 12px;
    font-size: 14px;
    line-height: 1.6;
  }

  #historyScreen .fish-prediction-filters {
    grid-template-columns: minmax(0, 1fr) minmax(96px, 0.56fr);
    gap: 10px;
    align-items: end;
  }

  #historyScreen .fish-prediction-filters .fish-prediction-note-field,
  #historyScreen .fish-prediction-filters .field--button {
    grid-column: 1 / -1;
  }

  #historyScreen .fish-prediction-filters .field--button label {
    display: none;
  }

  #historyScreen .fish-prediction-filters input,
  #historyScreen .fish-prediction-filters select,
  #historyScreen .fish-prediction-filters .action-button {
    height: 40px;
    min-width: 0;
  }

  #editorScreen .screen-topbar-copy,
  #modifyEditorScreen .screen-topbar-copy,
  #modifyEditorScreen .screen-topbar-spacer {
    display: none;
  }

  #editorScreen .editor-topbar,
  #modifyEditorScreen .editor-topbar {
    margin-bottom: 8px;
  }

  #editorScreen .screen-topbar-right {
    grid-column: 2;
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    justify-self: stretch;
    align-items: center;
  }

  #editorScreen .screen-topbar {
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 8px;
  }

  #editorScreen .editor-reset-slot {
    display: flex;
    grid-column: 1;
    width: auto;
    min-width: 0;
    min-height: 34px;
  }

  #editorScreen #editorSecondaryButton {
    width: 100%;
    min-width: 0;
    height: 34px;
    padding: 0 6px;
    font-size: 13px;
    white-space: nowrap;
  }

  #modifyEditorScreen .screen-topbar-right {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    justify-self: stretch;
    align-items: center;
  }

  #editorScreen .editor-topbar .queue-display {
    width: auto;
    min-width: 112px;
    min-height: 34px;
    font-size: 15px;
  }

  #modifyEditorScreen .editor-topbar .queue-display {
    width: auto;
    min-width: 74px;
    min-height: 34px;
    font-size: 15px;
  }

  #editorScreen #editorHomeButton,
  #modifyEditorScreen #modifyEditorBackButton {
    width: 100%;
    min-width: 0;
  }

  #editorScreen .toolbar,
  #modifyEditorScreen .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }

  #editorScreen .toolbar > .field.field--stack {
    gap: 0;
  }

  #editorScreen .toolbar > .field.field--stack label {
    display: none;
  }

  #editorScreen .toolbar > .field--button .action-button {
    height: 40px;
  }

  #editorScreen .toolbar > .field:nth-child(-n + 4) label,
  #modifyEditorScreen .toolbar > .field:nth-child(-n + 4) label {
    font-size: 14px;
    line-height: 1.15;
  }

  #editorScreen .toolbar > .field:nth-child(-n + 4) {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 0 8px;
    align-items: center;
  }

  #editorScreen .toolbar > .field:nth-child(4) {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  #editorScreen .toolbar > .field:nth-child(-n + 4) label {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding-left: 6px;
    text-align: left;
    white-space: normal;
  }

  #editorScreen .toolbar > .field:nth-child(4) label {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    line-height: 1.02;
  }

  #editorScreen .toolbar > .field:nth-child(4) .weight-unit-label {
    display: block;
    line-height: 1;
    padding-left: 0;
    font-size: 0.9em;
    white-space: nowrap;
  }

  #editorScreen .toolbar > .field:nth-child(4) .weight-title {
    display: block;
    padding-left: 0.1em;
  }

  #editorScreen .toolbar > .field:nth-child(-n + 4) input,
  #editorScreen .toolbar > .field:nth-child(-n + 4) select,
  #modifyEditorScreen .toolbar > .field:nth-child(-n + 4) input,
  #modifyEditorScreen .toolbar > .field:nth-child(-n + 4) select {
    height: 36px;
    padding: 0 9px;
    font-size: 14px;
  }

  #editorScreen .order-form {
    gap: 10px;
  }

  #editorScreen .content-grid,
  #modifyEditorScreen .content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 8px 10px;
    align-items: start;
  }

  #editorScreen .left-panel,
  #modifyEditorScreen .left-panel {
    display: contents;
  }

  #editorScreen .right-panel,
  #modifyEditorScreen .right-panel {
    display: grid;
    gap: 12px;
    order: 2;
    grid-column: 1 / -1;
  }

  #editorScreen .mode-box,
  #editorScreen .side-dish-box,
  #editorScreen .option-box,
  #editorScreen .flavor-row,
  #editorScreen .protein-row,
  #modifyEditorScreen .mode-box,
  #modifyEditorScreen .side-dish-box,
  #modifyEditorScreen .option-box,
  #modifyEditorScreen .flavor-row,
  #modifyEditorScreen .protein-row {
    padding: 12px;
    border: 1px solid rgba(135, 118, 89, 0.18);
    border-radius: 10px;
    background: rgba(255, 251, 244, 0.92);
  }

  #editorScreen .mode-box,
  #modifyEditorScreen .mode-box {
    gap: 8px;
    order: 1;
    grid-column: 1 / -1;
  }

  #editorScreen .mode-box {
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 0 10px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  #editorScreen .mode-box h2,
  #modifyEditorScreen .mode-box h2 {
    font-size: 18px;
    text-align: left;
  }

  #editorScreen .mode-box h2 {
    min-height: 38px;
    display: flex;
    align-items: center;
    margin: 0;
    line-height: 1.1;
  }

  #editorScreen .mode-box select {
    height: 36px;
  }

  #editorScreen .side-dish-box,
  #modifyEditorScreen .side-dish-box {
    order: 3;
    grid-column: 1;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 10px;
    width: fit-content;
    max-width: 100%;
    justify-self: start;
  }

  #editorScreen .quantity-row,
  #modifyEditorScreen .quantity-row {
    gap: 8px;
    min-width: 0;
  }

  #editorScreen .qty-select,
  #modifyEditorScreen .qty-select {
    width: 58px;
    min-width: 58px;
  }

  #modifyEditorScreen .qty-select {
    width: 72px;
    min-width: 72px;
    padding-left: 10px;
    padding-right: 10px;
  }

  #editorScreen .option-box,
  #modifyEditorScreen .option-box {
    order: 4;
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    padding: 12px 10px 12px 8px;
    width: calc(100% + 24px);
    max-width: none;
    justify-self: end;
  }

  #editorScreen .option-box {
    transform: translateX(calc(5px - 1em));
  }

  #editorScreen .option-box .checkbox-label,
  #modifyEditorScreen .option-box .checkbox-label {
    justify-self: start;
    white-space: nowrap;
  }

  #editorScreen .option-box__full,
  #modifyEditorScreen .option-box__full {
    grid-column: 1 / -1;
  }

  #editorScreen .option-box__wait-up-pot,
  #modifyEditorScreen .option-box__wait-up-pot {
    transform: translateX(-6px);
  }

  #editorScreen .option-box__left-shift,
  #modifyEditorScreen .option-box__left-shift {
    transform: translateX(-32px);
  }

  #editorScreen .option-box__wait-up-pot input,
  #modifyEditorScreen .option-box__wait-up-pot input {
    flex: 0 0 20px;
    width: 20px;
    min-width: 20px;
    height: 20px;
  }

  #editorScreen .checkbox-label,
  #modifyEditorScreen .checkbox-label {
    min-width: 0;
    font-size: 14px;
    width: 100%;
  }

  #editorScreen .flavor-row,
  #editorScreen .protein-row,
  #modifyEditorScreen .flavor-row,
  #modifyEditorScreen .protein-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 10px;
    align-items: start;
  }

  #editorScreen .protein-label,
  #modifyEditorScreen .protein-label {
    grid-column: 1 / -1;
    width: auto;
    padding-bottom: 0;
    text-align: left;
    transform: none;
    font-size: 18px;
  }

  #editorScreen .field label,
  #editorScreen .remark-label,
  #modifyEditorScreen .field label,
  #modifyEditorScreen .remark-label {
    text-align: left;
  }

  #editorScreen .footer-grid,
  #modifyEditorScreen .footer-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 0;
    align-items: stretch;
  }

  #editorScreen .footer-grid {
    transform: translateX(-4px);
  }

  #editorScreen .remark-label,
  #editorScreen #remark,
  #editorScreen .footer-actions,
  #modifyEditorScreen .remark-label,
  #modifyEditorScreen #modifyRemark,
  #modifyEditorScreen .footer-actions {
    grid-column: auto;
  }

  #editorScreen #remark,
  #modifyEditorScreen #modifyRemark {
    min-height: 88px;
  }

  #editorScreen .footer-actions,
  #modifyEditorScreen .footer-actions {
    display: grid;
    align-self: auto;
  }

  #editorScreen #confirmPot,
  #modifyEditorScreen #modifyConfirmPot {
    height: 56px;
    font-size: 20px;
  }
}

@media (min-width: 480px) and (max-width: 900px) and (pointer: coarse) {
  @supports (-webkit-touch-callout: none) {
    #editorScreen .order-panel,
    #modifyEditorScreen .order-panel {
      padding: 18px 20px 26px;
    }

    #editorScreen .order-form,
    #modifyEditorScreen .order-form {
      gap: 12px;
    }

    #editorScreen .content-grid,
    #modifyEditorScreen .content-grid {
      grid-template-columns: minmax(0, 1fr);
      gap: 10px;
      align-items: stretch;
    }

    #editorScreen .left-panel,
    #modifyEditorScreen .left-panel,
    #editorScreen .right-panel,
    #modifyEditorScreen .right-panel {
      display: grid;
      grid-column: auto;
      order: initial;
      gap: 10px;
    }

    #editorScreen .mode-box,
    #editorScreen .side-dish-box,
    #editorScreen .option-box,
    #editorScreen .flavor-row,
    #editorScreen .protein-row,
    #modifyEditorScreen .mode-box,
    #modifyEditorScreen .side-dish-box,
    #modifyEditorScreen .option-box,
    #modifyEditorScreen .flavor-row,
    #modifyEditorScreen .protein-row {
      width: auto;
      max-width: 100%;
      justify-self: stretch;
      transform: none;
    }

    #editorScreen .mode-box,
    #modifyEditorScreen .mode-box {
      grid-template-columns: 118px minmax(0, 1fr);
    }

    #editorScreen .side-dish-box,
    #modifyEditorScreen .side-dish-box {
      grid-template-columns: repeat(4, max-content);
      gap: 8px 14px;
      justify-content: start;
    }

    #editorScreen .option-box,
    #modifyEditorScreen .option-box {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 8px 12px;
      padding: 10px 12px;
    }

    #editorScreen .option-box__wait-up-pot,
    #modifyEditorScreen .option-box__wait-up-pot,
    #editorScreen .option-box__left-shift,
    #modifyEditorScreen .option-box__left-shift {
      transform: none;
    }

    #editorScreen .flavor-row,
    #editorScreen .protein-row,
    #modifyEditorScreen .flavor-row,
    #modifyEditorScreen .protein-row {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 10px 10px;
      align-items: end;
    }

    #editorScreen .protein-label,
    #modifyEditorScreen .protein-label {
      grid-column: 1 / -1;
      font-size: 18px;
      line-height: 1.15;
    }

    #editorScreen .footer-grid,
    #modifyEditorScreen .footer-grid {
      grid-template-columns: 68px minmax(0, 1fr) 188px;
      gap: 8px 12px;
      align-items: stretch;
      margin-top: 0;
      transform: none;
    }

    #editorScreen .remark-label,
    #modifyEditorScreen .remark-label {
      grid-column: 1;
      align-self: center;
      text-align: right;
    }

    #editorScreen #remark,
    #modifyEditorScreen #modifyRemark {
      grid-column: 2;
      min-height: 60px;
    }

    #editorScreen .footer-actions,
    #modifyEditorScreen .footer-actions {
      grid-column: 3;
      display: grid;
      align-self: stretch;
    }

    #editorScreen #confirmPot,
    #modifyEditorScreen #modifyConfirmPot {
      height: 60px;
      font-size: 21px;
    }
  }
}

@media (orientation: landscape) and (max-height: 520px) and (pointer: coarse) {
  #historyScreen .page-shell {
    align-items: flex-start;
    padding: 6px 8px;
  }

  #historyScreen .history-panel {
    padding: 8px 10px;
    gap: 8px;
  }

  #historyScreen .history-toolbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
  }

  #historyScreen .history-toolbar-copy {
    gap: 2px;
    justify-self: start;
    text-align: left;
  }

  #historyScreen .history-toolbar-copy h2 {
    font-size: 18px;
    line-height: 1.1;
  }

  #historyScreen .history-toolbar-copy p {
    font-size: 12px;
    line-height: 1.15;
  }

  #historyScreen .history-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px 8px;
  }

  #historyScreen .history-filters .field {
    gap: 3px;
  }

  #historyScreen .history-filters label {
    font-size: 12px;
    line-height: 1.1;
  }

  #historyScreen .history-filters input,
  #historyScreen .history-filters select,
  #historyScreen .history-filters .action-button {
    height: 30px;
    padding: 0 8px;
    font-size: 12px;
  }

  #historyScreen .fish-sales-report-filters {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  #historyScreen .fish-sales-report-filters > .field--button {
    grid-column: 1 / -1;
  }

  #historyScreen .fish-sales-report-filters > .field--button label {
    display: none;
  }

  #historyScreen .fish-sales-report-month-field {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    gap: 4px;
  }

  #historyScreen .fish-sales-report-month-field label {
    text-align: left;
  }

  #historyScreen .fish-sales-report-month-field input {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 34px;
  }

  #historyScreen .fish-sales-report-filters > .field--button .action-button {
    width: 100%;
    min-width: 0;
    padding: 0 8px;
  }

  #historyScreen .fish-sales-report-table-wrap .record-table {
    min-width: 408px;
  }

  #historyScreen .fish-sales-report-table-wrap .record-table th,
  #historyScreen .fish-sales-report-table-wrap .record-table td {
    padding: 4px 2px;
    font-size: 12px;
  }

  #historyScreen .history-section {
    gap: 6px;
  }

  .fish-stock-cards,
  .fish-stock-input-grid,
  .fish-prediction-filters,
  .fish-prediction-manual {
    grid-template-columns: 1fr;
  }

  #historyScreen .fish-prediction-reasoning-button {
    justify-self: start;
    width: 96px;
    min-width: 0;
    padding: 0 4px;
    font-size: 11px;
  }

  #historyRecordSummary {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
  }

  #historyRecordTableWrap {
    min-height: 240px;
    max-height: clamp(240px, calc(100dvh - 130px), 320px);
  }

  #historyRecordTableWrap .record-table {
    min-width: 980px;
  }

  #historyRecordTableHead th,
  #historyRecordTableBody td {
    padding: 6px 7px;
    font-size: 12px;
    line-height: 1.2;
  }
}

@media (max-width: 430px) {
  .fish-stock-action-grid {
    gap: 8px;
  }

  .fish-stock-action-panel {
    padding: 10px 8px;
  }

  .fish-stock-input-grid label {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 6px;
    font-size: 12px;
  }

  .fish-stock-action-panel .action-button {
    padding: 0 6px;
    font-size: 13px;
  }

  #staffScreen .history-toolbar-copy h2 {
    font-size: 22px;
  }

  #platformAccountLayout #platformUserEditorTitle {
    font-size: 21px;
  }

  #platformAccountLayout .platform-user-store-box {
    padding: 12px;
  }

  #platformAccountLayout .platform-user-store-controls {
    gap: 10px;
  }

  #platformAccountLayout .record-table td:last-child {
    min-width: 188px;
  }

  #platformStoreScreen .history-toolbar-copy h2 {
    font-size: 22px;
  }

  #platformStoreScreen .platform-store-toolbar__actions {
    grid-template-columns: minmax(0, 1fr);
  }

  #platformStoreScreen #platformStoreCreateButton {
    grid-column: auto;
  }

  #platformStoreScreen .record-table td:last-child {
    min-width: 188px;
  }

  #historyRecordTableHead th,
  #historyRecordTableBody td {
    padding: 7px 5px;
    font-size: 11px;
  }

  #historyRecordTableHead th:nth-child(1),
  #historyRecordTableBody td:nth-child(1) {
    width: 32px;
    min-width: 32px;
  }

  #historyRecordTableHead th:nth-child(2),
  #historyRecordTableBody td:nth-child(2) {
    width: 36px;
    min-width: 36px;
  }

  #historyRecordTableHead th:nth-child(3),
  #historyRecordTableBody td:nth-child(3),
  #historyRecordTableHead th:nth-child(4),
  #historyRecordTableBody td:nth-child(4) {
    width: 38px;
    min-width: 38px;
  }

  #historyRecordTableHead th:nth-child(5),
  #historyRecordTableBody td:nth-child(5),
  #historyRecordTableHead th:nth-child(6),
  #historyRecordTableBody td:nth-child(6) {
    width: 44px;
    min-width: 44px;
  }

  #editorScreen .content-grid,
  #modifyEditorScreen .content-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
    gap: 6px 8px;
  }

  #editorScreen .screen-topbar-right {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 6px;
  }

  #editorScreen .screen-topbar {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 6px;
  }

  #modifyEditorScreen .screen-topbar-right {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 6px;
  }

  #editorScreen .editor-topbar .queue-display {
    min-width: 104px;
    font-size: 14px;
  }

  #editorScreen #editorSecondaryButton {
    height: 34px;
    padding: 0 5px;
    font-size: 13px;
  }

  #modifyEditorScreen .editor-topbar .queue-display {
    min-width: 68px;
    font-size: 14px;
  }

  #editorScreen .toolbar,
  #modifyEditorScreen .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 8px;
  }

  #editorScreen .toolbar > .field.field--stack {
    gap: 0;
  }

  #editorScreen .toolbar > .field.field--stack label {
    display: none;
  }

  #editorScreen .toolbar > .field:nth-child(-n + 4) {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 0 6px;
  }

  #editorScreen .toolbar > .field:nth-child(4) {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  #editorScreen .toolbar > .field:nth-child(-n + 4) label,
  #modifyEditorScreen .toolbar > .field:nth-child(-n + 4) label {
    font-size: 13px;
  }

  #editorScreen .toolbar > .field:nth-child(-n + 4) label {
    min-height: 34px;
    line-height: 1.05;
    padding-left: 5px;
  }

  #editorScreen .toolbar > .field:nth-child(4) label {
    gap: 0;
    line-height: 1;
  }

  #editorScreen .toolbar > .field:nth-child(4) .weight-unit-label {
    padding-left: 0;
    font-size: 0.88em;
    white-space: nowrap;
  }

  #editorScreen .toolbar > .field:nth-child(4) .weight-title {
    padding-left: 0.08em;
  }

  #editorScreen .toolbar > .field:nth-child(-n + 4) input,
  #editorScreen .toolbar > .field:nth-child(-n + 4) select,
  #modifyEditorScreen .toolbar > .field:nth-child(-n + 4) input,
  #modifyEditorScreen .toolbar > .field:nth-child(-n + 4) select {
    height: 34px;
    padding: 0 8px;
    font-size: 13px;
  }

  #editorScreen .order-form {
    gap: 8px;
  }

  #editorScreen .mode-box {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 0 8px;
    padding: 8px 10px;
  }

  #editorScreen .mode-box h2 {
    min-height: 34px;
    font-size: 17px;
  }

  #editorScreen .mode-box select {
    height: 34px;
  }

  #editorScreen .side-dish-box,
  #modifyEditorScreen .side-dish-box {
    grid-template-columns: 1fr;
  }

  #editorScreen .option-box,
  #modifyEditorScreen .option-box {
    gap: 6px 8px;
  }

  .history-meal-summary-card {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 8px 10px;
    padding: 10px 12px;
  }

  .history-meal-summary-card__value {
    font-size: 14px;
  }

  #editorScreen .flavor-row,
  #editorScreen .protein-row,
  #modifyEditorScreen .flavor-row,
  #modifyEditorScreen .protein-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 8px;
  }
}

@media (max-width: 720px) {
  #historyScreen .history-filters.fish-sales-report-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  #historyScreen .history-filters.fish-sales-report-filters .fish-sales-report-month-field {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
    width: 100%;
    min-width: 0;
  }

  #historyScreen .history-filters.fish-sales-report-filters .fish-sales-report-month-field label {
    display: block;
    width: 100%;
    text-align: left;
  }

  #historyScreen .history-filters.fish-sales-report-filters #fishSalesReportDate {
    display: block;
    box-sizing: border-box;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 36px;
  }

  #historyScreen .history-filters.fish-sales-report-filters > .field--button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 720px) {
  #historyScreen .history-record-filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  #historyScreen .history-record-filters .history-date-field,
  #historyScreen .history-record-filters > .field--button {
    grid-column: 1 / -1;
  }

  #historyScreen .history-record-filters input,
  #historyScreen .history-record-filters select,
  #historyScreen .history-record-filters .action-button {
    width: 100%;
    min-width: 0;
  }
}
