:root {
  color-scheme: light;
  --bg: #efece5;
  --surface: #ffffff;
  --surface2: #f4f4f3;
  --border: rgba(40, 34, 20, .10);
  --accent: #80621f;
  --accent-weak: #fff9cc;
  --accent2: #8a6d2f;
  --text: #1a1a18;
  --text-muted: #6f6a60;
  --text-dim: #777168;
  --gold: #b99653;
  --info: #171719;
  --info-bg: #f1f1f0;
  --success: #171719;
  --success-bg: #f2f2f0;
  --radius: 18px;
  --shadow: 0 9px 24px rgba(40, 34, 20, .10);
  --brand-black: #1a1a18;
  --brand-yellow: #b99653;
  --teal: #1f5c56;
  --teal-hover: #16453f;
}

body {
  background: linear-gradient(160deg, #faf8f4 0%, #efece5 100%);
  background-attachment: fixed;
  color: var(--text);
}

/* 15c の放射光に 19b ダイヤ格子（±45°の極細線、キルティングレザーのステッチ）を重ねる */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 78px;
  gap: 12px;
  padding: 13px max(18px, calc((100% - 1120px) / 2));
  background-color: #15140f;
  background-image:
    radial-gradient(ellipse 420px 180px at 8% 0%, rgba(185, 150, 83, .18), transparent 68%),
    radial-gradient(ellipse 420px 180px at 100% 100%, rgba(185, 150, 83, .12), transparent 68%),
    repeating-linear-gradient(45deg, rgba(185, 150, 83, .12) 0 1px, transparent 1px 14px),
    repeating-linear-gradient(-45deg, rgba(185, 150, 83, .12) 0 1px, transparent 1px 14px);
  border: 0;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}

/* 15c: 内側の細枠＋四隅（左上・右下）のコーナーマーク */
.app-header::before,
.app-header::after {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
}
.app-header::before {
  border: 1px solid rgba(185, 150, 83, .3);
}
.app-header::after {
  background:
    linear-gradient(rgba(185, 150, 83, .6), rgba(185, 150, 83, .6)) top left / 16px 1px no-repeat,
    linear-gradient(rgba(185, 150, 83, .6), rgba(185, 150, 83, .6)) top left / 1px 16px no-repeat,
    linear-gradient(rgba(185, 150, 83, .6), rgba(185, 150, 83, .6)) bottom right / 16px 1px no-repeat,
    linear-gradient(rgba(185, 150, 83, .6), rgba(185, 150, 83, .6)) bottom right / 1px 16px no-repeat;
}
.app-header > * {
  position: relative;
  z-index: 1;
}

.premium-gallery-logo {
  display: block;
  width: min(230px, 46vw);
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
}

.app-header .dot {
  display: none;
}

.app-header h1 {
  color: #fff;
  font-size: 20px;
  letter-spacing: 2.5px;
}

.app-header .sub {
  color: #d7d7d7;
}

.app-header.member-header {
  display: block;
}

.app-header .header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

main,
.container,
.page {
  padding-top: 24px;
}

.panel,
.message,
.itemspanel,
.kpi-card,
.product-card,
.hold-card,
.hold-card-none,
.bulk-import,
form {
  border-color: var(--border) !important;
  background: rgba(255, 255, 255, .88) !important;
  box-shadow: var(--shadow) !important;
}

.panel,
.message,
.itemspanel,
.kpi-card,
.product-card,
.hold-card,
.hold-card-none {
  border-radius: var(--radius) !important;
}

input,
select,
textarea {
  border-color: var(--border);
  background: rgba(255, 255, 255, .92);
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand-yellow) !important;
  box-shadow: 0 0 0 3px rgba(185, 150, 83, .22) !important;
}

/* ══════════════════════════════════════════════
   ボタン方針統一：①その場で完結＝金アウトライン／
   ②画面遷移・データ登録＝ディープティール塗り／③削除・取り下げ＝赤
   ══════════════════════════════════════════════ */
button,
.btn-add,
.btn-reserve,
.bubble-btn {
  border-radius: 4px !important;
}

