:root {
  --bg: #f6f4f1;
  --surface: #ffffff;
  --ink: #1c1a18;
  --muted: #6b655e;
  --line: #e4dfd8;
  --accent: #7a5c3e;
  --accent-soft: #f1e9e0;
  --focus: #2f6fdf;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151412;
    --surface: #1f1d1a;
    --ink: #f2eee9;
    --muted: #a39c93;
    --line: #34302b;
    --accent: #d1ad85;
    --accent-soft: #2c2620;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
header.top {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
header.top .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 14px; padding-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent); color: var(--surface);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; letter-spacing: .5px;
}
.brand b { font-size: 16px; }
.brand span { display: block; font-size: 12px; color: var(--muted); }
.clock { font-size: 13px; color: var(--muted); text-align: right; }
.userbar { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
#me { display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); }
#me a, #me button { color: var(--accent); font: inherit; font-size: 13px; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
#me a:hover, #me button:hover { text-decoration: underline; }

main.wrap { padding-top: 28px; padding-bottom: 56px; }
h1 { font-size: 26px; line-height: 1.2; margin: 0 0 4px; }
.sub { color: var(--muted); margin: 0 0 28px; }
h2 {
  font-size: 13px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); margin: 36px 0 12px; font-weight: 600;
}

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; min-height: 168px; color: inherit; text-decoration: none;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
a.tile:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.06); }
a.tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tile .ic {
  width: 44px; height: 44px; border-radius: 11px; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.tile .ic svg { width: 24px; height: 24px; }
.tile h3 { margin: 0; font-size: 17px; }
.tile p { margin: 0; color: var(--muted); font-size: 14px; }
.tile .note { margin-top: auto; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.tile.soon { border-style: dashed; background: transparent; }
.tile.soon h3 { color: var(--muted); }
.pill { white-space: nowrap; flex: none; font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 14px 18px; border-top: 1px solid var(--line); color: inherit; text-decoration: none;
}
.row:first-child { border-top: 0; }
a.row:hover { background: var(--accent-soft); }
a.row:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.row b { display: block; font-size: 15px; }
.row span { display: block; font-size: 13px; color: var(--muted); }
.row .go { color: var(--accent); flex: none; }

footer.wrap { color: var(--muted); font-size: 12px; padding-top: 0; padding-bottom: 32px; }

/* SOP article pages */
article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
article h1 { margin-bottom: 8px; }
article ol { padding-left: 22px; }
article li { margin: 0 0 12px; }
article .meta { color: var(--muted); font-size: 13px; margin: 0 0 20px; }
.back { display: inline-block; margin: 0 0 16px; color: var(--accent); text-decoration: none; font-size: 14px; }
.callout { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin: 16px 0; }

@media (max-width: 520px) {
  h1 { font-size: 22px; }
  .clock { display: none; }
  #me span { display: none; }
  .tile { min-height: 0; }
}
@media print {
  header.top, .back, footer { display: none; }
  body { background: #fff; color: #000; }
  article { border: 0; padding: 0; }
}
