/* Same tokens as Fiscus, so hub and apps look like one place. */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1e;
  --muted: #6e6e73;
  --line: #e3e3e0;
  --accent: #2f6f5e;
  --danger: #b3261e;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121214;
    --surface: #1c1c1f;
    --text: #ececef;
    --muted: #9a9aa1;
    --line: #2c2c31;
    --accent: #7cc4ad;
    --danger: #f2827a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

/* One gap above and below the app tiles, so logo, tiles and logout sit evenly. */
:root { --section-gap: 28px; }

main { max-width: 480px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }

.wordmark { margin: 0; text-align: center; font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }

button, input { font: inherit; color: inherit; }
input { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
button { padding: 8px 14px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: var(--bg); cursor: pointer; }
button.link { border: 0; background: none; color: var(--muted); padding: 0; font-size: 14px; }
.error { color: var(--danger); margin: 0; }

.login { display: grid; gap: 12px; max-width: 320px; margin: 20vh auto 0; }
.login .wordmark { margin-bottom: 16px; }
.login label { font-size: 14px; color: var(--muted); }

.home-header { padding: 32px 0 var(--section-gap); }
.hub-logo { margin: 0; text-align: center; line-height: 0; }

.apps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
.apps a {
  display: grid; justify-items: center; gap: 6px; padding: 18px 12px;
  background: var(--surface); border-radius: 14px; color: var(--text); text-decoration: none; text-align: center;
}
.apps img, .monogram { width: 48px; height: 48px; border-radius: 11px; }
.monogram { display: grid; place-items: center; background: var(--accent); color: var(--bg); font-weight: 600; font-size: 22px; }
.apps .name { font-weight: 600; }

.actions { display: flex; justify-content: center; align-items: center; gap: 2px; margin-top: var(--section-gap); }
.logout-more { position: relative; }
.logout-more summary { display: grid; place-items: center; width: 28px; height: 28px; cursor: pointer; list-style: none; color: var(--muted); }
.logout-more summary::-webkit-details-marker { display: none; }
.logout-more svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; }
.logout-more[open] svg { transform: rotate(180deg); }
.logout-more form {
  position: absolute; top: 32px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 10px 14px; border-radius: 10px; background: var(--surface); box-shadow: 0 4px 16px rgb(0 0 0 / 0.12);
}
button.link.danger { color: var(--danger); }
