:root {
  font-family:
    "Noto Sans JP",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-size: 14px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --ink: #161616;
  --action: #242424;
  --action-hover: #404040;
  --canvas: #e9e9e9;
  --surface: #f5f5f5;
  --band: #e0e0e0;
  --field: #fff;
  --line: #c7c7c7;
  --control-line: #888;
  --muted: #555;
  --on-dark-muted: #cfcfcf;
  --red: #a12626;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 360px;
  background: var(--canvas);
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
:is(button, select, input[type="checkbox"]):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.loading {
  margin: 15vh auto;
  text-align: center;
  color: var(--muted);
}
.topbar {
  min-height: 52px;
  background: var(--ink);
  color: #fff;
  border-bottom: 1px solid #383838;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px max(28px, calc((100vw - 1392px) / 2));
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: 17px;
}
.brand small {
  display: block;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--on-dark-muted);
  font-weight: 500;
}
.brand-date {
  margin-left: 6px;
  color: var(--on-dark-muted);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.brand-mark {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 21px;
}
.topbar .brand-mark {
  background: #f0f0f0;
  color: var(--ink);
}
.top-actions,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.top-actions {
  min-width: 0;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px 12px;
}
.header-button {
  padding: 5px 9px;
  border: 1px solid #828282;
  border-radius: 5px;
  color: #fff;
  background: #292929;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.header-button:hover {
  background: var(--action-hover);
}
.sync {
  font-size: 12px;
  color: var(--on-dark-muted);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}
.sync i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #31a879;
}
.sync-error {
  color: #ffb8b8;
}
.sync-error i {
  background: #d84e4e;
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  max-width: 225px;
  min-width: 0;
  white-space: nowrap;
}
.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip small {
  font-weight: 400;
  color: var(--on-dark-muted);
  margin-left: -3px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  background: #414141;
  color: #fff;
  border-radius: 50%;
  font-size: 12px;
}
.text-button,
.plain,
.demo-link {
  background: none;
  border: 0;
  color: var(--muted);
}
.text-button {
  font-size: 12px;
  color: var(--on-dark-muted);
  white-space: nowrap;
}
.text-button:hover {
  color: #fff;
  text-decoration: underline;
}
main {
  max-width: 1392px;
  margin: 0 auto;
  padding: 12px 28px 36px;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0 0 5px;
  font-weight: 700;
}
.muted {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.secondary,
.primary {
  border: 1px solid var(--control-line);
  border-radius: 6px;
  padding: 9px 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 12px;
}
.secondary:hover {
  background: var(--band);
  border-color: var(--muted);
}
.primary {
  background: var(--action);
  color: white;
  border-color: var(--action);
}
.primary:hover {
  background: var(--action-hover);
}
.primary:focus-visible {
  outline-color: var(--ink);
}
.demo-badge {
  color: #835d12;
  background: #fff4d9;
  border-radius: 20px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.notice {
  padding: 13px 16px;
  border: 1px solid #efd2ad;
  background: #fff8ef;
  border-radius: 7px;
  margin: 0 0 10px;
  display: flex;
  gap: 12px;
  color: #845f2b;
  font-size: 12px;
}
.status-tab-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.status-tabs {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--band);
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 4px;
  padding: 4px;
  overflow: auto;
  scrollbar-width: thin;
}
.status-tabs[hidden] {
  display: none;
}
.tab-order-button {
  flex: 0 0 auto;
  padding: 6px 9px;
  white-space: nowrap;
}
#tabOrderDialog {
  width: min(460px, calc(100vw - 24px));
}
.modal-card.tab-order-form {
  width: 100%;
}
.tab-order-list {
  display: grid;
  gap: 5px;
  max-height: 46vh;
  overflow: auto;
  list-style: none;
  margin: 12px 0 8px;
  padding: 3px;
}
.tab-order-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--field);
}
.tab-order-list li[data-drop-position="before"] {
  box-shadow: 0 -2px var(--ink);
}
.tab-order-list li[data-drop-position="after"] {
  box-shadow: 0 2px var(--ink);
}
.tab-order-grip {
  color: var(--muted);
  cursor: grab;
  padding: 4px;
}
.tab-order-list .status-pill {
  white-space: normal;
  overflow-wrap: anywhere;
}
.tab-order-move {
  display: flex;
  flex: 0 0 auto;
  gap: 5px;
  margin-left: auto;
}
.tab-order-move button {
  min-width: 32px;
  min-height: 30px;
  padding: 4px;
}
.tab-order-error:empty {
  display: none;
}
.tab-order-form .modal-actions {
  flex-wrap: wrap;
  margin-top: 10px;
}
.tab-order-form [data-tab-order-reset] {
  margin-right: auto;
  padding-inline: 0;
  text-decoration: underline;
  font-size: 12px;
}
[data-tone] {
  --status-ink: #3f3f3f;
  --status-bg: #e8e8e8;
  --status-accent: #646464;
}
[data-tone="blue"] {
  --status-ink: #1e40af;
  --status-bg: #dceaff;
  --status-accent: #2563eb;
}
[data-tone="amber"] {
  --status-ink: #8a3909;
  --status-bg: #ffedd5;
  --status-accent: #c45b13;
}
[data-tone="purple"] {
  --status-ink: #5b21a6;
  --status-bg: #efe4ff;
  --status-accent: #7c3aed;
}
[data-tone="green"] {
  --status-ink: #166534;
  --status-bg: #dcfce7;
  --status-accent: #15803d;
}
[data-tone="rose"] {
  --status-ink: #9d174d;
  --status-bg: #fce7f3;
  --status-accent: #be185d;
}
[data-tone="red"] {
  --status-ink: #991b1b;
  --status-bg: #fee2e2;
  --status-accent: #b91c1c;
}
[data-tone="teal"] {
  --status-ink: #115e59;
  --status-bg: #ccfbf1;
  --status-accent: #0f766e;
}
.status-tab {
  white-space: nowrap;
  border: 0;
  background: none;
  padding: 8px 14px;
  color: #373737;
  border-radius: 5px;
  display: flex;
  gap: 9px;
  align-items: center;
  font-size: 13px;
}
.status-tab:not(.active):hover {
  background: var(--surface);
}
.status-tab:focus-visible {
  outline-offset: -3px;
}
.status-tab::before,
.status-pill::before {
  content: "";
  background: var(--status-accent);
  border-radius: 50%;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
}
.status-tab b {
  font-size: 11px;
  min-width: 21px;
  background: var(--status-bg);
  color: var(--status-ink);
  padding: 2px 6px;
  border-radius: 12px;
}
.status-tab.active {
  color: #fff;
  background: var(--action);
  font-weight: 700;
}
.status-tab.active::before {
  border: 1px solid var(--status-bg);
  width: 9px;
  height: 9px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
}
.searchbox {
  width: min(440px, 55vw);
  height: 38px;
  border: 1px solid var(--control-line);
  border-radius: 6px;
  background: var(--field);
  display: flex;
  align-items: center;
  padding: 0 10px;
  color: var(--muted);
  gap: 8px;
}
.searchbox > span {
  font-size: 22px;
  line-height: 1;
}
.searchbox input {
  border: 0;
  outline: 0;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--ink);
}
.searchbox:focus-within {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.search-clear {
  flex: 0 0 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
}
.search-clear:hover {
  background: var(--band);
  color: var(--ink);
}
.searchbox kbd {
  font: 10px inherit;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 4px;
  padding: 2px 5px;
}
.result-count {
  font-size: 12px;
  color: var(--muted);
}
.toolbar-right :is(button, .document-pdf) {
  white-space: nowrap;
}
.document-pdf {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}
.document-pdf:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.document-pdf-hint {
  margin: -3px 0 12px;
  line-height: 1.5;
}
.bulkbar {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  background: var(--band);
  border-radius: 6px;
  font-size: 12px;
  color: var(--ink);
}
.bulkbar.shown {
  display: flex;
}
.bulkbar select,
select {
  border: 1px solid var(--control-line);
  background: var(--field);
  border-radius: 5px;
  padding: 7px;
  color: var(--ink);
  font-size: 12px;
}
.bulkbar .primary {
  padding: 7px 11px;
}
.bulk-hint {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 2px 5px #0000000c;
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1210px;
  text-align: left;
}
thead {
  background: var(--action);
  color: #fff;
}
th {
  font-size: 12px;
  font-weight: 600;
  padding: 12px 13px;
  border-bottom: 1px solid #454545;
  white-space: nowrap;
}
th button {
  border: 0;
  background: none;
  color: inherit;
  font-weight: inherit;
  font-size: inherit;
  padding: 0;
}
th button span {
  color: var(--on-dark-muted);
}
td {
  padding: 13px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 13px;
  vertical-align: middle;
}
#listResults th {
  padding-block: 9px;
}
#listResults td {
  padding-block: 10px;
}
.order-total {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
td.order-total {
  font-weight: 600;
}
.order-ship-plan {
  white-space: nowrap;
}
.list-field-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 3px;
  margin: 0 -3px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-weight: inherit;
}
.list-date-button {
  white-space: nowrap;
}
.list-field-button:hover {
  background: var(--band);
  text-decoration: underline;
}
.list-field-button [aria-hidden="true"] {
  color: var(--muted);
}
.order-memo {
  width: 15%;
  min-width: 132px;
  max-width: 220px;
}
.list-memo-button {
  width: 100%;
  justify-content: space-between;
  text-align: left;
}
.list-memo-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.list-memo-preview,
.order-detail-memo {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr:nth-child(even) {
  background: #ededed;
}
.order-row:hover {
  background: var(--band);
}
.order-row:has(.order-check:checked) {
  background: #d7d7d7;
}
.order-row:has(.order-check:checked) td:first-child {
  box-shadow: inset 3px 0 var(--ink);
}
.check-col {
  width: 40px;
  text-align: center;
  padding-left: 14px;
  padding-right: 5px;
}
input[type="checkbox"] {
  accent-color: var(--action);
  width: 15px;
  height: 15px;
}
thead input[type="checkbox"] {
  color: #fff;
}
.order-number {
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--control-line);
  text-underline-offset: 3px;
}
.subline {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.pill {
  display: inline-flex;
  background: var(--band);
  color: var(--ink);
  border-radius: 12px;
  padding: 4px 9px;
  font-size: 10px;
  white-space: nowrap;
}
.pill.light {
  background: var(--band);
  color: var(--muted);
}
.pill.status-pill {
  align-items: center;
  gap: 5px;
  color: var(--status-ink);
  background: var(--status-bg);
  font-weight: 700;
}
.pill.status-pill[hidden] {
  display: none;
}
.status-color-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}
#statusColorMessage {
  margin-bottom: 0;
}
.overdue {
  color: var(--red);
  font-weight: 700;
}
.row-arrow {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 20px;
}
.empty {
  text-align: center;
  padding: 60px 12px;
  color: var(--muted);
}
.empty span {
  display: block;
  font-size: 28px;
  margin-bottom: 9px;
}
.empty b,
.empty small {
  display: block;
}
.empty b {
  color: var(--ink);
  font-size: 13px;
}
.empty small {
  font-size: 11px;
  margin-top: 4px;
}
.list-footer {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 10px;
  padding: 12px 2px;
}
.toast {
  position: fixed;
  z-index: 20;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  background: var(--action);
  color: white;
  border-radius: 7px;
  padding: 11px 17px;
  box-shadow: 0 8px 25px #00000038;
  transition: 0.2s;
  font-size: 12px;
}
.toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
.toast.error {
  background: #a93c3c;
}
dialog {
  border: 0;
  border-radius: 10px;
  padding: 0;
  box-shadow: 0 24px 80px #00000045;
  background: var(--canvas);
  color: var(--ink);
  max-height: 90vh;
}
dialog::backdrop {
  background: #11111180;
  backdrop-filter: blur(2px);
}
.login-card {
  width: min(420px, calc(100vw - 32px));
  padding: 36px 38px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border-top: 5px solid var(--ink);
}
.login-card[hidden],
.login-card [hidden],
#mfaInviteResult[hidden],
#inviteMfa[hidden] {
  display: none;
}
.login-mfa {
  display: grid;
  gap: 8px;
}
.login-mfa details label {
  margin-top: 8px;
}
.login-mfa summary {
  cursor: pointer;
}
.enrollment-qr {
  width: 164px;
  height: 164px;
  justify-self: center;
  object-fit: contain;
  background: #fff;
}
.recovery-codes {
  border: 1px solid #bac2cb;
  border-radius: 6px;
  padding: 12px;
  overflow: auto;
  line-height: 1.6;
}
#mfaInviteResult {
  margin-top: 12px;
}
.login-card .brand-mark {
  margin-bottom: 5px;
}
.login-card h1 {
  font-size: 22px;
  margin: 0;
  color: var(--ink);
}
.login-card label,
.form-grid label,
.shipment-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #333;
  font-size: 12px;
  font-weight: 600;
}
.login-card input,
.form-grid input,
.form-grid select,
.shipment-grid input,
.shipment-grid select,
textarea {
  border: 1px solid var(--control-line);
  border-radius: 5px;
  padding: 10px;
  background: var(--field);
  outline: none;
  color: var(--ink);
  font-size: 13px;
}
:is(.login-card, .form-grid, .shipment-grid, #memoForm, .inline-form, .user-edit-form)
  :is(input, select, textarea):focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.wide {
  width: 100%;
  padding: 11px;
}
.demo-link {
  margin: 0 auto;
  text-decoration: underline;
  font-size: 12px;
}
.form-error {
  font-size: 11px;
  color: var(--red);
  min-height: 16px;
  margin: 0;
}
.modal-card {
  width: min(600px, calc(100vw - 30px));
  padding: 28px;
}
#manageDialog {
  width: min(600px, calc(100vw - 30px));
}
#manageDialog > .modal-card {
  width: 100%;
}
.save-confirmation {
  width: min(380px, calc(100vw - 30px));
  padding: 22px 24px;
  background: var(--surface);
  border-top: 5px solid var(--ink);
}
.save-confirmation h2 {
  margin: 0 0 18px;
  font-size: 17px;
  color: var(--ink);
}
#listEditDialog {
  width: min(370px, calc(100vw - 24px));
}
#listEditDialog.memo-editor {
  width: min(540px, calc(100vw - 24px));
}
.modal-card.list-edit-form {
  width: 100%;
}
.list-edit-form .form-grid {
  grid-template-columns: 1fr;
  margin: 12px 0 7px;
}
.list-edit-form .form-error:empty {
  display: none;
}
.list-edit-form textarea {
  min-height: 125px;
  max-height: 52vh;
  resize: vertical;
}
.list-edit-form textarea:read-only {
  background: var(--surface);
}
.modal-card h2 {
  margin: 0 0 14px;
  font-size: 21px;
}
.modal-card h3 {
  font-size: 13px;
  margin: 18px 0 10px;
}
.close {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}
.modal-card > .close {
  float: right;
}
.inline-form {
  display: flex;
  gap: 8px;
}
.inline-form input {
  flex: 1;
  padding: 9px;
  border: 1px solid var(--control-line);
  border-radius: 5px;
  background: var(--field);
  color: var(--ink);
}
.modal-card section {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  margin-top: 10px;
}
.modal-card section > h3:first-child {
  margin-top: 0;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.mail-settings-grid {
  margin-top: 12px;
}
.mail-settings-hint {
  margin-bottom: 10px;
}
#mailSettingsMessage {
  margin-bottom: 0;
}
.user-edit-form > label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  color: #333;
  font-size: 12px;
  font-weight: 600;
}
.user-edit-form select {
  width: 100%;
  border: 1px solid var(--control-line);
  border-radius: 5px;
  padding: 9px;
  background: var(--field);
  color: var(--ink);
}
.user-edit-actions {
  display: flex;
  gap: 8px;
  margin: 0 0 12px;
}
.danger-button {
  border: 1px solid #e2bcbc;
  border-radius: 5px;
  background: #fff;
  color: #a33c3c;
  padding: 8px 12px;
}
.detail-dialog {
  width: min(920px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
}
.detail-head {
  position: sticky;
  top: 0;
  background: var(--ink);
  color: #fff;
  border-bottom: 1px solid #383838;
  z-index: 2;
  padding: 8px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.detail-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.detail-head h2 {
  margin: 0;
  font-size: 19px;
}
.detail-head .close {
  flex: 0 0 36px;
  height: 36px;
  color: #fff;
  border-radius: 5px;
}
.detail-head .close:hover {
  background: var(--action-hover);
}
.detail-content {
  padding: 12px 16px 18px;
}
.detail-section {
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}
.detail-section:last-child {
  margin-bottom: 0;
}
.detail-section h3 {
  margin: 0 0 10px;
  font-size: 15px;
}
.detail-section h3 small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  margin-left: 8px;
}
.detail-section > .form-grid {
  margin-bottom: 15px;
}
.detail-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.detail-field-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 6px;
}
.copy-button {
  border: 1px solid var(--control-line);
  border-radius: 4px;
  padding: 2px 6px;
  min-height: 24px;
  background: var(--band);
  color: var(--ink);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.copy-button:hover {
  background: #d0d0d0;
}
.detail-head .copy-button {
  background: #343434;
  border-color: #aaa;
  color: #fff;
}
.detail-head .copy-button:hover {
  background: #505050;
}
.detail-dialog .toast {
  width: max-content;
  max-width: calc(100vw - 32px);
}
.detail-content .form-error:empty {
  min-height: 0;
}
.detail-memo-section,
.detail-owner-section {
  padding-block: 10px;
}
.detail-memo-section h3,
.detail-owner-section h3 {
  margin-bottom: 8px;
}
.detail-memo-section {
  background: #fff3d9;
}
.detail-owner-section {
  background: #fbe7e9;
}
.detail-shipment-section {
  background: #e5f0fc;
}
.detail-section.product-details {
  background: #e6f4e9;
}
.detail-history-section {
  background: #eee9f7;
}
.detail-customer-memo {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.detail-customer-memo h4 {
  margin: 0 0 4px;
  font-size: 13px;
}
.detail-memo-section .order-detail-memo {
  margin-block: 0;
}
#memoForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 10px;
}
#memoForm .form-error {
  grid-column: 1 / -1;
}
#memoForm .form-error:not(:empty) {
  margin-top: 6px;
}
#memoForm textarea {
  width: 100%;
  resize: vertical;
  padding: 6px 9px;
}
#editForm .form-grid {
  row-gap: 8px;
  margin-bottom: 10px;
}
#editForm .form-grid input,
#editForm .form-grid select {
  min-height: 34px;
  padding: 6px 9px;
}
.section-title,
.shipment-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title h3 {
  margin: 0;
}
.section-title span {
  font-size: 11px;
  color: var(--muted);
}
.product-table-wrap,
.product-empty {
  margin-top: 10px;
}
.product-table-wrap:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.product-table {
  min-width: 760px;
}
.product-table :is(th, td) {
  padding: 9px 8px;
}
.product-table th small {
  display: block;
  margin-top: 2px;
  color: var(--on-dark-muted);
  font-weight: 400;
}
.product-label {
  min-width: 145px;
  overflow-wrap: anywhere;
}
.product-number {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.product-subtotal {
  font-weight: 700;
}
.product-scroll-hint {
  display: none;
}
.product-totals {
  max-width: 430px;
  margin: 12px 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
  font-size: 13px;
  overflow: hidden;
}
.product-totals > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 11px;
}
.product-totals > div + div {
  border-top: 1px solid var(--line);
}
.product-totals dd {
  margin: 0;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.product-totals .product-grand-total {
  align-items: baseline;
  background: var(--action);
  color: #fff;
  font-weight: 700;
}
.product-grand-total dd {
  font-size: 19px;
}
.product-tax-breakdown {
  margin-top: 7px;
  background: var(--band);
}
.shipment-form {
  padding: 15px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--field);
}
.shipment-plan-form.form-grid {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0 0;
}
.shipment-plan-form .detail-field {
  width: min(210px, 100%);
}
.shipment-form .detail-field :is(input, select) {
  background: var(--surface);
}
.shipment-heading {
  font-size: 13px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 10px;
}
.address {
  color: var(--muted);
  font-size: 11px;
  margin: 7px 0 12px;
}
.shipment-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.shipment-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.mail-button {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.history {
  padding: 0 0 0 18px;
  margin: 6px 0 18px;
  color: var(--muted);
  font-size: 12px;
}
.history li {
  padding: 4px 0;
}
.mail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  background: var(--band);
  padding: 14px;
  border-radius: 6px;
}
.mail-meta div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.mail-meta small {
  color: var(--muted);
  font-size: 10px;
}
.mail-meta b {
  font-size: 12px;
  overflow-wrap: anywhere;
}
.mail-meta span {
  font-size: 11px;
  color: var(--muted);
}
.mail-body {
  padding: 14px 4px 2px;
  font-size: 12px;
  line-height: 1.9;
}
.mail-body p {
  margin: 8px 0;
}
.mail-body ul {
  background: var(--band);
  padding: 9px 10px 9px 28px;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.form-grid :is(input, select):disabled,
.shipment-form .detail-field :is(input, select):disabled {
  background: var(--band);
  color: var(--muted);
  opacity: 1;
}
.login-card {
  margin: 0;
}
.login-card .eyebrow {
  margin-bottom: -10px;
}
@media (max-width: 760px) {
  .topbar {
    padding-inline: 14px;
  }
  .sync {
    display: none;
  }
  .user-chip small {
    display: none;
  }
  main {
    padding: 10px 14px 28px;
  }
  .status-tab {
    padding: 8px 10px;
    font-size: 12px;
  }
  .toolbar {
    gap: 8px;
  }
  .searchbox {
    width: auto;
    flex: 1;
  }
  .searchbox kbd {
    display: none;
  }
  .toolbar-right {
    gap: 7px;
  }
  .bulkbar {
    flex-wrap: wrap;
  }
  .bulk-hint {
    display: none;
  }
  .list-footer {
    font-size: 9px;
  }
  .detail-content {
    padding: 10px 10px 16px;
  }
  .detail-head {
    padding: 6px 15px;
  }
  .form-grid {
    grid-template-columns: 1fr 1fr;
  }
  .shipment-grid {
    grid-template-columns: 1fr 1fr;
  }
  .detail-section {
    padding: 12px;
  }
  .login-card {
    padding: 30px 25px;
  }
}
@media (max-width: 848px) {
  .product-scroll-hint {
    display: block;
    margin-top: 6px;
  }
}
@media (max-width: 460px) {
  .top-actions {
    gap: 4px 6px;
  }
  .header-button,
  .demo-badge {
    padding: 4px 6px;
    font-size: 10px;
  }
  .modal-card {
    padding: 18px;
  }
  #memoForm {
    grid-template-columns: 1fr;
  }
  #memoForm button {
    justify-self: end;
    margin-top: 6px;
  }
  .brand {
    font-size: 15px;
    gap: 7px;
  }
  .brand-date {
    font-size: 10px;
    margin-left: 3px;
  }
  .user-chip {
    font-size: 11px;
    max-width: 110px;
  }
  .user-chip .avatar {
    display: none;
  }
  .text-button {
    font-size: 10px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar .searchbox {
    flex-basis: 100%;
  }
  .toolbar-right {
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 100%;
  }
  .form-grid,
  .shipment-grid {
    grid-template-columns: 1fr;
  }
  .bulkbar select {
    max-width: 150px;
  }
  .bulkbar .primary {
    font-size: 11px;
  }
  .mail-meta {
    grid-template-columns: 1fr 1fr;
  }
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 2px;
  color: var(--muted);
  font-size: 11px;
}
.pagination > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pagination button {
  padding: 6px 10px;
}
.mail-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: inherit;
  line-height: 1.9;
  background: var(--surface);
  border-radius: 6px;
  padding: 15px;
  margin: 12px 0 18px;
  color: var(--ink);
  font-size: 13px;
}
.status-tab b {
  font-weight: 500;
}
