:root {
  --ivory: #FAF7F0;
  --card: #FFFDF8;
  --line: #E8E1D3;
  --ink: #3A3631;
  --muted: #7D756A;
  --sage: #8BA888;
  --sage-deep: #5F7D5C;
  --sage-soft: #E4EDE1;
  --taupe: #B5A898;
  --taupe-soft: #EFE9E0;
  --blush: #F3DCD4;
  --butter: #F6EBC8;
  --sky: #DCE8F0;
  --lilac: #E6DFF0;
  --serif: "Iowan Old Style", "Palatino", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--ivory); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.45;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0 0 8px; }
h1 { font-size: 30px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.error { color: #A4493A; font-size: 14px; }

.screen { min-height: 100vh; }
.center { display: flex; align-items: center; justify-content: center; padding: 24px; }
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 24px;
  padding: 28px; width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 12px;
}
.panel.wide { max-width: 640px; text-align: center; }

.btn {
  font: inherit; font-size: 15px; border: 0; border-radius: 999px; padding: 10px 18px;
  background: var(--sage); color: #fff; cursor: pointer;
}
.btn:hover { background: var(--sage-deep); }
.btn.big { padding: 13px 20px; font-size: 16px; }
.btn.small { font-size: 13px; padding: 7px 14px; }
.btn.ghost { background: transparent; color: var(--sage-deep); border: 1px solid var(--sage); }
.btn.ghost:hover { background: var(--sage-soft); }
.btn:disabled { opacity: .6; cursor: default; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
input {
  font: inherit; font-size: 16px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%;
}
input:focus { outline: 2px solid var(--sage); outline-offset: 1px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 8px 0 16px; }
.tile {
  font: inherit; border: 1px solid var(--line); border-radius: 22px; padding: 22px 10px;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink);
}
.tile .face { font-size: 44px; }
.tile .name { font-family: var(--serif); font-size: 20px; }
.tile .role { font-size: 12px; color: var(--muted); }
.tile:hover { outline: 2px solid var(--sage); }

.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 22px; border-bottom: 1px solid var(--line); background: var(--taupe-soft);
}
.topbar .brand { font-family: var(--serif); font-size: 20px; }
.topbar .who { font-size: 14px; color: var(--muted); }
.topbar a { color: var(--sage-deep); }
.home { max-width: 900px; margin: 0 auto; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.clock { font-size: 44px; margin: 0; font-variant-numeric: tabular-nums; }
.weather { text-align: right; }
.weather b { font-family: var(--serif); font-size: 28px; font-weight: 500; color: var(--ink); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card.soft { background: var(--sage-soft); border-color: #D2E0CE; }
.card p { margin: 4px 0 10px; }

.kid { background: #FFF8EE; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; position: relative; }
.kid-hi { font-size: 40px; text-align: center; }
.kid-tile { background: var(--butter); border-radius: 28px; padding: 28px 30px; font-size: 22px; font-weight: 600; text-align: center; }
.kid-exit { position: absolute; bottom: 20px; right: 20px; opacity: .7; }

.overlay { position: fixed; inset: 0; background: rgba(58,54,49,.35); display: flex; align-items: center; justify-content: center; padding: 24px; }
.overlay .panel { max-width: 300px; text-align: center; align-items: center; }
.pin-dots { display: flex; gap: 12px; justify-content: center; height: 18px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--taupe); }
.pin-dots i.on { background: var(--sage); border-color: var(--sage); }
.pinpad { display: grid; grid-template-columns: repeat(3, 64px); gap: 10px; }
.pinpad button {
  font: inherit; font-size: 22px; height: 56px; border-radius: 16px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer;
}
.pinpad button[data-k] { font-size: 14px; }
