/* ---------- トークン ---------- */
:root {
  --bg: #F2F4F7;
  --surface: #FFFFFF;
  --surface-2: #F6F8FA;
  --ink: #0E1726;
  --muted: #5D6B7E;
  --line: #E3E8EF;

  --brand: #1E3A6E;
  --in: #0E9F6E;
  --in-deep: #0A7F58;
  --in-soft: #DFF5EC;
  --unlock: #2563EB;
  --unlock-deep: #1D4ED8;
  --unlock-soft: #E3ECFF;
  --ok: #0E9F6E;
  --warn: #B45309;
  --warn-soft: #FDF1E1;
  --danger: #D23F31;
  --idle-soft: #E9EDF2;

  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  --radius: 18px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0B111A;
    --surface: #141C28;
    --surface-2: #1A2433;
    --ink: #E8EEF6;
    --muted: #93A1B5;
    --line: #253246;
    --brand: #5B8CE6;
    --in: #20B07E;
    --in-deep: #12936A;
    --in-soft: rgba(32, 176, 126, .16);
    --unlock: #4C82F7;
    --unlock-deep: #3268E0;
    --unlock-soft: rgba(76, 130, 247, .18);
    --ok: #20B07E;
    --warn: #F0A24A;
    --warn-soft: rgba(240, 162, 74, .14);
    --danger: #EF5B4C;
    --idle-soft: #1F2A3A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

/* ---------- ベース ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  overscroll-behavior: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

.i {
  width: 22px; height: 22px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}

.app {
  height: 100vh;
  height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  padding:
    calc(env(safe-area-inset-top) + 8px)
    16px
    calc(env(safe-area-inset-bottom) + 16px);
  display: flex;
  flex-direction: column;
}
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fade .25s ease;
}
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- ボタン ---------- */
.btn {
  height: 56px;
  border-radius: 14px;
  border: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .04em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .1s, opacity .2s, background .2s;
  flex: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-secondary { background: var(--idle-soft); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--line);
}

.icon-btn {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  display: grid; place-items: center;
}

.spinner {
  width: 28px; height: 28px; margin: auto;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- ログイン ---------- */
.view-login { justify-content: center; gap: 20px; }
.brand { text-align: center; }
.brand-mark {
  width: 64px; height: 64px; margin: 0 auto 12px;
  border-radius: 20px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 35%, transparent);
}
.brand-mark .i { width: 30px; height: 30px; }
.brand h1 { margin: 0; font-size: 24px; letter-spacing: .06em; }
.brand p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.login-form { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
  width: 100%; height: 52px;
  padding: 0 14px;
  font-size: 18px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  outline: none;
  transition: border-color .15s, background .15s;
}
.field input:focus { border-color: var(--brand); background: var(--surface); }
#phone { letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.pw { position: relative; display: block; }
.pw input { padding-right: 52px; }
.pw-toggle {
  position: absolute; right: 4px; top: 4px;
  width: 44px; height: 44px;
  border: 0; background: none; color: var(--muted);
  display: grid; place-items: center;
}
.form-error { margin: 0; min-height: 20px; font-size: 14px; color: var(--danger); }
.form-error:empty { min-height: 0; margin-top: -14px; }

.demo { text-align: center; }
.demo p { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.demo-list { display: flex; gap: 8px; justify-content: center; }
.chip {
  height: 36px; padding: 0 14px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  background: var(--surface);
  font-size: 14px; color: var(--muted);
}

/* ---------- ホーム ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 52px; flex: none; }
.topbar-actions { display: flex; gap: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.check-lg { margin: 16px 0 18px; padding: 14px; border-radius: 14px; background: var(--surface-2); color: var(--ink); font-size: 15px; }
.who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center;
  font-weight: 700;
}
.who-name { font-weight: 700; font-size: 16px; }
.who-sub { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.status { padding: 14px 18px 16px; flex: none; }
.status-row { display: flex; align-items: center; justify-content: space-between; }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 12px;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  background: var(--idle-soft); color: var(--muted);
}
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.is-on .pill { background: var(--in-soft); color: var(--in); }
.is-on .pill::before { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.today { font-size: 14px; color: var(--muted); }
.clock {
  margin-top: 6px;
  font-size: clamp(40px, 9dvh, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.clock small { font-size: .42em; color: var(--muted); font-weight: 600; margin-left: 2px; }
.status-sub { margin-top: 4px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.status-sub b { color: var(--ink); }
/* 出勤中は時計を少し小さくし、鍵BOXカードの場所を確保する */
.is-on .clock { font-size: clamp(32px, 6.5dvh, 44px); }

.keybox { padding: 12px 16px 14px; flex: none; }
.keybox-head { display: flex; align-items: center; justify-content: space-between; }
.keybox-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.keybox-title .i { width: 18px; height: 18px; color: var(--unlock); }
.keybox-note {
  flex: none; white-space: nowrap; margin-left: 8px;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 6px;
  color: var(--warn); background: var(--warn-soft);
}
.code { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.code span {
  width: 40px; height: 48px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 26px; font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.code span:nth-child(3) { margin-right: 10px; }
.code-label { margin-top: 6px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- 主操作（円形ボタン） ---------- */
.stage {
  flex: 1;
  min-height: 120px;
  display: grid;
  place-items: center;
  container-type: size;
}
.orb {
  /* 空き領域に合わせて伸縮（外周リング14px分を差し引く） */
  --size: min(220px, calc(100cqh - 32px), calc(100cqw - 48px));
  --c: var(--in); --c-deep: var(--in-deep); --c-soft: var(--in-soft);
  position: relative;
  width: var(--size); height: var(--size);
  border: 0; border-radius: 50%;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 80%, #fff) 0%, var(--c) 45%, var(--c-deep) 100%);
  box-shadow:
    0 0 0 14px var(--c-soft),
    0 16px 36px color-mix(in srgb, var(--c) 40%, transparent);
  transition: transform .12s ease, background .3s, box-shadow .3s;
}
.orb:active { transform: scale(.96); }
.orb:disabled { cursor: default; }
.orb-unlock { --c: var(--unlock); --c-deep: var(--unlock-deep); --c-soft: var(--unlock-soft); }
.orb-body { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.orb-icon { width: clamp(26px, 6dvh, 42px); height: clamp(26px, 6dvh, 42px); stroke-width: 2.2; }
.orb-label { font-size: clamp(20px, 3.6dvh, 26px); font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.orb-sub { font-size: 12px; opacity: .85; white-space: nowrap; }

/* 通信中：外周を回転するリング */
.orb.is-busy::after {
  content: "";
  position: absolute; inset: -14px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--c);
  animation: spin 1s linear infinite;
}
.orb.is-busy .orb-body { opacity: .9; }

/* 開錠成功 */
.orb.is-done { --c: var(--ok); --c-deep: var(--in-deep); --c-soft: var(--in-soft); animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.05); } }

.geo {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 20px;
  font-size: 12px; color: var(--muted);
  flex: none;
}
.geo .i { width: 15px; height: 15px; }
.geo.is-ok { color: var(--ok); }
.geo.is-warn { color: var(--warn); }

/* ---------- 退勤確認シート ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(8, 12, 20, .45); animation: fadeIn .2s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 480px; margin: 0 auto;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 10px 20px calc(env(safe-area-inset-bottom) + 20px);
  animation: up .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes up { from { transform: translateY(100%); } }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 14px; }
.sheet h2 { margin: 0 0 6px; font-size: 20px; }
.sheet p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.6; }
.sheet p strong { color: var(--danger); }
.sheet-summary {
  margin: 14px 0 18px; padding: 12px 14px;
  border-radius: 12px; background: var(--surface-2);
  font-size: 14px; display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  font-variant-numeric: tabular-nums;
}
.sheet-summary dt { color: var(--muted); }
.sheet-summary dd { margin: 0; font-weight: 700; text-align: right; }
.sheet-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }

/* ---------- トースト ---------- */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 12px); z-index: 30;
  transform: translate(-50%, -150%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink); color: var(--bg);
  font-size: 14px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility .3s;
  visibility: hidden;
  pointer-events: none;
}
.toast.is-show { transform: translate(-50%, 0); visibility: visible; }
.toast.is-error { background: var(--danger); color: #fff; }

/* 低い画面（iPhone SE 等）では余白を詰める */
@media (max-height: 640px) {
  .view { gap: 8px; }
  .status { padding: 10px 14px 12px; }
  .code span { width: 34px; height: 42px; font-size: 22px; }
  .orb { box-shadow: 0 0 0 10px var(--c-soft), 0 12px 28px color-mix(in srgb, var(--c) 40%, transparent); }
  .btn { height: 50px; }
}

/* ---------- 本日の現場 ---------- */
.site { display: flex; align-items: center; gap: 12px; padding: 12px 14px; flex: none; }
.site-icon {
  width: 40px; height: 40px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--in-soft); color: var(--in);
}
.site.is-none .site-icon { background: var(--idle-soft); color: var(--muted); }
.site-main { min-width: 0; }
.site-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.site-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }

/* ---------- 鍵情報の状態 ---------- */
.keybox-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.keybox-title { min-width: 0; }
.key-state { min-height: 78px; }
.key-wait { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 14px; color: var(--muted); }
.spinner-sm { width: 18px; height: 18px; border-width: 2px; margin: 0; }
.key-denied { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.key-denied p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; color: var(--warn); font-weight: 600; }
.btn-recheck {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--surface-2); font-size: 13px; font-weight: 700;
}
.btn-recheck .i { width: 16px; height: 16px; }

