:root {
  --bg: #fff;
  --text: #222;
  --border: #ccc;
  --header-bg: #555;
  --private-bg: #fff3cd;
  --link: #0645ad;
  --focus: #0b5fff;
}

:root[data-theme="dark"] {
  --bg: #181818;
  --text: #f0f0f0;
  --border: #555;
  --header-bg: #444;
  --private-bg: #4a4220;
  --link: #8ec2ff;
  --focus: #ffd23f;
}

* { box-sizing: border-box; }

html { font-size: 100%; }

body {
  font-family: system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.6;
  max-width: 900px;
  margin: 1.5rem auto;
  padding: 0 1rem;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--link); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--bg);
  color: var(--text);
  padding: 0.5rem 1rem;
  z-index: 10;
}
.skip-link:focus {
  left: 0.5rem;
  top: 0.5rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
header h1 { font-size: 1.4rem; margin: 0; }
header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }

.table-wrap { overflow-x: auto; margin-bottom: 1.5rem; }

table { width: 100%; border-collapse: collapse; min-width: 480px; }
th, td { text-align: left; padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--border); }

form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: end; margin-bottom: 1rem; }
label { display: flex; flex-direction: column; font-size: 0.95rem; gap: 0.3rem; }
input, select {
  font-size: 1.05rem;
  padding: 0.5rem 0.6rem;
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 4px;
}

button {
  font-size: 1rem;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--header-bg);
  color: #fff;
  cursor: pointer;
}
button:hover { opacity: 0.9; }

section { margin-bottom: 2rem; }

.badge {
  background: var(--header-bg);
  color: #fff;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.4rem;
  display: inline-block;
}

.error { color: #d32f2f; font-weight: 600; }
tr.private { background: var(--private-bg); }

.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 0.4rem 0.7rem;
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  font-size: 1.2rem;
}

@media (max-width: 600px) {
  body { font-size: 1.2rem; }
  header { flex-direction: column; align-items: flex-start; }
  form { flex-direction: column; align-items: stretch; }
  label { width: 100%; }
}
