.lhwk {
  --lhwk-accent: #0f766e;
  --lhwk-accent-bg: #ecfdf5;
  --lhwk-border: #d0d7e2;
  --lhwk-bg: #f7f9fc;
  --lhwk-text: #1f2937;
  --lhwk-muted: #6b7280;
  --lhwk-warn: #b91c1c;
  box-sizing: border-box;
  max-width: 520px;
  margin: 1.5em auto;
  padding: 16px;
  border: 1px solid var(--lhwk-border);
  border-radius: 14px;
  background: #fff;
  color: var(--lhwk-text);
  font-size: 15px;
  line-height: 1.5;
}
.lhwk *, .lhwk *::before, .lhwk *::after { box-sizing: border-box; }
.lhwk button, .lhwk input { font: inherit; color: inherit; margin: 0; }
.lhwk p { margin: 0; }

.lhwk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.lhwk-head strong { font-size: 1.15em; }
.lhwk-head span { font-size: .8em; color: var(--lhwk-muted); }

/* 結果：買い物中に何度も見るので画面上部に貼りつける */
.lhwk-result {
  position: sticky; top: 0; z-index: 5;
  padding: 12px 14px; margin: 0 -4px 14px;
  border-radius: 12px; background: var(--lhwk-accent-bg); border: 1px solid #a7f3d0;
}
.lhwk.is-over .lhwk-result { background: #fef2f2; border-color: #fecaca; }
.lhwk-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lhwk-stats small { display: block; font-size: .78em; color: var(--lhwk-muted); }
.lhwk-stats b { font-size: 1.9em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.lhwk-stats i { font-style: normal; margin-left: 2px; font-size: .9em; }
.lhwk-bar { height: 8px; margin: 10px 0 8px; border-radius: 99px; background: #fff; overflow: hidden; }
.lhwk-bar span { display: block; height: 100%; width: 0; background: var(--lhwk-accent); transition: width .2s; }
.lhwk.is-over .lhwk-bar span { background: var(--lhwk-warn); }
.lhwk-left { font-size: .95em; }
.lhwk-left b { font-size: 1.15em; color: var(--lhwk-accent); }
.lhwk.is-over .lhwk-left b { color: var(--lhwk-warn); }
.lhwk-left small { color: var(--lhwk-muted); margin-left: 4px; white-space: nowrap; }
.lhwk-msg { margin-top: 4px; font-size: .85em; color: var(--lhwk-muted); }

/* 入力 */
.lhwk-taxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.lhwk-taxes button {
  padding: 8px 4px; border: 1px solid var(--lhwk-border); border-radius: 8px; background: #fff;
  font-size: .9em; cursor: pointer; line-height: 1.25;
}
.lhwk-taxes button small { display: block; font-size: .75em; color: var(--lhwk-muted); }
.lhwk-taxes button.is-on { border-color: var(--lhwk-accent); background: var(--lhwk-accent); color: #fff; font-weight: 600; }
.lhwk-taxes button.is-on small { color: #d1fae5; }
.lhwk-row { display: flex; gap: 8px; align-items: stretch; }
.lhwk-price { flex: 1; min-width: 0; display: flex; align-items: center; border: 2px solid var(--lhwk-border); border-radius: 10px; padding: 0 10px; background: #fff; }
.lhwk-price:focus-within { border-color: var(--lhwk-accent); }
.lhwk-price input { flex: 1; min-width: 0; border: 0; outline: none; padding: 10px 0; font-size: 1.6em; font-variant-numeric: tabular-nums; background: transparent; }
.lhwk-price span { color: var(--lhwk-muted); }
.lhwk-qty { display: flex; align-items: center; border: 1px solid var(--lhwk-border); border-radius: 10px; overflow: hidden; }
.lhwk-qty button { width: 40px; height: 100%; border: 0; background: var(--lhwk-bg); font-size: 1.3em; cursor: pointer; }
.lhwk-qty output { min-width: 30px; text-align: center; font-weight: 600; }
.lhwk-add {
  display: block; width: 100%; margin-top: 10px; padding: 13px;
  border: 0; border-radius: 10px; background: var(--lhwk-accent); color: #fff !important;
  font-size: 1.1em; font-weight: 700; cursor: pointer;
}
.lhwk-add:active { filter: brightness(.9); }

/* カゴ */
.lhwk-listhead { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 6px; font-size: .9em; color: var(--lhwk-muted); }
.lhwk-clear { border: 0; background: none; color: var(--lhwk-warn); text-decoration: underline; cursor: pointer; padding: 4px; font-size: .95em; }
.lhwk-list { list-style: none; margin: 0; padding: 0; }
.lhwk-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid #eef1f5; margin: 0; }
.lhwk-item { flex: 1; font-variant-numeric: tabular-nums; }
.lhwk-tag { font-size: .75em; padding: 1px 6px; border-radius: 99px; background: var(--lhwk-bg); color: var(--lhwk-muted); }
.lhwk-line { min-width: 70px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.lhwk-del { width: 32px; height: 32px; border: 1px solid var(--lhwk-border); border-radius: 50%; background: #fff; color: var(--lhwk-muted); cursor: pointer; line-height: 1; }

/* 設定 */
.lhwk-settings { margin-top: 14px; padding: 10px 12px; border-radius: 10px; background: var(--lhwk-bg); }
.lhwk-settings summary { cursor: pointer; font-weight: 600; }
.lhwk-settings label { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; font-size: .9em; }
.lhwk-settings input { width: 9em; padding: 6px 8px; border: 1px solid var(--lhwk-border); border-radius: 6px; background: #fff; text-align: right; }
.lhwk-note { margin-top: 10px !important; font-size: .8em; color: var(--lhwk-muted); }

/* カゴの個数 */
.lhwk-qty-s { height: 32px; border-radius: 8px; }
.lhwk-qty-s button { width: 32px; font-size: 1.1em; }
.lhwk-qty-s button:disabled { color: #c3c9d3; cursor: default; }
.lhwk-qty-s output { min-width: 24px; }
.lhwk-item .lhwk-tag { margin-left: 6px; }
.lhwk-line { min-width: 64px; }

/* カメラ */
.lhwk-scan {
  display: block; width: 100%; margin-bottom: 12px; padding: 14px;
  border: 2px solid var(--lhwk-accent); border-radius: 10px; background: #fff; color: var(--lhwk-accent) !important;
  font-size: 1.1em; font-weight: 700; cursor: pointer;
}
.lhwk-scan::before { content: ""; display: inline-block; width: 1.1em; height: .85em; margin-right: 8px; vertical-align: -1px;
  border: 2px solid currentColor; border-radius: 3px; background: radial-gradient(circle, currentColor 0 22%, transparent 26%); }
.lhwk-scan:disabled { opacity: .6; }
html.lhwk-noscroll, html.lhwk-noscroll body { overflow: hidden; }
.lhwk-cam {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; flex-direction: column;
  background: #111; color: #fff; font-size: 15px; line-height: 1.5;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-text-size-adjust: 100%;
}
.lhwk-cam *, .lhwk-cam *::before, .lhwk-cam *::after { box-sizing: border-box; }
.lhwk-cam button, .lhwk-cam input { font: inherit; margin: 0; }
.lhwk-cam p { margin: 0; }
.lhwk-cam-sum { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 10px 14px; background: #0f766e; }
.lhwk-cam-sum b { font-size: 1.15em; font-variant-numeric: tabular-nums; }
.lhwk-cam-sum span { margin-left: auto; font-size: .9em; }
.lhwk-cam-sum .is-over { color: #fecaca; font-weight: 700; }
.lhwk-cam-view { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #000; }
.lhwk-cam-view video, .lhwk-cam-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.lhwk-cam-view img { object-fit: contain; }
.lhwk-cam-guide {
  position: absolute; left: 8%; right: 8%; top: 50%; aspect-ratio: 4 / 3; max-height: 80%; transform: translateY(-50%);
  border: 3px solid #fff; border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45);
}
.lhwk-cam-guide span { position: absolute; left: 0; right: 0; bottom: -2em; text-align: center; font-size: .85em; }
.lhwk-cam-view img:not([hidden]) ~ .lhwk-cam-guide { display: none; }
.lhwk-cam-status { padding: 8px 14px; font-size: .9em; min-height: 2.6em; }
.lhwk-cam-status.is-ok { color: #6ee7b7; }
.lhwk-cam-status.is-warn { color: #fde68a; }
.lhwk-cam-ctrl { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 16px 16px; }
.lhwk-cam-ctrl[hidden] { display: none; }
.lhwk-cam-close, .lhwk-cam-file { justify-self: start; padding: 8px 12px; border: 1px solid #555; border-radius: 8px; background: none; color: #fff; cursor: pointer; font-size: .9em; }
.lhwk-cam-file { justify-self: end; }
.lhwk-cam-shutter { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: #0f766e; cursor: pointer; }
.lhwk-cam-shutter:active { transform: scale(.94); }
.lhwk-cam-result { padding: 4px 14px 16px; background: #fff; color: #1f2937; border-radius: 14px 14px 0 0; }
.lhwk-cam-result[hidden] { display: none; }
.lhwk-cam-cands { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.lhwk-cam-cands:empty { display: none; }
.lhwk-cam-cands::before { content: "候補"; font-size: .8em; color: #6b7280; align-self: center; }
.lhwk-cam-cands button { padding: 4px 10px; border: 1px solid #d0d7e2; border-radius: 99px; background: #f7f9fc; cursor: pointer; }
.lhwk-cam .lhwk-taxes { margin-top: 10px; }
.lhwk-cam-result { --lhwk-accent: #0f766e; --lhwk-border: #d0d7e2; --lhwk-bg: #f7f9fc; --lhwk-muted: #6b7280; }
.lhwk-cam .lhwk-taxes button { padding: 8px 4px; border: 1px solid #d0d7e2; border-radius: 8px; background: #fff; cursor: pointer; }
.lhwk-cam .lhwk-taxes button.is-on { border-color: #0f766e; background: #0f766e; color: #fff; font-weight: 600; }
.lhwk-cam .lhwk-qty button { color: #1f2937; }
.lhwk-cam-btns { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; margin-top: 10px; }
.lhwk-cam-btns .lhwk-add { margin: 0; }
.lhwk-cam-retake { border: 1px solid #d0d7e2; border-radius: 10px; background: #fff; cursor: pointer; }
.lhwk-cam-top { display: flex; align-items: stretch; background: #0f766e; }
.lhwk-cam-top .lhwk-cam-sum { flex: 1; }
.lhwk-cam-x { width: 48px; border: 0; border-left: 1px solid rgba(255,255,255,.25); background: none; color: #fff; font-size: 1.5em; cursor: pointer; }

/* 持っているポイント・支払い内訳 */
.lhwk-pay { margin-bottom: 2px; font-size: .95em; }
.lhwk-pay b { font-size: 1.1em; }
.lhwk-ownedrow { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: var(--lhwk-bg); font-size: .95em; font-weight: 600; }
.lhwk-ownedrow span { font-weight: 400; white-space: nowrap; }
.lhwk-ownedrow input { width: 9em; padding: 8px; border: 1px solid var(--lhwk-border); border-radius: 6px; background: #fff; text-align: right; font-size: 1.05em; }
button.lhwk-tag { border: 1px dashed var(--lhwk-border); cursor: pointer; font-family: inherit; line-height: 1.5; }
.lhwk-cam-status { display: flex; align-items: center; gap: 10px; }
.lhwk-cam-status span { flex: 1; }
.lhwk-cam-undo { flex: none; padding: 6px 12px; border: 1px solid #fde68a; border-radius: 8px; background: none; color: #fde68a; cursor: pointer; font-size: .9em; }
.lhwk-cam-undo[hidden] { display: none; }

/* お得額 */
.lhwk-save { margin: 8px 0 0 !important; padding: 6px 10px; border-radius: 8px; background: #fef3c7; color: #92400e; font-weight: 600; text-align: center; }
.lhwk-save b { font-size: 1.5em; color: #b45309; font-variant-numeric: tabular-nums; }
.lhwk-cam-sum em { font-style: normal; font-weight: 700; color: #fde68a; }
.lhwk-cam button { -webkit-tap-highlight-color: transparent; }
.lhwk-cam-shutter:focus { outline: none; }
.lhwk-bundle { display: block; font-size: .75em; color: #b45309; }
