:root {
  --pitch: #1f8a4c;
  --pitch-bright: #2fbf6a;
  --ink: #0b1210;
  --panel: rgba(14, 22, 19, 0.78);
  --line: rgba(214, 232, 220, 0.12);
  --text: #e8f3ec;
  --muted: #9bb5a6;
  --gold: #e2c36a;
  --danger: #e07a6a;
  --watch: #4db6ff;
  --mine: #e2c36a;
  --reference: #c792ea;
  --radius: 14px;
  --font-display: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--ink);
  line-height: 1.45;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(47, 191, 106, 0.22), transparent 55%),
    radial-gradient(ellipse 40% 35% at 90% 20%, rgba(226, 195, 106, 0.12), transparent 50%),
    radial-gradient(ellipse 45% 40% at 10% 70%, rgba(31, 138, 76, 0.18), transparent 55%),
    linear-gradient(180deg, #07110c 0%, #0b1210 40%, #0a1511 100%);
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    -12deg,
    transparent,
    transparent 18px,
    rgba(255, 255, 255, 0.015) 18px,
    rgba(255, 255, 255, 0.015) 19px
  );
  pointer-events: none;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 1rem;
  animation: rise 0.7s ease both;
}

.brand {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: -0.04em;
  line-height: 0.95;
  background: linear-gradient(120deg, #f4fff8 20%, var(--pitch-bright) 55%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0.55rem 0 0;
  color: var(--muted);
  max-width: 28rem;
  font-size: 1rem;
}

.status-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pill {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

.pill.on {
  color: var(--pitch-bright);
  border-color: rgba(47, 191, 106, 0.35);
}

.pill.off {
  color: var(--danger);
  border-color: rgba(224, 122, 106, 0.35);
}

.layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 1rem;
  padding: 0.5rem clamp(1.25rem, 4vw, 3rem) 2.5rem;
  animation: rise 0.85s 0.08s ease both;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.25rem;
  backdrop-filter: blur(14px);
  min-height: 0;
}

.panel-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.panel-head p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.panel-head.row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.account-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 1rem;
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
}

input:focus,
select:focus {
  outline: 2px solid rgba(47, 191, 106, 0.35);
  border-color: rgba(47, 191, 106, 0.5);
}

.btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn:disabled {
  opacity: 0.55;
  cursor: wait;
  transform: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--pitch), #176b3c);
  border-color: transparent;
  font-weight: 600;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.03);
}

.btn.wide {
  width: 100%;
}

.btn.compact {
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
}

.role-legend {
  display: flex;
  gap: 0.85rem;
  margin: 1rem 0 0.6rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.3rem;
}

.dot.watch {
  background: var(--watch);
}
.dot.mine {
  background: var(--mine);
}
.dot.reference {
  background: var(--reference);
}

.account-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
  max-height: 220px;
  overflow: auto;
}

.account-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.account-list .meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.account-list .handle {
  font-weight: 600;
}

.account-list .role {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.account-list button {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.8rem;
}

.actions {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}

.msg {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--gold);
}

.msg.error {
  color: var(--danger);
}

.tweet-feed,
.suggestion-feed {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  max-height: min(70vh, 760px);
  overflow: auto;
  padding-right: 0.2rem;
}

.empty {
  color: var(--muted);
  margin: 0.5rem 0;
}

.tweet,
.suggestion {
  border-top: 1px solid var(--line);
  padding: 0.85rem 0.1rem 0.2rem;
  animation: fade-in 0.45s ease both;
}

.tweet:first-child,
.suggestion:first-child {
  border-top: 0;
  padding-top: 0.2rem;
}

.tweet-top,
.suggestion-top {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.tweet-top a,
.suggestion-top strong {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.score {
  color: var(--gold);
  font-size: 0.82rem;
  white-space: nowrap;
}

.tweet-text,
.suggestion-draft {
  margin: 0.45rem 0;
  white-space: pre-wrap;
}

.reason,
.meta-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
}

.tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
}

.reach {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  color: var(--pitch-bright);
}

.foot {
  padding: 0 clamp(1.25rem, 4vw, 3rem) 2rem;
  color: var(--muted);
  font-size: 0.8rem;
  animation: rise 1s 0.12s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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

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

  .status-row {
    justify-content: flex-start;
  }
}
