@font-face {
  font-family: "Makoto Display JP";
  src: url("/order-management-demo/fonts/kaisei-opti-menu-700.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  --ui-canvas: #f3f7f5;
  --ui-surface: #ffffff;
  --ui-text: #17364a;
  --ui-muted: #5f6f78;
  --ui-brand: #17485d;
  --ui-operation: #287d70;
  --ui-warning: #a66c13;
  --ui-urgent: #b84e42;
  --ui-border: #d8e4e0;
  color-scheme: light;
}

html {
  background: var(--ui-canvas);
}

body {
  margin: 0;
  background: var(--ui-canvas);
  color: var(--ui-text);
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt" 1;
  font-size: 17px;
  line-height: 1.65;
}

#root button {
  font-size: 16px;
}

#root [class~="text-xs"] { font-size: 13px !important; }
#root [class~="text-sm"] { font-size: 15px !important; }
#root [class~="text-base"] { font-size: 17px !important; }
#root [class~="text-lg"] { font-size: 20px !important; }
#root [class~="text-xl"] { font-size: 22px !important; }
#root [class~="text-2xl"] { font-size: 27px !important; }
#root [class~="text-3xl"] { font-size: 34px !important; }
#root [class~="text-4xl"] { font-size: 40px !important; }

#root .overflow-x-auto,
#root .overflow-x-scroll {
  -webkit-overflow-scrolling: touch;
}

#root [role="dialog"],
#root .fixed.inset-0 > div[class*="bg-white"] {
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  overscroll-behavior: contain;
}

/*
 * Order detail / fulfilment editor
 *
 * The editor is rendered by the production bundle, which uses a fixed
 * backdrop, a flex column panel, one scrolling body, and a footer.  The
 * broad dialog rule above used to turn the panel itself into a second scroll
 * container.  On iOS Safari that combination (nested scrolling + the dynamic
 * toolbar viewport) can leave the visual panel and the hit-test coordinate
 * system a few pixels apart.  Keep the backdrop and panel in the viewport's
 * own coordinate system and make only the body scroll.
 */
#root #order-preview-modal-wrapper {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  max-height: none !important;
  box-sizing: border-box;
  margin: 0 !important;
  padding: max(0.5rem, env(safe-area-inset-top))
    max(0.5rem, env(safe-area-inset-right))
    max(0.5rem, env(safe-area-inset-bottom))
    max(0.5rem, env(safe-area-inset-left)) !important;
  overflow: hidden !important;
  overscroll-behavior: none !important;
  /* Keep the backdrop tappable without disabling touch actions on an
   * ancestor of the scrollable panel. On iOS the effective touch-action is
   * the intersection of ancestors, so disabling it here would also suppress
   * vertical scrolling inside the editor. The backdrop itself cannot scroll
   * because its overflow is hidden and the body is scroll-locked by the
   * bundle. */
  touch-action: manipulation;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#root #order-preview-modal-wrapper > .screen-content {
  position: relative !important;
  width: min(100%, 56rem) !important;
  height: min(94%, 56rem) !important;
  max-height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex: 0 1 auto !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transform: none !important;
  contain: layout paint;
  touch-action: pan-y;
}

#root #order-preview-modal-wrapper > .screen-content > .overflow-y-auto {
  position: relative !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding-bottom: 1rem !important;
}

#root #order-preview-modal-wrapper > .screen-content > .bg-slate-50\/95 {
  position: relative !important;
  z-index: 2;
  flex: 0 0 auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding-bottom: 1rem !important;
  touch-action: manipulation;
}

#root #order-preview-modal-wrapper input[type="checkbox"]:not(.sr-only),
#root #order-preview-modal-wrapper input[type="number"],
#root #order-preview-modal-wrapper button,
#root #order-preview-modal-wrapper label {
  touch-action: manipulation;
}

#root #order-preview-modal-wrapper input[type="checkbox"]:not(.sr-only) {
  position: relative;
  z-index: 1;
  min-width: 1.5rem;
  min-height: 1.5rem;
}

/* The inventory-deduction switch is a styled peer control. Its native input
 * must remain visually hidden; only the decorative switch is visible. */
