:root {
  color-scheme: dark;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --bg: #0b0c0f;
  --panel: #1c1e24;
  --panel-soft: #23262d;
  --panel-dark: #15171c;
  --ink: #f4f7fb;
  --muted: #a8afbd;
  --line: #343844;
  --line-soft: #2a2d36;
  --accent: #10c7c3;
  --accent-dark: #0b8e8c;
  --danger: #ff3c98;
  --warn: #f6c65b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

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

button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0 16px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  border-color: #596071;
}

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

.primary:hover {
  border-color: var(--accent);
  background: #0aa6a3;
}

.ghost {
  background: transparent;
}

.wide {
  width: 100%;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 13px 14px;
  background: var(--panel-soft);
  color: var(--ink);
  outline: 0;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

label {
  display: grid;
  gap: 8px;
  color: #c8ced9;
  font-size: 14px;
  font-weight: 800;
}

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

h1 {
  margin-bottom: 10px;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 10px;
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 5px;
  font-size: 15px;
  line-height: 1.25;
}

p {
  color: var(--muted);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
}

.brand-mark,
.step-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 3px solid var(--accent);
  border-radius: 7px;
  color: var(--accent);
  font-weight: 1000;
}

.eyebrow {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.auth-view {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  align-items: center;
  width: min(1440px, calc(100vw - 48px));
  min-height: 100vh;
  margin: 0 auto;
  gap: 72px;
  padding: 48px 0;
}

.auth-card {
  display: grid;
  gap: 24px;
}

.auth-card h1 {
  font-size: 46px;
}

.auth-form,
.center-form,
.stack-form,
.modal {
  display: grid;
  gap: 16px;
}

.small-copy {
  font-size: 13px;
}

.auth-aside {
  display: grid;
  place-items: center;
  text-align: center;
}

.auth-aside h2 {
  max-width: 760px;
  font-size: 30px;
}

.preview-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: min(820px, 100%);
  margin-top: 24px;
  border: 1px solid #eceef2;
  border-radius: 8px;
  padding: 28px;
  background: #f7f5ef;
  color: #15171c;
}

.preview-board div {
  height: 104px;
  border: 1px dashed #cfd4dc;
  border-radius: 6px;
  background: #fffefa;
}

.preview-board strong {
  color: #15171c;
}

.account-menu {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 20;
  width: 156px;
}

.account-trigger {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
}

.account-trigger span:first-child {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-dark);
}

.account-trigger strong {
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-popover {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: var(--panel);
}

.account-popover button {
  justify-content: flex-start;
  border: 0;
  text-align: left;
}

#deleteLocalButton {
  color: var(--danger);
}

.onboard-view {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 68px 24px;
}

.onboard-step {
  width: min(720px, 100%);
  text-align: center;
}

.onboard-step .step-icon {
  margin: 0 auto 18px;
}

.center-form {
  width: min(420px, 100%);
  margin: 28px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: var(--panel);
  text-align: left;
}

.wide-form {
  width: min(660px, 100%);
}

.step-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.step-actions button {
  min-width: 112px;
}

.step-dots {
  position: fixed;
  bottom: 24px;
  left: 50%;
  display: flex;
  gap: 9px;
  transform: translateX(-50%);
}

.step-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #596071;
}

.step-dots span.active {
  background: #c8ced9;
}

.workspace-view {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line-soft);
  padding: 22px 16px;
  background: #08090b;
}

.side-nav {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.side-nav button {
  justify-content: flex-start;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--muted);
}

.side-nav button.active {
  background: var(--panel);
  color: var(--ink);
}

.workspace-main {
  min-width: 0;
  padding: 34px;
}

.workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.panel {
  display: grid;
  gap: 20px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

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

.metrics article,
.runner-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--panel);
}

.metrics strong {
  display: block;
  font-size: 34px;
}

.metrics span,
.item small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 18px;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
}

.social-grid.compact {
  grid-template-columns: repeat(5, minmax(96px, 1fr));
  width: min(590px, 100%);
  margin: 22px auto 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--panel);
}

.social-tile {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 112px;
  padding: 14px;
  text-align: center;
}

.social-tile.is-compact {
  min-height: 96px;
}

.social-tile.connected {
  border-color: rgba(16, 199, 195, 0.6);
  background: rgba(16, 199, 195, 0.08);
}

.social-tile small {
  color: var(--muted);
  font-size: 12px;
}

.social-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--social-color, var(--accent-dark));
  color: #fff;
  font-size: 13px;
  font-weight: 1000;
}

.social-mark.large {
  width: 42px;
  height: 42px;
  font-size: 18px;
}

.social-mark.small {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel);
}

.item p {
  margin-bottom: 4px;
  overflow-wrap: anywhere;
}

.text-item {
  display: block;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
}

legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

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

.check input {
  width: auto;
}

dialog {
  width: min(560px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
  color: var(--ink);
}

.social-picker-dialog {
  width: min(650px, calc(100vw - 28px));
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.modal {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: var(--panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.38);
}

.modal-head,
.modal-title,
.modal-actions {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.modal-head {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.modal-actions {
  justify-content: flex-end;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  padding: 0;
  font-size: 22px;
}

.status {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(520px, calc(100vw - 36px));
  margin: 0;
  color: var(--warn);
  font-size: 13px;
  font-weight: 800;
}

@media (max-width: 980px) {
  .auth-view,
  .workspace-view,
  .two-column,
  .metrics {
    grid-template-columns: 1fr;
  }

  .auth-aside,
  .sidebar {
    display: none;
  }

  .workspace-main {
    padding: 72px 18px 28px;
  }

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

@media (max-width: 560px) {
  .auth-view {
    width: min(100% - 28px, 460px);
  }

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

  .workspace-head,
  .step-actions,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
