/* hamlcheck — 高對比亮色主題(陽光下可讀);大按鈕(手套/單手) */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --paper: #ffffff; --bg: #eef1f5; --ink: #10161f; --sub: #4a5568;
  --line: #c3ccd8; --brand: #1d4ed8;
  --ok: #166534; --danger: #b91c1c; --warnbg: #fffbeb; --warnbd: #f4c74d;
  --radius: 12px;
}
html { font-size: 17px; }
body {
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }

#banner {
  display: none; background: #92400e; color: #fff; text-align: center;
  padding: 6px 10px; font-size: .88rem; position: sticky; top: 0; z-index: 50;
}
#banner.show { display: block; }

.page { max-width: 560px; margin: 0 auto; padding: 14px 14px 120px; }
.topbar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px; min-height: 44px;
}
.topbar h1 { font-size: 1.15rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .back {
  border: 2px solid var(--line); background: var(--paper); border-radius: 10px;
  width: 44px; height: 44px; font-size: 1.3rem; flex: none;
}
.topbar .mini {
  border: 2px solid var(--line); background: var(--paper); border-radius: 10px;
  padding: 8px 12px; font-size: .9rem; flex: none;
}

.card {
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; margin-bottom: 12px;
}
.warn {
  background: var(--warnbg); border: 2px solid var(--warnbd); border-radius: 10px;
  padding: 10px 12px; margin: 10px 0; font-size: .95rem;
}
.warn::before { content: "⚠️ "; }

/* 大按鈕 */
.bigbtn {
  display: block; width: 100%; min-height: 64px; margin-bottom: 10px;
  border: 2px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: var(--radius); font-size: 1.08rem; font-weight: bold; padding: 12px 16px;
  text-align: center;
}
.bigbtn:active { transform: scale(.99); }
.bigbtn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.bigbtn.picked { border-color: var(--brand); border-width: 3px; background: #eaf0ff; }
.bigbtn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.bigbtn.ng { background: var(--danger); border-color: var(--danger); color: #fff; }
.bigbtn:disabled { opacity: .45; }

.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grid .bigbtn { min-height: 56px; margin: 0; font-size: 1rem; padding: 8px 4px; }
.grid .bigbtn small { display: block; font-weight: normal; font-size: .7rem; color: var(--sub); }
.grid .bigbtn.busy { border-style: dashed; color: var(--sub); }

/* dashboard */
.tabs { display: flex; gap: 8px; margin: 12px 0; }
.tabs button {
  flex: 1; min-height: 48px; border: 2px solid var(--line); background: var(--paper);
  border-radius: 10px; font-weight: bold;
}
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.sess { position: relative; }
.sess .zone { font-weight: bold; font-size: 1.05rem; }
.sess .meta { color: var(--sub); font-size: .88rem; }
.sess .chip {
  display: inline-block; border-radius: 6px; padding: 1px 8px; font-size: .78rem;
  font-weight: bold; margin-left: 6px; vertical-align: 2px;
}
.chip.open { background: #fee2e2; color: var(--danger); }
.chip.closed { background: #dcfce7; color: var(--ok); }
.chip.idle { background: #f1f5f9; color: var(--sub); }
.empty { text-align: center; color: var(--sub); padding: 30px 0; }

/* 精靈 */
.chainbar { display: flex; gap: 4px; overflow-x: auto; padding: 4px 0 8px; }
.chainbar .n {
  flex: 1 0 auto; min-width: 52px; text-align: center; font-size: .72rem; line-height: 1.3;
  border: 2px solid var(--line); border-radius: 8px; padding: 4px 2px; color: #8895a7;
  background: var(--paper);
}
.chainbar .n.sus { border-color: var(--danger); color: var(--danger); font-weight: bold; }
.chainbar .n b { display: block; font-size: .85rem; }
.chainlabel { font-size: .85rem; color: var(--sub); margin-bottom: 8px; }

.steptag {
  display: inline-block; background: #334155; color: #fff; border-radius: 6px;
  padding: 2px 12px; font-weight: bold; margin-bottom: 8px; font-size: .9rem;
}
.steptitle { font-size: 1.3rem; font-weight: bold; margin-bottom: 8px; }
.stephint { font-size: 1.02rem; margin-bottom: 10px; }

.photoline { margin: 12px 0; }
.photoline .prompt { font-weight: bold; margin-bottom: 6px; }
.photoline.guided .addbtn { border-color: var(--brand); color: var(--brand); border-width: 2.5px; }
.addbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 56px; min-width: 150px; border: 2px dashed var(--line); border-radius: 10px;
  background: var(--paper); font-weight: bold; padding: 8px 14px;
}
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.thumb {
  position: relative; width: 76px; height: 76px; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--line); background: #dde3ea; flex: none;
}
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb .st {
  position: absolute; right: 2px; bottom: 2px; background: rgba(0,0,0,.65); color: #fff;
  font-size: .7rem; border-radius: 5px; padding: 0 5px;
}
.thumb.fail { border-color: var(--danger); }
.thumb .del {
  position: absolute; right: 2px; top: 2px; width: 24px; height: 24px; border: none;
  border-radius: 6px; background: rgba(0,0,0,.65); color: #fff; font-size: .8rem;
}

.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: var(--paper); border-top: 2px solid var(--line);
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
}
.bottom .inner { max-width: 560px; margin: 0 auto; }
.bottom .q { font-weight: bold; margin-bottom: 8px; font-size: 1.05rem; }
.bottom .pair { display: flex; gap: 10px; }
.bottom .pair .bigbtn { flex: 1; margin: 0; min-height: 72px; }
.bottom .stack .bigbtn { min-height: 58px; }
.subrow { display: flex; gap: 8px; margin-top: 8px; }
.subrow button {
  flex: 1; min-height: 44px; border: 1.5px solid var(--line); background: var(--paper);
  border-radius: 10px; font-size: .9rem; color: var(--sub);
}

/* timeline */
.tl { list-style: none; }
.tl li { border-left: 3px solid var(--line); padding: 2px 0 14px 14px; margin-left: 6px; position: relative; }
.tl li::before {
  content: ""; position: absolute; left: -8px; top: 6px; width: 13px; height: 13px;
  border-radius: 50%; background: var(--paper); border: 3px solid var(--brand);
}
.tl li.now::before { background: var(--brand); }
.tl .t { color: var(--sub); font-size: .82rem; }
.tl .redo { margin-top: 4px; font-size: .85rem; color: var(--brand); background: none; border: none; text-decoration: underline; }
.verdictbox { border: 2.5px solid var(--danger); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; background: #fef2f2; }
.verdictbox b { font-size: 1.15rem; }

/* close */
.radio { display: block; width: 100%; text-align: left; margin-bottom: 8px; }
.checkline { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-size: 1rem; }
.checkline input { width: 26px; height: 26px; flex: none; margin-top: 2px; }
textarea.note { width: 100%; min-height: 72px; border: 2px solid var(--line); border-radius: 10px; padding: 10px; }
select, input[type=text], input[type=tel] {
  width: 100%; min-height: 52px; border: 2px solid var(--line); border-radius: 10px; padding: 8px 12px;
  background: var(--paper);
}
.holdbtn { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.holdbtn .fill {
  position: absolute; inset: 0; width: 0%; background: rgba(255,255,255,.3); pointer-events: none;
}

/* login */
.login { max-width: 400px; margin: 8vh auto 0; }
.login label { font-weight: bold; display: block; margin: 12px 0 4px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.chips button { border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 14px; min-height: 40px; }
.err { color: var(--danger); min-height: 1.4em; font-size: .92rem; margin-top: 8px; }

.report {
  background: #0f1b2d; color: #dbe7f5; border-radius: 10px; padding: 12px 14px;
  font-family: Consolas, monospace; font-size: .82rem; white-space: pre-wrap; line-height: 1.7;
  margin: 10px 0;
}
dialog {
  border: none; border-radius: var(--radius); padding: 18px; max-width: 90vw; width: 340px;
  margin: auto;
}
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog .bigbtn { min-height: 52px; }
.viewer { background: #000; width: 96vw; max-width: 96vw; height: 80vh; display: flex; align-items: center; justify-content: center; padding: 4px; }
.viewer img, .viewer video { max-width: 100%; max-height: 100%; }
