/* ============================================================
   卸値資料スライド（PDF保存・印刷用）
   ============================================================ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: 'Noto Sans JP', 'Shippori Mincho B1', sans-serif;
  font-weight: 400;
  color: #333;
  background: #e8e8e8;
  line-height: 1.5;
}
img { max-width: 100%; height: auto; display: block; }

/* ツールバー（印刷時非表示） */
.ls-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(46, 125, 50, 0.95);
  padding: 12px 24px;
  color: #fff;
}
.ls-toolbar__inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ls-toolbar__title { font-size: 0.9rem; font-weight: 500; }
.ls-toolbar__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ls-toolbar__photo-toggle { font-size: 0.8rem; }
.ls-toolbar__photo-toggle a { color: #fff; text-decoration: none; }
.ls-toolbar__photo-toggle a:hover { text-decoration: underline; }
.ls-toolbar__photo-toggle a.is-active { font-weight: 600; opacity: 1; pointer-events: none; cursor: default; }
.ls-toolbar__photo-toggle a:not(.is-active) { opacity: 0.9; }
.ls-toolbar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  color: #fff;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}
.ls-toolbar__btn:hover { background: rgba(255,255,255,0.15); }
.ls-toolbar__btn--primary { background: rgba(255,255,255,0.2); }

/* 時期選択パネル */
.ls-period-panel {
  display: none;
  padding: 12px 24px;
  background: rgba(0,0,0,0.08);
  border-top: 1px solid rgba(255,255,255,0.2);
}
.ls-period-panel--open { display: block; }
.ls-period-panel__inner { max-width: 900px; margin: 0 auto; }
.ls-period-panel__title { font-size: 0.85rem; margin-bottom: 10px; font-weight: 600; }
.ls-period-panel__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
}
.ls-period-panel__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  cursor: pointer;
}
.ls-period-panel__item input { flex-shrink: 0; }
.ls-period-panel__actions { display: flex; gap: 8px; }

/* 読み込み・エラー */
.ls-loading {
  padding: 48px;
  text-align: center;
  color: #666;
}
.ls-error {
  padding: 48px 24px;
  text-align: center;
  color: #c62828;
  font-size: 0.95rem;
}
.ls-slides { display: none; }

