:root {
  --bg: #f4f7f8;
  --card: #fff;
  --ink: #12343b;
  --muted: #5b737a;
  --line: #d7e2e5;
  --brand: #155e6d;
  --brand-dark: #0f4a55;
  --warn: #b45309;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(18, 52, 59, 0.08);
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
a { color: var(--brand); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: var(--brand);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 700;
  background: rgba(255,255,255,0.15);
}
.brand-sub { display: block; font-size: 0.82rem; opacity: 0.85; }
.topnav { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.ghost, .primary, .secondary, .warn {
  border: 0; border-radius: 999px; padding: 0.55rem 1rem; cursor: pointer;
}
.ghost { background: rgba(255,255,255,0.12); color: inherit; }
.ghost.active { background: rgba(255,255,255,0.24); }
.link-btn { text-decoration: none; display: inline-flex; align-items: center; }
.primary { background: #fff; color: var(--brand-dark); font-weight: 600; }
.secondary { background: #e7f3f5; color: var(--brand-dark); }
.warn { background: #fff7ed; color: var(--warn); }

.panel { max-width: 1200px; margin: 0 auto; padding: 1.25rem; }
.hero h1 { margin: 0 0 0.35rem; }
.hero p, .muted { color: var(--muted); }
.toolbar { display: flex; gap: 0.75rem; margin: 1rem 0; flex-wrap: wrap; }
.toolbar.wrap { justify-content: flex-end; }

.month-list { display: grid; gap: 0.75rem; }
.month-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
  display: flex; justify-content: space-between; gap: 1rem; align-items: center;
}
.month-card h3 { margin: 0 0 0.25rem; }
.month-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.month-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

.editor-head {
  display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.editor-grid {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1rem;
}
@media (max-width: 960px) {
  .editor-grid { grid-template-columns: 1fr; }
}

.form-card, .preview-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
}
.field { display: grid; gap: 0.35rem; margin-bottom: 0.85rem; }
.field span { font-weight: 600; font-size: 0.92rem; }
.field small { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 0.65rem 0.75rem;
  background: #fcfdfd;
}
textarea { resize: vertical; min-height: 72px; }

.preview-passage {
  font-weight: 700; color: var(--brand); margin-bottom: 0.75rem;
}
.preview-thought strong { display: block; margin-top: 0.85rem; }
.preview-thought p { margin: 0.35rem 0; line-height: 1.55; white-space: pre-wrap; }

.status-line { min-height: 1.4rem; color: var(--muted); }
.status-line.ok { color: #047857; }
.status-line.err { color: #b91c1c; }

dialog {
  border: 0; border-radius: var(--radius); padding: 1.25rem; max-width: 420px; width: calc(100% - 2rem);
  box-shadow: var(--shadow);
}
dialog form { display: grid; gap: 0.75rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 0.5rem; margin-top: 0.5rem; }

.badge {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
  background: #e7f3f5; color: var(--brand-dark); font-size: 0.78rem; font-weight: 600;
}
