:root {
  --bg: #f7f6f3; --surface: #fff; --text: #1b1b1a; --muted: #6b6a66; --line: #e3e1dc; --accent: #d6341f; --ok: #2f7d4f;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141413; --surface: #1e1e1c; --text: #ecebe7; --muted: #9b9a95; --line: #33322f; --accent: #ff6a52; --ok: #6cc18f; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: inherit; }
code { font: 0.85em ui-monospace, "DM Mono", monospace; }
main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 48px; }

.top { display: flex; align-items: center; gap: 24px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { font-weight: 700; text-decoration: none; letter-spacing: 0.02em; }
.brand span { font-weight: 400; color: var(--muted); margin-left: 6px; }
.top nav { display: flex; gap: 16px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a[aria-current] { color: var(--text); box-shadow: inset 0 -2px var(--accent); }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; max-width: 1120px; margin: 0 auto;
  padding: 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.foot .drive.ok::before { content: "● "; color: var(--ok); }
.foot .drive.off::before { content: "● "; color: var(--accent); }

h1 { font-size: 28px; margin: 8px 0; }
h1 .sub { color: var(--muted); font-weight: 400; }
h2 { font-size: 18px; margin: 32px 0 12px; }
.hero p, .lede { color: var(--muted); max-width: 70ch; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.section { display: block; position: relative; padding: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; }
.section:hover { border-color: var(--accent); }
.section .num { position: absolute; top: 14px; right: 16px; font: 600 13px ui-monospace, monospace; color: var(--accent); }
.section h3 { margin: 0 0 4px; font-size: 17px; }
.section code { color: var(--muted); }
.section p { margin: 8px 0 0; font-size: 14px; }
.section .meta { color: var(--muted); font-size: 13px; }
.start .section { border-left: 4px solid var(--accent); margin-top: 16px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 8px; }
.filters input[type=search] { flex: 1 1 220px; }
.filters input, .filters select, .filters button { font: inherit; font-size: 14px; padding: 6px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--surface); color: var(--text); }
.filters button { cursor: pointer; }
.filters label { font-size: 14px; display: flex; gap: 6px; align-items: center; }
.count, .note, .empty { color: var(--muted); font-size: 13px; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.card .type { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.card h3 { margin: 4px 0; font-size: 16px; overflow-wrap: anywhere; }
.card .file, .card .folder { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.card dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 12px 0; font-size: 13px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; }
.card .open { margin-top: auto; align-self: flex-start; padding: 6px 12px; border-radius: 6px; background: var(--accent); color: #fff;
  text-decoration: none; font-size: 14px; font-weight: 600; }

.who { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.who button { font: inherit; background: none; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; color: var(--text); cursor: pointer; }
.signin { max-width: 460px; margin: 48px auto; }
.signin .open { display: inline-block; border: 0; cursor: pointer; padding: 10px 16px; border-radius: 6px; background: var(--accent);
  color: #fff; font: 600 15px system-ui, sans-serif; }
.error { color: var(--accent); min-height: 1.5em; }
@media (max-width: 560px) { .who span, .brand span { display: none; } .top { gap: 16px; } }

/* Uniform thumbnail frame: every card gets the same 16:10 box; the image fills it from the top (first page). */
.card .thumb { position: relative; display: block; aspect-ratio: 16 / 10; margin: -16px -16px 12px; overflow: hidden;
  border-radius: 10px 10px 0 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.card .thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; background: #fff; }
/* No thumbnail (Office files, failures): show the file type instead. */
.card .thumb::before { content: attr(data-type); position: absolute; inset: 0; display: grid; place-items: center;
  font: 600 13px ui-monospace, monospace; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.card .desc { margin: 2px 0 6px; font-size: 14px; }
.badge { margin-left: 6px; padding: 1px 6px; border-radius: 4px; background: var(--accent); color: #fff; font-size: 11px; letter-spacing: 0; text-transform: none; }

.crumbs { font-size: 13px; color: var(--muted); margin: 0; }
.crumbs a { color: var(--muted); }
h2 .more { font-size: 13px; font-weight: 400; margin-left: 8px; }
.guide-list { padding-left: 22px; line-height: 1.9; }
.badge.draft { background: var(--muted); }
.notice { padding: 10px 14px; border-left: 4px solid var(--accent); background: var(--surface); }
.guide { max-width: 760px; }
.prose { line-height: 1.6; overflow-wrap: anywhere; }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; }
.prose table { border-collapse: collapse; width: 100%; margin: 12px 0; display: block; overflow-x: auto; }
.prose td, .prose th { border: 1px solid var(--line); padding: 6px 10px; vertical-align: top; }
.prose ul.lvl-1, .prose ol.lvl-1 { margin-left: 24px; } .prose ul.lvl-2, .prose ol.lvl-2 { margin-left: 48px; }
.guide-foot { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 32px; font-size: 14px; }
