/* ==========================================================================
   即売会レジ regi.css（オフライン完全動作・外部CDN非依存）
   ========================================================================== */
:root {
  --bg: #090d16;
  --surface: #0f172a;
  --surface-deep: #060a12;
  --surface-soft: #1e293b;
  --border: #1e293b;
  --border-strong: #334155;
  --text: #f8fafc;
  --text-sub: #94a3b8;
  --text-muted: #64748b;
  --amber: #fbbf24;
  --amber-strong: #f59e0b;
  --emerald: #34d399;
  --emerald-bg: #059669;
  --teal: #14b8a6;
  --rose: #fb7185;
  --rose-bg: #9f1239;
  --sky: #38bdf8;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

input, textarea, select {
  user-select: text;
  -webkit-user-select: text;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  overscroll-behavior-y: none;
  overflow-x: clip;
  min-height: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  border: none;
}

button:active:not(:disabled),
.product-card:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.hidden { display: none !important; }
.mono-text { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, monospace; }

/* スクロールバー */
.custom-scroll::-webkit-scrollbar { width: 5px; height: 5px; }
.custom-scroll::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.65); border-radius: 4px; }
.custom-scroll::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.7); border-radius: 4px; }

/* ヘッダー */
.regi-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #881337;
  border-bottom: 1px solid rgba(251, 113, 133, 0.28);
  padding: 7px 10px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  transition: background-color 0.2s;
}
.regi-header.is-synced-room {
  background: #115e59;
  border-bottom-color: rgba(45, 212, 191, 0.3);
}
.regi-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.regi-header-left {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.regi-brand-badge {
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fde68a;
  font-size: 10px;
  font-weight: 900;
  flex-shrink: 0;
  white-space: nowrap;
}
.regi-title {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.btn-regi-id {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--amber);
  color: #090d16;
  font-size: 10.5px;
  font-weight: 900;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.btn-regi-id:hover { background: #fcd34d; }

.regi-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.btn-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.btn-sync-badge:hover { background: rgba(0, 0, 0, 0.48); }
.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sync-dot.local { background: #94a3b8; }
.sync-dot.ok { background: #34d399; }
.sync-dot.pending { background: #fbbf24; animation: pulseDot 1.1s infinite; }
.sync-dot.offline { background: #fb7185; }
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(1.35); }
}

.btn-admin-open {
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--amber-strong);
  color: #090d16;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
}
.btn-admin-open:hover { background: var(--amber); }

/* トースト通知 */
.toast-container {
  position: fixed;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 92%;
  max-width: 420px;
}
.toast-item {
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  transition: opacity 0.22s;
  text-align: center;
}
.toast-item.info { background: #059669; color: #ffffff; border-color: #34d399; }
.toast-item.warn { background: #f59e0b; color: #090d16; border-color: #fde68a; }
.toast-item.error { background: #e11d48; color: #ffffff; border-color: #fda4af; }

/* メインレイアウト */
.regi-main {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 8px 28px;
}
.regi-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
@media (min-width: 768px) {
  .regi-main { padding: 12px 12px 24px; }
  .regi-grid {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    gap: 12px;
  }
  .regi-left-col {
    position: sticky;
    top: 52px;
  }
}

/* 左カラム：POSパネル */
.pos-panel {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* 合計 / お預かり / お釣りバー */
.summary-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  background: var(--surface-deep);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  margin-bottom: 9px;
}
.summary-cell { min-width: 0; }
.summary-cell.divider {
  border-left: 1px solid var(--border);
  padding-left: 10px;
}
.summary-cell.right { text-align: right; }
.summary-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-sub);
  margin-bottom: 3px;
  white-space: nowrap;
}
.summary-value {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.summary-value.price { color: #ffffff; }
.summary-value.deposit { color: var(--amber); }
.summary-value.change { color: var(--emerald); }
.summary-value.shortage { color: var(--rose); font-size: 16px; }

@media (min-width: 768px) {
  .summary-bar { padding: 18px 12px; }
  .summary-label { font-size: 12.5px; }
  .summary-value { font-size: 28px; }
  .summary-value.shortage { font-size: 19px; }
}

/* 金種ボタン（特大2段） */
.cash-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.cash-row-top {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.btn-cash {
  padding: 18px 2px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 900;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}
.btn-cash:hover { background: #334155; }
.btn-cash.bill {
  color: #fcd34d;
  border-color: #475569;
}
.cash-row-bottom {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 6px;
}
.btn-exact {
  padding: 13px 8px;
  border-radius: 11px;
  background: rgba(17, 94, 89, 0.85);
  border: 1px solid rgba(45, 212, 191, 0.55);
  color: #99f6e4;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.btn-exact:hover { background: #0f766e; }
.btn-clear-dep {
  padding: 13px 8px;
  border-radius: 11px;
  background: rgba(136, 19, 55, 0.78);
  border: 1px solid rgba(251, 113, 133, 0.45);
  color: #fecdd3;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.btn-clear-dep:hover { background: #9f1239; }

@media (min-width: 768px) {
  .btn-cash { padding: 28px 4px; font-size: 16px; }
  .btn-exact, .btn-clear-dep { padding: 17px 10px; font-size: 15px; }
}

/* 3段固定カート枠 */
.cart-section { margin-bottom: 9px; }
.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--text-sub);
  margin-bottom: 4px;
  padding: 0 2px;
}
.cart-fixed-box {
  height: 118px;
  min-height: 118px;
  max-height: 118px;
  overflow-y: auto;
  background: rgba(6, 10, 18, 0.92);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
}
@media (min-width: 768px) {
  .cart-fixed-box {
    height: 132px;
    min-height: 132px;
    max-height: 132px;
  }
}
.cart-items-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}
.cart-empty {
  grid-column: 1 / -1;
  height: 98px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}
.cart-chip {
  height: 33px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}
.cart-chip.multi {
  border-color: var(--amber);
  background: rgba(120, 53, 15, 0.35);
}
.cart-chip-name {
  font-size: 10.5px;
  font-weight: 900;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cart-chip-qty {
  padding: 1px 6px;
  border-radius: 5px;
  background: #0284c7;
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 900;
  flex-shrink: 0;
}
.cart-chip.multi .cart-chip-qty {
  background: var(--amber);
  color: #090d16;
}

/* 下部アクションボタン */
.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.btn-act {
  padding: 15px 8px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  font-size: 14px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.btn-act:hover { background: #334155; }
.btn-act.clear { color: #e2e8f0; }
.btn-act.undo { color: #fcd34d; }

.btn-checkout {
  grid-column: 1 / -1;
  padding: 20px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, #059669 0%, #0d9488 100%);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #ffffff;
  font-size: 17px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.35);
}
.btn-checkout:hover { filter: brightness(1.08); }
.checkout-sub-badge {
  font-size: 11px;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.28);
  padding: 3px 8px;
  border-radius: 6px;
}
@media (min-width: 768px) {
  .btn-act { padding: 18px 10px; font-size: 15px; }
  .btn-checkout { padding: 22px 14px; font-size: 18px; }
}

/* 右カラム：商品グリッド */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
@media (min-width: 640px) {
  .product-grid { gap: 9px; }
}
.product-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  min-width: 0;
  touch-action: manipulation;
}
.product-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border-strong);
  background: var(--surface-soft);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.32);
}
.product-card.is-selected .product-thumb-wrap {
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45);
}
.product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-card.is-soldout .product-thumb-img,
.product-card.is-soldout .product-placeholder {
  filter: grayscale(100%);
  opacity: 0.38;
}
.product-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  color: rgba(148, 163, 184, 0.42);
  font-size: 28px;
  font-weight: 900;
}

/* 新作コーナーリボン */
.ribbon-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 48px;
  overflow: hidden;
  pointer-events: none;
  z-index: 15;
}
.ribbon {
  position: absolute;
  top: 9px;
  left: -17px;
  width: 66px;
  padding: 1.5px 0;
  background: linear-gradient(135deg, #ff2a2a 0%, #c80000 100%);
  color: #ffffff;
  font-size: 9px;
  font-weight: 900;
  text-align: center;
  transform: rotate(-45deg);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  letter-spacing: 0.05em;
  border-top: 1px solid rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid rgba(0, 0, 0, 0.4);
}

/* カート個数バッジ */
.qty-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 20;
  padding: 2px 7px;
  border-radius: 99px;
  background: var(--amber);
  color: #090d16;
  font-size: 11px;
  font-weight: 900;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(0, 0, 0, 0.3);
}

/* 中央タイトル帯 */
.title-band {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10, 15, 28, 0.88);
  backdrop-filter: blur(2px);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  padding: 4px 4px;
  text-align: center;
  z-index: 10;
}
.title-band-name {
  font-size: 10.5px;
  font-weight: 900;
  color: #ffffff;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (min-width: 640px) {
  .title-band-name { font-size: 11.5px; }
}
.gacha-pill {
  display: inline-block;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--amber);
  color: #090d16;
  font-size: 8.5px;
  font-weight: 900;
}

/* 在庫バッジ */
.stock-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  z-index: 20;
  padding: 1.5px 6px;
  border-radius: 5px;
  font-size: 9.5px;
  font-weight: 900;
}
.stock-badge.normal {
  background: rgba(23, 37, 84, 0.94);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.stock-badge.low {
  background: rgba(120, 53, 15, 0.95);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.5);
}
.stock-badge.gacha {
  background: rgba(15, 23, 42, 0.92);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.45);
}
.stock-badge.soldout {
  background: #881337;
  color: #fecdd3;
  border: 1px solid rgba(251, 113, 133, 0.45);
}