/* 出勤できない／開錠できないときの円形ボタン */
.orb.is-off {
  --c: #9AA5B4; --c-deep: #7E8A9A; --c-soft: var(--idle-soft);
  box-shadow: 0 0 0 14px var(--c-soft);
}

/* ---------- 鍵の持ち出し（工事関係者） ---------- */
.key-held { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.key-held > span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--unlock); }
.key-held .i { width: 16px; height: 16px; }
.check-key { margin: 0 0 16px; border: 1.5px solid var(--warn); background: var(--warn-soft); }

/* ---------- 仲介（内見） ---------- */
.avatar-broker { background: #7C3AED; }
.bcard { padding: 14px 18px 16px; flex: none; display: flex; flex-direction: column; gap: 4px; }
.bcard .pill.is-ok { background: var(--in-soft); color: var(--in); }
.bcard .pill.is-wait { background: var(--warn-soft); color: var(--warn); }
.bcard .pill.is-in { background: var(--unlock-soft); color: var(--unlock); }
.bcard .pill.is-in::before { animation: pulse 1.6s ease-in-out infinite; }
.bcard .pill.is-due { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.b-prop { margin-top: 6px; font-size: 18px; font-weight: 800; line-height: 1.35; }
.b-addr { font-size: 12px; color: var(--muted); }
.b-codebox .code { margin-top: 8px; }
.b-crew {
  margin-top: 8px; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.5; font-weight: 600;
  background: var(--unlock-soft); color: var(--unlock);
}
.b-crew.is-none { background: var(--idle-soft); color: var(--muted); }
.view-broker .stage { min-height: 110px; }
.view-broker .orb { --size: min(170px, calc(100cqh - 32px), calc(100cqw - 48px)); }
.orb-report { --c: var(--danger); --c-deep: #A82E22; --c-soft: color-mix(in srgb, var(--danger) 16%, transparent); }
.blist-card { flex: 0 1 auto; min-height: 120px; max-height: 32dvh; display: flex; flex-direction: column; overflow: hidden; }
.blist-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px 16px; font-size: 14px; }
.blist { list-style: none; margin: 0; padding: 0 8px 8px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.blist button {
  width: 100%; text-align: left; border: 1px solid transparent; background: var(--surface-2);
  border-radius: 12px; padding: 8px 10px; display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center;
}
.blist button.is-sel { border-color: var(--brand); background: var(--surface); }
.blist b { font-size: 13px; font-variant-numeric: tabular-nums; }
.blist small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blist .st { grid-row: span 2; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--idle-soft); color: var(--muted); white-space: nowrap; }
.st.is-ok { background: var(--in-soft); color: var(--in); }
.st.is-wait { background: var(--warn-soft); color: var(--warn); }
.st.is-in { background: var(--unlock-soft); color: var(--unlock); }
.st.is-due, .st.is-bad { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.blist .empty { padding: 14px; text-align: center; font-size: 13px; color: var(--muted); }

/* 操作シートの中身 */
.bform { display: flex; flex-direction: column; gap: 12px; margin: 14px 0 16px; }
.bform .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field select, .field input.sm {
  width: 100%; height: 46px; padding: 0 12px; font-size: 16px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface-2); outline: none;
}
.field input.sm { font-size: 16px; }
.choice { display: flex; flex-direction: column; gap: 8px; }
.choice label {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface-2); cursor: pointer;
}
.choice input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.choice b { display: block; font-size: 15px; }
.choice small { display: block; font-size: 12.5px; color: var(--muted); line-height: 1.55; margin-top: 2px; }
.choice label:has(input:checked) { border-color: var(--brand); background: var(--surface); }
.steps-mini { margin: 6px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.code-inline { font-weight: 800; letter-spacing: .12em; color: var(--ink); font-variant-numeric: tabular-nums; }
.sheet .note { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }
.b-actions { display: flex; justify-content: flex-end; margin-top: 4px; }
.btn-link { border: 0; background: none; padding: 4px 0; font-size: 12.5px; font-weight: 700; color: var(--danger); }

/* ---------- 現場の今・鍵の受け渡し ---------- */
.nowcard { padding: 10px 14px; flex: none; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.now-key { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.now-key .i { width: 16px; height: 16px; }
.now-key.is-in { color: var(--ok); }
.now-key.is-out { color: var(--unlock); }
.now-key.is-mine { color: var(--warn); }
.now-key.is-unknown { color: var(--danger); }
.now-people { color: var(--muted); line-height: 1.55; }
.now-people b { color: var(--ink); font-weight: 700; }
.key-choice { margin: 0 0 16px; }
.key-choice-head { display: flex; align-items: center; gap: 6px; margin: 0 0 8px !important; font-weight: 700; color: var(--warn) !important; font-size: 14px !important; }
.key-choice-head .i { width: 16px; height: 16px; }
.key-choice select { margin-top: 8px; width: 100%; height: 40px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 10px; font-size: 14px; }
.key-choice small.is-ok { color: var(--ok); font-weight: 700; }
.model-tag { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; background: var(--idle-soft); color: var(--muted); vertical-align: 1px; }
.model-tag.m1 { background: #E0F2FE; color: #0369A1; }
.model-tag.m2 { background: #F1EAFE; color: #7C3AED; }
.model-tag.m3 { background: #FEF3C7; color: #B45309; }

/* 物件写真（業プロ撮影） */
.site-icon.has-photo { padding: 0; overflow: hidden; background: none; width: 56px; height: 44px; }
.site-icon.has-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.now-people a { color: var(--unlock); font-variant-numeric: tabular-nums; }
.b-prop { display: flex; align-items: center; gap: 10px; }
.b-photo { width: 58px; height: 40px; border-radius: 8px; object-fit: cover; flex: none; }

/* 退勤（名前の横） */
.who { min-width: 0; }
.clockout-pill {
  margin-left: 6px; height: 34px; padding: 0 12px; border-radius: 999px; flex: none;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font-size: 13.5px; font-weight: 800; display: inline-flex; align-items: center; gap: 4px;
}
.clockout-pill .i { width: 16px; height: 16px; color: var(--danger); }
/* 本日の現場の欄にまとめた「現場の今」 */
.site { flex-wrap: wrap; }
.site-main { flex: 1; }
.site-now { flex-basis: 100%; display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12.5px; }
.site-now:empty { display: none; }
.keybox .now-key { margin-top: 8px; font-size: 13px; }
.keybox .now-people { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); font-size: 12px; }
.keybox .now-people:empty { display: none; }
/* 開錠ボタンを大きく、文字をはっきり */
#unlock-btn { --size: min(250px, calc(100cqh - 32px), calc(100cqw - 48px)); }
/* 文字とアイコンは円の大きさに合わせる（小さい画面でも円からはみ出さない） */
#unlock-btn .orb-label { font-size: calc(var(--size) * 0.13); }
#unlock-btn .orb-sub { font-size: max(11px, calc(var(--size) * 0.056)); font-weight: 700; opacity: 1; }
#unlock-btn .orb-icon { width: calc(var(--size) * 0.19); height: calc(var(--size) * 0.19); }
/* デモで暗証コードを出さないときは、空いた高さを詰める */
#key-ok.is-demo { min-height: 0; }
#key-ok.is-demo .code-label { margin-top: 4px; text-align: left; }

/* 鍵を持ったまま退勤しようとしたときの警告と、建物内での受け渡し（相手の承諾で持ち主が変わる） */
.key-warn { margin: 0 0 16px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--warn); background: var(--warn-soft); display: flex; flex-direction: column; gap: 8px; }
.key-warn-head { display: flex; align-items: center; gap: 6px; margin: 0 !important; font-weight: 800; color: var(--warn) !important; font-size: 15px !important; }
.key-warn-head .i { width: 18px; height: 18px; }
.key-warn-text { margin: 0 !important; font-size: 13px !important; line-height: 1.6; color: var(--ink) !important; }
.key-pass { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; border-top: 1px dashed var(--warn); }
.key-pass b { font-size: 13.5px; }
.key-pass small { font-size: 12px; color: var(--muted); line-height: 1.55; }
.key-pass-row { display: flex; gap: 8px; margin-top: 4px; }
.key-pass-row select { flex: 1; min-width: 0; height: 42px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 10px; font-size: 14px; }
.key-pass-row .btn { flex: none; height: 42px; padding: 0 12px; font-size: 13.5px; }
.key-wait { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface); font-size: 13px; line-height: 1.5; }
.key-wait b { color: var(--ink); }
.key-wait .btn-link { margin-left: auto; flex: none; }
.key-wait.is-bad { color: var(--danger); }
.key-wait .spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--warn); animation: ho-spin 1s linear infinite; flex: none; }
@keyframes ho-spin { to { transform: rotate(360deg); } }
.key-done { margin: 0 0 16px; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--ok); color: var(--ok); font-weight: 700; font-size: 13.5px; }
#ho-sheet .sheet-panel { border-top: 4px solid var(--warn); }
#ho-text { font-size: 15px !important; color: var(--ink) !important; }
.ho-note { font-size: 12.5px !important; }
#ho-sheet .sheet-actions { grid-template-columns: 1fr 1fr; }
#ho-sheet .sheet-actions .btn { white-space: nowrap; padding: 0 8px; }

/* 売主・工事管理者からの確認のお願い（スマホアプリ・仲介の画面で共通） */
#nt-sheet .sheet-panel { border-top: 4px solid var(--danger); }
.nt-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.nt-head h2 { margin: 0 !important; }
.nt-head small { font-size: 12.5px; color: var(--muted); }
.nt-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--danger); color: #fff; }
.nt-ic .i { width: 22px; height: 22px; }
#nt-sheet .nt-mail { margin-top: 8px; font-size: 11.5px; }
#nt-sheet .sheet-actions { grid-template-columns: 1fr; }

