/* HomeBase: Apple-style layout. Large titles, soft cards, system type, tab bar. */
:root {
  --ink: #0f2a2c;
  --muted: #5b7476;
  --bg: #eefaf8;
  --card: rgba(255, 255, 255, .92);
  --brand: #0e7490;
  --brand-ink: #ffffff;
  --sep: rgba(60, 60, 67, .14);
  --error: #d1355a;
  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px rgba(16, 24, 40, .06);
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

body { padding-top: var(--safe-top); }

button { font: inherit; cursor: pointer; }

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 18px calc(96px + var(--safe-bottom));
}

/* Titles */
.large-title {
  margin: 8px 0 4px;
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -.02em;
}
.subtitle { margin: 0 0 18px; color: var(--muted); font-size: 1rem; }
.section-title {
  margin: 26px 4px 10px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Cards */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px;
  backdrop-filter: saturate(180%) blur(12px);
}

/* Segmented control (Family / Private) */
.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(118, 118, 128, .12);
  border-radius: 11px;
  padding: 3px;
  margin: 6px 0 4px;
}
.segmented button {
  border: 0;
  background: transparent;
  padding: 9px 10px;
  border-radius: 9px;
  font-size: .95rem;
  font-weight: 600;
  color: var(--ink);
}
.segmented button[aria-pressed="true"] {
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

/* Module grid: vibrant icon tiles */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px 12px;
}
.module {
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
.module svg {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  box-shadow: 0 6px 16px rgba(16, 24, 40, .14);
  transition: transform .15s ease;
}
.module:active svg { transform: scale(.94); }
.module span { font-size: .85rem; font-weight: 500; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .85rem;
  color: var(--muted);
}
input {
  font: inherit;
  font-size: 17px; /* stops iPhone Safari zooming in */
  padding: 13px 15px;
  border: 0;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--sep);
}
input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

button.primary {
  padding: 15px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: var(--brand-ink);
  font-size: 1.02rem;
  font-weight: 600;
}
button.link {
  background: none;
  border: 0;
  padding: 8px 0;
  color: var(--brand);
  font-size: .98rem;
  text-align: left;
}

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }

.msg { min-height: 1.2em; margin: 14px 0 0; color: var(--muted); font-size: .93rem; }
.msg.error { color: var(--error); }

.hero {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero svg { width: 56px; height: 56px; border-radius: 16px; }

/* Tab bar */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: space-around;
  padding: 8px 18px calc(8px + var(--safe-bottom));
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--sep);
}
.tabbar button {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 64px;
}
.tabbar button[aria-current="page"] { color: var(--brand); }
.tabbar svg { width: 24px; height: 24px; }

.app-icon {
  display: block;
  margin: 28px 0 14px;
  border-radius: 20px;
  box-shadow: 0 8px 20px rgba(13, 148, 136, .25);
}

/* Security screens and lists */
button.secondary {
  padding: 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: rgba(14, 116, 144, .1);
  color: var(--brand);
  font-size: 1rem;
  font-weight: 600;
}
button.wide { width: 100%; }
button:disabled { opacity: .55; cursor: default; }
button.link.danger { color: var(--error); }
select {
  font: inherit;
  font-size: 17px;
  padding: 13px 15px;
  border: 0;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--sep);
  -webkit-appearance: none;
}
label.check {
  flex-direction: row;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: .95rem;
}
label.check input { width: 22px; height: 22px; padding: 0; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; word-break: break-all; }
.recovery {
  font-size: 1.05rem;
  line-height: 1.6;
  padding: 14px;
  border-radius: var(--radius-md);
  background: #f0fbf9;
  margin: 0;
}
.qr { display: block; width: 200px; height: 200px; margin: 10px auto; background: #fff; border-radius: 12px; }
.card.list { padding: 4px 0; }
.row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border: 0;
  border-bottom: 1px solid var(--sep);
  background: none;
  text-align: left;
  color: var(--ink);
}
.row:last-child { border-bottom: 0; }
.row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.row-main small { color: var(--muted); font-size: .82rem; }
.row-side { font-weight: 600; white-space: nowrap; }
