:root {
  color-scheme: light;
  --bg: #f4f5f7; --card: #ffffff; --ink: #111318; --ink-2: #6b7280; --line: #e6e8ec;
  --accent: #4a6ff3; --accent-ink: #ffffff; --accent-soft: #eceffd; --danger: #e5484d;
  --radius: 20px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1115; --card: #1a1d24; --ink: #f1f3f5; --ink-2: #a0a6b1; --line: #2a2f3a;
    --accent: #5b7cff; --accent-soft: #22304f; --danger: #f06a6e;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
h1, h2 { margin: 0; font-weight: 700; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
.page { max-width: 640px; margin: 0 auto; padding: 8px 16px 24px; }
.muted { color: var(--ink-2); margin: 0; }
.error { color: var(--danger); margin: 0 0 12px; font-weight: 500; }

.greeting { display: flex; align-items: center; gap: 12px; padding: 10px 0 18px; }
.greeting-text { flex: 1; }
.greeting .hello { color: var(--ink-2); font-size: .9rem; }
.greeting .name { font-weight: 700; font-size: 1.15rem; }
.section-title { font-size: 1.4rem; margin-bottom: 14px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--accent-soft); }
.avatar-fallback { display: grid; place-items: center; color: var(--accent); font-weight: 700; font-size: 1.1rem; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; }
.empty-card h2 { margin-bottom: 6px; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.tile {
  display: flex; flex-direction: column; gap: 10px; min-height: 150px;
  background: var(--card); border-radius: var(--radius); padding: 18px; text-decoration: none; color: var(--ink);
  transition: transform .12s;
}
.tile:active { transform: scale(.97); }
.tile-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: #fff; }
.tile-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile-letter { font-size: 1.5rem; font-weight: 700; }
.tile-name { font-weight: 700; font-size: 1.05rem; margin-top: auto; }
.tile-desc { color: var(--ink-2); font-size: .85rem; line-height: 1.3; }

.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 12px 18px;
  border: 0; border-radius: 14px; font-weight: 600; font-size: 1.05rem; text-decoration: none; cursor: pointer;
  background: var(--accent-soft); color: var(--accent);
}
.button.primary { background: var(--accent); color: var(--accent-ink); }
.button.block { width: 100%; }
.button.link { background: none; min-height: 44px; padding: 8px 4px; font-weight: 500; color: var(--ink-2); }

.login { text-align: center; padding-top: 14vh; }
.login-icon { width: 84px; height: 84px; border-radius: 22px; margin-bottom: 14px; }
.login h1 { font-size: 1.8rem; margin-bottom: 6px; }
.login .muted { margin-bottom: 20px; }
