/* Safe Way photo app. Adapted from the partner's page; no inline styles
   anywhere (the Content-Security-Policy allows style sheets from 'self' only). */
:root {
  --bg: #f5f6f8; --card: #fff; --tx: #161a20; --mut: #6b7280; --pr: #ea580c; --on: #fff;
  --ok: #15803d; --wr: #b45309; --bd: #e3e6ea; --dn: #b91c1c;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101418; --card: #1a2027; --tx: #eef1f4; --mut: #9aa4b0; --pr: #fb923c; --on: #1c0f03;
    --ok: #4ade80; --wr: #fbbf24; --bd: #2a323b; --dn: #f87171;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--tx);
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  padding: env(safe-area-inset-top, 0) 0 calc(76px + env(safe-area-inset-bottom, 0));
}
main { max-width: 560px; margin: 0 auto; padding: 14px; }
h1 { font-size: 20px; margin: 4px 0 12px; }
h2 { font-size: 16px; margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--bd); border-radius: 14px; padding: 14px; margin-bottom: 12px; }
.btn {
  display: block; width: 100%; border: 0; border-radius: 12px; padding: 14px; font-size: 16px; font-weight: 600;
  background: var(--pr); color: var(--on); margin-top: 8px; cursor: pointer; font-family: inherit;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, nav button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--pr); outline-offset: 2px; }
.btn.s { background: var(--card); color: var(--tx); border: 1px solid var(--bd); }
.btn.d { background: var(--dn); color: #fff; }
.btn.sm { display: inline-block; width: auto; padding: 8px 12px; font-size: 14px; margin: 0; }
input[type=text], input[type=search], input[type=tel], input[type=password], select {
  width: 100%; padding: 13px; border-radius: 10px; border: 1px solid var(--bd); background: var(--bg); color: var(--tx);
  font-size: 16px; margin: 4px 0 10px; font-family: inherit;
}
input:disabled { opacity: .6; }
label { font-size: 13px; color: var(--mut); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.st { text-align: center; }
.st b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.st span { font-size: 13px; color: var(--mut); }
.bar { height: 12px; background: var(--bd); border-radius: 8px; overflow: hidden; margin: 8px 0; }
.bar .fill { display: block; height: 100%; width: 0; background: var(--ok); }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bd); cursor: pointer; }
.row:last-child { border: 0; }
.row .t { flex: 1; min-width: 0; }
.row .t div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .acts { display: flex; gap: 6px; }
.mut { color: var(--mut); font-size: 13px; }
.ok { color: var(--ok); }
.wr { color: var(--wr); }
nav {
  position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--bd);
  display: flex; padding-bottom: env(safe-area-inset-bottom, 0); z-index: 5;
}
nav button {
  flex: 1; background: none; border: 0; color: var(--mut); padding: 10px 4px; font-size: 13px; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
nav button.on { color: var(--pr); font-weight: 700; }
video { width: 100%; border-radius: 12px; background: #000; max-height: 55vh; }
img.th { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--bd); flex: none; }
img.big { width: 100%; max-height: 300px; object-fit: contain; border-radius: 10px; background: var(--bd); }
#toast {
  position: fixed; top: calc(12px + env(safe-area-inset-top, 0)); left: 50%; transform: translateX(-50%);
  background: var(--tx); color: var(--bg); padding: 10px 18px; border-radius: 20px; z-index: 9; font-size: 14px;
  max-width: calc(100vw - 32px); text-align: center;
}
details summary { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