#root #order-preview-modal-wrapper input[type="checkbox"].sr-only.peer {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  min-width: 1px !important;
  min-height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#root #order-preview-modal-wrapper .overflow-x-auto {
  position: relative;
  z-index: 0;
  overflow-x: auto !important;
  overflow-y: visible !important;
  -webkit-overflow-scrolling: touch;
}

#root #order-preview-modal-wrapper .overflow-x-auto table {
  position: relative;
  border-collapse: separate;
  border-spacing: 0;
}

#root .ui-delivery-note-status {
  margin: 0 0 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #fff;
  color: #334155;
  font-size: 0.9375rem;
}

#root .ui-delivery-note-status__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.375rem;
}

#root .ui-delivery-note-status__heading > span,
#root .ui-procurement-chip {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.2rem 0.625rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
}

#root .ui-delivery-note-status__heading .is-issued,
#root .ui-procurement-chip--received {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

#root .ui-delivery-note-status__heading .is-unissued,
#root .ui-procurement-chip--waiting {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

#root .ui-delivery-note-status__heading .is-unprepared,
#root .ui-procurement-chip--disabled {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #64748b;
}

#root .ui-delivery-note-status__details {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.2rem 0.75rem;
  margin: 0.5rem 0 0;
}

#root .ui-delivery-note-status__details dt {
  color: #64748b;
  font-weight: 700;
}

#root .ui-delivery-note-status__details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

#root .ui-procurement-action {
  display: flex;
  align-items: stretch;
}

#root .ui-procurement-add,
#root .ui-procurement-resync,
#root .ui-delivery-note-action {
  min-height: 44px;
  touch-action: manipulation;
}

#root .ui-procurement-resync {
  width: 100%;
  cursor: pointer;
  justify-content: flex-start;
  text-align: left;
}

#root .ui-procurement-resync:disabled {
  cursor: wait;
  opacity: 0.6;
}

#root .ui-procurement-add {
  width: 100%;
  padding: 0.5rem 0.625rem;
  border: 1px solid #f59e0b;
  border-radius: 0.625rem;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.25;
  text-align: left;
}

#root .ui-procurement-add:hover {
  background: #fef3c7;
}

#root .ui-procurement-add:disabled {
  cursor: wait;
  opacity: 0.6;
}

/* The small administrator-note editor can be opened from inside the main
 * modal. Give it the same viewport anchoring so it cannot inherit a stale
 * scroll offset from the parent editor. */
#root .modal-overlay {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  max-height: none !important;
  box-sizing: border-box;
  margin: 0 !important;
  padding: max(0.5rem, env(safe-area-inset-top))
    max(0.5rem, env(safe-area-inset-right))
    max(0.5rem, env(safe-area-inset-bottom))
    max(0.5rem, env(safe-area-inset-left)) !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  touch-action: pan-y;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

#root .modal-overlay > .bg-white {
  position: relative !important;
  width: min(100%, 32rem) !important;
  max-height: 100% !important;
  margin: auto !important;
  overflow: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

@media (max-width: 640px) {
  #root #order-preview-modal-wrapper {
    align-items: stretch !important;
  }

  #root #order-preview-modal-wrapper > .screen-content {
    width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 1rem !important;
  }

  #root #order-preview-modal-wrapper > .screen-content > .overflow-y-auto {
    padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right)) !important;
  }

  #root #order-preview-modal-wrapper > .screen-content > .bg-slate-50\/95 {
    padding-inline: max(1rem, env(safe-area-inset-left)) max(1rem, env(safe-area-inset-right)) !important;
  }

  #root .ui-delivery-note-status {
    padding: 0.75rem;
  }

  #root .ui-delivery-note-status__details {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }

  #root .ui-delivery-note-status__details dd + dt {
    margin-top: 0.4rem;
  }

  #root .ui-procurement-add,
  #root .ui-procurement-resync,
  #root .ui-delivery-note-action {
    min-height: 2.75rem;
  }
}

