:root {
  color-scheme: light;
  --ink: #18212b;
  --muted: #6d7480;
  --line: #e7e9ee;
  --paper: #ffffff;
  --canvas: #fafbfd;
  --cyan: #00b8d9;
  --cyan-dark: #0085a3;
  --cyan-soft: #e7faff;
  --magenta: #d91683;
  --magenta-dark: #aa0d65;
  --magenta-soft: #fff0f8;
  --violet: #7b5cff;
  --violet-soft: #f1eeff;
  --success: #049f72;
  --shadow: 0 10px 28px rgba(33, 42, 54, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
}

button:hover {
  border-color: var(--cyan);
}

button:disabled {
  cursor: progress;
  opacity: 0.62;
}

a {
  color: var(--cyan-dark);
  overflow-wrap: anywhere;
}

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

h1 {
  margin-bottom: 8px;
  font-size: 32px;
  line-height: 1.14;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 18px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

.shell {
  min-height: 100vh;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--magenta);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel,
.calendar-panel,
.connection-callout {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel {
  padding: 22px;
}

.panel-head {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-head p,
.page-heading p,
.muted {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.section-icon {
  display: inline-grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 800;
}

.section-icon.cyan {
  background: var(--cyan-soft);
  color: var(--cyan-dark);
}

.section-icon.magenta {
  background: var(--magenta-soft);
  color: var(--magenta);
}

.section-icon.violet {
  background: var(--violet-soft);
  color: var(--violet);
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
  color: #39414d;
  font-size: 13px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid #dfe3e9;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 184, 217, 0.14);
}

.primary {
  width: 100%;
  border-color: var(--magenta);
  background: var(--magenta);
  color: #fff;
  font-weight: 800;
}

.primary:hover {
  border-color: var(--magenta-dark);
  background: var(--magenta-dark);
}

.primary.compact {
  width: auto;
  min-width: 126px;
}

.quiet-button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.quiet-button:hover {
  border-color: var(--line);
  color: var(--ink);
}

/* Authentication */
.auth-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 440px);
  width: min(1060px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  gap: 80px;
  align-items: center;
}

.auth-intro {
  max-width: 500px;
}

.auth-intro h1 {
  margin-bottom: 14px;
  font-size: 52px;
}

.auth-intro > p:last-child {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.auth-panel {
  width: 100%;
}

.auth-panel .panel-head {
  display: block;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: -4px -4px 20px;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  min-height: 42px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.auth-tab.active {
  border-bottom-color: var(--magenta);
  color: var(--magenta-dark);
}

.auth-message {
  margin: 16px 0 0;
  color: var(--cyan-dark);
  font-size: 14px;
  line-height: 1.5;
}

.text-button {
  min-height: 30px;
  margin-top: 8px;
  border-color: transparent;
  color: var(--magenta);
  padding-left: 0;
}

/* Application */
.app-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: 100vh;
  background: var(--canvas);
}

.app-sidebar {
  display: flex;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 22px 14px 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 850;
}

.brand-mark {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 7px;
  background: var(--magenta);
  color: #fff;
  font-size: 15px;
  font-weight: 900;
}

.workspace-label {
  margin: 38px 8px 8px;
  color: #9ca3ae;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.sidebar-nav {
  display: grid;
  gap: 3px;
}

.nav-item {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #5f6876;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 720;
  text-align: left;
}

.nav-item span {
  color: var(--cyan-dark);
  font-size: 14px;
}

.nav-item:hover {
  border: 0;
  background: var(--cyan-soft);
}

.nav-item.active {
  background: var(--magenta-soft);
  color: var(--magenta-dark);
}

.nav-item.active span {
  color: var(--magenta);
}

.sidebar-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 15px 8px 2px;
  color: #57606c;
  font-size: 13px;
  font-weight: 750;
}

.account-avatar {
  display: inline-grid;
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
  place-items: center;
  border-radius: 50%;
  background: var(--cyan-soft);
  color: var(--cyan-dark);
  font-size: 12px;
  font-weight: 900;
}

#account-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  min-width: 0;
}

.app-header {
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  padding: 0 42px;
}

.workspace-site {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #47505d;
  font-size: 13px;
  font-weight: 750;
}

.site-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
}

.account-area {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 700;
}

.status-pill.ok {
  border-color: rgba(0, 184, 217, 0.35);
  background: var(--cyan-soft);
  color: var(--cyan-dark);
}

.app-page {
  width: min(1280px, calc(100% - 64px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

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

.dashboard-metric {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.dashboard-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dashboard-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
  line-height: 1;
}

.dashboard-metric.cyan strong { color: var(--cyan-dark); }
.dashboard-metric.magenta strong { color: var(--magenta); }
.dashboard-metric.violet strong { color: var(--violet); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(380px, 1.2fr);
  gap: 18px;
  align-items: start;
}

.sites-panel {
  min-height: 420px;
}

.row {
  display: grid;
  grid-template-columns: 1fr 130px;
  gap: 12px;
}

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

.check input {
  width: 18px;
  min-height: 18px;
}

.sites,
.articles {
  display: grid;
  gap: 12px;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.site-card,
.article-card {
  display: grid;
  gap: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 15px;
}

.site-main p {
  margin-bottom: 0;
}

.connection {
  margin: 9px 0 0;
  color: var(--magenta);
  font-size: 12px;
  font-weight: 800;
}

.connection.connected {
  color: var(--success);
}

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

.metric {
  border-left: 3px solid var(--cyan);
  background: #fbfdff;
  padding: 8px;
}

.metric:nth-child(2) { border-color: var(--magenta); }
.metric:nth-child(3) { border-color: var(--violet); }
.metric:nth-child(4) { border-color: var(--success); }

.metric strong {
  display: block;
  font-size: 17px;
}

.metric span {
  color: var(--muted);
  font-size: 10px;
}

.keywords,
.topic-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag,
.topic-suggestions button {
  border: 0;
  border-radius: 999px;
  background: var(--cyan-soft);
  color: var(--cyan-dark);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 800;
}

.tag.alt,
.topic-suggestions button:nth-child(even) {
  background: var(--magenta-soft);
  color: var(--magenta-dark);
}

.topic-suggestions button {
  min-height: 29px;
}

.actions,
.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions button,
.article-actions button {
  min-height: 34px;
  color: var(--cyan-dark);
  font-size: 12px;
  font-weight: 750;
}

.article-card {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.article-card .eyebrow {
  color: var(--violet);
}

.articles-panel {
  min-height: 260px;
}

/* Brand review */
.brand-page {
  width: min(900px, calc(100% - 48px));
}

.review-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 28px;
}

.review-step {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  background: #f1f2f5;
  color: #737a85;
  font-size: 13px;
  font-weight: 800;
}

.review-step.done {
  background: var(--cyan-soft);
  color: var(--cyan-dark);
}

.review-step.active {
  background: var(--magenta);
  color: #fff;
}

.review-steps i {
  width: 38px;
  height: 1px;
  background: #e2e5e9;
}

.brand-heading {
  max-width: 620px;
  margin: 0 auto 24px;
  text-align: center;
}

.brand-heading h1 {
  margin-bottom: 8px;
}

.brand-review {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.brand-site-picker {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center;
  gap: 11px;
  border: 1px solid #d9ecf1;
  border-radius: 8px;
  background: #f8feff;
  padding: 12px;
}

.brand-site-picker label {
  margin: 0;
}

.brand-site-picker select {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  padding: 4px 0;
  font-weight: 800;
}

.brand-site-picker select:focus {
  box-shadow: none;
}

.brand-site-avatar {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--magenta-soft);
  color: var(--magenta);
  font-size: 15px;
  font-weight: 900;
}

.brand-site-domain {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  text-align: right;
}

.brand-field {
  min-width: 0;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fcfcfd;
  padding: 12px;
}

.brand-field.full,
.brand-actions.full {
  grid-column: 1 / -1;
}

.brand-field label {
  margin-bottom: 7px;
  color: #505866;
  font-size: 12px;
}

.brand-field textarea {
  min-height: 96px;
  resize: vertical;
  border-color: transparent;
  background: transparent;
  padding: 0;
  line-height: 1.5;
}

.brand-field textarea:focus {
  box-shadow: none;
}

.brand-field input {
  min-height: 38px;
  background: #fff;
}

.brand-themes-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.brand-theme {
  border: 1px solid #c8f0f7;
  border-radius: 999px;
  background: var(--cyan-soft);
  color: var(--cyan-dark);
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 750;
}

.brand-theme:nth-child(even) {
  border-color: #f4c5df;
  background: var(--magenta-soft);
  color: var(--magenta-dark);
}

.brand-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.brand-actions .quiet-button {
  min-height: 38px;
}

/* Guided content setup */
.onboarding-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow);
}

.onboarding-site-summary {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid #d9ecf1;
  border-radius: 8px;
  background: #f8feff;
  padding: 12px;
}

.onboarding-site-summary strong,
.onboarding-site-summary span:last-child {
  display: block;
}

.onboarding-site-summary span:last-child {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.image-style-intro {
  margin: 22px 0 16px;
}

.image-style-intro h2 {
  margin-bottom: 4px;
  font-size: 20px;
}

.image-style-intro p,
.selection-note {
  margin: 0;
  color: var(--muted);
}

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

.image-style-card {
  position: relative;
  display: grid;
  grid-template-rows: 126px auto auto;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.image-style-card.selected {
  border: 2px solid var(--magenta);
  box-shadow: 0 0 0 3px var(--magenta-soft);
}

.image-style-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.image-style-card strong,
.image-style-card small {
  padding: 0 11px;
}

.image-style-card strong {
  font-size: 14px;
}

.image-style-card small {
  min-height: 36px;
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.image-style-preview {
  position: relative;
  display: block;
  overflow: hidden;
  background: #edfaff;
}

.image-style-preview::before,
.image-style-preview::after {
  position: absolute;
  content: "";
}

.image-style-preview::before {
  width: 66px;
  height: 66px;
  left: calc(50% - 33px);
  top: 24px;
  border: 8px solid #172333;
  border-radius: 8px;
  background: #fff;
}

.image-style-preview::after {
  width: 74px;
  height: 34px;
  left: calc(50% - 37px);
  bottom: -8px;
  border-radius: 36px 36px 0 0;
  background: #00b8d9;
}

.image-style-preview.clean-editorial { background: #f3f5f6; }
.image-style-preview.clean-editorial::before { border-color: var(--magenta); background: #fff; }
.image-style-preview.clean-editorial::after { background: var(--cyan); }
.image-style-preview.photorealistic { background: #d8e5db; }
.image-style-preview.photorealistic::before { border-color: #8a5a48; background: #f1d6b1; border-radius: 50%; }
.image-style-preview.photorealistic::after { background: #3f7659; }
.image-style-preview.soft-illustration { background: #f4eafd; }
.image-style-preview.soft-illustration::before { border-color: #8a75c8; background: #ffedcc; border-radius: 50% 50% 42% 42%; }
.image-style-preview.soft-illustration::after { background: #9f8ed7; }
.image-style-preview.three-d-render { background: #dff6fa; }
.image-style-preview.three-d-render::before { border-color: #5838bd; background: #fff; box-shadow: 7px 8px 0 #a4dfe8; }
.image-style-preview.three-d-render::after { background: #6c4ee2; }
.image-style-preview.editorial-vintage { background: #ebd7ad; }
.image-style-preview.editorial-vintage::before { border-color: #9d672d; background: #f0c47e; border-radius: 50%; }
.image-style-preview.editorial-vintage::after { background: #c58842; }
.image-style-preview.abstract { background: #d91683; }
.image-style-preview.abstract::before { border-color: #00b8d9; background: #ffe55b; transform: rotate(20deg); }
.image-style-preview.abstract::after { background: #5b35d5; transform: rotate(-14deg); }

.onboarding-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 22px;
}

.generation-progress {
  margin: 16px 0 -6px;
  border: 1px solid #bdeaf1;
  border-radius: 6px;
  background: #f1fcfe;
  padding: 11px 13px;
  color: #275862;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

.keyword-analysis-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.keyword-analysis-summary span {
  border: 1px solid #d9ecf1;
  border-radius: 999px;
  background: #f8feff;
  padding: 6px 9px;
  color: var(--cyan-dark);
  font-size: 12px;
  font-weight: 750;
}

.keyword-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-option {
  position: relative;
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  border: 1px solid #d9dfe5;
  border-radius: 999px;
  background: #fff;
  padding: 6px 11px;
  color: #46505c;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

.keyword-option.selected {
  border-color: #f4c5df;
  background: var(--magenta-soft);
  color: var(--magenta-dark);
}

.keyword-option input {
  position: absolute;
  opacity: 0;
}

.selection-note {
  margin-top: 14px;
  font-size: 13px;
}

.first-post-empty {
  padding: 40px 16px;
  text-align: center;
}

.first-post-empty h2 {
  margin-bottom: 6px;
}

.first-post-empty p {
  margin: 0 auto 18px;
  color: var(--muted);
}

.first-post-preview {
  max-width: 720px;
  margin: 24px auto 0;
}

.first-post-preview h2 {
  margin-bottom: 8px;
  font-size: 30px;
}

.first-post-meta {
  color: var(--muted);
}

.first-post-content {
  max-height: 430px;
  overflow: auto;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  line-height: 1.65;
}

.first-post-content h2,
.first-post-content h3 {
  margin-top: 20px;
}

.first-post-content li {
  margin-bottom: 6px;
}

/* Settings */
.settings-page {
  max-width: 900px;
}

.settings-panel {
  padding: 22px;
}

.settings-select {
  display: block;
  max-width: 460px;
}

.settings-site-summary {
  display: grid;
  grid-template-columns: 1.8fr repeat(2, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.settings-site-summary > div {
  min-width: 0;
  border: 1px solid #e7ecf0;
  border-radius: 8px;
  background: #fbfdfe;
  padding: 13px;
}

.settings-site-summary span,
.settings-site-summary strong {
  display: block;
}

.settings-site-summary span {
  color: var(--muted);
  font-size: 12px;
}

.settings-site-summary strong {
  overflow-wrap: anywhere;
  margin-top: 4px;
}

.meta-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  margin-top: 24px;
  padding: 22px 0;
  border-top: 1px solid #d8f0f5;
  border-bottom: 1px solid #d8f0f5;
}

.meta-settings h2 {
  margin: 3px 0 6px;
  font-size: 18px;
}

.meta-settings p {
  max-width: 620px;
  margin: 0;
}

.meta-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-page-form {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(240px, 460px) minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border: 1px solid #cdeaf1;
  border-radius: 8px;
  background: #f8fdfe;
}

.meta-page-form label {
  margin: 0;
}

.meta-page-form .muted {
  font-size: 13px;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
  border-top: 1px solid #f1d9e7;
  padding-top: 22px;
}

.danger-zone h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.danger-zone p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.danger-button {
  min-height: 40px;
  flex: 0 0 auto;
  border-color: #efb9d3;
  background: #fff7fb;
  color: #ac165b;
  font-weight: 800;
}

.danger-button:hover,
.danger-button:focus-visible {
  border-color: #ac165b;
  background: #ac165b;
  color: #fff;
}

.confirmation-dialog {
  width: min(460px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0;
}

.confirmation-dialog::backdrop {
  background: rgb(20 28 38 / 35%);
}

.confirmation-dialog form {
  padding: 24px;
}

.confirmation-dialog h2 {
  margin-bottom: 8px;
}

.confirmation-dialog p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

/* Calendar */
.calendar-heading {
  margin-bottom: 24px;
}

.connection-callout {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
}

.connection-callout h2,
.connection-callout p {
  margin-bottom: 0;
}

.connection-callout > div {
  flex: 1;
}

.calendar-panel {
  overflow: hidden;
  padding: 24px;
}

.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.calendar-nav button {
  width: 34px;
  min-height: 34px;
  padding: 0;
  color: var(--violet);
  font-size: 19px;
}

.calendar-nav strong {
  min-width: 170px;
  color: var(--ink);
  font-size: 18px;
  text-align: center;
  text-transform: capitalize;
}

.today-button {
  min-height: 34px;
  border-color: var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.calendar-form {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(230px, 1.7fr) 150px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #ececf7;
  border-radius: 8px;
  background: #fcfcff;
}

.calendar-form label {
  margin-bottom: 0;
}

.calendar-form .primary {
  width: auto;
}

.topic-suggestions {
  min-height: 28px;
  margin: 0 0 18px;
}

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

.calendar-weekday {
  padding: 4px 6px 8px;
  color: #8a919c;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.calendar-day {
  position: relative;
  min-height: 116px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.calendar-day.outside {
  background: #fcfcfd;
  color: #b4bac3;
}

.calendar-day.today {
  border: 2px solid var(--cyan);
  padding: 7px;
}

.calendar-day.today .day-number {
  color: var(--cyan-dark);
}

.day-number {
  display: block;
  margin-bottom: 7px;
  color: #6d7480;
  font-size: 12px;
  font-weight: 850;
}

.calendar-event {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  margin-bottom: 5px;
  border-left: 3px solid var(--magenta);
  border-radius: 3px;
  background: var(--magenta-soft);
  color: var(--magenta-dark);
  padding: 4px;
  font-size: 11px;
  line-height: 1.3;
}

.calendar-event.published {
  border-color: #159b62;
  background: #e8f8ef;
  color: #137249;
}

.calendar-event.failed {
  border-color: #d84a68;
  background: #fff0f3;
  color: #a51f44;
}

.calendar-event button {
  min-height: 19px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0 2px;
  font-size: 13px;
  line-height: 1;
}

.calendar-event .event-title {
  flex: 1;
  overflow-wrap: anywhere;
}

.event-warning {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 17px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.planned { background: var(--magenta); }
.legend-dot.generated { background: var(--cyan); }

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(440px, calc(100% - 36px));
  border-radius: 8px;
  background: #202733;
  color: white;
  padding: 13px 15px;
  box-shadow: var(--shadow);
  z-index: 20;
}

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

  .app-sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 18px;
  }

  .workspace-label,
  .sidebar-foot {
    display: none;
  }

  .sidebar-nav {
    display: flex;
    margin-top: 12px;
  }

  .nav-item {
    width: auto;
  }

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

  .brand-review {
    grid-template-columns: 1fr;
  }

  .brand-field.full,
  .brand-actions.full {
    grid-column: auto;
  }

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

  .auth-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 48px 0;
  }

  .auth-intro h1 {
    font-size: 42px;
  }
}

@media (max-width: 700px) {
  .app-header {
    min-height: 62px;
    padding: 0 18px;
  }

  .workspace-site,
  .status-pill {
    display: none;
  }

  .app-page {
    width: min(100% - 28px, 1280px);
    padding: 28px 0 40px;
  }

  .dashboard-metrics,
  .calendar-form {
    grid-template-columns: 1fr;
  }

  .calendar-form .primary {
    width: 100%;
  }

  .calendar-panel {
    padding: 14px;
  }

  .calendar-day {
    min-height: 82px;
    padding: 5px;
  }

  .calendar-day.today {
    padding: 4px;
  }

  .calendar-event {
    font-size: 9px;
  }

  .calendar-nav strong {
    min-width: 135px;
    font-size: 15px;
  }

  .connection-callout {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .brand-page {
    width: min(100% - 28px, 900px);
  }

  .brand-site-picker {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .brand-site-domain {
    grid-column: 2;
    text-align: left;
  }

  .image-style-grid {
    grid-template-columns: 1fr;
  }

  .image-style-card {
    grid-template-columns: 116px 1fr;
    grid-template-rows: auto auto;
    column-gap: 0;
  }

  .image-style-preview {
    grid-row: 1 / span 2;
  }

  .image-style-card strong,
  .image-style-card small {
    padding-left: 12px;
  }

  .image-style-card strong {
    padding-top: 16px;
  }

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

  .onboarding-actions button {
    width: 100%;
  }

  .first-post-preview h2 {
    font-size: 24px;
  }

  .settings-site-summary {
    grid-template-columns: 1fr;
  }

  .meta-settings,
  .meta-page-form {
    grid-template-columns: 1fr;
  }

  .meta-actions {
    justify-content: flex-start;
  }

  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .danger-zone .danger-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .auth-grid {
    width: min(100% - 28px, 1060px);
  }

  .auth-intro h1,
  h1 {
    font-size: 30px;
  }

  .sidebar-nav {
    gap: 2px;
  }

  .nav-item {
    padding: 8px;
    font-size: 12px;
  }

  .nav-item span {
    display: none;
  }

  .row,
  .metrics,
  .article-card {
    grid-template-columns: 1fr;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .primary.compact {
    width: 100%;
  }
}