.soldout-overlay {
  position: absolute;
  inset: 0;
  z-index: 22;
  background: rgba(0, 0, 0, 0.68);
  display: flex;
  align-items: center;
  justify-content: center;
}
.soldout-stamp {
  padding: 3px 8px;
  border-radius: 6px;
  background: #be123c;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  border: 1px solid rgba(255, 255, 255, 0.3);
  transform: rotate(-12deg);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
}

.product-price {
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 900;
  color: #f1f5f9;
}
.product-card.is-selected .product-price { color: var(--amber); }
@media (min-width: 640px) {
  .product-price { font-size: 14px; }
}

/* ==========================================================================
   モーダル（管理・設定 / 合言葉）
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.modal-dialog {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  width: 100%;
  max-width: 780px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
}
.modal-dialog.modal-sm { max-width: 400px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface-deep);
  border-bottom: 1px solid var(--border);
}
.modal-head-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: #ffffff;
}
.modal-status-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
}
.modal-status-pill.ok { background: #022c22; color: #6ee7b7; border-color: #065f46; }
.modal-status-pill.warn { background: #451a03; color: #fcd34d; border-color: #b45309; }

.btn-modal-close {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 900;
  flex-shrink: 0;
}
.btn-modal-close:hover { background: #334155; }

.modal-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: rgba(6, 10, 18, 0.65);
  border-bottom: 1px solid var(--border);
}
.modal-tab {
  padding: 10px 4px;
  background: transparent;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 800;
  border-bottom: 2px solid transparent;
}
.modal-tab.active {
  color: var(--amber);
  border-bottom-color: var(--amber);
  font-weight: 900;
}

.modal-body {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 管理画面内のカード・フォーム */
.admin-card {
  background: var(--surface-deep);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}