@media (max-width: 420px) {
  #root #order-preview-modal-wrapper > .screen-content > .bg-slate-50\/95 {
    gap: 0.5rem !important;
  }

  #root #order-preview-modal-wrapper > .screen-content > .bg-slate-50\/95 > div:last-child {
    width: 100%;
  }

  #root #order-preview-modal-wrapper > .screen-content > .bg-slate-50\/95 button,
  #root #order-preview-modal-wrapper > .screen-content > .bg-slate-50\/95 label {
    min-height: 2.75rem;
  }
}

/*
 * Printing uses a detached snapshot (body > #delivery-note-print-root), so
 * no app ancestor can clip it with the editor's fixed viewport or scroll
 * containers.  The original modal rules remain as a defensive fallback for
 * browsers that print before the snapshot is attached; they never affect the
 * on-screen editor because this block is print-only.
 */
#delivery-note-print-root {
  display: none;
}

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  html,
  body {
    visibility: hidden !important;
    width: auto !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }

  /* The app shell, including the detail/edit modal, is not printable. */
  body > *:not(#delivery-note-print-root) {
    display: none !important;
    visibility: hidden !important;
  }

  body > #delivery-note-print-root {
    position: static !important;
    inset: auto !important;
    display: block !important;
    visibility: visible !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    color: #000 !important;
  }

  body > #delivery-note-print-root,
  body > #delivery-note-print-root * {
    visibility: visible !important;
  }

  body > #delivery-note-print-root #printable-area {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #fff !important;
    color: #000 !important;
  }

  body > #delivery-note-print-root #printable-area > * {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body > #delivery-note-print-root #printable-area .screen-content,
  body > #delivery-note-print-root #printable-area .modal-overlay,
  body > #delivery-note-print-root #printable-area .no-print {
    display: none !important;
    visibility: hidden !important;
  }

  body > #delivery-note-print-root #printable-area tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  body > #delivery-note-print-root #printable-area .page-break {
    break-before: page;
    page-break-before: always;
    display: block !important;
  }

  /* Defensive fallback for a print invocation that predates the snapshot. */
  #root #order-preview-modal-wrapper {
    position: absolute !important;
    inset: auto !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    overflow: visible !important;
    visibility: visible !important;
    background: transparent !important;
    contain: none !important;
    transform: none !important;
  }

  #root #order-preview-modal-wrapper > .screen-content,
  #root #order-preview-modal-wrapper > .modal-overlay,
  #root #order-preview-modal-wrapper > .no-print,
  #root #order-preview-modal-wrapper .screen-content {
    display: none !important;
    visibility: hidden !important;
  }

  #root #order-preview-modal-wrapper #printable-area {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    visibility: visible !important;
    background: #fff !important;
    color: #000 !important;
  }

  #root #order-preview-modal-wrapper #printable-area * {
    visibility: visible !important;
  }

  #root #order-preview-modal-wrapper #printable-area tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

@media (min-width: 640px) {
  #root [class~="sm:text-xs"] { font-size: 13px !important; }
  #root [class~="sm:text-sm"] { font-size: 15px !important; }
  #root [class~="sm:text-base"] { font-size: 17px !important; }
  #root [class~="sm:text-lg"] { font-size: 20px !important; }
  #root [class~="sm:text-xl"] { font-size: 22px !important; }
  #root [class~="sm:text-2xl"] { font-size: 27px !important; }
  #root [class~="sm:text-3xl"] { font-size: 34px !important; }
  #root [class~="sm:text-4xl"] { font-size: 40px !important; }
}

#root :is(input, select, textarea) {
  font-size: 17px !important;
  line-height: 1.5;
}

#root label {
  font-size: 16px !important;
  line-height: 1.55;
}

#root table th {
  font-size: clamp(13px, 1.2vw, 14px) !important;
  line-height: 1.5;
}

#root table td {
  font-size: clamp(14px, 1.25vw, 15px) !important;
  line-height: 1.55;
}

/* The order memo exists only in the order-management route. Keep its fixed
 * trigger inside the mobile viewport and below all modal layers. */
#root .ui-order-memo-fab {
  left: max(0.75rem, env(safe-area-inset-left)) !important;
  bottom: max(0.75rem, env(safe-area-inset-bottom)) !important;
  z-index: 40 !important;
  max-width: calc(100vw - max(1.5rem, env(safe-area-inset-left) + env(safe-area-inset-right)));
}

