:root {
  --green: #2e7d32;
  --orange: #ff6f00;
  --bg: #f1f8e9;
  --muted: #757575;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: #1a1a1a;
}
header {
  background: var(--green);
  color: #fff;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
header h1 { margin: 0; font-size: 22px; }
.status { font-size: 14px; padding: 4px 10px; border-radius: 12px; font-weight: 600; }
.status.connected { background: #c8e6c9; color: #1b5e20; }
.status.connecting { background: #ffe0b2; color: #e65100; }
.status.disconnected { background: #eeeeee; color: #616161; }

main {
  max-width: 760px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  gap: 20px;
}
.card {
  background: #fff;
  border-radius: 16px;
  padding: 20px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.card h2 { margin-top: 0; }

.live-weight { font-size: 56px; font-weight: 800; text-align: center; margin: 8px 0 16px; }
.live-weight .unit { font-size: 24px; color: var(--muted); margin-left: 6px; }

.row { display: flex; gap: 10px; margin-bottom: 16px; }
form { display: grid; gap: 14px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 14px; }
input {
  padding: 10px 12px;
  border: 1px solid #cfd8cf;
  border-radius: 8px;
  font-size: 16px;
}
small { color: var(--muted); font-weight: 400; }

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  background: #e0e0e0;
}
.btn.primary { background: var(--orange); color: #fff; }
.btn.secondary { background: #fff; border: 1px solid var(--green); color: var(--green); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.msg { min-height: 20px; font-weight: 600; }
.msg.ok { color: var(--green); }
.msg.err { color: #c62828; }

table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid #eee; }
th { color: var(--muted); font-weight: 600; }
button.link { background: none; border: none; cursor: pointer; font-size: 13px; padding: 0 4px; }
button.link.edit { color: #1565c0; }
button.link.del { color: #c62828; }

a { color: var(--green); }
.back { color: #fff; font-size: 13px; text-decoration: none; opacity: 0.9; }
header > div h1 { margin: 4px 0 0; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label.check { flex-direction: row; display: flex; align-items: center; gap: 8px; font-weight: 600; }
label.check input { width: auto; }
.thumb { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
code { background: #f1f1f1; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
a.btn { text-decoration: none; display: inline-block; }
