@font-face {
  font-family: "Raleway";
  src: url("assets/fonts/Raleway-VariableFont_wght.ttf") format("truetype");
  font-display: swap;
  font-style: normal;
  font-weight: 100 900;
}

@font-face {
  font-family: "ITC Avant Garde";
  src: url("assets/fonts/ITCAvantGardeGothicMd.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400 900;
}

:root {
  color-scheme: dark;
  --bg: #1a1f27;
  --bg-soft: #151a21;
  --panel: #20262f;
  --panel-strong: #262d39;
  --panel-muted: #171c23;
  --line: rgba(127, 155, 198, 0.16);
  --line-strong: rgba(127, 155, 198, 0.28);
  --text: #eef4ff;
  --muted: #94a3bd;
  --subtle: #7f8ca4;
  --blue: #3d7cff;
  --cyan: #22c7ff;
  --teal: #18d2c3;
  --orange: #ff922d;
  --green: #56d08c;
  --danger: #ff6f61;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
  --radius-lg: 30px;
  --radius-md: 22px;
  --radius-sm: 14px;
  --max: 1440px;
  --font-sans: "Raleway", "Avenir Next", "Segoe UI", Arial, sans-serif;
  --font-display: "ITC Avant Garde", "Avant Garde", "Raleway", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, #222832 0%, #1a1f27 42%, #151a21 100%);
  background-size: 48px 48px, 48px 48px, auto;
  color: var(--text);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.page-shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 56px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 84px;
  margin-bottom: 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(20, 26, 34, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 16px;
}

.brand-logo {
  width: 144px;
  height: auto;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: brightness(1.8) contrast(1.8);
}

.brand-lockup span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-lockup strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-lockup small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-select,
.ghost-link,
.week-chip,
.platform-pill,
.status-pill,
.post-index {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.client-select {
  min-width: 170px;
  min-height: 42px;
  padding: 0 38px 0 14px;
  border-radius: 999px;
}

.client-select option {
  color: #10151c;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--muted);
}

.ghost-link:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.calendar-app {
  display: grid;
  gap: 20px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 0;
  padding: 0;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(135deg, rgba(61, 124, 255, 0.22), transparent 30%),
    linear-gradient(145deg, rgba(32, 41, 52, 0.98), rgba(20, 26, 34, 0.98));
  box-shadow: var(--shadow);
}

.hero-left {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 28px;
}

.hero-showcase {
  position: relative;
  z-index: 1;
  overflow: hidden;
  background: var(--panel-muted);
  min-height: 380px;
}

.hero-showcase img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0%, rgba(34, 199, 255, 0.1) 44%, transparent 58%),
    linear-gradient(90deg, transparent 0%, rgba(255, 146, 45, 0.08) 100%);
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.eyebrow-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.week-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.week-chip.ready {
  border-color: rgba(86, 208, 140, 0.32);
  color: #b9f4d0;
  background: rgba(86, 208, 140, 0.12);
}

.hero-title {
  max-width: 780px;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.75rem, 2.8vw, 2.9rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-title span {
  display: block;
  color: var(--muted);
  font-size: clamp(0.85rem, 1.2vw, 1rem);
  line-height: 1.3;
  margin-top: 10px;
  font-weight: 500;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mini-metric {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(16, 21, 28, 0.48);
}

.mini-metric strong {
  display: block;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1;
}

.mini-metric span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
}

.hero-detail {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10, 14, 20, 0.55);
  overflow: hidden;
  min-height: 0;
}

.hero-detail-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.hero-detail-copy {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  color: #d9e0ea;
  font-size: 0.86rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.calendar-workspace {
  display: grid;
  gap: 20px;
}

.focus-grid {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(0, 1.2fr);
  gap: 20px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(27, 34, 44, 0.86);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.22);
}

.week-panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.15;
  letter-spacing: 0;
}

.panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 1px;
  padding: 1px;
  overflow: hidden;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--line);
}

.day-cell {
  display: grid;
  align-content: start;
  min-height: 154px;
  padding: 14px;
  border: 0;
  background: rgba(20, 26, 34, 0.96);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.day-cell:hover,
.day-cell.active {
  background: rgba(61, 124, 255, 0.14);
}

.day-cell.empty {
  cursor: default;
  opacity: 0.62;
}

.day-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.day-name {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.day-number {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
}

.mini-posts {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mini-post {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.mini-post img {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: contain;
  background: #eef2f7;
}

.mini-post span {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-list {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.post-card {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  min-height: 150px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent),
    rgba(16, 21, 28, 0.72);
  cursor: pointer;
}

.post-card.active {
  border-color: rgba(34, 199, 255, 0.46);
  box-shadow: 0 0 0 1px rgba(34, 199, 255, 0.12);
}

.post-media {
  position: relative;
  min-height: 150px;
  padding: 8px;
  background: #eef2f7;
}

.post-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.post-index {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  background: rgba(16, 21, 28, 0.72);
  backdrop-filter: blur(12px);
}

.post-body {
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: 18px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.platform-pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-pill {
  border-color: rgba(86, 208, 140, 0.32);
  color: #b9f4d0;
  background: rgba(86, 208, 140, 0.1);
}

.post-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.1rem, 1.7vw, 1.55rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.post-caption {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.48;
}

.detail-panel {
  display: block;
  overflow: hidden;
}

.detail-media {
  display: grid;
  place-items: center;
  min-height: 540px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(238, 242, 247, 0.94)),
    #eef2f7;
}

.detail-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-copy {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.detail-copy h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.5rem, 2.6vw, 2.55rem);
  line-height: 1;
  letter-spacing: 0;
}

.copy-block {
  max-height: none;
  overflow: visible;
  padding-right: 8px;
  color: #d9e0ea;
  font-size: 0.96rem;
  line-height: 1.58;
  white-space: pre-wrap;
}

.queue-panel {
  position: static;
}

.queue-panel .post-list {
  max-height: none;
  overflow: visible;
}

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

.detail-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
}

.detail-stat span {
  display: block;
  color: var(--subtle);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-stat strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 0.94rem;
}

.empty-state,
.loading-state,
.error-state {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(27, 34, 44, 0.86);
  color: var(--muted);
}

.error-state {
  border-color: rgba(255, 111, 97, 0.45);
  color: #ffd1cc;
}

@media (max-width: 1120px) {
  .hero-panel {
    grid-template-columns: 1fr;
  }

  .hero-showcase {
    min-height: auto;
    aspect-ratio: 4 / 3;
  }

  .queue-panel {
    position: static;
  }

  .queue-panel .post-list {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 20px, var(--max));
    padding-top: 10px;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .client-select,
  .ghost-link {
    width: 100%;
  }

  .brand-logo {
    width: 126px;
  }

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

  .detail-footer {
    grid-template-columns: 1fr;
  }

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

  .day-cell {
    min-height: 104px;
  }

  .post-card {
    grid-template-columns: 104px minmax(0, 1fr);
    min-height: 124px;
  }

  .post-media {
    min-height: 124px;
    aspect-ratio: auto;
  }

  .post-body {
    gap: 12px;
    padding: 14px;
  }

  .post-caption {
    display: none;
  }

  .post-title {
    font-size: 1.05rem;
  }
}