#root .ui-order-memo-panel {
  width: min(24rem, calc(100vw - 1.5rem)) !important;
  max-width: 100% !important;
  max-height: min(72dvh, 40rem);
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#root .ui-order-memo-panel > textarea {
  height: clamp(7rem, 26dvh, 12rem) !important;
  min-height: 7rem;
  flex: 0 0 auto;
}

#root .ui-account-card__identity {
  min-width: 0 !important;
}

#root .ui-account-card__email {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-height: 600px) {
  #root .ui-order-memo-panel {
    max-height: calc(100dvh - 5rem);
  }

  #root .ui-order-memo-panel > textarea {
    height: 7rem !important;
  }
}

/* Account security panel (available to every authenticated role). */
.ui-password-panel {
  width: min(1240px, calc(100% - 2rem));
  margin: 1.25rem auto 0;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid #c9d9e5;
  border-radius: 16px;
  background: linear-gradient(110deg, #f8fbff, #eef6fc);
  box-shadow: 0 8px 24px rgba(29, 72, 95, 0.08);
}

.ui-password-panel__eyebrow,
.ui-password-modal__eyebrow {
  margin: 0;
  color: #527086;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ui-password-panel__title {
  margin: 0.1rem 0 0;
  color: #183b52;
  font-size: 1.08rem;
  font-weight: 800;
}

.ui-password-panel__copy {
  margin: 0.1rem 0 0;
  color: #5b7180;
  font-size: 0.9rem;
}

.ui-password-panel__button,
.ui-password-submit {
  min-height: 2.75rem;
  border: 0;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  color: #fff;
  background: #1f6b87;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, transform 0.2s ease;
}

.ui-password-panel__button:hover,
.ui-password-submit:hover:not(:disabled) {
  background: #174f66;
  transform: translateY(-1px);
}

.ui-password-modal-open {
  overflow: hidden;
}

.ui-password-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right))
    max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.ui-password-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 29, 43, 0.48);
  touch-action: manipulation;
}

