* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0d1117;
  color: #e6edf3;
  line-height: 1.6;
}

header {
  background: #161b22;
  border-bottom: 1px solid #30363d;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-email {
  color: #8b949e;
  font-size: 0.875rem;
}

.billing-link {
  color: #3fb950;
  font-size: 0.875rem;
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  border: 1px solid #238636;
  border-radius: 4px;
}
.billing-link:hover {
  background: #238636;
  color: #fff;
}

.logout-form {
  display: inline;
}

.logout-btn {
  background: transparent;
  border: 1px solid #30363d;
  color: #8b949e;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  cursor: pointer;
  border-radius: 4px;
}

.logout-btn:hover {
  color: #e6edf3;
  border-color: #8b949e;
  background: transparent;
}

.header-link {
  color: #8b949e;
  text-decoration: none;
  font-size: 0.875rem;
}

.header-link:hover {
  color: #e6edf3;
}

.logo {
  color: #58a6ff;
  text-decoration: none;
  font-size: 1.25rem;
  font-weight: 600;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem;
}

h1 {
  margin-bottom: 1.5rem;
}

h2 {
  margin: 1.5rem 0 0.75rem;
  font-size: 1.1rem;
  color: #8b949e;
}

a {
  color: #58a6ff;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
}

.error {
  background: #3d1f1f;
  border: 1px solid #f85149;
  color: #f85149;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}

.empty {
  color: #8b949e;
  font-style: italic;
}

/* Forms */
.launch-form {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.build-hint {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #8b949e;
  font-size: 0.85rem;
}

.build-hint p {
  margin: 0 0 0.5rem 0;
}

.build-hint pre {
  margin: 0;
  padding: 0.5rem 0.75rem;
  background: #161b22;
  border-radius: 4px;
  overflow-x: auto;
}

.build-hint code {
  color: #e6edf3;
  font-size: 0.8rem;
}

label {
  display: block;
  margin-bottom: 0.25rem;
  color: #8b949e;
  font-size: 0.875rem;
}

select,
input:not([type="checkbox"]):not([type="radio"]),
textarea {
  width: 100%;
  padding: 0.5rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  color: #e6edf3;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  font-family: inherit;
}

textarea {
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  /* Default browser styling for checkboxes/radios — the global input
   * rule sets width: 100% which blew them into giant rectangles. */
  width: auto;
  margin: 0;
  vertical-align: middle;
  accent-color: #58a6ff;
}

/* Inline checkbox + label layout (e.g. the "Automatically set up" toggle).
 * Without these rules the global label rule sets display: block and the
 * input is on its own line; this lines them up horizontally with the text
 * aligned against the checkbox top-edge.
 *
 * The em-based input sizing + margin-top scales with the surrounding
 * font so the box visually centers against the first line of text. */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #e6edf3;
  cursor: pointer;
  line-height: 1.4;
}
.checkbox-label input[type="checkbox"] {
  width: 1em;
  height: 1em;
  margin: 0;
  margin-top: 0.25em;
  flex-shrink: 0;
}
.checkbox-label small {
  display: block;
  color: #8b949e;
  font-size: 0.8rem;
  margin-top: 0.2rem;
}

button {
  padding: 0.5rem 1rem;
  background: #238636;
  color: #fff;
  border: 1px solid #2ea043;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
}

button:hover {
  background: #2ea043;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button.danger {
  background: #da3633;
  border-color: #f85149;
}

button.danger:hover {
  background: #f85149;
}

/* Status */
.status-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.status-running {
  background: #0d2818;
  color: #3fb950;
  border: 1px solid #238636;
}

.status-stopped {
  background: #2a1f0b;
  color: #d29922;
  border: 1px solid #9e6a03;
}

.status-unknown {
  background: #1c1c1c;
  color: #8b949e;
  border: 1px solid #30363d;
}

.status-msg {
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.status-msg.success {
  color: #3fb950;
}

.status-msg.error {
  color: #f85149;
}



@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  display: inline-block;
  width: 0.75em;
  height: 0.75em;
  border: 2px solid #8b949e;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 0.35em;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
}

th, td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #21262d;
  vertical-align: middle;
}

