/* 叫貨系統 共用元件（門市端、總部端都載）：按鈕、提示、對話框、離線列、標籤
   規則：只用 tokens.css 變數；單一圓角 var(--r)；層次靠 hairline；陰影只給浮層 */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-size: 16px; }
img, svg { max-width: 100%; }
input, select, textarea { font-size: 16px; } /* iOS 小於 16px 會自動放大畫面 */
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.mo-break { overflow-wrap: anywhere; word-break: break-word; }

/* 按鈕（沿用 tokens.css 的 button 基本樣式，這裡加語意類別） */
.mo-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border: 1px solid var(--hair); background: var(--white); color: var(--ink); border-radius: var(--r); font-weight: 500;
  white-space: nowrap; text-decoration: none; cursor: pointer; }
.mo-btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); font-weight: 700; }
.mo-btn.red { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.mo-btn.green { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.mo-btn.ghost { background: transparent; border-color: transparent; }
.mo-btn.block { width: 100%; }
.mo-btn:disabled { opacity: .45; cursor: not-allowed; }

/* 標籤：方角＋框，一律「顏色＋文字」雙重表示 */
.mo-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--hair); border-radius: 3px;
  font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap; background: var(--paper-2); color: var(--ink-2); }
.mo-tag.ok { background: var(--green-wash); border-color: var(--green); color: var(--green); }
.mo-tag.bad { background: var(--red-wash); border-color: var(--red); color: var(--red); }
.mo-tag.warn { background: #F5EAD0; border-color: #C99A2E; color: #7A5A0E; }
.mo-tag.ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* 提示（固定在底部送出列上方，不擋按鈕） */
.mo-toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 90;
  display: flex; flex-direction: column; gap: 8px; width: min(92vw, 480px); pointer-events: none; }
.mo-toast { background: var(--ink); color: var(--paper); padding: 12px 16px; border-radius: var(--r); box-shadow: var(--shadow-md);
  font-size: 16px; line-height: 1.45; overflow-wrap: anywhere; }
.mo-toast.error { background: var(--red); color: #fff; }
.mo-toast.ok { background: var(--green); color: #fff; }

/* 對話框 */
.mo-modal-bg { position: fixed; inset: 0; z-index: 100; background: rgba(28, 28, 28, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.mo-modal { background: var(--white); border-radius: var(--r); box-shadow: var(--shadow-md); width: min(100%, 460px); max-height: calc(100dvh - 32px);
  overflow: auto; padding: 24px; }
.mo-modal-title { font-family: var(--serif); font-size: 22px; margin: 0 0 12px; line-height: 1.35; overflow-wrap: anywhere; }
.mo-modal-body { font-size: 17px; line-height: 1.6; color: var(--ink-2); overflow-wrap: anywhere; }
.mo-modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.mo-modal-actions .mo-btn { min-width: 120px; }

/* 離線列 */
.mo-offline { position: fixed; top: 0; left: 0; right: 0; z-index: 95; background: var(--red); color: #fff; padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top)); font-size: 16px; font-weight: 700; text-align: center; line-height: 1.4; }

/* 落款 */
.mo-sig { display: flex; justify-content: center; padding: 24px 16px; }

/* 載入 */
.mo-loading { padding: 48px 16px; text-align: center; color: var(--ink-2); font-size: 17px; }
.mo-empty { padding: 32px 16px; text-align: center; color: var(--ink-2); font-size: 17px; line-height: 1.6; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
