:root {
  --bg: #070b12;
  --panel: #0d1520;
  --panel-2: #111c2b;
  --line: #1c2b40;
  --text: #dbe6f5;
  --muted: #8aa0bb;
  --cyan: #00e5ff;
  --red: #ff4d6d;
  --green: #22d3a6;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% -10%, #10243a 0%, var(--bg) 55%);
  color: var(--text);
  font-family: Inter, "Mukta", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 11, 18, 0.82);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 5;
}

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

.mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff4d6d, #ff9f43);
  color: #0b0f16;
  font-size: 16px;
}

h1 {
  margin: 0;
  font-size: 17px;
  font-family: Sora, Inter, sans-serif;
  letter-spacing: 0.2px;
}

h1 b {
  color: var(--cyan);
}

#health {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 22px 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-content: start;
}

.rail button {
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.rail button:hover {
  background: var(--panel);
  border-color: var(--line);
}

.rail button.active {
  background: var(--panel-2);
  border-color: #1f4a63;
  box-shadow: inset 3px 0 0 var(--cyan);
}

.rail .cmd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--cyan);
}

.rail .one-line {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.stage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  min-height: 70vh;
}

.head h2 {
  margin: 0 0 6px;
  font-size: 19px;
  font-family: Sora, Inter, sans-serif;
}

.head p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.field {
  display: block;
  margin-bottom: 14px;
}

.field span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

textarea,
input[type="text"] {
  width: 100%;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #080f19;
  color: var(--text);
  font: inherit;
  line-height: 1.6;
  resize: vertical;
}

textarea:focus,
input[type="text"]:focus {
  outline: none;
  border-color: #1f6a86;
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.08);
}

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

button {
  font: inherit;
}

.primary,
.ghost {
  border-radius: 10px;
  padding: 9px 16px;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease;
}

.primary {
  border: none;
  background: linear-gradient(135deg, var(--cyan), #38bdf8);
  color: #04121a;
  font-weight: 600;
}

.primary:hover {
  transform: translateY(-1px);
}

.primary:disabled {
  opacity: 0.55;
  cursor: progress;
  transform: none;
}

.ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}

.ghost:hover {
  border-color: #2a4a66;
}

.status {
  color: var(--muted);
  font-size: 12.5px;
}

.out {
  margin: 16px 0 0;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #060d15;
  color: #cfe3f7;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.8px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 62vh;
  overflow: auto;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  color: var(--text);
  width: min(880px, 92vw);
  padding: 0;
}

dialog::backdrop {
  background: rgba(3, 7, 12, 0.72);
}

.voice {
  padding: 20px;
}

.voice h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12.8px;
  line-height: 1.55;
}

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

  .rail {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .rail button {
    min-width: 190px;
  }
}

/* --- static page additions --- */
.back {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
}

.back:hover {
  color: var(--cyan);
  border-color: #2a4a66;
}

.fine {
  margin: 18px 0 0;
  color: #5f7590;
  font-size: 11.8px;
  line-height: 1.6;
}

header.top a.brand {
  text-decoration: none;
  color: inherit;
}

/* --- auto pilot --- */
.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.primary.active {
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.45);
}

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

.grid2 .field {
  margin-bottom: 6px;
}

.steps {
  margin: 16px 0 0;
  padding: 0 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.9;
}

.steps li.run {
  color: var(--cyan);
}

.steps li.done {
  color: var(--green);
}

.steps li.fail {
  color: var(--red);
}

.card {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
}

.card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.muted {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0 0 8px;
}

.top-videos {
  margin: 0;
  padding-left: 18px;
  font-size: 12.8px;
  line-height: 1.7;
}

.top-videos a {
  color: var(--cyan);
  text-decoration: none;
}

.top-videos a:hover {
  text-decoration: underline;
}

.pkg-actions {
  margin-top: 16px;
}

.out.pkg {
  max-height: 70vh;
  font-family: Inter, "Mukta", system-ui, sans-serif;
  font-size: 13.5px;
  line-height: 1.75;
  white-space: pre-wrap;
}

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

/* --- channel connect + autopilot --- */
.publish {
  border: 1px solid #1f4a63;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 20px;
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.06), transparent 60%), var(--panel-2);
}

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