.admin-card-title {
  font-size: 13px;
  font-weight: 900;
  color: #ffffff;
  margin: 0 0 6px;
}
.admin-card-title.amber { color: #fcd34d; }
.admin-card-title.sky { color: #7dd3fc; }
.admin-card-title.emerald { color: #6ee7b7; }
.admin-desc {
  margin: 0 0 10px;
  font-size: 11.5px;
  color: var(--text-sub);
  line-height: 1.6;
}
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-toolbar-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* 汎用ボタン */
.btn-primary-emerald {
  padding: 8px 13px;
  border-radius: 8px;
  background: #059669;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.btn-primary-emerald:hover { background: #10b981; }
.btn-primary-amber {
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--amber-strong);
  color: #090d16;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.btn-primary-amber:hover { background: var(--amber); }
.btn-primary-sky {
  padding: 8px 13px;
  border-radius: 8px;
  background: #0369a1;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.btn-primary-sky:hover { background: #0284c7; }
.btn-sub {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.btn-sub:hover { background: #334155; }
.btn-danger-soft {
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(136, 19, 55, 0.72);
  border: 1px solid rgba(251, 113, 133, 0.4);
  color: #fecdd3;
  font-size: 11.5px;
  font-weight: 800;
}
.btn-danger-soft:hover { background: #9f1239; }

.file-label { cursor: pointer; }

/* 入力欄 */
.field-group { margin-bottom: 10px; }
.field-group:last-child { margin-bottom: 0; }
.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  color: #cbd5e1;
  margin-bottom: 4px;
}
.field-input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}
.field-input:focus {
  outline: none;
  border-color: var(--amber);
}
.input-row {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.input-row .field-input { flex: 1; min-width: 160px; }
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 600px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .field-input, .stock-input { font-size: 16px !important; }
}

/* 商品編集行 */
.stock-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stock-row {
  background: var(--surface-deep);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stock-row.is-dragging { opacity: 0.45; border-style: dashed; border-color: var(--amber); }
.stock-row-main {
  display: flex;
  align-items: center;
  gap: 9px;
}
.drag-handle {
  cursor: grab;
  color: var(--text-muted);
  font-size: 17px;
  font-weight: 900;
  padding: 6px 3px;
  flex-shrink: 0;
}
.drag-handle:hover { color: var(--amber); }
.stock-thumb-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  width: 54px;
}
.stock-thumb {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 18px;
}
.btn-mini-img {
  width: 100%;
  text-align: center;
  padding: 3px 2px;
  border-radius: 5px;
  background: #0369a1;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 900;
  cursor: pointer;
}
.stock-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stock-fields-top,
.stock-fields-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.stock-idx {
  font-size: 10.5px;
  font-weight: 900;
  color: var(--text-sub);
}
.stock-input {
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 800;
}
.stock-input.name { width: 155px; max-width: 100%; }
.stock-input.price { width: 82px; color: #fcd34d; }
.stock-input.qty { width: 68px; color: #7dd3fc; }
.chk-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.chk-inline.rose { color: #fda4af; }
.chk-inline.amber { color: #fcd34d; }
.stock-lbl { font-size: 11px; color: var(--text-sub); font-weight: 700; }

.stock-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}
.btn-xs {
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--border-strong);
  color: #e2e8f0;
  font-size: 10.5px;
  font-weight: 900;
}
.btn-xs:hover { background: #334155; }
.btn-xs.amber { color: #fcd34d; }
.btn-xs.rose { background: rgba(136, 19, 55, 0.65); border-color: rgba(251, 113, 133, 0.4); color: #fecdd3; }
.btn-xs.save { background: var(--amber-strong); border-color: var(--amber-strong); color: #090d16; padding: 4px 10px; }

/* 売上KPI・集計テーブル */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.kpi-card {
  background: var(--surface-deep);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
}
.kpi-label { font-size: 10.5px; font-weight: 800; color: var(--text-sub); }
.kpi-value { font-size: 20px; font-weight: 900; color: #ffffff; margin-top: 2px; }
.kpi-value.amber { color: var(--amber); }
.kpi-value.emerald { color: var(--emerald); }

.summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.summary-table th, .summary-table td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.summary-table th { color: var(--text-sub); font-size: 11px; font-weight: 800; }
.summary-table td.num, .summary-table th.num { text-align: right; font-weight: 800; }
.summary-table tr:last-child td { border-bottom: none; }

.sales-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sale-row {
  background: var(--surface-deep);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sale-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-sub);
  font-weight: 700;
}
.sale-regi-pill {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-soft);
  color: #fcd34d;
  font-weight: 900;
}
.sale-summary {
  font-size: 12px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 2px;
  word-break: break-word;
}
.sale-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sale-total {
  font-size: 14px;
  font-weight: 900;
  color: var(--emerald);
}

/* 共有ルーム表示 */
.room-active-box {
  background: rgba(17, 94, 89, 0.25);
  border: 1px solid rgba(45, 212, 191, 0.45);
  border-radius: 12px;
  padding: 12px;
}
.room-id-pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 7px;
  background: var(--surface-deep);
  border: 1px solid var(--border-strong);
  color: #5eead4;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  word-break: break-all;
}
.room-url-box {
  margin: 8px 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-deep);
  border: 1px solid var(--border);
  font-size: 11px;
  color: #cbd5e1;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
}
.advanced-details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-deep);
}
.advanced-details summary {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #cbd5e1;
  cursor: pointer;
}
.advanced-details-body {
  padding: 0 12px 12px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.notice-banner {
  padding: 9px 11px;
  border-radius: 9px;
  background: rgba(120, 53, 15, 0.32);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
  font-size: 11.5px;
  line-height: 1.6;
  margin-bottom: 10px;
}

.passcode-desc {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.6;
}
.error-text {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--rose);
}
.modal-footer-btns {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.empty-msg {
  text-align: center;
  padding: 20px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.settings-footer-links {
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  padding-top: 4px;
}
.settings-footer-links a {
  color: var(--sky);
  text-decoration: none;
  font-weight: 700;
}
