:root {
  color-scheme: light;
  --primary: #00863c;
  --primary-dark: #00692f;
  --accent: #f1b72d;
  --ink: #17221b;
  --muted: #66736b;
  --line: #dce5df;
  --surface: #ffffff;
  --soft: #f5f8f6;
  --danger: #d64242;
  --shadow: 0 18px 48px rgba(23, 34, 27, .12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #eef4f0;
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .68;
}

#app {
  min-height: 100vh;
}

.screen {
  width: min(100%, 920px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px;
}

.screen-auth {
  display: grid;
  align-content: center;
  gap: 18px;
}

.brand-panel,
.auth-panel,
.profile-box,
.status-strip {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-panel {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 6px;
  font-size: 30px;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.brand-copy,
.hint,
#profile-summary {
  color: var(--muted);
}

.auth-panel {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.segment {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.segment.active {
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(23, 34, 27, .08);
}

.signup-fields {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 134, 60, .13);
}

.primary-btn,
.ghost-btn,
.danger-btn,
.quick-actions button,
.status-strip button,
.section-head button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.ghost-btn,
.quick-actions button,
.status-strip button,
.section-head button {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.danger-btn {
  background: #fff;
  border-color: #f0c3c3;
  color: var(--danger);
}

.boot-error {
  padding: 12px 14px;
  border: 1px solid #f0c3c3;
  border-radius: 8px;
  background: #fff4f4;
  color: var(--danger);
  font-weight: 800;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hint {
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.5;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 0 16px;
}

.topbar-main {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #eef4f0;
}

.search-wrap {
  margin-bottom: 14px;
}

.region-list,
.board-grid,
.post-list,
.main-layout {
  display: grid;
  gap: 12px;
}

.region-card,
.board-card,
.post-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.region-card,
.board-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 16px;
}

.region-card {
  width: 100%;
  text-align: left;
}

.region-card strong,
.board-card strong,
.post-card strong {
  display: block;
  margin-bottom: 3px;
}

.region-card span,
.board-card span,
.post-card span {
  color: var(--muted);
  font-size: 13px;
}

.main-layout {
  padding-bottom: 28px;
}

.status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
}

.metric {
  color: var(--primary-dark);
  font-size: 26px;
  font-weight: 900;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0;
}

.board-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.board-card {
  min-height: 96px;
  align-items: flex-start;
}

.post-card {
  padding: 15px;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.profile-box {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 12px 14px;
  border-radius: 8px;
  background: #162218;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

[hidden] {
  display: none !important;
}

@media (max-width: 620px) {
  .screen {
    padding: 16px;
  }

  .brand-panel,
  .profile-box,
  .status-strip {
    align-items: stretch;
    flex-direction: column;
  }

  .quick-actions,
  .board-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }
}
