:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --ink: #18201b;
  --muted: #637064;
  --line: #dfe4dc;
  --accent: #236c57;
  --accent-strong: #174d3d;
  --warn: #8a5b12;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

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

a {
  color: inherit;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0.75rem;
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 650;
}

label input,
label select,
label textarea {
  color: var(--ink);
  font-weight: 400;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 245, 0.95);
  padding: 0.75rem clamp(1rem, 4vw, 2rem);
  backdrop-filter: blur(10px);
}

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

.page {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 1rem;
}

.toolbar,
.editor-header,
.section-title,
.row-main,
.row-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.toolbar {
  margin-bottom: 1rem;
}

.search-form {
  display: flex;
  flex: 1;
  gap: 0.5rem;
}

.primary-button,
.secondary-button,
.ghost-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0.7rem 1rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

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

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  border-color: var(--line);
  background: #edf3ec;
  color: var(--accent-strong);
}

.ghost-button,
.ghost-link {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}

.fit {
  width: fit-content;
}

.meeting-list {
  display: grid;
  gap: 0.7rem;
}

.meeting-row,
.panel,
.auth-panel,
.empty-state,
.detail-header {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.meeting-row a {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  text-decoration: none;
}

.row-main span,
.row-meta,
.meeting-row p,
.detail-header p,
#save-status {
  color: var(--muted);
}

.row-meta {
  flex-wrap: wrap;
  justify-content: flex-start;
  font-size: 0.9rem;
}

.pill {
  border-radius: 999px;
  background: #fff3d6;
  color: var(--warn);
  padding: 0.1rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 750;
}

.panel,
.auth-panel,
.empty-state,
.detail-header {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1rem;
}

.auth-panel {
  max-width: 420px;
  margin: 12vh auto 0;
}

.stack,
.meeting-editor,
.image-form {
  display: grid;
  gap: 1rem;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: end;
}

.checkbox-line {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
}

.checkbox-line input {
  width: auto;
}

.quick-create {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.quick-create summary {
  color: var(--accent-strong);
  cursor: pointer;
  font-weight: 750;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.75rem;
}

.image-card {
  display: grid;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fbfcfa;
}

.image-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.image-card strong,
.image-card p {
  margin: 0;
  padding: 0 0.65rem 0.65rem;
}

.message {
  border-radius: var(--radius);
  background: #e8f3ed;
  padding: 0.75rem;
}

.pending-banner {
  border: 1px solid #e5ce93;
  border-radius: var(--radius);
  background: #fff8e7;
  color: var(--warn);
  padding: 0.75rem;
}

@media (max-width: 680px) {
  .page {
    padding: 0.75rem;
  }

  .toolbar,
  .search-form,
  .editor-header {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .ghost-button {
    width: 100%;
  }

  .grid-two {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: 1fr 1fr;
  }
}
