:root {
  --bg: #f4f6f9; --card: #ffffff; --text: #1b2430; --muted: #5d6b7c; --line: #dbe1e8;
  --accent: #1f5fbf; --accent-text: #ffffff; --err: #b3261e; --hint: #8a5a00; --hint-bg: #fff4d6; --shadow: 0 1px 2px rgba(20, 30, 50, .08), 0 4px 14px rgba(20, 30, 50, .06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171e; --card: #1b222c; --text: #e8edf3; --muted: #9aa8b8; --line: #2c3745;
    --accent: #6ea2f0; --accent-text: #0c1a30; --err: #ff8a80; --hint: #ffd480; --hint-bg: #3a2f12; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 1.5rem; margin: 0 0 .25rem; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }
.err { color: var(--err); min-height: 1.4em; margin: .5rem 0 0; }
.hint { background: var(--hint-bg); color: var(--hint); padding: .6rem .8rem; border-radius: 8px; margin: .5rem 0 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.login-card { max-width: 400px; margin: 12vh auto 0; padding: 28px 24px; }
form.login { display: grid; gap: 12px; margin-top: 8px; }
label { display: grid; gap: 4px; font-size: .9rem; color: var(--muted); }
input { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; width: 100%; }
input:focus-visible, .btn:focus-visible, .tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn { font: inherit; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: .55rem 1rem; min-height: 44px; }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.btn.wide { width: 100%; margin-top: 8px; }
.bar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.spacer { flex: 1; } .who { color: var(--muted); }
.search { margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; min-height: 130px; color: inherit; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease; }
a.tile:hover { transform: translateY(-2px); border-color: var(--accent); }
.tile .icon { font-size: 1.8rem; line-height: 1; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: var(--bg); }
.tile .name { font-weight: 600; } .tile .desc { color: var(--muted); font-size: .9rem; }
.tile.disabled { opacity: .65; cursor: not-allowed; }
.badge { position: absolute; top: 12px; right: 12px; font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 0 .55rem; }
.empty { grid-column: 1 / -1; text-align: center; padding: 32px 0; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; opacity: 0; pointer-events: none; transition: all .2s ease; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .tile, #toast { transition: none; } a.tile:hover { transform: none; } }
@media (max-width: 480px) { main { padding-top: 16px; } .login-card { margin-top: 4vh; } .grid { grid-template-columns: 1fr; } }