.ui-password-modal__card {
  position: relative;
  width: min(100%, 30rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  border: 1px solid #d5e1e7;
  border-radius: 20px;
  padding: 1.4rem;
  background: #fff;
  box-shadow: 0 24px 80px rgba(14, 40, 58, 0.3);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}

.ui-password-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.ui-password-modal__header h2 {
  margin: 0.15rem 0 0;
  color: #17364a;
  font-family: "Makoto Display JP", "Zen Kaku Gothic New", sans-serif;
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  line-height: 1.3;
}

.ui-password-modal__close {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #d5e1e7;
  border-radius: 999px;
  color: #4e6775;
  background: #f7fafb;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.ui-password-modal__lead {
  margin: 0.8rem 0 1.1rem;
  color: #5c707c;
  font-size: 0.95rem;
}

.ui-password-field {
  margin-top: 1rem;
}

.ui-password-field label {
  display: block;
  margin-bottom: 0.35rem;
  color: #24495e;
  font-size: 0.95rem;
  font-weight: 700;
}

.ui-password-input-row {
  display: flex;
  align-items: stretch;
  border: 1px solid #b8cedb;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.ui-password-input-row:focus-within {
  border-color: #247895;
  box-shadow: 0 0 0 3px rgba(36, 120, 149, 0.16);
}

.ui-password-input-row input {
  min-width: 0;
  flex: 1;
  border: 0 !important;
  outline: 0;
  padding: 0.7rem 0.75rem !important;
  color: #17364a;
  background: transparent;
  font-size: 1rem !important;
}

.ui-password-visibility {
  flex: 0 0 auto;
  border: 0;
  border-left: 1px solid #d5e1e7;
  padding: 0 0.7rem;
  color: #1f6b87;
  background: #f7fbfd;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}

.ui-password-hint {
  margin: 0.3rem 0 0;
  color: #647b89;
  font-size: 0.78rem;
}

.ui-password-message {
  margin: 1rem 0 0;
  border-radius: 9px;
  padding: 0.65rem 0.75rem;
  color: #9a2f2f;
  background: #fff1f1;
  font-size: 0.88rem;
}

.ui-password-message[data-kind="success"] {
  color: #16623f;
  background: #ecfbf2;
}

.ui-password-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.ui-password-cancel {
  min-height: 2.75rem;
  border: 1px solid #c8d7de;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  color: #46616f;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.ui-password-submit:disabled,
.ui-password-panel__button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.ui-master-force-panel {
  border-color: #d9c8a5;
  background: linear-gradient(110deg, #fffdf7, #fff6e5);
}

.ui-master-force-panel .ui-password-panel__eyebrow {
  color: #8a6b2f;
}

.ui-master-force-panel .ui-password-panel__title {
  color: #5d461e;
}

.ui-master-force-panel .ui-password-panel__button {
  background: #8a6425;
}

.ui-master-force-panel .ui-password-panel__button:hover {
  background: #654a1b;
}

.ui-master-force-modal__card {
  width: min(100%, 34rem);
}

.ui-master-force-modal select {
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid #b8cedb;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  color: #17364a;
  background: #fff;
  font-size: 1rem;
}

.ui-master-force-modal select:focus {
  outline: 0;
  border-color: #247895;
  box-shadow: 0 0 0 3px rgba(36, 120, 149, 0.16);
}

.ui-master-force-check {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 1.1rem;
  color: #4f4330;
  font-size: 0.9rem;
  font-weight: 700;
}

.ui-master-force-check input {
  width: 1.2rem !important;
  height: 1.2rem;
  flex: 0 0 auto;
  margin: 0.1rem 0 0 !important;
  accent-color: #8a6425;
}

.ui-master-force-warning {
  margin: 0.35rem 0 0;
  color: #896c37;
  font-size: 0.78rem;
}

@media (max-width: 560px) {
  .ui-password-panel {
    width: calc(100% - 1rem);
    align-items: stretch;
    flex-direction: column;
    padding: 0.9rem;
  }

  .ui-password-panel__button {
    width: 100%;
  }

  .ui-password-modal__card {
    max-height: calc(100dvh - 1rem);
    border-radius: 16px;
    padding: 1.1rem;
  }

  .ui-password-modal__actions > button {
    flex: 1;
  }
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #fff inset !important;
  -webkit-text-fill-color: var(--ui-text) !important;
}

.ui-refreshed-header {
  border-bottom: 1px solid var(--ui-border) !important;
  border-image: none !important;
  box-shadow: 0 1px 2px rgb(23 54 74 / 0.04) !important;
}

.ui-refreshed-header h1 {
  color: var(--ui-text) !important;
  font-size: clamp(1.25rem, 2vw, 1.5rem) !important;
  letter-spacing: -0.015em;
}

.ui-original-header-mark,
.ui-original-brand-title,
.ui-original-menu-photo,
.ui-original-menu-banner,
.ui-original-settings-label {
  display: none !important;
}

.ui-header-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex: 0 0 auto;
}

.ui-brand-title {
  display: none;
  width: min(100%, 560px);
  aspect-ratio: 4 / 1;
}

.ui-brand-title.is-loaded {
  display: block;
}

.ui-brand-title img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 1;
  object-fit: contain;
}

.ui-login {
  background: var(--ui-canvas) !important;
}

.ui-login .ui-brand-title--login {
  width: min(88vw, 460px);
  margin: 0 auto 2rem;
}

.ui-login > div {
  border: 1px solid var(--ui-border);
  box-shadow: 0 10px 30px rgb(23 54 74 / 0.07) !important;
}

.ui-home {
  display: block !important;
  min-height: calc(100vh - 4rem);
  padding: clamp(1rem, 2.6vw, 2rem) max(1rem, env(safe-area-inset-left)) 6rem !important;
  background: var(--ui-canvas) !important;
  color: var(--ui-text);
}

.ui-home > .absolute:first-child {
  position: relative !important;
  inset: auto !important;
  display: flex;
  justify-content: flex-end;
  width: min(1240px, 100%);
  margin: 0 auto 0.35rem;
}

.ui-home > .absolute:first-child button {
  color: var(--ui-muted) !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
}

.ui-home > .absolute:first-child button:hover {
  color: var(--ui-urgent) !important;
  border-color: var(--ui-border) !important;
  background: var(--ui-surface);
}

.ui-home-intro {
  width: min(1240px, 100%) !important;
  margin: 0 auto;
  padding: 0 !important;
}

.ui-home-intro .ui-brand-title--home {
  width: min(82vw, 520px);
  margin: 0 auto 1.25rem;
}

.ui-home-intro > p:first-child {
  display: none !important;
}

.ui-home-intro > p:last-child {
  margin: 1.25rem 0 0 !important;
  color: var(--ui-muted) !important;
  font-size: 1rem !important;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-align: left;
}

.ui-menu-grid {
  width: min(1240px, 100%) !important;
  max-width: none !important;
  margin: 1rem auto 0 !important;
  padding: 0 !important;
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.9rem, 1.7vw, 1.25rem) !important;
  /* A one-card role must not stretch its only menu tile to the remaining
     viewport height. Every grid row is sized by its actual card content. */
  align-items: start;
  align-content: start;
  grid-auto-rows: max-content;
}

.ui-menu-grid[data-primary-card-count="1"] {
  min-height: 0 !important;
  align-content: start;
  grid-auto-rows: max-content;
}

.ui-card-cluster,
.ui-settings-slot {
  display: contents !important;
}

.ui-menu-card {
  --card-accent: #287d70;
  position: relative;
  min-width: 0;
  min-height: 188px;
  margin: 0 !important;
  padding: 22px 22px 22px 26px !important;
  overflow: hidden;
  display: flex !important;
  align-items: center;
  background: var(--ui-surface) !important;
  color: var(--ui-text) !important;
  border: 2px solid color-mix(in srgb, var(--card-accent) 30%, var(--ui-border)) !important;
  border-radius: 20px !important;
  box-shadow:
    0 4px 14px rgb(23 54 74 / 0.055),
    0 0 0 1px color-mix(in srgb, var(--card-accent) 7%, transparent) !important;
  transform: none !important;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease !important;
}

.ui-menu-card[data-accent="navy"] { --card-accent: #234d63; }
.ui-menu-card[data-accent="aqua"] { --card-accent: #258b8a; }
.ui-menu-card[data-accent="amber"] { --card-accent: #a66c13; }
.ui-menu-card[data-accent="blue"] { --card-accent: #376f91; }
.ui-menu-card[data-accent="green"] { --card-accent: #3c7659; }
.ui-menu-card[data-accent="indigo"] { --card-accent: #4c5f91; }
.ui-menu-card[data-accent="slate"] { --card-accent: #63717a; }

.ui-menu-card:hover {
  border-color: color-mix(in srgb, var(--card-accent) 62%, var(--ui-border)) !important;
  box-shadow:
    0 8px 20px rgb(23 54 74 / 0.09),
    0 0 0 1px color-mix(in srgb, var(--card-accent) 11%, transparent) !important;
  transform: translateY(-1px) !important;
}

.ui-menu-card--primary {
  grid-column: 1 / -1;
  align-self: start;
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  flex: 0 0 auto !important;
}

.ui-menu-card--primary.ui-banner-ready {
  min-height: 0;
  height: auto !important;
  aspect-ratio: auto !important;
  padding: 0 !important;
  display: block !important;
  background: #fff !important;
  border-width: 3px !important;
  border-color: color-mix(in srgb, var(--card-accent) 72%, #fff) !important;
  border-radius: 24px !important;
  box-shadow:
    0 12px 30px rgb(23 54 74 / 0.12),
    0 2px 8px rgb(23 54 74 / 0.07) !important;
}

.ui-menu-card--primary.ui-banner-ready:hover,
.ui-menu-card--primary.ui-banner-ready:focus-visible {
  border-color: var(--card-accent) !important;
  box-shadow:
    0 16px 36px rgb(23 54 74 / 0.16),
    0 3px 10px rgb(23 54 74 / 0.08) !important;
}

.ui-menu-card > div {
  width: 100%;
  min-width: 0;
  gap: 20px !important;
}

.ui-menu-card--primary.ui-banner-ready > div {
  display: flex !important;
  flex-direction: column;
  align-items: stretch !important;
  justify-content: flex-start !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  flex: 0 0 auto !important;
  gap: 0 !important;
}

.ui-menu-card__text,
.ui-settings-copy {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.ui-menu-card--secondary h2,
.ui-settings-copy__title {
  margin: 0 !important;
  padding: 0;
  color: var(--ui-brand) !important;
  font-family: "Makoto Display JP", "Kaisei Opti", "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.5rem, 2vw, 1.75rem) !important;
  font-weight: 700 !important;
  letter-spacing: 0.025em;
  line-height: 1.38;
}

.ui-menu-card--secondary p,
.ui-settings-copy__description {
  margin: 0.5rem 0 0 !important;
  color: var(--ui-muted) !important;
  font-family: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", sans-serif;
  font-size: clamp(1rem, 1.35vw, 1.125rem) !important;
  font-weight: 500;
  letter-spacing: 0.012em;
  line-height: 1.65;
}

.ui-menu-button {
  position: relative;
  order: -1;
  display: none;
  width: 100%;
  max-width: none !important;
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: var(--button-ratio);
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: 20px;
  margin: 0 !important;
  pointer-events: none;
  user-select: none;
}

.ui-menu-button.is-loaded {
  display: block;
}

.ui-menu-button img {
  display: block;
  width: 100%;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  aspect-ratio: auto;
  object-fit: contain;
  object-position: center;
  margin: 0 !important;
  pointer-events: none;
}

.ui-menu-card[data-menu-rendering="banner-only"].ui-banner-ready .ui-menu-card__text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ui-menu-photo {
  position: relative;
  display: none;
  width: clamp(112px, 10vw, 128px);
  height: clamp(112px, 10vw, 128px);
  margin-left: auto;
  overflow: hidden;
  flex: 0 0 clamp(112px, 10vw, 128px);
  border-radius: 20px;
  box-shadow:
    0 9px 20px rgb(23 54 74 / 0.14),
    0 2px 6px rgb(23 54 74 / 0.08);
  pointer-events: none;
  user-select: none;
}

.ui-menu-photo.is-loaded {
  display: block;
}

.ui-menu-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgb(255 255 255 / 0.72);
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(23 54 74 / 0.06);
  pointer-events: none;
}

.ui-menu-photo img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.ui-menu-card[data-module="settings"] {
  width: auto !important;
  justify-content: flex-start !important;
  gap: 20px !important;
}

.ui-menu-card[data-module="settings"] .ui-settings-copy {
  order: -1;
  display: flex;
  flex-direction: column;
}

.ui-menu-card > span.absolute {
  display: none !important;
}

.ui-menu-card:focus-visible,
.ui-home button:focus-visible,
.ui-refreshed-header button:focus-visible {
  outline: 3px solid #72aa9f !important;
  outline-offset: 3px !important;
}

@media (max-width: 760px) {
  .ui-home {
    padding-top: 0.75rem !important;
  }

  .ui-home-intro .ui-brand-title--home {
    margin-bottom: 0.75rem;
  }

  .ui-menu-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem !important;
  }

  .ui-menu-card {
    min-height: 148px;
    padding: 16px 16px 16px 18px !important;
  }

  .ui-menu-card--primary.ui-banner-ready {
    min-height: 0;
    height: auto !important;
    padding: 0 !important;
    border-radius: 22px !important;
  }

  .ui-menu-button {
    border-radius: 18px;
  }

  .ui-menu-photo {
    width: clamp(84px, 24vw, 96px);
    height: clamp(84px, 24vw, 96px);
    flex-basis: clamp(84px, 24vw, 96px);
    border-radius: 17px;
    box-shadow:
      0 6px 14px rgb(23 54 74 / 0.13),
      0 2px 4px rgb(23 54 74 / 0.07);
  }

  .ui-home-intro > p:last-child {
    text-align: center;
  }
}

@media (max-width: 420px) {
  .ui-login .ui-brand-title--login {
    margin-bottom: 1.5rem;
  }

  .ui-menu-card,
  .ui-menu-card > div {
    gap: 12px !important;
  }

  .ui-menu-card--secondary h2,
  .ui-settings-copy__title {
    font-size: 1.5rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ui-menu-card:hover {
    transform: none !important;
  }
}