/* ②画面遷移・データ登録に走るボタン（塗り・ティール） */
.page-newitem-addition .submit,
.page-newitem-addition .bulk-submit,
.page-create-member-card button:not(.sub),
.page-member-card button:not(.sub),
.page-verify-member-card button:not(.secondary),
.modal-btn-submit,
.bubble-btn.reserve,
.page-index .btn-reserve,
.page-index .btn-pending-items,
.page-newitem-addition .btn-pending-items {
  border: none !important;
  border-radius: 4px !important;
  background: var(--teal) !important;
  color: #f3eee2 !important;
  box-shadow: none !important;
}

.page-newitem-addition .submit:hover,
.page-newitem-addition .bulk-submit:hover,
.page-create-member-card button:not(.sub):hover,
.page-member-card button:not(.sub):hover,
.page-verify-member-card button:not(.secondary):hover,
.modal-btn-submit:hover,
.bubble-btn.reserve:hover,
.page-index .btn-reserve:hover,
.page-index .btn-pending-items:hover,
.page-newitem-addition .btn-pending-items:hover {
  background: var(--teal-hover) !important;
}

/* ①その場で完結する操作（金のアウトライン） */
.page-index .tab-button,
.filter-reset,
.modal-btn-cancel,
.page-member-card button.sub,
.page-verify-member-card button.secondary {
  border: 1px solid #d8c48c !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: #8a6d2f !important;
  box-shadow: none !important;
}

.page-index .tab-button.active {
  border-color: var(--brand-yellow) !important;
  background: var(--brand-yellow) !important;
  color: var(--brand-black) !important;
}

.page-index .container {
  max-width: 1120px;
}

.page-index .action-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.page-index .btn-pending-items,
.page-index .btn-reserve {
  width: 100%;
  min-height: 44px;
  padding: 11px 20px;
}

.page-index .section-heading {
  border-color: var(--brand-black);
}

.page-index .section-heading h2,
.sec-title h2,
.page-newitem-addition .bulk-import h2 {
  color: var(--text);
  font-size: 16px;
}

.page-index .items-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.page-index .item-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 13px;
  border: 1px solid var(--border);
  border-left: 3px solid #d8c48c;
  border-radius: 18px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 9px 24px rgba(40, 34, 20, .10);
}

.page-index .item-card.is-sold {
  background: rgba(255, 255, 255, .7) !important;
  opacity: .85;
}

.page-index .section-count {
  background: #efece3 !important;
  border-color: transparent !important;
  color: #8b8578 !important;
}

.page-index .item-image,
.page-index .item-no-image {
  width: 108px;
  min-width: 108px;
  height: 126px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(140deg, #f4f1ea, #e6e1d6);
}

.page-index .btn-change-price {
  border: 1px solid #8a6d2f !important;
  border-radius: 4px !important;
  background: transparent !important;
  color: #8a6d2f !important;
}

.product-price,
.item-price-value,
.td-price,
.kpi-card .k-value,
.hold-amount,
.sb-value,
.page-index .price-original,
.page-index .price-new {
  color: var(--text) !important;
}

.page-index .item-card.is-sold {
  border-left: 3px solid var(--brand-yellow) !important;
}

.page-newitem-addition .bulk-import {
  border: 1px solid #cbb684 !important;
  border-radius: var(--radius) !important;
  background: rgba(255, 255, 255, .88) !important;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .6), 0 9px 24px rgba(40, 34, 20, .08) !important;
}

.page-newitem-addition .bulk-clear {
  background: transparent !important;
  border: 1px solid #d8c48c !important;
  color: #8a6d2f !important;
}

.page-newitem-addition .page {
  max-width: 860px;
}

.page-newitem-addition .hero {
  border-radius: var(--radius);
  background: #f3eee2 !important;
  border: 1px solid #cbb684 !important;
  color: var(--text);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .7), var(--shadow);
}

.page-newitem-addition .hero img {
  display: none !important;
}

/* 会員情報は編集欄ではなく、参照情報として表示する */
.page-newitem-addition #memberId,
.page-newitem-addition #ownerName,
.page-newitem-addition #verifiedAt,
.page-index #currentMemberId,
.page-index #currentOwnerName,
.page-index #currentVerifiedAt,
#memberIdInput,
#ownerNameInput,
#verifiedAtInput {
  min-height: auto;
  padding: 2px 0 6px;
  border: 0 !important;
  border-radius: 0;
  outline: 0;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--text) !important;
  font-weight: 700;
  cursor: default;
  caret-color: transparent;
}

