:root {
  --bg: #f4f6f2;
  --surface: #ffffff;
  --surface-strong: #edf4ee;
  --ink: #15201b;
  --muted: #617168;
  --line: #d9e1d8;
  --green: #16745f;
  --green-dark: #0e5143;
  --blue: #2f5d9b;
  --amber: #b7791f;
  --danger: #9b2f2f;
  --shadow: 0 12px 30px rgba(18, 33, 26, 0.08);
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(47, 93, 155, 0.42);
  outline-offset: 2px;
}

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

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: end;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
}

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

.summary span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(18, 33, 26, 0.04);
}

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

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 1.7fr) repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(244, 246, 242, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

.field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid #ccd8ce;
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--surface);
  color: var(--ink);
}

.content {
  margin-top: 18px;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.post-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(18, 33, 26, 0.06);
}

.media-link {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--surface-strong);
  border-bottom: 1px solid var(--line);
}

.media-link img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.post-body {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto auto;
  gap: 9px;
  padding: 13px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.language-pill,
.status-pill {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.language-pill {
  background: #e5f1ed;
  color: var(--green-dark);
}

.status-pill {
  background: #f4ead7;
  color: #6e4610;
}

.status-pill.status-draft_created,
.status-pill.status-scheduled,
.status-pill.status-published {
  background: #e2f0e8;
  color: #176244;
}

.status-pill.status-error {
  background: #f5dddd;
  color: var(--danger);
}

h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: 0;
}

.category {
  margin: 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.caption,
.hashtags {
  margin: 0;
  color: #24352c;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hashtags {
  color: var(--green-dark);
  font-weight: 700;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.actions button,
.actions a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  background: var(--surface-strong);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.actions button:hover,
.actions a:hover {
  border-color: rgba(22, 116, 95, 0.42);
  background: #dfeee8;
  color: var(--green-dark);
}

.actions .copied {
  border-color: rgba(22, 116, 95, 0.5);
  background: var(--green);
  color: white;
}

.empty-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px dashed #bfcabe;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  font-weight: 700;
}

@media (max-width: 1120px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .field-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 14px;
  }

  .topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  h1 {
    font-size: 30px;
  }

  .summary {
    justify-content: flex-start;
  }

  .toolbar,
  .post-grid {
    grid-template-columns: 1fr;
  }

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