/* LINE相談記録PDF（/line-record/）。左に操作（ファイル・期間・件数・印刷）、右に印刷のプレビュー。
   版面（.lr-page）は 210mm×296mm のまま組み、画面では transform で縮めて見せる。印刷のときだけ版面を body の直下へ移す */
[hidden] { display: none !important; }
.lr { --l-line: var(--hairline, #e5e7eb); --l-soft: var(--ink-soft, #4b5563); --l-acc: var(--accent, #b45309); --l-green: #06c755;
  display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--l-line); background: var(--panel, #fff); margin-bottom: 8px; }
@media (min-width: 900px) { .lr { grid-template-columns: 330px minmax(0, 1fr); } .lr-panel { border-right: 1px solid var(--l-line); } }

.lr-panel { display: flex; flex-direction: column; gap: 14px; padding: 18px; min-width: 0; }
.lr-step { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; border-radius: 50%; background: var(--ink, #1f2937); color: #fff;
  font-family: var(--mono); font-size: 12px; font-weight: 500; line-height: 1; flex: none; }

/* 1. ファイル */
.lr-drop { padding: 14px; border: 1.5px dashed var(--hairline-strong, #d1d5db); background: #fcfcfd; transition: background-color .15s, border-color .15s; }
.lr-drop.is-over { border-color: var(--l-acc); background: var(--accent-wash, #fffbeb); }
.lr-pick { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 0 14px; border: 1px solid var(--ink, #1f2937);
  background: var(--ink, #1f2937); color: #fff; font: inherit; font-size: 15.5px; font-weight: 700; cursor: pointer; transition: transform .08s ease, background-color .15s; }
.lr-pick .lr-step { background: #fff; color: var(--ink, #1f2937); }
.lr-pick:hover { background: #111827; }
.lr-pick:active { transform: scale(.98); }
.lr-drop-sub { margin: 8px 0 0; font-size: 12.5px; color: var(--l-soft); text-align: center; }
.lr-link { padding: 0; border: 0; background: none; font: inherit; color: var(--l-acc); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.lr-src { margin: 10px 0 0; font-size: 13px; line-height: 1.55; color: var(--ink, #1f2937); }
.lr-src:empty { display: none; }
.lr.is-sample .lr-src { padding: 6px 10px; border-left: 3px solid var(--l-acc); background: var(--accent-wash, #fffbeb); }
.lr-err { margin: 0; padding: 10px 12px; border-left: 3px solid var(--ng, #c03434); background: #fef2f2; color: #7f1d1d; font-size: 13.5px; line-height: 1.6; }
.lr-warn { margin: 0; padding: 8px 12px; border-left: 3px solid #ca8a04; background: #fefce8; color: #713f12; font-size: 13px; line-height: 1.6; }

/* 2. 期間 */
.lr-range { margin: 0; padding: 0; border: 0; min-width: 0; }
.lr-range legend { display: flex; align-items: center; padding: 0; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.lr-dates { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 6px; }
.lr-dates > span { padding-bottom: 12px; color: var(--l-soft); }
.lr-dates label { display: grid; gap: 3px; font-size: 12px; color: var(--l-soft); min-width: 0; }
.lr-dates input { width: 100%; min-width: 0; min-height: 42px; padding: 0 8px; border: 1px solid var(--hairline-strong, #d1d5db); background: #fff; font: inherit;
  font-family: var(--mono); font-size: 14px; color: var(--ink, #1f2937); }
.lr-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lr-chips button, .lr-over-list button { min-height: 32px; padding: 0 10px; border: 1px solid var(--hairline-strong, #d1d5db); background: #fff; font: inherit; font-size: 12.5px;
  color: var(--ink, #1f2937); cursor: pointer; transition: transform .08s ease; }
.lr-chips button:active, .lr-over-list button:active { transform: scale(.96); }
.lr-chips button[aria-pressed="true"] { border-color: var(--ink, #1f2937); box-shadow: inset 0 0 0 1px var(--ink, #1f2937); font-weight: 700; }

/* 件数 */
.lr-sum { padding: 12px 0; border-top: 1px solid var(--l-line); border-bottom: 1px solid var(--l-line); }
.lr-nums { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0; font-size: 13px; font-weight: 700; color: var(--l-soft); }
.lr-nums b { margin-right: 3px; font-family: var(--mono); font-size: 32px; line-height: 1; font-weight: 500; color: var(--ink, #1f2937); font-variant-numeric: tabular-nums; }
.lr-nums .lr-x b { font-size: 20px; margin-left: 3px; }
.lr-ms { margin-left: auto; font-family: var(--mono); font-size: 11.5px; font-weight: 400; color: #6b7280; }
.lr-ds { margin: 6px 0 0; font-size: 12.5px; color: var(--l-soft); }
.lr-over { padding: 10px 12px; border-left: 3px solid var(--ng, #c03434); background: #fef2f2; font-size: 13px; line-height: 1.6; color: #7f1d1d; }
.lr-over p { margin: 0; }
.lr-over-pick { margin-top: 8px !important; font-weight: 700; }
.lr-over-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.lr-over-list button { text-align: left; }
.lr-over-list small { color: var(--l-soft); }

/* 名前の置き換え */
.lr-anon { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; cursor: pointer; }
.lr-anon input { width: 18px; height: 18px; accent-color: var(--ink, #1f2937); }
.lr-map { margin-top: -6px; padding: 10px 12px; background: #f3f4f6; font-size: 12.5px; line-height: 1.55; color: var(--l-soft); }
.lr-map table { width: 100%; border-collapse: collapse; margin-bottom: 6px; color: var(--ink, #1f2937); }
.lr-map th, .lr-map td { padding: 4px 6px; border-bottom: 1px solid #e5e7eb; text-align: left; font-size: 13px; overflow-wrap: anywhere; }
.lr-map thead th { font-size: 11.5px; color: var(--l-soft); font-weight: 500; }
.lr-map tbody th { font-family: var(--mono); width: 3em; }
.lr-map td:last-child { width: 4em; text-align: right; font-family: var(--mono); }
.lr-map p { margin: 0; }
.lr-fname-warn { margin-top: 6px !important; color: #713f12; font-weight: 700; }

/* 3. 印刷 */
.lr-print { display: grid; place-content: center; gap: 1px; min-height: 58px; padding: 6px 16px; border: 1px solid var(--l-acc); background: var(--l-acc); color: #fff; font: inherit; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: transform .08s ease, background-color .15s, opacity .15s; }
.lr-print small { font-size: 12px; font-weight: 500; opacity: .9; }
.lr-print:hover { background: var(--accent-dark, #92400e); }
.lr-print:active { transform: scale(.98); }
.lr-print:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.lr-print.is-busy { opacity: .7; }
.lr-printhint { display: flex; align-items: flex-start; margin: -4px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--l-soft); }
.lr-check { margin: 0; padding: 10px 12px; border-left: 3px solid var(--ink, #1f2937); background: #f3f4f6; font-size: 14px; font-weight: 700; line-height: 1.55; }
.lr-fine { margin: 0; font-size: 12px; line-height: 1.7; color: var(--l-soft); }

/* プレビュー */
.lr-preview { min-width: 0; padding: 16px 18px 18px; background: #eef0f3; }
.lr-pv-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: 12px; font-size: 13px; }
.lr-pv-head b { font-weight: 700; }
.lr-pv-empty { margin: 0; padding: 48px 16px; border: 1px dashed var(--hairline-strong, #d1d5db); background: #fff; text-align: center; font-size: 14px; color: var(--l-soft); }
@media screen {
  /* 縮小は transform で行う（zoom だと字の折り返しが変わり、測った高さとずれる）。外枠の高さは app.js が合わせる */
  .lr-sheetwrap { position: relative; overflow: hidden; margin: 0 auto; }
  .lr-sheets { width: 210mm; transform: scale(var(--z, .5)); transform-origin: 0 0; }
  .lr-sheets .lr-page { margin: 0 auto 24px; box-shadow: 0 1px 2px rgba(17, 24, 39, .12), 0 0 0 1px rgba(17, 24, 39, .06); }
  .lr-sheets:not(.all) > .lr-page:nth-child(n+4) { display: none; }
  .lr-sheets .lr-page:last-child { margin-bottom: 0; }
}
.lr-measure { position: absolute; left: -10000px; top: 0; visibility: hidden; pointer-events: none; }

/* 次に使う */
.lr-after { margin: 12px 0 0; padding: 12px 16px; border: 1px solid var(--l-line); border-left: 3px solid var(--l-acc); background: var(--accent-wash, #fffbeb); font-size: 14px; line-height: 1.6; }
.lr-after p { margin: 0; }
.lr-after.is-on { animation: lr-in .3s ease both; }
@keyframes lr-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.lr-next { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; margin: 12px 0 28px; border: 1px solid var(--l-line); background: #fff; }
.lr-next a { display: grid; gap: 2px; padding: 12px 16px; color: var(--ink, #1f2937); text-decoration: none; border-right: 1px solid var(--l-line); }
.lr-next a:last-child { border-right: 0; }
.lr-next a:hover b { color: var(--l-acc); }
.lr-next b { font-size: 14px; }
.lr-next span { font-size: 12.5px; color: var(--l-soft); }
@media (max-width: 640px) { .lr-next a { border-right: 0; border-bottom: 1px solid var(--l-line); } .lr-next a:last-child { border-bottom: 0; } }
.lr-about-h { margin: 18px 0 8px; font-size: 16px; }
.lr-alltools { margin: 14px 0 0; font-size: 14px; }

/* ===== 版面（A4縦）。系統のフォントで組み、測った高さと印刷の高さをそろえる ===== */
.lr-page { box-sizing: border-box; width: 210mm; height: 296mm; padding: 12mm 13mm 9mm; display: flex; flex-direction: column; overflow: hidden; background: #fff; color: #111;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Meiryo", "Noto Sans JP", "Noto Sans CJK JP", sans-serif;
  font-size: 9.5pt; line-height: 1.55; font-weight: 400; letter-spacing: 0; text-align: left; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lr-page * { box-sizing: border-box; }
.lr-head { display: flex; justify-content: space-between; gap: 4mm; padding-bottom: 1.6mm; border-bottom: .35mm solid #111; font-size: 7.5pt; color: #333; flex: none; }
.lr-head span:last-child { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; color: #666; }
.lr-cols, .lr-row { display: grid; grid-template-columns: 9mm 15mm 10mm 28mm minmax(0, 1fr); column-gap: 2.2mm; }
.lr-cols { padding: 1.3mm 0 1mm; border-bottom: .2mm solid #999; font-size: 6.8pt; color: #555; flex: none; }
.lr-body { flex: 1 1 auto; min-height: 0; overflow: hidden; }
.lr-foot { flex: none; margin-top: auto; padding-top: 1.8mm; border-top: .2mm solid #bbb; font-size: 7.5pt; color: #333; text-align: center; font-variant-numeric: tabular-nums; }
.lr-day { display: flex; align-items: baseline; gap: 2mm; margin: 0; padding: 3mm 0 1.2mm; border-bottom: .3mm solid #111; font-size: 10pt; font-weight: 700; color: #111; }
.lr-day span { font-size: 7.5pt; font-weight: 400; color: #555; }
.lr-row { padding: 1.2mm 0; border-bottom: .15mm solid #ddd; }
.lr-row > span { font-variant-numeric: tabular-nums; }
.c-no { font-weight: 700; text-align: right; }
.c-ln, .c-tm { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 8pt; color: #333; padding-top: .3mm; }
.c-ln { color: #555; }
.c-who { font-weight: 700; overflow-wrap: anywhere; }
.c-tx { white-space: pre-wrap; overflow-wrap: anywhere; word-break: normal; }
.c-cont { display: block; font-size: 7.2pt; color: #555; }
.c-sys { font-weight: 400; color: #555; }
.lr-row.is-sys .c-tx { color: #444; }

/* 表紙 */
.lr-cover { padding: 22mm 22mm 9mm; }
.lr-kicker { margin: 0 0 14mm; padding-bottom: 3mm; border-bottom: .5mm solid #111; font-size: 11pt; font-weight: 700; letter-spacing: .02em; }
.lr-plabel { margin: 0 0 1.5mm; font-size: 8.5pt; color: #555; }
.lr-period { display: block; margin-bottom: 10mm; font-size: 17pt; font-weight: 700; line-height: 1.4; }
.lr-period i { font-style: normal; margin: 0 2mm; color: #555; }
.lr-dl { display: grid; grid-template-columns: 46mm minmax(0, 1fr); margin: 0 0 9mm; border-top: .2mm solid #bbb; }
.lr-dl dt, .lr-dl dd { margin: 0; padding: 2.4mm 0; border-bottom: .2mm solid #ddd; }
.lr-dl dt { font-size: 8.5pt; color: #555; padding-right: 3mm; }
.lr-dl dd { font-size: 10pt; overflow-wrap: anywhere; }
.lr-big { font-size: 15pt; margin-right: 1mm; }
.lr-fname { font-size: 9pt; }
.lr-hash { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 8.6pt; letter-spacing: .02em; word-spacing: .6mm; }
.lr-cover .lr-check { margin: 0 0 4mm; padding: 3mm 4mm; border: .4mm solid #111; background: none; font-size: 10.5pt; font-weight: 700; }
.lr-note { margin: 0 0 2.5mm; font-size: 8.3pt; line-height: 1.65; color: #333; }
.lr-made { margin: 6mm 0 0; font-size: 7.5pt; color: #666; }

@page { size: A4 portrait; margin: 0; }
@media print {
  body.lr-printing { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  body.lr-printing > *:not(#lr-sheets) { display: none !important; }
  body.lr-printing #lr-sheets { transform: none !important; width: auto !important; }
  body.lr-printing .lr-page { margin: 0 !important; box-shadow: none !important; display: flex !important; break-after: page; page-break-after: always; }
  body.lr-printing .lr-page:last-child { break-after: auto; page-break-after: auto; }
}
@media (prefers-reduced-motion: reduce) { .lr-after.is-on { animation: none; } .lr-pick, .lr-print, .lr-chips button { transition: none; } }
