:root {
  --bg: #f7f7f7;
  --card: #fff;
  --fg: #111;
  --muted: #5c5c5c;
  --line: #e2e2e2;
  --btn: #111;
  --btn-fg: #fff;
  --danger: #111;
  --ok-bg: #f0f0f0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--fg); }
header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.wrap { width: min(980px, calc(100% - 32px)); margin: 0 auto; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px 16px; padding: 14px 0;
}
.top nav {
  display: flex; flex-wrap: wrap; gap: 8px 16px;
  flex: 1 1 100%;
}
@media (min-width: 900px) {
  .top nav { flex: 1 1 auto; }
}
.brand { font-weight: 700; letter-spacing: 0.02em; text-decoration: none; }
.top nav a { margin-right: 14px; text-decoration: none; color: var(--muted); font-size: 0.95rem; }
.top nav a.active { color: var(--fg); font-weight: 600; text-decoration: underline; }
.user { font-size: 0.9rem; color: var(--muted); display: flex; gap: 10px; align-items: center; }
main { flex: 1; padding: 28px 0 48px; }
h1 { font-size: 1.6rem; margin: 0 0 8px; font-weight: 700; }
h2 { font-size: 1.1rem; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px 20px;
  margin: 14px 0;
}
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.btn, button, input[type=submit] {
  appearance: none; border: 1px solid var(--btn);
  background: var(--btn); color: var(--btn-fg);
  padding: 8px 14px; border-radius: 6px; cursor: pointer;
  font: inherit; text-decoration: none; display: inline-block;
}
.btn.ghost, button.ghost, input.ghost {
  background: #fff; color: var(--fg);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
form.inline { display: inline; }
.notice, .error, .ok {
  border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 12px 0;
  white-space: pre-wrap;
}
.error { background: #fff; font-weight: 500; }
.ok { background: var(--ok-bg); }
.list { list-style: none; padding: 0; margin: 0; }
.list li {
  border-bottom: 1px solid var(--line); padding: 10px 0;
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
}
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--muted); }
select, input[type=text], input[type=number] {
  font: inherit; padding: 6px 8px; border: 1px solid #ccc; border-radius: 6px; background: #fff;
}
footer {
  border-top: 1px solid var(--line); color: var(--muted);
  font-size: 0.85rem; padding: 16px 0 24px; background: #fff;
}
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
.login-box { max-width: 520px; margin: 48px auto; }

a.more { display: inline-block; margin-left: 12px; font-weight: 600; }
.card form { margin-top: 8px; }
.card label { display: inline-flex; align-items: center; gap: 8px; margin-right: 8px; }
