@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,650;9..144,800&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --ink: #17211c;
  --muted: #667169;
  --paper: #f5efe1;
  --panel: rgba(255, 252, 244, 0.82);
  --line: rgba(23, 33, 28, 0.13);
  --green: #1f7a4d;
  --green-dark: #105b36;
  --moss: #d9e7c4;
  --orange: #e86f2a;
  --amber: #f0b24a;
  --red: #b53b3b;
  --shadow: 0 28px 80px rgba(45, 52, 42, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(232, 111, 42, 0.22), transparent 30rem),
    radial-gradient(circle at 84% 16%, rgba(31, 122, 77, 0.2), transparent 24rem),
    linear-gradient(135deg, #fbf3df 0%, #eef2df 48%, #f7e4c7 100%);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(23, 33, 28, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(23, 33, 28, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.64;
}

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

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 360px);
  gap: 24px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Fraunces", Georgia, serif;
  line-height: 0.98;
}

h1 {
  max-width: 900px;
  font-size: clamp(3rem, 7.8vw, 7.6rem);
  letter-spacing: -0.07em;
}

h2 {
  font-size: clamp(1.35rem, 2.1vw, 2.35rem);
  letter-spacing: -0.04em;
}

.hero-copy {
  max-width: 740px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.hero-card,
.panel,
.stat {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 22px;
}

.hero-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.status-dot {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 999px;
  background: var(--amber);
  box-shadow: 0 0 0 8px rgba(240, 178, 74, 0.18);
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 8px rgba(31, 122, 77, 0.16);
}

.status-dot.error {
  background: var(--red);
  box-shadow: 0 0 0 8px rgba(181, 59, 59, 0.16);
}

.control-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.25fr 0.85fr;
  gap: 18px;
}

.panel {
  padding: 22px;
}

.panel-heading {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
}

.panel-heading span {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  color: #fffaf0;
  font-weight: 800;
  background: var(--ink);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.field span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  color: var(--ink);
  outline: none;
  background: rgba(255, 255, 255, 0.66);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 122, 77, 0.12);
}

textarea {
  min-height: 156px;
  resize: vertical;
  line-height: 1.42;
}

.two-fields,
.button-row,
.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.primary,
.ghost,
.danger {
  min-height: 48px;
  border-radius: 16px;
  padding: 0 18px;
  font-weight: 800;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.primary:hover,
.ghost:hover,
.danger:hover {
  transform: translateY(-1px);
}

.primary {
  color: #fffaf0;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  box-shadow: 0 14px 28px rgba(31, 122, 77, 0.26);
}

.ghost {
  color: var(--ink);
  background: var(--moss);
}

.danger {
  width: 100%;
  color: #fffaf0;
  background: linear-gradient(135deg, var(--orange), #bc451e);
  box-shadow: 0 14px 28px rgba(232, 111, 42, 0.25);
}

.button-stack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.publish-all {
  background: linear-gradient(135deg, var(--green-dark), var(--orange));
}

.plain-list {
  display: grid;
  gap: 10px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.plain-list li {
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 16px;
  padding: 11px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.42);
}

.bulk-form {
  border: 1px solid rgba(31, 122, 77, 0.18);
  border-radius: 22px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.36);
}

.check-field {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 16px 0;
  border: 1px solid rgba(31, 122, 77, 0.22);
  border-radius: 18px;
  padding: 13px;
  background: rgba(217, 231, 196, 0.48);
}

.check-field input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--green);
}

.check-field span {
  color: var(--ink);
  font-weight: 800;
}

.check-field small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.35;
}

.queue-settings {
  display: grid;
  grid-template-columns: 1fr 1fr 0.75fr;
  gap: 10px;
  margin: 0 0 14px;
  border: 1px solid rgba(23, 33, 28, 0.1);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.34);
}

.queue-settings .field {
  min-width: 0;
  margin: 0;
}

