@font-face { font-family: "Fira Sans"; font-weight: 400; src: url(fonts/FiraSans-Regular.ttf); font-display: swap; }
@font-face { font-family: "Fira Sans"; font-weight: 500; src: url(fonts/FiraSans-Medium.ttf); font-display: swap; }
@font-face { font-family: "Fira Sans"; font-weight: 600; src: url(fonts/FiraSans-SemiBold.ttf); font-display: swap; }

:root {
  --ink: #2E3258;
  --soft: #5d6180;
  --bg: #f2ebe0;
  --card: #fffaf3;
  --line: #e6dccb;
  --green: #627b66;
  --sage: #91a283;
  --brown: #814d35;
  --orange: #d17e3f;
  --mustard: #e0b161;
  --blue: #567d8f;
  --paleblue: #adc2ca;
  --rust: #a54c40;
  --radius: 18px;
  --nav-h: 76px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Fira Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 24px calc(var(--nav-h) + 40px + env(safe-area-inset-bottom));
}

h1 { font-size: 26px; font-weight: 600; margin: 8px 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 15px; font-weight: 600; margin: 36px 0 12px; color: var(--soft); text-transform: uppercase; letter-spacing: 0.06em; }
h3 { font-size: 17px; font-weight: 600; margin: 0; }
p  { margin: 0; }
.lead { color: var(--soft); margin-bottom: 8px; }
.muted { color: var(--soft); font-size: 14px; }

.emoji { width: 40px; height: 40px; flex: none; }
.emoji.lg { width: 64px; height: 64px; }
.emoji.sm { width: 28px; height: 28px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 14px;
}
.row { display: flex; gap: 16px; align-items: flex-start; }
.row > .grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 6px; }

.pill {
  display: inline-block; font-size: 13px; font-weight: 500;
  padding: 3px 12px; border-radius: 99px;
  background: #ece3d3; color: var(--ink);
}
.pill.on { background: #dfe7da; color: #3f5543; }
.pill.moved { background: #f6e2cc; color: #8a4d1c; }
.pill.cancelled { background: #f1d6d1; color: var(--rust); }
.pill.paid { background: #dfe7da; color: #3f5543; }
.pill.due { background: #f6e2cc; color: #8a4d1c; }

.status { border-left: 6px solid var(--green); }
.status.moved { border-left-color: var(--orange); }
.status.cancelled { border-left-color: var(--rust); }

.bring { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.bring span { font-size: 13px; padding: 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: #fff; }

button, .btn {
  font: inherit; font-weight: 500; cursor: pointer;
  border: 0; border-radius: 99px;
  padding: 12px 22px; background: var(--green); color: #fff;
  text-decoration: none; display: inline-block;
}
button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
button:active { transform: scale(0.98); }

/* Sign in */
.signin { text-align: center; padding-top: 48px; }
.signin img.logo { width: 220px; margin: 0 auto 40px; display: block; }
.signin form { max-width: 320px; margin: 32px auto 0; text-align: left; }
label { display: block; font-size: 14px; font-weight: 500; margin: 18px 0 6px; }
input[type=email], input[type=password], input[type=text], textarea, select {
  width: 100%; font: inherit; color: var(--ink);
  padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff;
}
.signin button { width: 100%; margin-top: 28px; }
.note { font-size: 13px; color: var(--soft); margin-top: 24px; text-align: center; }

/* Updates */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0 24px; }
.filters button { padding: 6px 16px; font-size: 14px; background: transparent; color: var(--ink); border: 1px solid var(--line); }
.filters button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.update .body { margin-top: 10px; }
.update.unread h3::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); margin-left: 8px; vertical-align: middle; }

/* Timetable */
.day { font-weight: 600; margin: 28px 0 10px; }
.session { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.session .when { font-size: 14px; color: var(--soft); }

/* Messages */
.thread { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.bubble { max-width: 82%; padding: 12px 16px; border-radius: 18px; font-size: 15px; }
.bubble.team { background: var(--card); border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 6px; }
.bubble.family { background: var(--blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
.bubble time { display: block; font-size: 12px; opacity: 0.7; margin-top: 4px; }
.compose { display: flex; gap: 10px; align-items: flex-end; }
.compose textarea { resize: none; min-height: 48px; }

/* Family */
.toggle { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.toggle:first-of-type { border-top: 0; padding-top: 0; }
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #d9cfbf; border-radius: 99px; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::before { transform: translateX(20px); }
.invoice { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.invoice:first-child { border-top: 0; padding-top: 0; }

/* Bottom tabs */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255, 250, 243, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
#tabs .inner { max-width: 480px; margin: 0 auto; display: flex; justify-content: space-around; height: var(--nav-h); align-items: center; }
#tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 12px; font-weight: 500; color: var(--soft); text-decoration: none;
  padding: 6px 8px; border-radius: 14px; position: relative; min-width: 64px;
}
#tabs a img { width: 34px; height: 34px; opacity: 0.55; filter: saturate(0.6); transition: .15s; }
#tabs a.active { color: var(--ink); }
#tabs a.active img { opacity: 1; filter: none; }
#tabs .dot { position: absolute; top: 4px; right: 14px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--orange); color: #fff; font-size: 11px; line-height: 18px; text-align: center; padding: 0 5px; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom));
  transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 10px 20px; border-radius: 99px; font-size: 14px; z-index: 10;
  max-width: 90vw; text-align: center;
}
.foot { text-align: center; margin-top: 48px; }
.foot img { width: 150px; opacity: 0.9; }
