:root {
  --bg: #f4f6fb;
  --bg-soft: #ffffff;
  --card: #ffffff;
  --card-2: #eef1f8;
  --line: #d7dee9;
  --fg: #161d2e;
  --muted: #5d6a85;
  --accent: #2f6fed;
  --accent-2: #b06f00;
  --good: #0f7a54;
  --bad: #cf3434;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(22, 32, 60, .09);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  background: radial-gradient(1200px 800px at 50% -10%, #ffffff 0%, var(--bg) 62%);
  color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100dvh;
}

h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
a { color: var(--accent); }

.wrap { max-width: 720px; margin: 0 auto; padding: 16px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.card.tight { padding: 12px; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap-row { flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.hidden { display: none !important; }

button, .btn {
  font: inherit;
  font-weight: 600;
  color: var(--fg);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 16px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
  touch-action: manipulation;
}
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary, .btn.primary { background: linear-gradient(180deg, #4b86f5, #2f6fed); border-color: #2f6fed; color: #fff; }
button.good { background: #0f7a54; border-color: #0c6746; color: #fff; }
button.danger { background: #cf3434; border-color: #b32a2a; color: #fff; }
button.ghost { background: transparent; }
button.wide { width: 100%; }
button.small-btn { padding: 7px 11px; font-size: .85rem; border-radius: 10px; }

input, textarea, select {
  font: inherit;
  width: 100%;
  color: var(--fg);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.field { margin-bottom: 12px; }
input[type=checkbox] { width: auto; accent-color: var(--accent); transform: scale(1.3); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line);
  font-size: .8rem; font-weight: 600;
}
.pill.on { background: #e2f6ee; border-color: #8fd6bd; color: #0b6444; }
.pill.off { background: #fdeaea; border-color: #f0b4b4; color: #a52a2a; }

.logo-badge {
  width: 44px; height: 44px; border-radius: 12px; object-fit: cover;
  background: var(--card-2); border: 1px solid var(--line); flex: none;
}
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--card-2); flex: none; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #1b2231; color: #fff; border: 1px solid #2e384d; box-shadow: 0 12px 30px rgba(20, 30, 60, .25);
  padding: 12px 18px; border-radius: 12px; z-index: 999; max-width: 90vw;
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { border-color: var(--bad); }

.timer-bar { height: 8px; background: var(--card-2); border-radius: 999px; overflow: hidden; }
.timer-bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--good), var(--accent-2)); transition: width .3s linear; }