.input-suffix {
  position: relative;
}

.input-suffix input {
  padding-right: 44px;
}

.input-suffix small {
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  transform: translateY(-50%);
  pointer-events: none;
}

.last-run {
  margin: 14px 0 0;
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 800;
  background: rgba(31, 122, 77, 0.1);
}

.run-item {
  display: inline-grid;
  min-width: 92px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  color: #fffaf0;
  font-weight: 900;
  background: var(--ink);
  box-shadow: 0 10px 22px rgba(23, 33, 28, 0.16);
}

.publish-item {
  display: inline-grid;
  min-width: 82px;
  height: 42px;
  margin-left: 8px;
  place-items: center;
  border-radius: 14px;
  color: #fffaf0;
  font-size: 0.82rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--green), var(--orange));
  box-shadow: 0 10px 22px rgba(232, 111, 42, 0.18);
}

.run-item:disabled,
.publish-item:disabled {
  color: rgba(23, 33, 28, 0.38);
  background: rgba(23, 33, 28, 0.08);
  box-shadow: none;
}

.wide {
  width: 100%;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

code {
  border-radius: 8px;
  padding: 2px 6px;
  background: rgba(23, 33, 28, 0.08);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 18px 0;
}

.stat {
  padding: 22px;
}

.stat span {
  color: var(--muted);
  font-weight: 700;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.88;
}

.queue-panel {
  padding: 0;
  overflow: hidden;
}

.queue-toolbar {
  display: flex;
  gap: 18px;
  align-items: end;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.filters {
  width: min(620px, 100%);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
}

th,
td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.34);
}

td a {
  color: var(--green-dark);
  font-weight: 800;
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.muted {
  color: var(--muted);
  font-size: 0.86rem;
}

.preview-card {
  position: relative;
  width: 132px;
  min-height: 176px;
  overflow: hidden;
  border: 1px solid rgba(23, 33, 28, 0.12);
  border-radius: 18px;
  background: rgba(23, 33, 28, 0.08);
}

.video-preview,
.reel-preview {
  display: block;
  width: 100%;
  height: 176px;
  border: 0;
  object-fit: cover;
  background: #111;
}

.reel-preview {
  transform: scale(0.72);
  transform-origin: top left;
  width: 183%;
  height: 245px;
  pointer-events: none;
}

.preview-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  border-radius: 999px;
  padding: 5px 8px;
  color: #fffaf0;
  font-size: 0.68rem;
  font-weight: 900;
  background: rgba(23, 33, 28, 0.78);
  backdrop-filter: blur(8px);
}

.preview-badge.posted {
  background: rgba(31, 122, 77, 0.86);
}

.preview-badge.ready {
  background: rgba(232, 111, 42, 0.88);
}

.preview-empty {
  display: grid;
  width: 132px;
  height: 176px;
  place-items: center;
  border: 1px dashed rgba(23, 33, 28, 0.22);
  border-radius: 18px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(23, 33, 28, 0.08);
}

.pill.pending {
  background: rgba(240, 178, 74, 0.34);
}

.pill.posted {
  color: #fffaf0;
  background: var(--green);
}

.pill.error {
  color: #fffaf0;
  background: var(--red);
}

.pill.claimed,
.pill.caption_ready {
  color: #fffaf0;
  background: var(--orange);
}

.empty {
  padding: 40px 18px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  max-width: min(440px, calc(100% - 40px));
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  color: #fffaf0;
  opacity: 0;
  background: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1040px) {
  .hero,
  .control-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .shell {
    width: min(100% - 20px, 1440px);
    padding-top: 18px;
  }

  .panel,
  .hero-card,
  .stat {
    border-radius: 22px;
  }

  .two-fields,
  .button-row,
  .filters,
  .queue-settings {
    grid-template-columns: 1fr;
  }

  .queue-toolbar {
    display: block;
  }

  .filters {
    margin-top: 16px;
  }
}