.page-newitem-addition #memberId:focus,
.page-newitem-addition #ownerName:focus,
.page-newitem-addition #verifiedAt:focus,
.page-index .summary-field input:focus,
.page-sales-dashboard .search-wrap input:focus {
  border: 0 !important;
  box-shadow: none !important;
}

.page-newitem-addition .hero h1,
.page-newitem-addition .hero p {
  color: var(--text) !important;
}

.page-create-member-card .container,
.page-member-card .container,
.page-verify-member-card .container {
  max-width: 680px;
}

.page-member-card .panel {
  border-top: 3px solid var(--brand-yellow) !important;
}

.page-member-card .qr-wrap,
.page-create-member-card .qr-wrap,
.page-verify-member-card #reader {
  border-radius: 18px;
  background: #fff;
}

.app-brand-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
  margin-top: 36px;
  padding: 30px max(20px, calc((100% - 1120px) / 2));
  position: relative;
  background-color: #15140f;
  background-image:
    radial-gradient(ellipse 420px 180px at 8% 0%, rgba(185, 150, 83, .16), transparent 68%),
    radial-gradient(ellipse 420px 180px at 100% 100%, rgba(185, 150, 83, .10), transparent 68%);
  color: #fff;
}

.app-brand-footer::before,
.app-brand-footer::after {
  content: "";
  position: absolute;
  inset: 5px;
  pointer-events: none;
}
.app-brand-footer::before {
  border: 1px solid rgba(185, 150, 83, .3);
}
.app-brand-footer::after {
  background:
    linear-gradient(rgba(185, 150, 83, .6), rgba(185, 150, 83, .6)) top left / 16px 1px no-repeat,
    linear-gradient(rgba(185, 150, 83, .6), rgba(185, 150, 83, .6)) top left / 1px 16px no-repeat,
    linear-gradient(rgba(185, 150, 83, .6), rgba(185, 150, 83, .6)) bottom right / 16px 1px no-repeat,
    linear-gradient(rgba(185, 150, 83, .6), rgba(185, 150, 83, .6)) bottom right / 1px 16px no-repeat;
}
.app-brand-footer > * {
  position: relative;
  z-index: 1;
}

.app-brand-footer__logo {
  width: min(250px, 100%);
}

/* フッターの「最新の情報に更新」：その場で完結する操作なので①金アウトライン */
.app-footer-refresh {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(900px, 100%);
}

.app-footer-refresh__button {
  width: min(320px, 100%);
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #e0c787;
  border-radius: 4px;
  background: transparent;
  color: #e0c787;
  font-size: 13px;
}

.app-footer-refresh__button::before {
  content: "↻";
  margin-right: 6px;
}

.app-footer-refresh__button:hover:not(:disabled),
.app-footer-refresh__button:focus-visible {
  background: rgba(185, 150, 83, .18);
}

.app-footer-refresh__status {
  min-height: 1.5em;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
  text-align: center;
}

/* One row with as many equal columns as there are links. */
.app-footer-nav {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
  width: min(900px, 100%);
}

.app-footer-nav__link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid rgba(185, 150, 83, .65);
  border-radius: 4px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  background: rgba(255, 255, 255, .06);
}

.app-footer-nav__link:hover,
.app-footer-nav__link:focus-visible {
  border-color: #e0c787;
  background: rgba(185, 150, 83, .18);
}

.app-footer-nav__link[aria-current="page"] {
  color: #15140f;
  background: #e0c787;
}