/* 確認のお願い：5W1H のカード（見出し＝何が／いつ・どこで／なぜ／お願いしたいこと／メッセージ） */
#nt-sheet { --nc-accent: var(--unlock); --nc-accent-soft: var(--unlock-soft); --nc-bad: var(--danger); --nc-bad-soft: #FDECEA; }
#nt-sheet .sheet-panel { max-height: 92dvh; overflow-y: auto; }
#nt-sheet .nt-mail { margin-top: 10px !important; font-size: 11.5px !important; }
.nc { display: flex; flex-direction: column; gap: 10px; }
.nc .nc-what { margin: 0; font-size: 16px; font-weight: 800; line-height: 1.45; color: var(--ink); }
.nc-facts { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; padding: 2px 12px; }
.nc-fact { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); }
.nc-fact:last-child { border-bottom: 0; }
.nc-fi { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--nc-accent-soft); color: var(--nc-accent); }
.nc-fi .i { width: 17px; height: 17px; }
.nc-fact > div { min-width: 0; }
.nc-fact small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
.nc-fact b { display: block; font-size: 15px; line-height: 1.4; color: var(--ink); }
.nc-fact > div > span { display: block; font-size: 12.5px; color: var(--muted); }
.nc-why { border-radius: 12px; padding: 10px 12px; background: var(--nc-bad-soft); border: 1.5px solid var(--nc-bad); }
.nc-why small { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: var(--nc-bad); }
.nc-why small .i { width: 14px; height: 14px; }
.nc-why ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--ink); }
.nc-how { border-radius: 12px; padding: 10px 12px; background: var(--nc-accent-soft); border: 1.5px solid var(--nc-accent); }
.nc-how small { display: block; font-size: 11px; font-weight: 800; color: var(--nc-accent); }
.nc-how b { display: block; font-size: 14px; line-height: 1.55; color: var(--ink); }
.nc-note { position: relative; margin-left: 8px; border-radius: 12px; padding: 8px 12px; background: var(--surface-2); font-size: 14px; line-height: 1.5; color: var(--ink); }
.nc-note::before { content: ''; position: absolute; left: -7px; top: 14px; border: 7px solid transparent; border-left: 0; border-right-color: var(--surface-2); }
.nc-note small { display: block; font-size: 11px; font-weight: 700; color: var(--muted); }
