:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --bg: #f1f5f9;
  --box: #fff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --ok: #15803d;
  --warn: #b45309;
  --err: #b91c1c;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
a { color: var(--primary); }
h1 { font-size: 1.25rem; margin: 0 0 .5rem; }
h2 { font-size: 1.05rem; margin: 0; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: .6rem; padding: .6rem 1rem; padding-top: calc(.6rem + env(safe-area-inset-top)); background: var(--primary); color: #fff; }
.logo { width: 28px; height: 28px; border-radius: 7px; background: #fff; }
.bar-title { font-weight: 600; flex: 1; }
.net { font-size: .9rem; color: #86efac; }
.net.off { color: #fca5a5; }

.view { max-width: 640px; margin: 0 auto; padding: 1rem; }
.box { background: var(--box); border-radius: 12px; padding: 1rem; margin-bottom: 1rem; box-shadow: 0 1px 2px rgba(15, 23, 42, .06); }
main.box { max-width: 480px; margin: 2rem auto; }

label { display: block; font-size: .85rem; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: .25rem; font: inherit; font-size: 16px; color: var(--text); padding: .6rem .7rem; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
#show { font-weight: 600; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin: .5rem 0 1rem; }
.grid .full { grid-column: 1 / -1; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: inherit; font-weight: 600; padding: .55rem .9rem; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; color: var(--text); cursor: pointer; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:active { background: var(--primary-dark); }
.btn.big { width: 100%; padding: 1rem; font-size: 1.05rem; }
.btn.small { padding: .35rem .7rem; font-size: .85rem; }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }
.actions { display: grid; gap: .7rem; margin-bottom: 1rem; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.hint { color: var(--muted); font-size: .85rem; margin: .4rem 0; }
.warn { color: var(--warn); background: #fffbeb; border-radius: 8px; padding: .5rem .7rem; font-size: .85rem; margin: 0; }
.error { color: var(--err); background: #fef2f2; border-radius: 8px; padding: .5rem .7rem; font-size: .9rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; }

.list { list-style: none; margin: .5rem 0 0; padding: 0; }
.list li { display: flex; align-items: center; gap: .6rem; padding: .6rem 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .who { flex: 1; min-width: 0; }
.list .who b, .list .who span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .who span { color: var(--muted); font-size: .85rem; }
.badge { font-size: .75rem; font-weight: 600; padding: .2rem .5rem; border-radius: 999px; white-space: nowrap; background: #e2e8f0; color: #334155; }
.badge.ok { background: #dcfce7; color: var(--ok); }
.badge.wait { background: #fef3c7; color: var(--warn); }
.badge.err { background: #fee2e2; color: var(--err); }
.badge.check { background: #dbeafe; color: #1d4ed8; }

.card { position: relative; margin: .5rem 0 1rem; }
.card img { width: 100%; max-height: 260px; object-fit: contain; border-radius: 8px; background: #e2e8f0; }
.scan-state { margin-top: .4rem; font-size: .9rem; color: var(--muted); }
.scan-state.busy::before { content: ""; display: inline-block; width: .9rem; height: .9rem; margin-right: .4rem; vertical-align: -2px; border: 2px solid #cbd5e1; border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.rating { display: flex; gap: .5rem; border: 0; padding: 0; margin: 0 0 1rem; flex-wrap: wrap; }
.rating legend { font-size: .85rem; color: var(--muted); margin-bottom: .3rem; padding: 0; }
.rating label { flex: 1; display: flex; align-items: center; justify-content: center; gap: .3rem; border: 1px solid #cbd5e1; border-radius: 10px; padding: .55rem; color: var(--text); font-size: .95rem; }
.rating input { width: auto; margin: 0; }
.rating label:has(input:checked) { border-color: var(--primary); background: #f0fdfa; }

.toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: 90vw; background: #0f172a; color: #fff; padding: .7rem 1rem; border-radius: 10px; font-size: .9rem; z-index: 10; }
