:root {
  --ink: #1b211d;
  --muted: #667066;
  --line: #d9ded5;
  --paper: #fbfaf6;
  --panel: #ffffff;
  --brand: #314d36;
  --brand-strong: #203324;
  --danger: #9b2f25;
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

button,
.actions a {
  border: 0;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  text-decoration: none;
}

button:hover,
.actions a:hover {
  background: var(--brand-strong);
}

button.secondary {
  background: #e9ede5;
  color: var(--ink);
}

button.danger {
  background: var(--danger);
}

.create-blog-btn {
  min-width: 140px;
}

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

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.hidden {
  display: none !important;
}

.login-panel {
  width: min(430px, 100%);
  margin: 8vh auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 30px;
  box-shadow: 0 20px 50px rgba(31, 40, 32, 0.08);
}

.stack {
  display: grid;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dashboard,
.posts-panel,
.editor {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.dashboard {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.dashboard-hero,
.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.dashboard-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.posts-panel {
  align-self: start;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 18px;
}

.panel-heading span {
  color: var(--muted);
}

.posts-list {
  display: grid;
}

.post-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 14px 18px;
}

.post-row:last-child {
  border-bottom: 0;
}

.post-row > div:first-child {
  display: grid;
  gap: 6px;
}

.post-row strong,
.post-row small {
  overflow-wrap: anywhere;
}

.post-row small {
  color: var(--muted);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.row-actions button {
  min-height: 36px;
  padding: 0 12px;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 26px 18px;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.editor {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toggle {
  display: inline-flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.toggle input {
  width: 18px;
  height: 18px;
}

.message {
  min-height: 20px;
  margin: 0;
  color: var(--brand);
}

.message.error {
  color: var(--danger);
}

@media (max-width: 820px) {
  .topbar,
  .form-footer,
  .dashboard-hero,
  .editor-heading,
  .post-row {
    align-items: stretch;
    flex-direction: column;
  }

  .row-actions {
    justify-content: flex-start;
  }

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