th {
  color: #8b949e;
  font-size: 0.75rem;
  text-transform: uppercase;
}

td, th { white-space: nowrap; }
td:first-child, th:first-child { white-space: normal; }

td code {
  background: #161b22;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
  word-break: break-all;
}

td.actions button {
  margin-right: 0.5rem;
  white-space: nowrap;
}

.inline-status {
  display: block;
  font-size: 0.8rem;
  margin-top: 0.35rem;
}

/* Detail card */
.detail-card {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 1.5rem;
}

.ssh-command {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 0.75rem 1rem;
}

.ssh-command code {
  flex: 1;
  font-size: 0.9rem;
}

/* Auth forms */
.auth-form {
  max-width: 400px;
  margin: 2rem auto;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 2rem;
}

.auth-form h1 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-form button[type=submit] {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.5rem;
}

.auth-link {
  text-align: center;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: #8b949e;
}

/* Help page */
.help-sidebar {
  position: fixed;
  top: 60px;
  left: max(0px, calc((100vw - 960px) / 2 - 180px));
  width: 160px;
  padding-top: 2rem;
}

.help-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-sidebar li {
  margin-bottom: 0.4rem;
}

.help-sidebar a {
  font-size: 0.8rem;
  color: #8b949e;
  text-decoration: none;
  display: block;
  padding: 0.15rem 0.5rem;
  border-left: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.help-sidebar a:hover,
.help-sidebar a.active {
  color: #e6edf3;
  border-left-color: #58a6ff;
}

@media (max-width: 1200px) {
  .help-sidebar {
    position: static;
    width: auto;
    padding-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #21262d;
    padding-bottom: 1rem;
  }

  .help-sidebar ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
  }

  .help-sidebar a {
    border-left: none;
    padding: 0.15rem 0;
  }
}

.help-section {
  margin-bottom: 2.5rem;
}

.help-section h3 {
  color: #e6edf3;
  font-size: 0.95rem;
  margin: 1.25rem 0 0.5rem;
}

.help-section p {
  margin-bottom: 0.75rem;
  color: #c9d1d9;
  font-size: 0.9rem;
}

.help-section pre {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.help-section code {
  font-size: 0.8rem;
  color: #e6edf3;
}

.help-section p code {
  background: #161b22;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  border: 1px solid #30363d;
}

.help-section ol,
.help-section ul {
  padding-left: 1.25rem;
  margin-bottom: 1rem;
  color: #c9d1d9;
  font-size: 0.9rem;
}

.help-steps li {
  margin-bottom: 1rem;
}

.help-table {
  margin-bottom: 1rem;
}

.help-table td {
  font-size: 0.85rem;
  padding: 0.4rem 0.75rem;
}

.help-table td:first-child {
  white-space: nowrap;
}

/* Landing page */
.landing {
  max-width: 700px;
  margin: 3rem auto 0;
  text-align: center;
}

.landing-logo {
  width: 300px;
  height: 300px;
  border-radius: 24px;
  margin-bottom: 1.5rem;
  max-width: 100%;
}

.landing-headline {
  font-size: 1.5rem;
  color: #e6edf3;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.landing-sub {
  color: #8b949e;
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

.landing-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  text-align: left;
  margin-bottom: 2rem;
}

.landing-feature {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 1.25rem;
}

.landing-feature h3 {
  font-size: 0.95rem;
  color: #e6edf3;
  margin-bottom: 0.4rem;
}

.landing-feature p {
  font-size: 0.85rem;
  color: #8b949e;
  line-height: 1.6;
  margin: 0;
}

.landing-cta {
  color: #8b949e;
  font-size: 0.9rem;
  margin-top: 1.5rem;
}

@media (max-width: 600px) {
  .landing-features {
    grid-template-columns: 1fr;
  }
}

dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
}

dt {
  color: #8b949e;
  font-size: 0.875rem;
}

dd {
  font-size: 0.875rem;
}

/* CLI command pill used inline in marketing copy ("Run `typhons …`").
 * Box + monospace carry the "command" reading. */
.cli-cmd {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: #0d1117;
  color: inherit;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 0.25em 0.6em;
  white-space: nowrap;
}
