:root {
  color-scheme: light;
  --ink: #111111;
  --muted: #6b6760;
  --paper: #f6f1e9;
  --panel: rgba(255, 255, 255, 0.82);
  --line: rgba(17, 17, 17, 0.12);
  --line-strong: rgba(17, 17, 17, 0.18);
  --rose: #d94f3d;
  --green: #54785c;
  --blue: #3f638e;
  --gold: #d6a83d;
  --shadow: 0 26px 80px rgba(24, 20, 16, 0.13);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(217, 79, 61, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(63, 99, 142, 0.13), transparent 38%),
    linear-gradient(180deg, #fffaf3, var(--paper));
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(290px, 360px) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 34px);
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 36px);
}

.composer,
.summary-grid article,
.post-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.composer {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: start;
  border-radius: 8px;
  padding: 20px;
  position: sticky;
  top: 24px;
}

.brand-row,
.board-header,
.post-topline,
.side-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

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

.mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: #fffaf3;
  font-weight: 900;
}

.eyebrow,
label span,
.summary-grid span,
.metric-row span {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.2rem;
}

h2 {
  margin-top: 7px;
  font-size: clamp(2rem, 3.7vw, 4.2rem);
  line-height: 1;
  max-width: 920px;
}

h3 {
  min-height: 2.55em;
  font-size: 1.02rem;
  line-height: 1.25;
}

.upload-zone {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 158px;
  padding: 22px;
  border: 1px dashed rgba(17, 17, 17, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.32)),
    #eee5d9;
  text-align: center;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

.upload-zone:hover,
.upload-zone.is-active {
  border-color: var(--rose);
  background: #fff8ed;
  transform: translateY(-1px);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: var(--ink);
  color: #fffaf3;
}

.upload-title {
  font-weight: 900;
}

.upload-copy {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.post-form,
label {
  display: grid;
  gap: 12px;
}

label {
  gap: 7px;
}

.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input:focus {
  border-color: rgba(217, 79, 61, 0.72);
  box-shadow: 0 0 0 4px rgba(217, 79, 61, 0.1);
}

.primary-button,
.export-button,
.ghost-button,
.remove-button {
  border-radius: 8px;
  font-weight: 850;
}

.primary-button,
.export-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  border: 0;
  background: var(--ink);
  color: #fffaf3;
}

.export-button {
  border: 1px solid rgba(17, 17, 17, 0.28);
  background: #fffaf3;
  color: var(--ink);
}

.export-button.secondary {
  min-height: 42px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
}

.publish-status {
  min-height: 1.35em;
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.publish-status a {
  color: var(--ink);
  font-weight: 850;
}

.ghost-button {
  flex: 1;
  min-height: 40px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.48);
  color: var(--ink);
}

.ghost-button.danger {
  color: #9a3027;
}

.board {
  min-width: 0;
  padding-bottom: 30px;
}

.client-page {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 4vw, 42px) clamp(12px, 3vw, 24px) 56px;
}

.board-header {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
  margin: 8px auto clamp(22px, 4vw, 42px);
  max-width: 980px;
}

.board-header .eyebrow {
  color: rgba(17, 17, 17, 0.52);
}

#postCount,
#clientPostCount {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-weight: 900;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-grid article {
  min-height: 116px;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.summary-grid strong {
  font-size: clamp(1.25rem, 2.4vw, 2rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.post-card {
  border-radius: 8px;
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.post-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 30px 90px rgba(24, 20, 16, 0.18);
}

.post-card figure {
  aspect-ratio: 1 / 1;
  margin: 0;
  background:
    linear-gradient(135deg, rgba(217, 79, 61, 0.18), transparent),
    linear-gradient(225deg, rgba(84, 120, 92, 0.22), transparent),
    #e9dfd3;
  overflow: hidden;
}

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

.post-content {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.post-rank {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.remove-button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
}

.remove-button:hover {
  border-color: rgba(154, 48, 39, 0.36);
  color: #9a3027;
}

.metric-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-row div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.metric-row strong {
  font-size: 1.1rem;
  overflow-wrap: anywhere;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 340px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .composer {
    position: static;
  }

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

@media (max-width: 640px) {
  .app-shell {
    padding: 12px;
  }

  .composer,
  .summary-grid article,
  .post-content {
    padding: 14px;
  }

  h2 {
    font-size: 2.2rem;
  }

  .field-pair,
  .summary-grid {
    grid-template-columns: 1fr;
  }

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