@media (min-width: 760px) {
  body:not(.page-index) > main {
    max-width: 960px;
  }

  body:not(.page-index) .kpi-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  body:not(.page-index) .product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .page-index .items-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .app-header {
    min-height: 68px;
    padding: 10px 14px;
  }

  .premium-gallery-logo {
    width: min(180px, 48vw);
    max-height: 44px;
  }

  .app-header h1 {
    font-size: 17px;
  }

  .page-index .items-grid {
    grid-template-columns: 1fr;
  }

  .page-index .btn-pending-items,
  .page-index .btn-reserve {
    width: 100%;
  }

  .page-index .item-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .page-index .item-image,
  .page-index .item-no-image {
    width: 92px;
    min-width: 92px;
    height: 110px;
  }

  .app-brand-footer {
    padding: 24px 18px 70px;
  }

  .app-footer-nav {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  /* An odd last link takes the whole row instead of leaving a gap beside it. */
  .app-footer-nav__link:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

}

/* Very narrow screens: the logo takes its share of the header, so a one-word English name (SHOWCASE, INCOMING) is set a
   little tighter, and may break, instead of pushing the page wider. The owner screens set their own header. */
@media (max-width: 380px) {
  body:not(.owner-redesign) .app-header .header-brand > div { min-width: 0; }
  body:not(.owner-redesign) .app-header h1 { font-size: 15px; letter-spacing: 1px; overflow-wrap: anywhere; }
  body:not(.owner-redesign) .app-header .sub { overflow-wrap: anywhere; }
}

/* ══════════════════════════════════════════════
   会員情報ヘッダー・売上ダッシュボード系画面の追加スタイル
   ══════════════════════════════════════════════ */

/* ヘッダー：会員情報を統合 */
.app-header .header-brand { gap: 12px; }
.premium-gallery-logo { width: 230px; max-height: 52px; }
.app-header .search-wrap {
  margin: 12px 0 0; padding-top: 11px; border-top: 1px solid rgba(185, 150, 83, .25);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px;
}
.app-header .search-wrap .input-group-label { display: none; }
.app-header .input-group { width: auto; min-width: 0; }
/* 1行目：オーナー名。改行せず、はみ出す場合は premium_gallery_theme.js が文字サイズを縮小する */
.app-header .owner-name-group { order: 1; grid-column: 1 / -1; overflow: hidden; }
.app-header .owner-name-group .member-field {
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 2行目：左に会員番号、右に前回ご来店日 */
.app-header .input-group:not(.owner-name-group):not(.verified-at-group) {
  order: 2; grid-column: 1; display: flex; align-items: baseline; overflow: hidden;
}
/* 取得失敗の長いメッセージが右の来店日と重ならないよう、収まらない分は省略表示にする */
.app-header .input-group:not(.owner-name-group):not(.verified-at-group) .member-field {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 会員番号は [ ] で囲んで表示する */
.app-header .input-group:not(.owner-name-group):not(.verified-at-group)::before { content: "["; color: var(--brand-yellow); font-size: 12px; }
.app-header .input-group:not(.owner-name-group):not(.verified-at-group)::after { content: "]"; color: var(--brand-yellow); font-size: 12px; }
.app-header .verified-at-group {
  order: 3; grid-column: 2; display: flex; align-items: baseline; justify-content: flex-end; gap: 3px;
}
.app-header .verified-at-group .input-group-label {
  display: inline; color: #d7d2c4; font-size: 11px; font-weight: 500; white-space: nowrap;
}
.app-header.member-header #ownerNameInput,
.app-header.member-header #currentOwnerName,
.app-header.member-header #ownerName {
  font-size: 15px !important; font-weight: 700 !important; color: #fff !important;
}
.app-header.member-header #memberIdInput,
.app-header.member-header #currentMemberId,
.app-header.member-header #memberId {
  font-family: 'Noto Sans JP', sans-serif !important; font-size: 12px !important;
  letter-spacing: .06em !important; color: var(--brand-yellow) !important; word-break: break-all;
}
.app-header.member-header #verifiedAtInput,
.app-header.member-header #currentVerifiedAt,
.app-header.member-header #verifiedAt {
  font-size: 11px !important; font-weight: 500 !important; color: #d7d2c4 !important; text-align: right;
  white-space: nowrap !important; overflow: hidden; text-overflow: ellipsis;
}

