* { margin:0; padding:0; box-sizing:border-box; }
html { font-size: 16px; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── card ── */
.card {
  background: var(--surface); border-radius: 10px;
  padding: 18px 16px; margin-bottom: 12px;
  border: 1px solid var(--hairline-light);
}
.card-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.card-head h3 { font-size: 15px; font-weight: 600; color: var(--ink); flex:1; }
.card-head .tag {
  font-size: 11px; padding: 2px 8px; border-radius: 10px;
  color: var(--accent); background: #fff1eb; font-weight: 550;
}
.card label {
  display: block; font-size: 12px; color: var(--ink-light);
  font-weight: 540; margin-bottom: 5px; margin-top: 12px; letter-spacing: .1px;
}
.card label:first-of-type { margin-top: 0; }
.card input, .card textarea, .card select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--hairline);
  border-radius: 8px; font-size: 15px; font-family: inherit;
  background: #fafaf8; color: var(--ink); transition: border .15s, box-shadow .15s;
  -webkit-appearance: none;
}
.card input::placeholder, .card textarea::placeholder { color: #c5c0b8; }
.card input:focus, .card textarea:focus, .card select:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(232,112,64,.1);
  background: #fff;
}
.card textarea { resize: vertical; min-height: 56px; line-height: 1.5; }
.inline-fields { display: flex; gap: 10px; }
.inline-fields > * { flex: 1; }

/* ── buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 5px; padding: 11px 18px; border: none; border-radius: 8px;
  font-size: 14px; font-weight: 550; cursor: pointer; transition: .15s;
  font-family: inherit; letter-spacing: .2px;
}
.btn:active { transform: scale(.975); }
.btn-primary { background: var(--ink); color: #fff; width: 100%; padding: 12px; }
.btn-accent { background: var(--accent); color: #fff; width: 100%; padding: 12px; }
.btn-outline { background: #fff; color: var(--ink); border: 1px solid var(--hairline); }
.btn-danger { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn-sm { padding: 7px 14px; font-size: 12px; border-radius: 6px; }
.btn-group { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }

/* ── toast ── */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(30,30,42,.88); color: #fff; padding: 9px 22px;
  border-radius: 22px; font-size: 13px; z-index: 9999; font-weight: 500;
  pointer-events: none; opacity: 0; transition: opacity .25s;
  backdrop-filter: blur(8px);
}
.toast.show { opacity: 1; }

/* ── empty ── */
.empty { text-align: center; padding: 56px 20px; color: var(--mute); }
.empty .icon { font-size: 44px; margin-bottom: 14px; opacity: .7; }
.empty p { font-size: 14px; line-height: 1.7; }

/* ── search ── */
.search-box {
  width: 100%; padding: 11px 14px; border: 1px solid var(--hairline);
  border-radius: 10px; font-size: 14px; margin-bottom: 4px;
  background: var(--surface); font-family: inherit; color: var(--ink);
}
.search-box::placeholder { color: #c5c0b8; }
.search-box:focus { outline: none; border-color: var(--ink); }

/* ── fab ── */
.fab {
  position: fixed; bottom: 24px; right: 20px; width: 50px; height: 50px;
  border-radius: 16px; background: var(--ink); color: #fff; border: none;
  font-size: 24px; cursor: pointer; z-index: 50; display: flex;
  align-items: center; justify-content: center; transition: .15s;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.fab:active { transform: scale(.92); background: #333; }

/* ── hint / info bars ── */
.hint {
  padding: 10px 14px; background: #fffbf5; border-radius: 8px;
  font-size: 12px; color: #b65620; margin-bottom: 10px;
  border: 1px solid #fce4d0; line-height: 1.6;
}
.calib-info {
  padding: 10px 14px; background: #fafcff; border-radius: 8px;
  font-size: 12px; color: #3050a0; margin-bottom: 8px;
  border: 1px solid #dae4f6; line-height: 1.5;
}

/* ── section divider ── */
.section-divider {
  height: 1px; background: var(--hairline); margin: 16px 0;
}

/* ── coordinate display ── */
.coord-row {
  display: flex; gap: 12px; align-items: center; margin-top: 6px;
  font-size: 13px; color: var(--ink-light);
  font-family: "SF Mono", "Menlo", "Consolas", monospace;
  background: #fafaf8; padding: 8px 10px; border-radius: 6px;
}
.coord-row .val { flex: 1; font-weight: 550; color: var(--ink); }
.coord-row .sep { color: var(--mute); }

/* ── modal / agreement ── */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  z-index: 9998; display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-sheet {
  background: var(--surface); width: 100%; max-width: 480px;
  border-radius: 16px 16px 0 0; padding: 24px 20px 32px;
  max-height: 85vh; overflow-y: auto; animation: slideUp .3s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-sheet h2 { font-size: 18px; margin-bottom: 6px; }
.modal-sheet .sub { font-size: 12px; color: var(--mute); margin-bottom: 18px; }
.modal-sheet p { font-size: 13px; line-height: 1.8; color: var(--ink-light); margin-bottom: 12px; }
.modal-sheet .policy-box {
  background: #fafaf8; border: 1px solid var(--hairline);
  border-radius: 8px; padding: 12px 14px; font-size: 12px;
  color: var(--ink-light); line-height: 1.8; margin-bottom: 18px; max-height: 200px; overflow-y: auto;
}
.modal-sheet .policy-box strong { color: var(--ink); }
.modal-btns { display: flex; gap: 10px; }
.modal-btns button { flex: 1; padding: 12px; border-radius: 8px; font-size: 14px; font-weight: 550; font-family: inherit; cursor: pointer; border: none; }
.modal-btns .btn-agree { background: var(--ink); color: #fff; }
.modal-btns .btn-reject { background: #fff; color: var(--ink); border: 1px solid var(--hairline); }

/* install banner */
.install-banner {
  display: none; background: var(--ink); color: #fff;
  padding: 11px 16px; align-items: center; gap: 10px;
  font-size: 13px; position: fixed; bottom: 88px; left: 14px; right: 14px;
  border-radius: 12px; z-index: 60; box-shadow: 0 8px 30px rgba(0,0,0,.25);
  max-width: 452px; margin: 0 auto;
}
.install-banner.show { display: flex; }
.install-banner .ib-text { flex: 1; line-height: 1.4; }
.install-banner .ib-text b { display: block; font-size: 14px; }
.install-banner button {
  background: #fff; color: var(--ink); border: none;
  padding: 8px 16px; border-radius: 6px; font-size: 13px;
  font-weight: 600; cursor: pointer; flex-shrink: 0; font-family: inherit;
}
.install-banner .ib-close {
  background: transparent; color: rgba(255,255,255,.6); border: none;
  font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1;
}
