:root {
  --ink: #1f2933;
  --muted: #64748b;
  --line: #d8dee9;
  --paper: #ffffff;
  --wash: #f4f7f9;
  --green: #1f8a70;
  --rose: #c2415d;
  --gold: #b7791f;
  --cyan: #0f7894;
  --shadow: 0 18px 50px rgba(31, 41, 51, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

a.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 16px;
  background: var(--green);
  color: #ffffff;
  font-weight: 800;
  text-decoration: none;
}

button:hover {
  filter: brightness(0.96);
}

button.secondary,
a.button.secondary {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

label {
  display: grid;
  gap: 8px;
  font-weight: 800;
}

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

input {
  min-height: 44px;
  padding: 10px 12px;
}

textarea {
  min-height: 140px;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 1;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.hidden {
  display: none !important;
}

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

.brand-logo {
  width: min(290px, 100%);
  height: auto;
  display: block;
  margin-bottom: 14px;
}

.hero-logo {
  width: min(360px, 86vw);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.26));
}

.legal-logo {
  width: min(320px, 100%);
  margin-bottom: 24px;
}

.lead {
  max-width: 680px;
  color: #334155;
  font-size: 1.16rem;
  line-height: 1.55;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 460px);
}

.auth-copy {
  position: relative;
  min-height: 620px;
  display: grid;
  align-content: end;
  padding: min(8vw, 72px);
  overflow: hidden;
  color: #ffffff;
}

.auth-copy::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(180deg, rgba(9, 16, 20, 0.08), rgba(9, 16, 20, 0.74));
}

.auth-copy > div {
  position: relative;
  z-index: 1;
}

.auth-copy .eyebrow,
.auth-copy .lead {
  color: #ffffff;
}

.auth-copy .brand-logo {
  margin-bottom: 20px;
}

.auth-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-panel {
  display: grid;
  align-content: center;
  gap: 18px;
  padding: min(8vw, 64px);
  background: #ffffff;
}

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

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

.compact-form {
  border-top: 1px solid var(--line);
  margin-top: 6px;
  padding-top: 22px;
}

.notice {
  width: min(1500px, 100%);
  margin: 0 auto 18px;
  border: 1px solid #9fd8c9;
  border-radius: 8px;
  padding: 13px 16px;
  background: #e9fbf4;
  color: #165f50;
  font-weight: 800;
}

.notice.error {
  border-color: #f0a6b6;
  background: #fff0f3;
  color: #9f1d3a;
}

.site-footer {
  width: min(1500px, 100%);
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  margin: 28px auto 0;
  padding: 18px 0 4px;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--green);
}

.auth-footer {
  position: absolute;
  right: min(8vw, 64px);
  bottom: 20px;
  width: auto;
  margin: 0;
}

.legal-page {
  min-height: 100vh;
  padding: 32px 18px;
}

.legal-page section {
  width: min(860px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(22px, 5vw, 44px);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.legal-page h1 {
  font-size: clamp(2rem, 6vw, 3.2rem);
}

.legal-page h2 {
  margin-top: 28px;
}

.legal-page p {
  color: #475569;
  line-height: 1.65;
}

.public-home {
  min-height: 100vh;
  padding: 28px;
}

.public-hero,
.public-details {
  width: min(1500px, 100%);
  margin: 0 auto;
}

.public-hero {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.75fr);
  gap: 28px;
  align-items: center;
}

.public-hero > div {
  display: grid;
  gap: 16px;
}

.public-hero h1 {
  font-size: clamp(2.4rem, 7vw, 5rem);
}

.public-photo {
  width: 100%;
  height: min(620px, 70vh);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

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

.public-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.public-details article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.public-details p {
  color: var(--muted);
  line-height: 1.55;
}

.dashboard {
  min-height: 100vh;
  padding: 28px;
}

.topbar,
.workspace,
.stats {
  width: min(1500px, 100%);
  margin: 0 auto;
}

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

.topbar h1 {
  font-size: clamp(2rem, 5vw, 3.3rem);
}

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

#userBadge {
  max-width: 260px;
  overflow-wrap: anywhere;
  color: var(--muted);
  font-weight: 800;
}

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

.stats article {
  min-height: 96px;
  display: grid;
  align-content: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  color: var(--muted);
  font-weight: 800;
}

.stats span {
  display: block;
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
}

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

.account-connectors {
  width: min(1500px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 auto 20px;
}

.account-connectors article {
  display: grid;
  gap: 10px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.account-connectors p {
  color: var(--muted);
  line-height: 1.45;
}

.account-list {
  width: min(1500px, 100%);
  margin: 0 auto;
}

.composer,
.queue {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

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

.form-heading,
.queue-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

fieldset {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

legend {
  padding: 0 8px;
  font-weight: 900;
}

.channel-pills,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  background: #ffffff;
  font-weight: 800;
  cursor: pointer;
}

.pill input {
  width: auto;
  min-height: auto;
}

.filter-btn {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: #ffffff;
  color: var(--ink);
}

.filter-btn.active {
  border-color: transparent;
  background: var(--ink);
  color: #ffffff;
}

.platform-editors {
  display: grid;
  gap: 14px;
}

.platform-editor {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fbfcfd;
}

.platform-editor h3 {
  margin: 0;
  font-size: 1rem;
}

.media-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 12px;
  align-items: center;
}

.media-preview {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.media-preview img,
.media-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue {
  min-height: 640px;
  padding: 22px;
}

.post-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.empty {
  display: grid;
  place-items: center;
  min-height: 260px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.post-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.post-card header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.post-card h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.post-card time {
  color: var(--muted);
  font-weight: 800;
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.variant {
  display: grid;
  gap: 8px;
  border-radius: 8px;
  padding: 12px;
  background: #f7fafb;
}

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

.variant p {
  margin: 0;
  color: #475569;
  overflow-wrap: anywhere;
}

.variant img,
.variant video {
  width: 100%;
  max-height: 220px;
  border-radius: 8px;
  object-fit: cover;
  background: #ffffff;
}

.status-line {
  margin: 6px 0 0;
  color: var(--muted);
  font-weight: 800;
}

.delete-btn {
  min-width: 86px;
  background: var(--rose);
}

dialog {
  width: min(760px, calc(100% - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

dialog form {
  display: grid;
  gap: 14px;
  padding: 22px;
}

#exportText {
  min-height: 360px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

@media (max-width: 980px) {
  .auth-screen,
  .workspace,
  .public-hero,
  .public-details {
    grid-template-columns: 1fr;
  }

  .auth-copy {
    min-height: 420px;
  }

  .auth-footer {
    position: static;
    width: min(1500px, 100%);
    padding: 18px;
  }
}

@media (max-width: 680px) {
  .dashboard {
    padding: 18px;
  }

  .topbar,
  .topbar-actions,
  .form-heading,
  .queue-heading,
  .post-card header {
    align-items: stretch;
    flex-direction: column;
  }

  .stats,
  .date-grid,
  .media-row,
  .account-connectors {
    grid-template-columns: 1fr;
  }

  .media-preview {
    width: 100%;
    height: 160px;
  }
}
