/* Rimuru Tempest: dark, slime-blue glow, thin lines, calm motion. */
:root {
  --bg: #05080d;
  --bg2: #0a1018;
  --card: rgba(14, 22, 33, .72);
  --card-solid: #0d1520;
  --line: rgba(120, 220, 255, .12);
  --line2: rgba(120, 220, 255, .24);
  --text: #e8f4fb;
  --dim: #8aa3b5;
  --faint: #56697a;
  --slime: #5fe1ff;
  --slime2: #3aa8ff;
  --glow: rgba(95, 225, 255, .35);
  --ok: #6ff0b4;
  --warn: #ffc56b;
  --bad: #ff7d8f;
  --radius: 18px;
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); overflow: hidden;
  overscroll-behavior: none; }
body { font: 15px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; position: fixed; inset: 0; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }

/* background: two slow slime orbs + a faint grid */
.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .32; }
.o1 { width: 340px; height: 340px; background: radial-gradient(circle, #2bd4ff, transparent 70%); top: -120px;
  right: -110px; animation: drift 18s ease-in-out infinite alternate; }
.o2 { width: 300px; height: 300px; background: radial-gradient(circle, #2a6bff, transparent 70%); bottom: 8%;
  left: -150px; animation: drift 22s ease-in-out infinite alternate-reverse; opacity: .2; }
.grid { position: absolute; inset: 0; opacity: .05;
  background-image: linear-gradient(var(--slime) 1px, transparent 1px), linear-gradient(90deg, var(--slime) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: linear-gradient(to bottom, #000, transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 70%); }
@keyframes drift { to { transform: translate(-40px, 60px) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

/* the scrolling page (only this scrolls; no page bounce) */
.view { position: absolute; z-index: 1; left: 0; right: 0; top: 0;
  bottom: calc(var(--tab-h) + var(--safe-b)); overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; padding: calc(var(--safe-t) + 14px) 16px 28px; }
.view.full { bottom: 0; }
.wrap { max-width: 560px; margin: 0 auto; }

/* bottom bar: pinned to the very bottom edge, its background runs under the home indicator */
.tabs { position: fixed; z-index: 5; left: 0; right: 0; bottom: 0; height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b); display: flex; background: rgba(6, 10, 16, .88);
  backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line); }
.tabs[hidden] { display: none; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); text-decoration: none; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
  min-height: var(--tab-h); }
.tabs a svg { width: 24px; height: 24px; transition: transform .2s, filter .2s; }
.tabs a.on { color: var(--slime); }
.tabs a.on svg { filter: drop-shadow(0 0 6px var(--glow)); transform: translateY(-1px); }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 16px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .mark { width: 30px; height: 30px; }
.brand h1 { margin: 0; font-size: 13px; letter-spacing: .32em; font-weight: 600; }
.brand small { display: block; color: var(--faint); font-size: 10px; letter-spacing: .24em; margin-top: 1px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px;
  border: 1px solid var(--line2); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--slime); background: rgba(95, 225, 255, .06); white-space: nowrap; }
.chip i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chip.warn { color: var(--warn); border-color: rgba(255, 197, 107, .35); background: rgba(255, 197, 107, .07); }
.chip.bad { color: var(--bad); border-color: rgba(255, 125, 143, .35); background: rgba(255, 125, 143, .07); }
.chip.ok { color: var(--ok); border-color: rgba(111, 240, 180, .3); background: rgba(111, 240, 180, .06); }
.chip.dim { color: var(--dim); border-color: var(--line); background: transparent; }

/* cards */
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card.glow { border-color: var(--line2); box-shadow: 0 0 0 1px rgba(95, 225, 255, .04), 0 10px 40px -18px var(--glow); }
.card h2 { margin: 0 0 12px; font-size: 10.5px; font-weight: 600; letter-spacing: .24em; text-transform: uppercase;
  color: var(--dim); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card p { margin: 0 0 10px; color: var(--dim); }
.card p:last-child { margin-bottom: 0; }
.note { font-size: 13px; color: var(--dim); }
.faint { color: var(--faint); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px;
  border: 1px dashed rgba(255, 197, 107, .35); background: rgba(255, 197, 107, .05); color: #f4d9a8; font-size: 13px; }
.banner svg { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--warn); }
.banner.bad { border-color: rgba(255, 125, 143, .4); background: rgba(255, 125, 143, .06); color: #ffd0d7; }
.banner.bad svg { color: var(--bad); }

/* devices */
.devices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dev { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(5, 10, 16, .5); }
.dev .k { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .14em; color: var(--dim); }
.dev .k svg { width: 18px; height: 18px; color: var(--slime); }
.dev .v { margin-top: 8px; font-size: 18px; font-weight: 600; }
.dev .s { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

/* family */
.people { display: grid; gap: 8px; }
.person { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(5, 10, 16, .45); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  font-size: 14px; color: var(--bg); background: linear-gradient(140deg, var(--slime), var(--slime2));
  box-shadow: 0 0 14px -2px var(--glow); flex: none; }
.avatar.away { background: #24313d; color: var(--dim); box-shadow: none; }
.person .who { flex: 1; min-width: 0; }
.person .who b { display: block; font-weight: 600; }
.person .who span { font-size: 12.5px; color: var(--faint); }

/* night slots */
.slots { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 4px 0 12px; }
.slot { text-align: center; }
.slot .dot { height: 34px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center;
  background: rgba(5, 10, 16, .5); }
.slot .dot svg { width: 16px; height: 16px; }
.slot.clear .dot { border-color: rgba(95, 225, 255, .45); color: var(--slime); box-shadow: inset 0 0 12px rgba(95, 225, 255, .12); }
.slot.busy .dot { border-color: rgba(255, 197, 107, .35); color: var(--warn); }
.slot.miss .dot { border-style: dashed; color: var(--faint); }
.slot.next .dot { border-color: var(--line2); animation: pulse 2.4s ease-in-out infinite; }
.slot .t { font-size: 10.5px; color: var(--faint); margin-top: 4px; }
@keyframes pulse { 50% { box-shadow: 0 0 14px -2px var(--glow); } }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line);
  font-size: 13.5px; }
.kv:first-of-type { border-top: 0; }
.kv span:first-child { color: var(--dim); }
.kv span:last-child { text-align: right; }

/* lists */
.group { margin: 18px 4px 8px; font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--faint);
  display: flex; justify-content: space-between; }
.row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none;
  border: 1px solid var(--line); color: var(--slime); }
.row .ic svg { width: 17px; height: 17px; }
.row .main { flex: 1; min-width: 0; }
.row .main b { display: block; font-weight: 550; font-size: 14px; }
.row .main span { display: block; font-size: 12.5px; color: var(--faint); overflow-wrap: anywhere; }
.row .end { font-size: 12px; color: var(--faint); white-space: nowrap; }
.thumb { width: 64px; height: 40px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none;
  background: #0b131c; }
.thumb.none { display: grid; place-items: center; color: var(--faint); }
.thumb.none svg { width: 16px; height: 16px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
  border-radius: 14px; border: 1px solid var(--line2); background: rgba(95, 225, 255, .06); color: var(--slime);
  font-weight: 600; letter-spacing: .02em; transition: transform .12s, background .2s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: linear-gradient(135deg, #5fe1ff, #3aa8ff); color: #031018; border: 0;
  box-shadow: 0 8px 30px -10px var(--glow); }
.btn.danger { color: var(--bad); border-color: rgba(255, 125, 143, .35); background: rgba(255, 125, 143, .06); }
.btn.ghost { border-color: var(--line); color: var(--dim); background: transparent; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 11px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: transparent;
  color: var(--dim); display: grid; place-items: center; }
.iconbtn svg { width: 18px; height: 18px; }

/* forms */
.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--dim);
  margin-bottom: 6px; }
.field input { width: 100%; min-height: 50px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line2);
  background: rgba(5, 10, 16, .7); font-size: 17px; outline: none; }
.field input:focus { border-color: var(--slime); box-shadow: 0 0 0 3px rgba(95, 225, 255, .12); }
.field input.code { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 600; }
.secret { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; padding: 12px; border-radius: 12px;
  border: 1px dashed var(--line2); background: rgba(5, 10, 16, .7); overflow-wrap: anywhere; user-select: all;
  -webkit-user-select: all; color: var(--slime); }
.bigcode { font-size: 30px; letter-spacing: .2em; text-align: center; font-weight: 700; padding: 16px; }

/* switch */
.switch { position: relative; width: 50px; height: 30px; border-radius: 99px; border: 1px solid var(--line2);
  background: rgba(5, 10, 16, .7); flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--dim); transition: transform .2s, background .2s; }
.switch.on { background: rgba(95, 225, 255, .18); border-color: var(--slime); }
.switch.on::after { transform: translateX(20px); background: var(--slime); box-shadow: 0 0 10px var(--glow); }

/* login / keep-on */
.center { min-height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: stretch;
  max-width: 420px; margin: 0 auto; padding: 24px 4px; }
.hero { text-align: center; margin-bottom: 28px; }
.hero .mark { width: 88px; height: 88px; filter: drop-shadow(0 0 22px var(--glow)); animation: float 5s ease-in-out infinite; }
.hero h1 { margin: 18px 0 4px; font-size: 18px; letter-spacing: .42em; font-weight: 600; }
.hero p { margin: 0; color: var(--faint); font-size: 12px; letter-spacing: .24em; text-transform: uppercase; }
@keyframes float { 50% { transform: translateY(-6px); } }
.keep { width: 210px; height: 210px; border-radius: 50%; margin: 10px auto 24px; display: grid; place-items: center;
  border: 1px solid var(--line2); background: radial-gradient(circle, rgba(95, 225, 255, .18), rgba(5, 10, 16, .4) 70%);
  box-shadow: 0 0 60px -10px var(--glow); color: var(--slime); font-size: 20px; font-weight: 700; letter-spacing: .12em;
  animation: pulse 2.4s ease-in-out infinite; }
.keep:active { transform: scale(.97); }
.count { text-align: center; font-size: 42px; font-weight: 300; letter-spacing: .06em; }

/* sheet (bottom drawer) */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet[hidden] { display: none; }
.sheet .panel { width: 100%; max-width: 600px; margin: 0 auto; max-height: 88%; overflow-y: auto;
  background: var(--card-solid); border: 1px solid var(--line2); border-bottom: 0; border-radius: 22px 22px 0 0;
  padding: 18px 16px calc(18px + var(--safe-b)); animation: up .22s ease-out; overscroll-behavior: contain; }
.sheet .panel h3 { margin: 0 0 10px; font-size: 16px; display: flex; justify-content: space-between; align-items: center; }
.sheet ol { padding-left: 20px; color: var(--dim); font-size: 14px; }
.sheet ol li { margin-bottom: 8px; }
.sheet ol b { color: var(--text); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.photo { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line2); background: #000; }
.photo img { display: block; width: 100%; }
.photo .box { position: absolute; border: 2px solid var(--slime); border-radius: 6px; box-shadow: 0 0 12px var(--glow); }
.photo .box em { position: absolute; top: -20px; left: -2px; font-style: normal; font-size: 11px; padding: 1px 6px;
  border-radius: 6px; background: var(--slime); color: #031018; font-weight: 700; }

/* toast */
.toast { position: fixed; z-index: 30; left: 50%; top: calc(var(--safe-t) + 12px); transform: translate(-50%, -140%);
  max-width: calc(100% - 32px); padding: 11px 16px; border-radius: 14px; background: rgba(13, 21, 32, .96);
  border: 1px solid var(--line2); box-shadow: 0 10px 40px -10px #000; font-size: 14px; transition: transform .25s;
  display: flex; gap: 8px; align-items: center; }
.toast.show { transform: translate(-50%, 0); }
.toast.bad { border-color: rgba(255, 125, 143, .5); }
.toast svg { width: 18px; height: 18px; flex: none; color: var(--slime); }
.toast.bad svg { color: var(--bad); }

.empty { text-align: center; color: var(--faint); padding: 26px 10px; font-size: 13.5px; }
.empty svg { width: 30px; height: 30px; display: block; margin: 0 auto 10px; color: var(--line2); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(95, 225, 255, .25);
  border-top-color: var(--slime); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px 0; }
.tc { text-align: center; }
.card h2 svg { width: 16px; height: 16px; flex: none; color: var(--faint); }
.person > svg { width: 20px; height: 20px; flex: none; color: var(--faint); }
.view svg:not([class]) { max-width: 40px; max-height: 40px; }
.sheet li .secret { display: block; margin-top: 6px; }
