/* EOA AG — mobile-first web app. Navy #1B2A4A / yellow #F5C518. */
:root {
  --primary: #1B2A4A;
  --accent: #F5C518;
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --text: #1B2A4A;
  --muted: #8A8A8A;
  --line: #ECEEF2;
  --danger: #E0245E;
  --maxw: 560px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
.loading { text-align: center; color: var(--muted); padding: 80px 0; }

/* App shell */
#app { min-height: 100%; }
.app-shell { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  background: var(--primary); color: #fff; text-align: center; font-weight: 600; font-size: 18px;
  padding: calc(env(safe-area-inset-top) + 14px) 16px 14px; position: sticky; top: 0; z-index: 20;
}
.screen { flex: 1; padding: 16px; padding-bottom: 90px; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: var(--maxw); margin: 0 auto;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 20;
}
.tabbar button {
  flex: 1; border: none; background: none; padding: 9px 2px 8px; font-size: 11px; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 3px; font-family: inherit; cursor: pointer;
}
.tabbar button .ic { font-size: 20px; line-height: 1; }
.tabbar button.active { color: var(--primary); font-weight: 700; }

/* Cards & bits */
.card { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 14px; box-shadow: 0 1px 8px rgba(27,42,74,.05); }
.section-title { font-size: 15px; font-weight: 700; color: var(--primary); margin: 6px 2px 12px; }
.muted { color: var(--muted); font-size: 14px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.empty { text-align: center; color: var(--muted); padding: 50px 0; }

.greet { display: flex; justify-content: space-between; align-items: baseline; padding: 4px 2px 12px; }
.greet b { font-size: 22px; color: var(--primary); }
.greet span { color: var(--muted); font-size: 14px; }
.prompt { font-size: 16px; font-weight: 600; margin-bottom: 12px; }

textarea, input, select {
  font-family: inherit; font-size: 16px; width: 100%; border: 1.5px solid var(--line);
  border-radius: 12px; padding: 12px; background: #fff; color: var(--text);
}
textarea { min-height: 90px; resize: vertical; }
.label { color: var(--muted); font-size: 13px; margin: 14px 0 8px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-size: 13px; padding: 6px 13px; border-radius: 999px; background: #EEF1F6; color: var(--primary); cursor: pointer; user-select: none; }
.tag.on { background: var(--accent); font-weight: 600; }

.btn { background: var(--primary); color: #fff; border: none; width: 100%; padding: 14px; border-radius: 12px; font-size: 16px; font-weight: 600; margin-top: 16px; cursor: pointer; font-family: inherit; }
.btn:disabled { opacity: .5; }
.btn.accent { background: var(--accent); color: var(--primary); }
.btn.ghost { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); }
.btn.sm { width: auto; padding: 9px 18px; font-size: 14px; margin: 0; }

.reflect-badge { display: inline-block; font-size: 12px; padding: 3px 12px; border-radius: 999px; background: var(--accent); color: var(--primary); font-weight: 700; }
.reflect { margin-top: 10px; font-size: 15px; background: #FCFAF2; border-left: 4px solid var(--accent); padding: 12px 14px; border-radius: 0 10px 10px 0; white-space: pre-wrap; }
.entry-text { font-size: 16px; margin: 8px 0; white-space: pre-wrap; }
.vis-chip { font-size: 12px; color: var(--muted); background: #EEF1F6; padding: 3px 10px; border-radius: 999px; }

/* Feed */
.post-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.post-author { font-weight: 600; color: var(--primary); }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--primary); font-weight: 600; }
.post-time { margin-left: auto; color: var(--muted); font-size: 12px; }
.post-img { width: 100%; border-radius: 12px; margin-top: 10px; display: block; }
.actions { display: flex; gap: 26px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.actions .a { cursor: pointer; }
.actions .liked { color: var(--danger); }
.comments { margin-top: 12px; background: #F7F8FA; border-radius: 10px; padding: 12px; }
.comment { font-size: 14px; margin-bottom: 6px; }
.comment b { color: var(--primary); }
.crow { display: flex; gap: 8px; margin-top: 8px; }
.crow input { flex: 1; }
.compose-trigger { display: flex; align-items: center; color: var(--muted); }
.compose-trigger .plus { font-size: 26px; color: var(--primary); margin-left: auto; }
.img-add { display: inline-block; border: 1.5px dashed var(--line); border-radius: 12px; padding: 12px 22px; color: var(--muted); margin-top: 12px; }
.thumb-wrap { position: relative; display: inline-block; margin-top: 12px; }
.thumb-wrap img { width: 120px; height: 120px; object-fit: cover; border-radius: 12px; display: block; }
.thumb-wrap .x { position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; text-align: center; line-height: 26px; }

/* Events */
.ev-date { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--primary); padding: 4px 12px; border-radius: 999px; }
.ev-title { font-size: 19px; font-weight: 700; color: var(--primary); margin: 12px 0 6px; }
.signup { border: none; background: var(--accent); color: var(--primary); font-weight: 600; padding: 10px 22px; border-radius: 12px; cursor: pointer; font-family: inherit; font-size: 15px; }
.signup.going { background: var(--primary); color: #fff; }
.attendees { margin-top: 6px; font-size: 13px; color: var(--muted); }

/* Group */
.group-name { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.roster { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.rchip { font-size: 14px; padding: 6px 14px; border-radius: 999px; background: #EEF1F6; color: var(--primary); }
.rchip.coach { background: var(--primary); color: #fff; }
.shared { background: #F7F8FA; border-radius: 10px; padding: 12px; margin-top: 10px; }
.shared b { color: var(--primary); }
.note { background: #FCFAF2; border-radius: 12px; padding: 14px; color: #6b5d1f; font-size: 14px; }
.weekly { border-left: 4px solid var(--accent); }

.filter { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 6px; }
.filter .tag { flex-shrink: 0; }

/* Auth */
.auth-wrap { max-width: 460px; margin: 0 auto; padding: 40px 20px; }
.auth-hero { text-align: center; margin-bottom: 24px; }
.auth-hero h1 { font-size: 30px; letter-spacing: 2px; margin: 0 0 6px; color: var(--primary); }
.auth-hero p { color: var(--muted); margin: 0; font-size: 14px; }
.seg { display: flex; background: #fff; border-radius: 12px; padding: 5px; margin-bottom: 18px; border: 1px solid var(--line); }
.seg button { flex: 1; border: none; background: none; padding: 10px; border-radius: 9px; font-size: 15px; color: var(--muted); font-family: inherit; cursor: pointer; }
.seg button.active { background: var(--primary); color: #fff; font-weight: 600; }
.name-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.name-chip { width: calc(33.33% - 7px); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 4px; text-align: center; cursor: pointer; }
.name-chip.on { border-color: var(--primary); background: #EEF1F6; }
.name-chip b { display: block; color: var(--primary); font-size: 15px; }
.name-chip small { color: var(--muted); font-size: 11px; }
.field { margin-bottom: 12px; }
.error { color: var(--danger); font-size: 14px; margin-top: 8px; min-height: 18px; }

/* Modal */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; z-index: 50; }
.modal { width: 100%; max-width: var(--maxw); margin: 0 auto; background: #fff; border-radius: 20px 20px 0 0; padding: 18px; max-height: 82vh; display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.modal-title { font-size: 18px; font-weight: 700; color: var(--primary); }
.modal-body { overflow-y: auto; flex: 1; }
.digest-member { border-bottom: 1px solid var(--line); padding: 12px 0; }

.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); background: rgba(27,42,74,.95); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 14px; z-index: 80; opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }

.tabs { display: flex; background: #fff; border-radius: 12px; padding: 5px; margin-bottom: 16px; border: 1px solid var(--line); }
.tabs button { flex: 1; border: none; background: none; padding: 10px; border-radius: 9px; font-size: 14px; color: var(--muted); font-family: inherit; cursor: pointer; }
.tabs button.active { background: var(--primary); color: #fff; font-weight: 600; }
.digest-content { font-size: 14px; white-space: pre-wrap; line-height: 1.7; background: #F7F8FA; border-radius: 12px; padding: 14px; }

@media (prefers-color-scheme: dark) {
  :root { --bg:#0e1524; --card:#161d2e; --text:#e7ebf3; --muted:#8b93a6; --line:#26304400; --line:#263044; }
  body { background: var(--bg); }
  textarea, input, select { background:#0e1524; color: var(--text); }
  .shared, .comments, .filter, .digest-content { background:#0e1524; }
  .reflect { background:#20242e; }
  .note { background:#2a2410; color:#e8d98a; }
  .name-chip.on { background:#20263a; }
}