/* スライド共通（高さコンパクト・余白最小・1ページに約2倍入るように） */
.ls-slide {
  max-width: 900px;
  margin: 0 auto 4px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-radius: 8px;
  overflow: hidden;
}
.ls-slide__inner { padding: 4px 12px 6px; }
.ls-slide__header {
  margin-bottom: 2px;
  padding-bottom: 2px;
  border-bottom: 1px solid #2e7d32;
}
.ls-slide__period { font-size: 0.9rem; font-weight: 600; color: #2e7d32; }

/* 表紙 */
.ls-slide--cover .ls-slide__inner {
  text-align: center;
  padding: 24px 20px;
}
.ls-cover__title { font-size: 1.35rem; font-weight: 600; margin-bottom: 4px; color: #1b5e20; }
.ls-cover__sub { font-size: 0.9rem; font-weight: 400; color: #666; margin-bottom: 12px; }
.ls-cover__customer { font-size: 0.95rem; font-weight: 600; margin-bottom: 8px; color: #2e7d32; }
.ls-cover__company { font-size: 0.8rem; color: #888; }

/* 表（行を極力詰めて余白なし・商品名は1行） */
.ls-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.7rem;
  font-weight: 400;
}
.ls-table th,
.ls-table td {
  border: 1px solid #e0e0e0;
  padding: 1px 4px;
  vertical-align: middle;
  line-height: 1.2;
  font-weight: 400;
}
.ls-table thead th {
  background: #f5f5f5;
  font-weight: 600;
  text-align: left;
  padding: 1px 4px;
}
.ls-table .ls-table__name {
  font-weight: 500;
  font-size: 0.6rem;
  word-break: break-all;
  width: 18%;
}
.ls-table .ls-table__photo {
  width: 40px;
  padding: 0 2px;
  text-align: center;
  vertical-align: middle;
}
.ls-table .ls-table__photo img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 2px;
  margin: 0 auto;
  display: block;
  vertical-align: middle;
}
.ls-table__no-photo {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  background: #eee;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #999;
}
.ls-table .ls-table__price { text-align: right; white-space: nowrap; }
.ls-table .ls-table__origin,
.ls-table .ls-table__spec,
.ls-table .ls-table__season,
.ls-table .ls-table__weight,
.ls-table .ls-table__piece { font-size: 0.65rem; color: #111; }
.ls-table .ls-table__season { white-space: nowrap; font-size: 0.6rem; }

/* 希少資料モード：四半期帯 */
.ls-table tr.ls-quarter-band td {
  background: linear-gradient(90deg, #e8f5e9 0%, #c8e6c9 100%);
  color: #1b5e20;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 6px;
  border-color: #a5d6a7;
  text-align: left;
}
.ls-table .ls-table__empty {
  text-align: center;
  color: #888;
  padding: 12px;
  font-size: 0.75rem;
}

/* 抹茶テーブル */
.ls-table--matcha { font-size: 0.5rem; table-layout: fixed; }
.ls-table--matcha th, .ls-table--matcha td { padding: 1px 3px; vertical-align: middle; line-height: 1.15; }
.ls-table--matcha tbody tr { height: 28px; }
.ls-table--matcha tbody td { max-height: 28px; overflow: hidden; }
.ls-table--matcha thead th { font-size: 0.48rem; text-align: center; vertical-align: middle; white-space: nowrap; }
.ls-matcha__col-photo { width: 32px; text-align: center; }
.ls-matcha__col-photo img { width: 24px !important; height: 24px !important; }
.ls-matcha__col-name { width: 20%; font-weight: 500; word-break: break-word; line-height: 1.2; font-size: 0.5rem; }
.ls-matcha__col-origin { width: 8%; font-size: 0.48rem; color: #111; }
.ls-matcha__col-shelf { width: 5%; font-size: 0.45rem; color: #111; text-align: center; }
.ls-matcha__col-cert { width: 10%; font-size: 0.45rem; color: #111; word-break: break-word; }
.ls-matcha__col-stock { width: 11%; font-size: 0.45rem; color: #111; word-break: break-word; }
.ls-matcha__col-qty { width: 6%; text-align: center; white-space: nowrap; font-size: 0.48rem; }
.ls-matcha__col-price { width: 8%; text-align: right; white-space: nowrap; font-size: 0.48rem; }
.ls-matcha__col-total { width: 9%; text-align: right; white-space: nowrap; font-size: 0.48rem; }
.ls-matcha__col-note { font-size: 0.38rem; color: #111; line-height: 1.15; overflow: hidden; word-break: break-word; }
.ls-matcha__meta { display: block; font-size: 0.4rem; color: #333; font-weight: 400; margin-top: 1px; }

/* 注意事項 */
.ls-slide--notes .ls-notes { font-size: 0.85rem; color: #666; }
.ls-slide--notes .ls-slide__inner { padding: 4px 12px 6px; }
.ls-notes p { margin: 0 0 2px; }
.ls-notes p:last-child { margin-bottom: 0; }

/* ========== 行サイズ調整 ========== */
/* 中 (m) */
.ls-row-m .ls-table__photo { width: 56px; }
.ls-row-m .ls-table__photo img { width: 44px !important; height: 44px !important; }
.ls-row-m.ls-table--matcha tbody tr { height: 48px; }
.ls-row-m.ls-table--matcha tbody td { max-height: 48px; }
.ls-row-m .ls-matcha__col-photo { width: 50px; }
.ls-row-m .ls-matcha__col-photo img { width: 40px !important; height: 40px !important; }

/* 大 (l) */
.ls-row-l .ls-table__photo { width: 76px; }
.ls-row-l .ls-table__photo img { width: 64px !important; height: 64px !important; }
.ls-row-l.ls-table--matcha tbody tr { height: 72px; }
.ls-row-l.ls-table--matcha tbody td { max-height: 72px; }
.ls-row-l .ls-matcha__col-photo { width: 70px; }
.ls-row-l .ls-matcha__col-photo img { width: 60px !important; height: 60px !important; }

/* 特大 (xl) */
.ls-row-xl .ls-table__photo { width: 100px; }
.ls-row-xl .ls-table__photo img { width: 88px !important; height: 88px !important; }
.ls-row-xl.ls-table--matcha tbody tr { height: 96px; }
.ls-row-xl.ls-table--matcha tbody td { max-height: 96px; }
.ls-row-xl .ls-matcha__col-photo { width: 94px; }
.ls-row-xl .ls-matcha__col-photo img { width: 84px !important; height: 84px !important; }

@media print {
  .ls-row-m .ls-table__photo img { width: 44px !important; height: 44px !important; }
  .ls-row-m .ls-matcha__col-photo img { width: 40px !important; height: 40px !important; }
  .ls-row-l .ls-table__photo img { width: 64px !important; height: 64px !important; }
  .ls-row-l .ls-matcha__col-photo img { width: 60px !important; height: 60px !important; }
  .ls-row-xl .ls-table__photo img { width: 88px !important; height: 88px !important; }
  .ls-row-xl .ls-matcha__col-photo img { width: 84px !important; height: 84px !important; }
}
.ls-cover__note { white-space: pre-wrap; line-height: 1.7; font-size: 13px; max-width: 80%; margin: 20px auto; }

/* 品目・品種別資料：四半期をまたぐ商品も1回だけ掲載する。 */
.ls-toolbar [hidden] { display: none; }
.ls-slide--variety-doc .ls-slide__inner { padding: 18px 22px; }
.ls-slide--variety-doc h2 { margin-bottom: 12px; font-size: 1.1rem; }
.ls-slide--variety-doc h2 small { font-size: .75rem; font-weight: 400; margin-left: 10px; color: #666; }
.ls-table--varieties th, .ls-table--varieties td { padding: 6px 7px; line-height: 1.5; overflow-wrap: anywhere; }
.ls-table--varieties .ls-table__name { font-size: .75rem; }
.ls-table--varieties .ls-table__origin { width: 12%; }
.ls-table--varieties .ls-table__spec { width: 27%; }
.ls-table--varieties .ls-table__weight { width: 8%; }
.ls-table--varieties .ls-table__piece { width: 12%; }
.ls-table--varieties .ls-table__price { width: 15%; white-space: normal; }
.ls-table--varieties .ls-table__price small { display: block; color: #777; font-size: .6rem; }
.ls-table--varieties tr.ls-variety-band th { background: #edf5ee; color: #1b5e20; text-align: left; font-weight: 600; }
/* A4の用紙に合わせた印刷レイアウト。表はページをまたぎ、行と見出しは分断しない。 */
@page {
  size: A4 portrait;
  margin: 12mm 12mm 16mm;
  @bottom-left {
    content: "9province合同会社";
    font-family: sans-serif;
    font-size: 7pt;
    color: #647166;
  }
  @bottom-right {
    content: counter(page) " / " counter(pages);
    font-family: sans-serif;
    font-size: 7pt;
    color: #647166;
  }
}
.ls-print-variety { display: none; }
.ls-table--varieties col.ls-table__name { width: auto; }
.ls-table--varieties thead .ls-category-heading > th {
  background: #fff;
  border: 0;
  padding: 0 0 10px;
}
.ls-table--varieties .ls-category-heading h2 { margin: 0; }
@media print {
  html { font-size: 12pt; }
  body {
    background: #fff;
    color: #202c23;
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
    font-size: 9pt;
    line-height: 1.5;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .ls-toolbar, .ls-period-panel, .ls-loading { display: none !important; }
  .ls-slides { width: 100%; }
  .ls-slide {
    max-width: none;
    margin: 0 0 6mm;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
    break-inside: auto;
    page-break-inside: auto;
  }
  .ls-slide .ls-slide__inner { padding: 0; }
  .ls-slide--cover {
    margin-bottom: 7mm;
    padding-bottom: 5mm;
    border-bottom: 1.2pt solid #325b3c;
    break-inside: avoid;
    break-after: avoid;
  }
  .ls-slide--cover .ls-slide__inner { text-align: left; padding: 0; }
  .ls-slide--cover .ls-cover__title {
    font-size: 19pt;
    line-height: 1.45;
    letter-spacing: .035em;
    color: #24452d;
    margin-bottom: 2mm;
  }
  .ls-slide--cover .ls-cover__sub { font-size: 9pt; margin-bottom: 3mm; color: #58665b; }
  .ls-slide--cover .ls-cover__customer { font-size: 11pt; margin: 2mm 0; }
  .ls-slide--cover .ls-cover__company { font-size: 8pt; margin-top: 2mm; color: #647166; }
  .ls-cover__note { max-width: none; margin: 3mm 0 0; font-size: 9pt; line-height: 1.6; }
  .ls-slide__header { margin-bottom: 3mm; padding-bottom: 2mm; break-after: avoid; }
  .ls-slide .ls-slide__period { font-size: 13pt; line-height: 1.4; color: #24452d; }
  .ls-slide--variety-doc h2 small { font-size: 8pt; margin-left: 3mm; color: #647166; }
  .ls-table, .ls-table--varieties { width: 100%; table-layout: fixed; font-size: 9pt; }
  .ls-table thead { display: table-header-group; }
  .ls-table tfoot { display: table-footer-group; }
  .ls-table tr { break-inside: avoid; page-break-inside: avoid; }
  .ls-table th, .ls-table td,
  .ls-table--varieties th, .ls-table--varieties td {
    border: .5pt solid #d9e0da;
    padding: 1.5mm 1.8mm;
    font-size: 9pt;
    line-height: 1.4;
    vertical-align: middle;
    word-break: normal;
    overflow-wrap: anywhere;
  }
  .ls-table thead th {
    background: #f1f4f0;
    color: #46564a;
    font-size: 8pt;
    font-weight: 600;
    padding: 2mm 1.8mm;
  }
  .ls-table .ls-table__name,
  .ls-table .ls-table__origin,
  .ls-table .ls-table__spec,
  .ls-table .ls-table__weight,
  .ls-table .ls-table__piece,
  .ls-table .ls-table__season { font-size: 9pt; line-height: 1.4; word-break: normal; }
  .ls-table .ls-table__name { font-weight: 500; }
  .ls-table .ls-table__season { white-space: normal; }
  .ls-table .ls-table__price { font-size: 9pt; font-variant-numeric: tabular-nums; white-space: normal; }
  .ls-table .ls-table__price small { font-size: 7pt; line-height: 1.4; }
  .ls-table .ls-table__photo { width: 13mm; padding: 1.5mm; }
  .ls-table .ls-table__photo img { width: 10mm; height: 10mm; object-fit: cover; }
  .ls-table__no-photo { width: 10mm; height: 10mm; font-size: 6pt; }
  .ls-table--varieties thead .ls-category-heading > th { padding: 0 0 3mm; }
  .ls-table--varieties .ls-variety-group { break-inside: avoid; page-break-inside: avoid; }
  .ls-table--varieties .ls-variety-band { display: none; }
  .ls-table--varieties .ls-variety-group tr:nth-child(2) td { border-top: 1pt solid #aebfb0; }
  .ls-table--varieties .ls-variety-group tr:nth-child(2) .ls-table__name { color: #24452d; font-weight: 600; }
  .ls-table--varieties .ls-print-variety { display: block; font-size: 8pt; font-weight: 600; margin-bottom: 1mm; }
  .ls-table--varieties .ls-variety-band,
  .ls-table .ls-quarter-band { break-after: avoid; page-break-after: avoid; }
  .ls-table--varieties tr.ls-variety-band th,
  .ls-table tr.ls-quarter-band td {
    background: #edf3ed;
    color: #325b3c;
    border-color: #d9e0da;
    padding: 1.4mm 1.8mm;
    font-size: 8.5pt;
    font-weight: 600;
    line-height: 1.4;
  }
  .ls-slide--notes { border-top: .5pt solid #c9d3cb; padding-top: 3mm; break-inside: avoid; }
  .ls-slide--notes p, .ls-slide--notes .ls-notes { font-size: 8pt; line-height: 1.6; color: #647166; }
  .ls-slide--notes p + p { margin-top: 1.5mm; }
}
