/* Design A — "Classic": calm cards in a grid. Follows OS light/dark unless the visitor picks one. */
:root {
  --bg: #f3f6f8;
  --surface: #ffffff;
  --surface-2: #f7fafb;
  --border: #e3e9ee;
  --text: #13232f;
  --muted: #5f7180;
  --brand: #0e7c86;
  --brand-2: #0b4f71;
  --brand-soft: #e3f3f4;
  --hover: #f1f8f9;
  --shadow: 0 1px 2px rgba(16, 40, 56, .05), 0 4px 16px rgba(16, 40, 56, .05);
  --toggle-bg: var(--surface-2);
  --toggle-border: var(--border);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1418;
    --surface: #151d23;
    --surface-2: #1a242b;
    --border: #25323b;
    --text: #e6eef2;
    --muted: #93a6b3;
    --brand: #3fb6bf;
    --brand-2: #2b7fa8;
    --brand-soft: #173238;
    --hover: #1b2930;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --toggle-bg: var(--surface-2);
    --toggle-border: var(--border);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .mode-toggle .moon { display: none; }
  :root:not([data-theme="light"]) .mode-toggle .sun { display: block; }
}
:root[data-theme="dark"] {
    --bg: #0e1418;
    --surface: #151d23;
    --surface-2: #1a242b;
    --border: #25323b;
    --text: #e6eef2;
    --muted: #93a6b3;
    --brand: #3fb6bf;
    --brand-2: #2b7fa8;
    --brand-soft: #173238;
    --hover: #1b2930;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --toggle-bg: var(--surface-2);
    --toggle-border: var(--border);
    color-scheme: dark;
}
:root[data-theme="dark"] .mode-toggle .moon { display: none; }
:root[data-theme="dark"] .mode-toggle .sun { display: block; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

/* Light/dark toggle (top right). Shows the moon in light mode, the sun in dark mode. */
.mode-toggle {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--toggle-border); background: var(--toggle-bg); color: var(--muted);
  transition: color .15s, border-color .15s, background .15s;
}
.mode-toggle:hover { color: var(--text); border-color: var(--brand); }
.mode-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.mode-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mode-toggle .sun { display: none; }

.top { background: var(--surface); border-bottom: 1px solid var(--border); }
.top-inner {
  max-width: 1240px; margin: 0 auto; padding: 20px 24px;
  display: grid; grid-template-columns: auto 1fr minmax(240px, 360px) auto; gap: 16px 20px; align-items: center;
}
.brand { display: flex; align-items: center; gap: 14px; }
.mark { width: 44px; height: 44px; border-radius: 12px; display: block; }
.brand h1 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.sub { margin: 1px 0 0; color: var(--muted); font-size: 13.5px; }
.greet { display: flex; grid-column: 2; flex-direction: column; justify-self: end; text-align: right; }
.greet-hello { font-weight: 600; font-size: 14.5px; }
.greet-date { color: var(--muted); font-size: 13px; }

.search {
  position: relative; display: flex; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search svg { width: 18px; height: 18px; margin-left: 12px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; padding: 10px 10px; outline: none;
}
.search kbd {
  margin-right: 10px; font: 600 11px/1 Inter, system-ui, sans-serif; color: var(--muted);
  border: 1px solid var(--border); border-radius: 5px; padding: 3px 6px; background: var(--surface);
}

.sections {
  max-width: 1240px; margin: 0 auto; padding: 28px 24px 12px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 20px; align-items: start;
}
.section {
  background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.section h2 {
  margin: 0; padding: 14px 18px 10px; display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand);
}
.count {
  font-size: 11px; font-weight: 600; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 99px; padding: 1px 7px; letter-spacing: 0;
}
.links { list-style: none; margin: 0; padding: 0 8px 8px; }
.link {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 10px;
  color: inherit; text-decoration: none; transition: background .12s;
}
.link:hover, .link:focus-visible { background: var(--hover); outline: none; }
.link:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.icon {
  width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
}
.icon img { width: 24px; height: 24px; object-fit: contain; display: block; }
.letter {
  width: 100%; height: 100%; display: grid; place-items: center; border-radius: 9px;
  font-weight: 700; font-size: 16px; color: #fff; background: hsl(var(--h) 45% 45%);
}
.text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.desc { color: var(--muted); font-size: 13px; line-height: 1.35; margin-top: 1px; }
.go { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity .12s, transform .12s; }
.link:hover .go { opacity: 1; transform: translate(1px, -1px); }

.empty { text-align: center; color: var(--muted); padding: 40px 0; grid-column: 1 / -1; }
.foot { display: flex; justify-content: space-between; gap: 16px; max-width: 1240px; margin: 0 auto; padding: 12px 24px 32px; color: var(--muted); font-size: 12.5px; }

@media (max-width: 860px) {
  .top-inner { grid-template-columns: 1fr auto auto; }
  .brand { grid-column: 1; grid-row: 1; }
  .greet { grid-column: 2; grid-row: 1; }
  .mode-toggle { grid-column: 3; grid-row: 1; }
  .search { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 560px) {
  .top-inner { padding: 16px; grid-template-columns: 1fr auto; }
  .greet { grid-column: 1 / -1; grid-row: 2; justify-self: start; text-align: left; flex-direction: row; gap: 8px; flex-wrap: wrap; }
  .mode-toggle { grid-column: 2; }
  .search { grid-row: 3; }
  .search kbd { display: none; }
  .sections { padding: 16px 16px 8px; grid-template-columns: 1fr; gap: 14px; }
  .foot { padding: 8px 16px 24px; }
}

.foot-admin { color: var(--muted); text-decoration: none; }
.foot-admin:hover { color: var(--brand); text-decoration: underline; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px 18px; }
