/* hp-factory の機能の部品の見た目（hpf-parts.js と組）。色・角・文字は --hpf-* を使うので、各社の site.css で上書きできる。
   site-design 型9：灰色の文字にしない（--hpf-muted は地との差 7:1 以上）。押せる所は 44px 以上 */

.hpf-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- かんたん見積もり ---- */
.hpf-est { display: grid; gap: 14px; padding: clamp(16px, 4vw, 28px); background: var(--hpf-surface); border-radius: var(--hpf-radius); }
.hpf-est-title { margin: 0; font-family: var(--hpf-font-head); font-weight: var(--hpf-head-weight); font-size: 1.2rem; }
.hpf-est-row { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; min-width: 0; }
.hpf-est-row legend { padding: 0; font-weight: 700; margin-bottom: 4px; }
.hpf-est select, .hpf-est input[type="number"] { font: inherit; min-height: 44px; padding: 6px 10px; border: 1px solid var(--hpf-muted); border-radius: var(--hpf-radius); background: var(--hpf-bg); color: var(--hpf-text); max-width: 100%; }
.hpf-est input[type="number"] { width: 6.5em; }
.hpf-est-opt { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.hpf-est-opt input { width: 22px; height: 22px; accent-color: var(--hpf-main); flex: none; }
.hpf-est-num { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.hpf-est-unit { font-size: .9em; }
.hpf-est-sum { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 2px solid var(--hpf-main); }
.hpf-est-total { font-size: clamp(1.4rem, 5vw, 1.9rem); font-weight: 700; color: var(--hpf-main); font-variant-numeric: tabular-nums; }
.hpf-est-note { margin: 0; font-size: .92em; }
.hpf-est-cta { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 10px 22px; border-radius: var(--hpf-radius); background: var(--hpf-accent); color: #fff; font-weight: 700; text-decoration: none; justify-self: start; text-align: center; max-width: 100%; }
.hpf-est-cta:focus-visible { outline: 3px solid var(--hpf-main); outline-offset: 2px; }

/* ---- 絞り込み ---- */
[data-hpf-filter] { display: grid; gap: 10px; margin-bottom: 18px; }
.hpf-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hpf-filter-head { font-weight: 700; margin-right: 4px; }
.hpf-filter-btn { font: inherit; min-height: 44px; padding: 6px 16px; border: 1px solid var(--hpf-main); border-radius: 999px; background: var(--hpf-bg); color: var(--hpf-main); cursor: pointer; }
.hpf-filter-btn[aria-pressed="true"] { background: var(--hpf-main); color: var(--hpf-on-main); }
.hpf-filter-btn:focus-visible { outline: 3px solid var(--hpf-accent); outline-offset: 2px; }
.hpf-filter-count { margin: 0; font-weight: 700; }
[data-hpf-filter-items] > [hidden] { display: none !important; }

/* ---- カレンダー ---- */
.hpf-cal { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 18px; }
.hpf-cal-month { width: 100%; border-collapse: collapse; table-layout: fixed; font-variant-numeric: tabular-nums; }
.hpf-cal-month caption { font-weight: 700; padding-bottom: 6px; text-align: left; }
.hpf-cal-month th { font-size: .85em; padding: 4px 0; }
.hpf-cal-month th.sun { color: #b3261e; }
.hpf-cal-month th.sat { color: #1f4e9c; }
.hpf-cal-month td { height: 3.1em; vertical-align: top; text-align: center; border: 1px solid var(--hpf-surface); padding: 2px; }
.hpf-cal-month td .d { display: block; }
.hpf-cal-month td .m { display: block; font-size: .78em; font-weight: 700; }
.hpf-cal-month td .l { display: block; font-size: .7em; line-height: 1.3; overflow-wrap: anywhere; }
.hpf-cal-month td.off { background: var(--hpf-surface); }
.hpf-cal-month td.off .m { color: #b3261e; }
.hpf-cal-month td.today { outline: 3px solid var(--hpf-main); outline-offset: -3px; }
.hpf-cal-legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; font-size: .92em; }
.hpf-cal-legend .sw { display: inline-block; width: 1em; height: 1em; margin-right: -8px; border-radius: 3px; vertical-align: -.1em; }
.hpf-cal-legend .sw.off { background: var(--hpf-surface); border: 2px solid #b3261e; }
.hpf-cal-legend .sw.today { outline: 3px solid var(--hpf-main); outline-offset: -3px; }
.hpf-cal-note { margin: 8px 0 0; }

/* ---- 文字の大きさ ---- */
.hpf-fs { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.hpf-fs-label { font-size: .9em; font-weight: 700; }
.hpf-fs button { font: inherit; font-size: .9em; min-height: 44px; min-width: 44px; padding: 4px 12px; border: 1px solid var(--hpf-main); border-radius: var(--hpf-radius); background: var(--hpf-bg); color: var(--hpf-main); cursor: pointer; }
.hpf-fs button[aria-pressed="true"] { background: var(--hpf-main); color: var(--hpf-on-main); }

/* ---- 合言葉のページ ---- */
.hpf-lock-form { display: grid; gap: 10px; max-width: 420px; margin: 32px auto; padding: 24px; background: var(--hpf-surface); border-radius: var(--hpf-radius); }
.hpf-lock-lead { margin: 0; }
.hpf-lock-form label { font-weight: 700; }
.hpf-lock-form input { font: inherit; min-height: 48px; padding: 8px 12px; border: 1px solid var(--hpf-muted); border-radius: var(--hpf-radius); background: var(--hpf-bg); color: var(--hpf-text); }
.hpf-lock-form button { font: inherit; min-height: 48px; border: 0; border-radius: var(--hpf-radius); background: var(--hpf-main); color: var(--hpf-on-main); font-weight: 700; cursor: pointer; }
.hpf-lock-msg { margin: 0; font-weight: 700; color: #b3261e; min-height: 1.5em; }
[data-hpf-lock] > script { display: none; }

/* ---- 自前の予約 ---- */
.hpf-bk { display: grid; gap: 14px; padding: clamp(16px, 4vw, 28px); background: var(--hpf-surface); border-radius: var(--hpf-radius); }
.hpf-bk-slots { margin: 0; padding: 0; border: 0; display: grid; gap: 12px; min-width: 0; }
.hpf-bk-slots legend { font-weight: 700; padding: 0; margin-bottom: 6px; }
.hpf-bk-date { margin: 0 0 4px; font-weight: 700; }
.hpf-bk-times { display: flex; flex-wrap: wrap; gap: 8px; }
.hpf-bk-time { position: relative; }
.hpf-bk-time input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hpf-bk-time label { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; border: 1px solid var(--hpf-main); border-radius: var(--hpf-radius); background: var(--hpf-bg); color: var(--hpf-main); cursor: pointer; }
.hpf-bk-time input:checked + label { background: var(--hpf-main); color: var(--hpf-on-main); font-weight: 700; }
.hpf-bk-time input:focus-visible + label { outline: 3px solid var(--hpf-accent); outline-offset: 2px; }
.hpf-bk-time.full label { border-color: var(--hpf-muted); color: var(--hpf-muted); cursor: not-allowed; background: var(--hpf-surface); }
.hpf-bk-field { display: grid; gap: 4px; }
.hpf-bk-field label { font-weight: 700; }
.hpf-bk-field input, .hpf-bk-field select, .hpf-bk-field textarea { font: inherit; min-height: 44px; padding: 8px 10px; border: 1px solid var(--hpf-muted); border-radius: var(--hpf-radius); background: var(--hpf-bg); color: var(--hpf-text); max-width: 100%; }
.hpf-bk-submit { font: inherit; min-height: 48px; border: 0; border-radius: var(--hpf-radius); background: var(--hpf-accent); color: #fff; font-weight: 700; cursor: pointer; padding: 10px 22px; }
.hpf-bk-submit:disabled { opacity: .6; cursor: wait; }
.hpf-bk-msg { margin: 0; font-weight: 700; color: #b3261e; min-height: 1.5em; }
.hpf-bk-done { padding: 24px; background: var(--hpf-surface); border-radius: var(--hpf-radius); border-left: 6px solid var(--hpf-main); }
.hpf-bk-done-h { font-weight: 700; font-size: 1.2rem; margin-top: 0; }

/* ---- インスタの最新投稿 ---- */
.hpf-ig { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(4px, 1vw, 10px); }
.hpf-ig a { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: calc(var(--hpf-radius) / 2); background: var(--hpf-surface); }
.hpf-ig img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hpf-ig a.video::after { content: ""; position: absolute; right: 8px; top: 8px; border-style: solid; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.hpf-ig a:focus-visible { outline: 3px solid var(--hpf-accent); outline-offset: 2px; }
.hpf-ig-more { margin: 10px 0 0; text-align: right; }
.hpf-ig-more a { color: var(--hpf-main); font-weight: 700; }

/* ---- AIの案内係 ---- */
.hpf-chat-open { position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); /* 右下は電話・問い合わせのボタン（.hpf-cta-floating）なので左下 */ bottom: max(16px, env(safe-area-inset-bottom, 0px)); z-index: 850; font: inherit; font-weight: 700; min-height: 48px; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--hpf-main); color: var(--hpf-on-main); box-shadow: 0 6px 20px rgba(0,0,0,.2); cursor: pointer; }
.hpf-chat-panel { position: fixed; left: max(12px, env(safe-area-inset-left, 0px)); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 851; width: min(380px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--hpf-bg); color: var(--hpf-text); border: 1px solid var(--hpf-surface); border-radius: 14px; box-shadow: 0 12px 36px rgba(0,0,0,.22); overflow: hidden; }
.hpf-chat-panel[hidden] { display: none; }
.hpf-chat-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; background: var(--hpf-main); color: var(--hpf-on-main); font-weight: 700; }
.hpf-chat-close { font: inherit; font-size: 1.3rem; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.hpf-chat-note { margin: 0; padding: 8px 14px; font-size: .85em; background: var(--hpf-surface); }
.hpf-chat-log { flex: 1; overflow-y: auto; padding: 12px 14px; display: grid; gap: 8px; align-content: start; }
.hpf-chat-msg { margin: 0; padding: 8px 12px; border-radius: 12px; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; }
.hpf-chat-msg.user { justify-self: end; background: var(--hpf-main); color: var(--hpf-on-main); }
.hpf-chat-msg.assistant { justify-self: start; background: var(--hpf-surface); }
.hpf-chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--hpf-surface); }
.hpf-chat-form textarea { flex: 1; min-width: 0; font: inherit; padding: 8px; border: 1px solid var(--hpf-muted); border-radius: 8px; resize: none; background: var(--hpf-bg); color: var(--hpf-text); }
.hpf-chat-form button { font: inherit; font-weight: 700; min-width: 56px; min-height: 44px; border: 0; border-radius: 8px; background: var(--hpf-accent); color: #fff; cursor: pointer; }

@media (prefers-reduced-motion: reduce) { .hpf-filter-btn, .hpf-fs button { transition: none; } }
