:root {
  color-scheme: light;
  --bg: #f7f5ef;
  --ink: #202426;
  --muted: #697177;
  --line: #d8d4c8;
  --accent: #244c5a;
  --accent-2: #9a5b2f;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

.brand {
  font-weight: 700;
  text-decoration: none;
}

nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-form {
  margin: 0;
}

main {
  width: min(1180px, calc(100vw - 32px));
  margin: 28px auto;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

h1,
h2 {
  margin: 0 0 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.panel,
.stats > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.narrow {
  max-width: 620px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.stats strong {
  display: block;
  margin-top: 6px;
  font-size: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
}

textarea {
  min-height: 90px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.checkbox-label input {
  width: auto;
}

button,
.button {
  display: inline-block;
  width: auto;
  padding: 9px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
}

.auth-panel {
  margin: 0 auto;
}

.error-text {
  color: #8c2f1b;
  font-weight: 600;
}

.messages p {
  padding: 10px 12px;
  border-radius: 6px;
  background: #e8f2ed;
  border: 1px solid #b8d8c6;
}

.messages .error {
  background: #f7e7e4;
  border-color: #d9aca4;
}

canvas {
  width: 100%;
  max-width: 900px;
  height: auto;
}

@media (max-width: 700px) {
  .site-header,
  .page-header {
    align-items: flex-start;
    flex-direction: column;
  }
}
