:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #667085;
  --line: #d9e1e3;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
  --soft: #e7f4f1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

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

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto;
}

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

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

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
}

.status {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  color: var(--muted);
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 18px;
}

.account-panel {
  margin-bottom: 18px;
}

.account-panel .panel-head p {
  color: var(--muted);
  margin-top: 4px;
}

.account-form {
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.editor-head p {
  color: var(--muted);
  margin-top: 4px;
}

.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 22px;
  cursor: pointer;
}

.campaign-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  max-height: calc(100vh - 170px);
  overflow: auto;
}

.campaign-card {
  text-align: right;
  border: 1px solid var(--line);
  background: #fbfdfc;
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
}

.campaign-card.active {
  border-color: var(--accent);
  background: var(--soft);
}

.campaign-card strong {
  display: block;
  margin-bottom: 6px;
}

.campaign-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  margin-top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #344054;
  font-size: 12px;
}

.badge.on {
  background: #dcfae6;
  color: #067647;
}

.form {
  display: grid;
  gap: 16px;
  padding: 18px;
}

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

label {
  display: grid;
  gap: 7px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
}

.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.primary:hover {
  background: var(--accent-dark);
}

.danger {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

legend {
  padding: 0 6px;
  color: var(--muted);
  font-weight: 700;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.segmented label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  cursor: pointer;
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.switch input {
  display: none;
}

.switch span {
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5df;
  position: relative;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: 0.18s ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  transform: translateX(-18px);
}

.post-picker {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
  max-height: 260px;
  overflow: auto;
}

.post-option {
  text-align: right;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

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

.actions {
  display: flex;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #17202a;
  color: #fff;
  box-shadow: 0 8px 30px rgba(16, 24, 40, 0.18);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(440px, 100%);
  padding: 22px;
}

.auth-panel h1 {
  margin-top: 6px;
}

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

.compact-form h2 {
  font-size: 17px;
}

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

.hidden {
  display: none !important;
}

@media (max-width: 860px) {
  .layout,
  .grid.two,
  .input-row,
  .account-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: space-between;
  }
}