/* ヘッダー下段：会員向け画面への4ボタン（フッターと同じリンク。4等分で1行） */
.app-header.has-member-nav { display: block; }
.app-header-nav {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 10px;
}
.app-header-nav__link {
  display: flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 4px 6px;
  border: 1px solid rgba(185, 150, 83, .65); border-radius: 4px;
  background: rgba(255, 255, 255, .06); color: #fff;
  font-size: 12px; font-weight: 700; line-height: 1.25; text-align: center; text-decoration: none;
  /* 折り返しは <wbr> の位置（語の切れ目）だけにする。極端に狭い幅のときのみ語の途中でも折る */
  word-break: keep-all; overflow-wrap: anywhere;
}
.app-header-nav__link:hover,
.app-header-nav__link:focus-visible { border-color: #e0c787; background: rgba(185, 150, 83, .18); }
.app-header-nav__link[aria-current="page"] { background: #e0c787; color: #15140f; }

/* 来店予約（商品一覧・新規出品の本文上部）：画面遷移なので②ティール塗り。 */
.reservation-banner {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 20px; padding: 16px 20px;
  border-radius: 4px; background: var(--teal); color: #f3eee2; text-decoration: none;
}
.reservation-banner[hidden] { display: none; }
.reservation-banner::before {
  content: ""; position: absolute; inset: 4px; border: 1px solid rgba(224, 199, 135, .55);
  border-radius: 2px; pointer-events: none;
}
.reservation-banner::after { content: "›"; color: #e0c787; font-size: 28px; line-height: 1; }
.reservation-banner:hover,
.reservation-banner:focus-visible { background: var(--teal-hover); }
.reservation-banner__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.reservation-banner__eyebrow { color: #e0c787; font-size: 11px; font-weight: 500; letter-spacing: .16em; }
.reservation-banner__title { font-size: 16px; font-weight: 700; }
html body.page-index .action-bar .reservation-banner { display: flex; flex-direction: row; margin: 0; padding: 14px 20px; text-align: left; }

/* スクロールしたときだけ右下に表示。ヘッダーと各種ダイアログより下の階層。 */
html body #backToTopButton {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 52px !important; min-height: 52px; margin: 0; padding: 5px;
  border: 1px solid #b99653 !important; background: #15140f !important; color: #fff !important;
  font-size: 11px; line-height: 1.25; box-shadow: 0 2px 8px #0003 !important;
}
html body #backToTopButton[hidden] { display: none; }
html body #backToTopButton .back-to-top__arrow { font-size: 20px; }
html body #backToTopButton:hover { background: #29271f !important; }
html body #backToTopButton:focus-visible { outline: 2px solid #8a6d2f; outline-offset: 3px; }

/* KPI 主役カード（当月成約金額） */
.kpi-hero {
  background: #f3eee2 !important; border: 1px solid #cbb684 !important;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .7), 0 10px 24px rgba(40, 34, 20, .10) !important;
}
.kpi-hero .k-label { color: #7d6227 !important; }

/* KPI サブカード：左ボーダーを指標色に */
.kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
.kpi-card {
  border-top: 0 !important;
  border-left: 3px solid var(--kpi-color, var(--brand-yellow)) !important;
}

/* 精算履歴セクション */
.sec-title { border-bottom-color: #ddd6c7 !important; }
.sec-title h2 { text-transform: none !important; }
.badge { background: #efece3 !important; color: var(--text-muted) !important; }

.settlement-banner {
  background: linear-gradient(135deg, #fdfbf6, #f3eee2) !important;
  border: 1px solid #d8c48c !important;
}
.sb-value { color: #8a6d2f !important; }
.sb-note {
  color: #6b5524 !important; background: #faf5ea !important; border: 1px solid #d8c48c !important;
}

thead th { background: #f4f1e9 !important; border-bottom-color: #e6e0d4 !important; }
tbody tr { border-bottom-color: #efece3 !important; }
.td-price { color: #8a6d2f !important; }
.settle-badge.done {
  background: #f4f2ee !important; color: #6d6a63 !important; border: 1px solid #ded9d0 !important;
}
.settle-badge.pending {
  background: #faf5ea !important; color: #8a6d2f !important; border: 1px solid #d8c48c !important;
}
.settle-row-done { background: #fafffc !important; }
.settle-row-pending { background: #fffef3 !important; }

/* 保留受注 */
.hold-card { border-left: 3px solid var(--brand-yellow) !important; }
.hold-title { color: #8a6d2f !important; }
.hold-amount { color: var(--text) !important; }
.hold-reason { color: #8a6d2f !important; background: transparent !important; }

/* 商品状況サマリー（新設セクション） */
.product-status-card.on-sale { --status-color: #8a6d2f; }
.product-status-card.hold { --status-color: #6d6a63; }
.product-status-card.sold { --status-color: #8b877f; }
.product-all-link { color: #8a6d2f !important; }

/* 商品カード（sales_items / admin_sales_items） */
.product-card.on-sale { border-left: 3px solid #d8c48c !important; }
.product-card.on-hold {
  border-left: 3px solid #d9d5cc !important; background: rgba(255, 255, 255, .88) !important;
}
.status-sale {
  background: #faf5ea !important; color: #8a6d2f !important; border: 1px solid #d8c48c !important;
}
.status-hold {
  background: #f4f2ee !important; color: #6d6a63 !important; border: 1px solid #d9d5cc !important;
}
.status-sold {
  background: #efece6 !important; color: #8b877f !important; border: 1px solid #ded9d0 !important;
}
.tab-btn.active {
  background: var(--brand-yellow) !important; border-color: var(--brand-yellow) !important; color: var(--brand-black) !important; border-radius: 8px !important;
}
.tab-btn {
  background: rgba(255, 255, 255, .7) !important; border-color: #d8c48c !important; color: #8a6d2f !important; border-radius: 8px !important;
}

@media (max-width: 640px) {
  .app-header .input-group:not(.owner-name-group):not(.verified-at-group)::before,
  .app-header .input-group:not(.owner-name-group):not(.verified-at-group)::after { font-size: 11px; }

  .app-header-nav { gap: 4px; margin-top: 8px; }
  .app-header-nav__link { min-height: 34px; padding: 3px 2px; font-size: 10.5px; }

  .app-header .search-wrap { gap: 4px 6px !important; padding-top: 8px !important; margin-top: 8px !important; }
  .app-header .input-group:not(.owner-name-group):not(.verified-at-group) { white-space: nowrap; }
  .app-header.member-header #ownerNameInput,
  .app-header.member-header #currentOwnerName,
  .app-header.member-header #ownerName {
    font-size: 14px !important;
  }
  .app-header.member-header #memberIdInput,
  .app-header.member-header #currentMemberId,
  .app-header.member-header #memberId {
    font-size: 11px !important;
  }
  .app-header.member-header #verifiedAtInput,
  .app-header.member-header #currentVerifiedAt,
  .app-header.member-header #verifiedAt {
    font-size: 10px !important;
  }
}

/* ══════════════════════════════════════════════
   16a（罫線で区切る・箱なし）＋ 18b（ウォームアンバーの文字色）
   各画面CSSの上書きより優先させるため html body を前置
   ══════════════════════════════════════════════ */
html body {
  --text: #3d3428;
  --text-muted: #6a6152;
  --text-dim: #6a6152;
  --border: #e3dbca;
  --line: #e3dbca;
  --line-strong: #3d3428;
  --radius: 0px;
  --shadow: none;
  background: #f7f4ee;
  color: var(--text);
}

/* 箱をやめ、罫線で区切る */
html body .panel,
html body .message,
html body .itemspanel,
html body .product-card,
html body .product-status-card,
html body .hold-card,
html body .hold-card-none,
html body .bulk-import,
html body form,
html body .settlement-banner,
html body.page-newitem-addition .hero {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
html body .hold-card,
html body .product-card { padding: 12px 0 !important; }
html body.page-newitem-addition form { padding-left: 0 !important; padding-right: 0 !important; }
/* member_card.css の .page-member-card .panel（上端の金3px罫）より強くする */
html body.page-member-card .panel { border-top: 0 !important; }
html body .settlement-banner { padding: 8px 0 !important; }
/* 画面CSSの .page-newitem-addition .bulk-import（枠・白背景・影）より強くする */
html body.page-newitem-addition .bulk-import {
  border: 0 !important;
  border-top: 1px solid #ddd6c7 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 18px 0 0 !important;
}
/* sales_dashboard.css の .product-card.on-sale / .on-hold（左罫・白背景）より強くする */
html body .product-card.on-sale,
html body .product-card.on-hold {
  border-left: 0 !important;
  background: transparent !important;
}

/* 見出し：黒（インク色）の細罫 */
html body .sec-title,
html body.page-index .section-heading {
  border-bottom: 1px solid var(--line-strong) !important;
}
html body .sec-title h2,
html body.page-index .section-heading h2 {
  color: var(--text) !important;
  font-size: 14px !important;
  letter-spacing: .06em !important;
}
html body .badge,
html body.page-index .section-count {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  color: var(--text-muted) !important;
}

/* KPI：主役カードのみ面を残し、3指標は罫で区切る */
html body .kpi-hero {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: 1px solid #cbb684 !important;
  background: #f3eee2 !important;
}
html body .kpi-row {
  gap: 0 !important;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
html body .kpi-card {
  background: transparent !important;
  border: 0 !important;
  border-right: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 10px 8px 10px 0 !important;
}
html body .kpi-card:last-child { border-right: 0 !important; }
html body .kpi-card + .kpi-card { padding-left: 8px !important; }
html body .kpi-card .k-value {
  color: #8a6d2f !important;
  font-size: 23px !important;
  letter-spacing: .5px;
}

/* 精算テーブル */
html body thead th { background: transparent !important; border-bottom-color: var(--line) !important; color: var(--text-muted) !important; }
html body tbody tr { border-bottom-color: var(--line) !important; }
html body .settle-row-done,
html body .settle-row-pending { background: transparent !important; }
html body .td-price { color: var(--text) !important; }
html body .settle-badge,
html body .status-badge,
html body .sb-note { border-radius: 2px !important; }

/* 商品一覧カード */
html body.page-index .item-card {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 14px 0 !important;
}
/* index.css の .page-index .item-card.is-sold（金の左罫・白背景）より強くする */
html body.page-index .item-card.is-sold {
  border-left: 0 !important;
  background: transparent !important;
  opacity: .75;
}
html body.page-index .items-grid { gap: 0 24px !important; }
html body.page-index .item-image,
html body.page-index .item-no-image,
html body .product-thumb,
html body .product-thumb-placeholder { border-radius: 2px !important; border: 0 !important; }

/* タブ：下線式 */
html body.page-index .tabs,
html body .product-tab-row {
  gap: 18px !important;
  border-bottom: 1px solid #ddd6c7;
}
html body.page-index .tab-button,
html body .tab-btn {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  padding: 8px 0 !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  color: var(--text-muted) !important;
}
html body.page-index .tab-button.active,
html body .tab-btn.active {
  background: transparent !important;
  border-bottom-color: #8a6d2f !important;
  border-radius: 0 !important;
  color: var(--text) !important;
}

/* 入力欄：下線のみ（ヘッダー内の会員情報表示は対象外） */
html body main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html body main select,
html body main textarea {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid #d9d3c6 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
html body main input:focus,
html body main select:focus,
html body main textarea:focus {
  border-bottom-color: #8a6d2f !important;
  box-shadow: none !important;
}

/* 角丸：ボタン4px、それ以外は2px */
html body button,
html body .btn-add,
html body .btn-reserve,
html body .bubble-btn,
html body.page-newitem-addition .bubble-btn.reserve,
html body .filter-reset,
html body .product-all-link,
html body .csv-export-btn,
html body .export-dialog__button { border-radius: 4px !important; }
html body.page-index .tab-button,
html body .tab-btn { border-radius: 0 !important; }
html body .export-dialog,
html body .qr-wrap,
html body #reader { border-radius: 2px !important; }

/* 新規出品申請：画像の選び方（ファイル＝①金アウトライン／カメラ＝②ティール） */
html body.page-newitem-addition .product-image-source-button {
  border: 1px solid #d8c48c;
  border-radius: 4px;
  background: transparent;
  color: #8a6d2f;
}
html body.page-newitem-addition .product-image-camera-button {
  border-color: var(--teal);
  background: var(--teal);
  color: #f3eee2;
}
html body.page-newitem-addition .product-image-camera-button:hover {
  border-color: var(--teal-hover);
  background: var(--teal-hover);
}

/* 新規出品申請：「必須」は背景なしの赤文字、注意書きは箱をやめ罫で区切る
   （注意書きはフォームの最後の要素なので、下側はフォーム自身の下罫に任せる） */
html body.page-newitem-addition .required {
  margin-left: 4px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
html body.page-newitem-addition .footer-notice {
  padding: 14px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

/* 売上商品一覧の「売上ダッシュボードへ戻る」は画面遷移なので②ティール
   （同じクラスのダッシュボード「すべての商品を確認する」は対象外） */
html body .error-bar + .product-all-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0 !important;
  background: var(--teal) !important;
  color: #f3eee2 !important;
}
html body .error-bar + .product-all-link:hover { background: var(--teal-hover) !important; }
