/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Inter', sans-serif; background: #EEF2F7; color: #14181B; -webkit-tap-highlight-color: transparent; }

/* ── Tokens ── */
:root {
  --blue:    #162660;
  --blue-lt: #D0E6FD;
  --teal:    #4A7FA7;
  --bg:      #EEF2F7;
  --surface: #FFFFFF;
  --card:    #F4F7FA;
  --border:  #DDE3EA;
  --text:    #14181B;
  --muted:   #6B7A8A;
  --red:     #E53935;
  --green:   #1E9E8A;
  --amber:   #D97706;
  --r:       14px;
  --r-lg:    22px;
  --r-xl:    32px;
}

/* ── Utils ── */
.hidden { display: none !important; }

/* ── Spinner ── */
.spin {
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: rot .7s linear infinite;
  flex-shrink: 0;
  display: inline-block;
}
@keyframes rot { to { transform: rotate(360deg); } }

/* ── Snackbar ── */
#snack {
  position: fixed; bottom: 24px; left: 16px; right: 16px;
  max-width: 440px; margin: 0 auto;
  padding: 14px 18px;
  background: #1E293B; color: #fff;
  border-radius: var(--r);
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  transform: translateY(100px); opacity: 0;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .2s;
  z-index: 9999; pointer-events: none;
}
#snack.show  { transform: translateY(0); opacity: 1; }
#snack.ok    { background: var(--green); }
#snack.err   { background: var(--red); }

/* ── Buttons ── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 20px; border: none; border-radius: var(--r);
  font-family: 'Inter', sans-serif; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: opacity .15s, transform .1s; width: 100%;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(.97); opacity: .9; }
.btn-primary  { background: var(--blue); color: #fff; }
.btn-ghost    { background: var(--card); color: var(--text); border: 1.5px solid var(--border); font-size: 14px; height: 44px; }
.btn-danger   { background: rgba(229,57,53,.08); color: var(--red); border: 1.5px solid rgba(229,57,53,.2); }

/* ── Pill ── */
.pill { width: 36px; height: 4px; background: var(--border); border-radius: 2px; margin: 0 auto; }

/* ── Modal ── */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 500;
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.overlay.open { opacity: 1; pointer-events: all; }
.sheet {
  width: 100%; background: var(--surface);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 20px 20px 0;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.34,1.1,.64,1);
  max-height: 90dvh; overflow-y: auto;
}
.overlay.open .sheet { transform: translateY(0); }

/* modal header */
.m-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.m-ico  { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--teal); }
.m-title { font-size: 18px; font-weight: 700; }
.m-sub   { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* modal field */
.mfld { margin-bottom: 14px; }
.mfld label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .4px; }
.mfld input {
  width: 100%; padding: 14px 16px;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--r); font-family: 'Inter', sans-serif;
  font-size: 16px; font-weight: 700; color: var(--text);
  outline: none; letter-spacing: 1.5px; transition: border-color .15s;
  -webkit-appearance: none;
}
.mfld input[type=date] { letter-spacing: 0; font-weight: 500; font-size: 15px; }
.mfld input:focus { border-color: var(--blue); }
.mfld input.bad   { border-color: var(--red); }
.mfld input:disabled { opacity: .5; }
.ferr { font-size: 12px; color: var(--red); margin-top: 5px; }

.info-box {
  background: #EFF6FF; border: 1px solid #BFDBFE;
  border-radius: var(--r); padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: #1E40AF; line-height: 1.5; margin-bottom: 18px;
}
.info-box svg { flex-shrink: 0; margin-top: 1px; }

.m-actions { display: flex; gap: 10px; padding: 16px 0 env(safe-area-inset-bottom, 20px); }
.del-zone  { border-top: 1px solid var(--border); padding: 16px 0 env(safe-area-inset-bottom, 16px); }

/* menu rows */
.menu-user { padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-user strong { font-size: 17px; font-weight: 700; display: block; }
.menu-user span   { font-size: 13px; color: var(--muted); margin-top: 2px; display: block; }

.mrow {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: opacity .15s;
}
.mrow:last-of-type { border-bottom: none; }
.mrow:active { opacity: .6; }
.mrow-ico { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--card); color: var(--teal); }
.mrow span { font-size: 15px; font-weight: 500; }
.mrow.danger .mrow-ico { background: rgba(229,57,53,.08); color: var(--red); }
.mrow.danger span { color: var(--red); }
.m-foot { padding: 12px 0 env(safe-area-inset-bottom, 20px); }

/* support */
.sup-ico { width: 56px; height: 56px; background: var(--card); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--teal); margin: 0 auto 14px; }
.sup-sender { background: var(--card); border-radius: var(--r); padding: 12px 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.srow { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.srow strong { color: var(--text); font-weight: 600; }
textarea.sup-msg {
  width: 100%; min-height: 110px; padding: 12px 14px;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: var(--r); font-family: 'Inter', sans-serif;
  font-size: 14px; color: var(--text); resize: vertical;
  outline: none; transition: border-color .15s; margin-bottom: 16px;
}
textarea.sup-msg:focus { border-color: var(--blue); }
textarea.sup-msg::placeholder { color: var(--muted); }

/* state boxes */
.state-box { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 28px; gap: 10px; }
.state-ico  { width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }
.state-ico.err   { background: rgba(229,57,53,.08); color: var(--red); }
.state-ico.empty { background: var(--card); color: var(--muted); }
.state-box h3 { font-size: 17px; font-weight: 700; }
.state-box p  { font-size: 14px; color: var(--muted); line-height: 1.5; max-width: 260px; }
.state-box .btn { max-width: 200px; margin-top: 6px; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--border) 25%, var(--card) 50%, var(--border) 75%); background-size: 200% 100%; animation: shim 1.3s infinite; border-radius: var(--r); height: 72px; }
@keyframes shim { to { background-position: -200% 0; } }

/* ── Responsive cap ── */
@media (min-width: 520px) {
  .page { max-width: 440px; margin: 0 auto; }
  .overlay .sheet { max-width: 440px; margin: 0 auto; }
  #snack { max-width: 440px; }
  .fab   { right: calc(50% - 220px + 16px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

.bnb-option {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  border: 1.5px solid var(--border); cursor: pointer;
  background: var(--surface); transition: border-color .15s;
}
.bnb-option:hover  { border-color: #4A7FA7; }
.bnb-option.active { border-color: #162660; background: #EEF2F7; }
.bnb-option:active { opacity: .75; }
.bnb-option-ico  { width: 36px; height: 36px; border-radius: 10px; background: #EEF2F7; display: flex; align-items: center; justify-content: center; color: #4A7FA7; flex-shrink: 0; }
.bnb-option-name { font-size: 15px; font-weight: 600; }
.bnb-option-addr { font-size: 12px; color: var(--muted); margin-top: 2px; }
.bnb-option-info { flex: 1; min-width: 0; }