/* ADR-035 family website. Local fonts only: Google Fonts is slow or blocked in China. */
:root {
  --accent: #9c2f86;
  --accent-dark: #7a2368;
  --tint: #f6e4f1;
  --bg: #faf6f9;
  --card: #ffffff;
  --text: #2b2230;
  --muted: #6b5f68;
  --line: #eadde6;
  --ok: #1f7a4d;
  --error: #b3261e;
  --radius: 16px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    system-ui, sans-serif;
}
a { color: var(--accent); }
main { max-width: 720px; margin: 0 auto; padding: 8px 16px 32px; }
h1 { font-size: 26px; margin: 16px 0 12px; }
h2 { font-size: 19px; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 720px; margin: 0 auto; padding: 14px 16px;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px;
  color: var(--text); text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent); color: #fff; font-size: 18px; }
nav { display: flex; align-items: center; gap: 16px; }
footer { text-align: center; color: var(--muted); font-size: 14px; padding: 24px 16px; }
footer a { color: var(--muted); }
.hero { padding: 8px 0 4px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin: 14px 0;
}
.narrow { max-width: 440px; margin: 24px auto; }
.step { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--tint); color: var(--accent); font-size: 15px; flex: none; }
.muted { color: var(--muted); }
.note { background: var(--tint); border-radius: 12px; padding: 10px 12px; }
.error { color: var(--error); margin: 0; }
.done { color: var(--ok); font-weight: 600; }
.stack { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-weight: 600; font-size: 15px; }
label.check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; }
label.check input { width: 22px; height: 22px; accent-color: var(--accent); }
input, select {
  font: inherit; font-weight: 400; min-height: 46px; padding: 8px 12px; width: 100%;
  border: 1px solid #d9c6d3; border-radius: 12px; background: #fff; color: var(--text);
}
input:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--tint); outline-offset: 1px; border-color: var(--accent);
}
.phone { display: grid; grid-template-columns: minmax(0, 9em) minmax(0, 1fr); gap: 8px; }
button, .button {
  font: inherit; font-weight: 600; min-height: 46px; padding: 8px 20px; border-radius: 12px;
  border: 1px solid var(--accent); background: var(--accent); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
}
button:hover, .button:hover { background: var(--accent-dark); }
button[disabled] { opacity: 0.6; cursor: wait; }
button.secondary { background: #fff; color: var(--accent); }
button.danger { background: #fff; color: var(--error); border-color: #e3b5b1; }
button.link { background: none; border: 0; color: var(--accent); padding: 0; min-height: 0; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.devices { display: grid; gap: 14px; }
.device { display: grid; gap: 6px; }
.device h2 { justify-content: space-between; }
.badge { font-size: 13px; font-weight: 600; padding: 2px 10px; border-radius: 999px;
  background: #eee8ec; color: var(--muted); }
.badge.on { background: #e1f3e9; color: var(--ok); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.list li.card { margin: 0; display: grid; gap: 8px; }
.lines { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.when { font-weight: 700; color: var(--accent); }
.tag { font-size: 13px; background: var(--tint); color: var(--accent); border-radius: 999px;
  padding: 1px 8px; margin-left: 6px; }
/* ADR-036 device settings and persona. */
.menu .item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  min-height: 56px; padding: 12px 18px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); text-decoration: none; font-weight: 600;
}
.menu .item:hover { border-color: var(--accent); }
.choices { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.choice { display: flex; align-items: flex-start; gap: 12px; margin: 0; cursor: pointer;
  font-weight: 400; }
.choice input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--accent);
  flex: none; min-height: 0; }
.choice > span { display: grid; gap: 2px; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.small { font-size: 14px; }
.safety { background: #f7eef5; border-color: #e7cfe0; }
.safety ul { margin: 0 0 8px; padding-left: 20px; }
a.button.outline { background: #fff; color: var(--accent); width: 100%;
  border: 2px dashed var(--accent); }
a.button.outline:hover { background: var(--tint); }
textarea {
  font: inherit; font-weight: 400; padding: 10px 12px; width: 100%; resize: vertical;
  border: 1px solid #d9c6d3; border-radius: 12px; background: #fff; color: var(--text);
}
textarea:focus { outline: 3px solid var(--tint); outline-offset: 1px; border-color: var(--accent); }
.chips { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.chips legend { font-weight: 600; font-size: 15px; padding: 0; margin-bottom: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 14px;
  border: 1px solid #d9c6d3; border-radius: 999px; background: #fff; font-weight: 400;
  cursor: pointer; }
.chip input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }
.chip:has(input:checked) { border: 2px solid var(--accent); background: var(--tint);
  font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }

/* Public front page (haige.co.nz). */
.home main.home-main { max-width: 1152px; padding: 0 24px 32px; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1152px; margin: 0 auto; padding: 18px 24px; }
.home-top .quiet { color: var(--muted); text-decoration: none; }
.pill { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px;
  background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }
.pill:hover { background: var(--accent-dark); color: #fff; }
.pill.big { height: 52px; padding: 0 28px; font-size: 17px; }
.pill.ghost { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.pill.ghost:hover { background: var(--tint); color: var(--accent-dark); }
.home-hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center;
  padding: 40px 0 56px; }
.badge { display: inline-block; font-size: 13px; font-weight: 500; color: #6e1f5e;
  background: var(--tint); padding: 4px 12px; border-radius: 999px; }
.home-hero h1 { font-size: 48px; line-height: 1.2; margin: 16px 0; }
.lead { font-size: 19px; line-height: 1.7; color: var(--muted); margin: 0; max-width: 34em; }
.home-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.home-art { position: relative; height: 420px; display: grid; place-items: center; }
.home-blob { position: absolute; width: 380px; height: 380px; border-radius: 50%;
  background: var(--tint); }
.home-art svg { position: relative; width: 280px; height: auto; }
.bubble { position: absolute; background: #fff; padding: 10px 14px; font-size: 15px;
  box-shadow: 0 4px 16px rgba(110, 31, 94, 0.12); }
.bubble-a { left: 0; top: 64px; border-radius: 16px 16px 16px 4px; }
.bubble-b { right: 0; bottom: 76px; border-radius: 16px 16px 4px 16px; }
.home-section { padding: 0 0 48px; }
.home-section h2 { font-size: 28px; margin: 0 0 20px; }
.home-grid { display: grid; gap: 16px; }
.home-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-card { background: var(--card); border-radius: 20px; padding: 22px;
  box-shadow: 0 1px 2px rgba(20, 30, 40, 0.08); }
.home-card h3 { font-size: 18px; margin: 10px 0 6px; }
.home-card p { font-size: 15px; color: var(--muted); margin: 0; }
.home-card.home-step { display: flex; gap: 14px; align-items: flex-start; }
.home-card.home-step h3 { margin-top: 2px; }
.home-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px;
  background: var(--tint); }
.home-icon svg { width: 24px; height: 24px; }
.num { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; }
.home-safety { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 32px; align-items: center;
  background: #f7eef5; border-radius: 24px; padding: 32px 36px; margin: 0 0 48px; }
.home-safety h2 { display: flex; align-items: center; gap: 10px; color: #6e1f5e; font-size: 26px;
  margin: 0 0 10px; }
.home-safety h2 svg { width: 26px; height: 26px; flex: 0 0 26px; }
.home-safety p { color: var(--muted); margin: 0; }
.home-safety ul { list-style: none; margin: 0; padding: 0; display: grid;
  grid-template-columns: 1fr 1fr; gap: 12px; }
.home-safety li { background: #fff; border-radius: 14px; padding: 14px 16px; }
.home-foot { max-width: 1152px; margin: 0 auto; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 24px; text-align: left; padding: 24px; }
.home-foot p { margin: 0; max-width: 46em; }
@media (max-width: 900px) {
  .home-hero, .home-safety { grid-template-columns: 1fr; gap: 24px; }
  .home-hero { padding-top: 16px; }
  .home-hero h1 { font-size: 34px; }
  .lead { font-size: 17px; }
  .home-art { height: 340px; }
  .home-blob { width: 300px; height: 300px; }
  .home-art svg { width: 220px; }
  .home-grid.four { grid-template-columns: 1fr 1fr; }
  .home-grid.three { grid-template-columns: 1fr; }
  .home-foot { flex-direction: column; gap: 8px; }
}
@media (max-width: 560px) {
  .hide-narrow { display: none; }
  .home main.home-main, .home-top { padding-left: 16px; padding-right: 16px; }
  .home-grid.four, .home-safety ul { grid-template-columns: 1fr; }
  .home-safety { padding: 24px 20px; }
  .bubble { font-size: 13px; }
}

/* ADR-039 status lights. */
.lights { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lights li { display: flex; align-items: center; gap: 10px; }
.light { flex: 0 0 14px; height: 14px; border-radius: 50%; background: #b9b0b6; }
.light.ok, .hour.ok { background: #1f9d55; }
.light.degraded, .hour.degraded { background: #e0a100; }
.light.down, .hour.down { background: #d23b2f; }
.light-name { font-weight: 500; }
.light-state { margin-left: auto; color: var(--muted); font-size: 14px; }
.home-status { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 24px; align-items: center;
  background: var(--card); border-radius: 20px; padding: 24px 28px; margin: 0 0 48px;
  box-shadow: 0 1px 2px rgba(20, 30, 40, 0.08); }
.home-status h2 { font-size: 22px; margin: 0 0 6px; }
.home-status p { margin: 0; }
.home-status .lights { grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 3px; margin: 8px 0; }
.hour { height: 28px; border-radius: 4px; background: #e4dde2; }
@media (max-width: 900px) {
  .home-status { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .home-status .lights { grid-template-columns: 1fr; }
}

/* Device name and time zone; the Wi-Fi guide. */
.local-time { color: var(--accent); }
.guide p { margin: 0 0 8px; }
.guide ol { margin: 0 0 8px; padding-left: 22px; display: grid; gap: 6px; }

/* ADR-043: the 中文 | EN button, top right of the home page; small enough for a phone. */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; margin: 0; flex: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px; font-size: 14px; }
.lang-switch span { color: var(--muted); }
.lang-switch button { font: inherit; font-weight: 600; min-height: 32px; padding: 0 8px; border: 0;
  border-radius: 999px; background: transparent; color: var(--muted); cursor: pointer; }
.lang-switch button[aria-current="true"] { background: var(--tint); color: var(--accent); }
.home-top .brand, .home-top nav a { white-space: nowrap; }
@media (max-width: 560px) {
  .home-top nav { gap: 10px; }
  .home-top .pill { padding: 0 12px; }
}
/* On a phone the header keeps the brand and the language button; the hero has the buttons. */
@media (max-width: 420px) {
  .hide-tiny { display: none; }
}