.pub-head h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-family: Sora, Inter, sans-serif;
}

.pub-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 76ch;
}

.pill {
  flex: 0 0 auto;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.pill.ok {
  color: var(--green);
  border-color: rgba(34, 211, 166, 0.45);
  background: rgba(34, 211, 166, 0.1);
}

.pill.bad {
  color: var(--red);
  border-color: rgba(255, 77, 109, 0.4);
  background: rgba(255, 77, 109, 0.08);
}

.pub-channel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 12px;
}

.pub-channel img {
  border-radius: 50%;
  border: 1px solid var(--line);
}

.pub-channel strong {
  font-size: 14.5px;
}

.pub-channel .muted {
  margin: 2px 0 0;
}

.pub-actions {
  margin-bottom: 12px;
}

.link {
  color: var(--cyan);
  font-size: 12.5px;
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.pub-notes {
  border-left: 2px solid #1f4a63;
  padding: 2px 0 2px 12px;
  margin: 0 0 14px;
}

.pub-notes p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.pub-notes code {
  color: #b9d7ef;
  background: #080f19;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 11.5px;
  word-break: break-all;
}

.pub-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 6px;
}

.pub-lists h3 {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}

.pub-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.6px;
  line-height: 1.5;
}

.pub-list li {
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.pub-list li:last-child {
  border-bottom: none;
}

.pub-list a {
  color: var(--cyan);
  text-decoration: none;
}

.pub-list a:hover {
  text-decoration: underline;
}

.pub-list .when {
  color: #5f7590;
  font-size: 11px;
  white-space: nowrap;
}

.pub-setup {
  border: 1px dashed #24536e;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 14px;
  background: rgba(0, 229, 255, 0.03);
}

.pub-setup h3 {
  margin: 0 0 4px;
  font-size: 13.5px;
  letter-spacing: 0.2px;
  color: #cfe6f7;
}

.pub-setup .field {
  margin-top: 10px;
}

.copy-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.copy-row input {
  flex: 1 1 auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.copy-row button {
  flex: 0 0 auto;
}

.login-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

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

.account img,
.account .avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-2);
}

.account .who {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  max-width: 170px;
}

.account .who b,
.account .who small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account .who b {
  font-size: 12.5px;
}

.account .who small {
  color: var(--muted);
  font-size: 11px;
}

.account a.primary,
.account button {
  text-decoration: none;
  white-space: nowrap;
}

/* --------------------------------------------------- login / signup page */
.auth-body {
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.auth-wrap {
  width: 100%;
  max-width: 430px;
}

.auth-back {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
}

.auth-back:hover {
  color: var(--cyan);
}

.auth-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 22px 20px;
  background: linear-gradient(180deg, rgba(17, 28, 43, 0.96), rgba(13, 21, 32, 0.99));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.auth-brand h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0.3px;
}

.auth-brand h1 b {
  color: var(--cyan);
}

.auth-brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.auth-tabs {
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(0, 229, 255, 0.05);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.auth-tabs button {
  flex: 1 1 0;
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.auth-tabs button.active {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.auth-card h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.auth-card .muted {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
}

.auth-card a {
  color: var(--cyan);
  text-decoration: none;
}

.auth-card a:hover {
  text-decoration: underline;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid #dfe6f0;
  background: #fff;
  color: #1b2431;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.google-btn:hover {
  background: #f3f7fd;
}

.google-btn svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.gis-box {
  display: flex;
  justify-content: center;
  min-height: 44px;
}

.client-setup {
  margin-top: 14px;
  border: 1px dashed #24536e;
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(0, 229, 255, 0.03);
}

.client-setup summary {
  cursor: pointer;
  font-size: 12.5px;
  color: #9fd8f2;
}

.client-setup .muted {
  font-size: 12px;
  line-height: 1.65;
  margin: 8px 0;
}

.client-setup code {
  color: var(--cyan);
  word-break: break-all;
}

.auth-perks {
  margin: 16px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}

@media (max-width: 720px) {
  .pub-head {
    flex-direction: column;
  }

  .pub-lists {
    grid-template-columns: 1fr;
  }
}
