:root {
  color-scheme: light;
  --bg: #f5f3ee;
  --panel: #ffffff;
  --ink: #1c2430;
  --muted: #667085;
  --line: #d8dde6;
  --brand: #126c67;
  --brand-strong: #0b4f4b;
  --accent: #c85c2e;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(28, 36, 48, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
.ghost-link {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

button:hover,
.ghost-link:hover {
  border-color: var(--brand);
}

button.primary {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

button.danger {
  color: var(--danger);
  border-color: rgba(180, 35, 24, 0.35);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  padding: 10px 12px;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(18, 108, 103, 0.12);
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(18px, 4vw, 56px) 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(34px, 6vw, 72px);
}

h2 {
  font-size: 18px;
}

.token-form {
  display: flex;
  align-items: end;
  gap: 10px;
  max-width: 460px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(220px, 300px) minmax(240px, 360px) minmax(360px, 1fr);
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 56px) 42px;
}

.panel,
.empty-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.create-panel {
  align-self: start;
}

.stack {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cards {
  display: grid;
  gap: 10px;
}

.project-card {
  width: 100%;
  min-height: 98px;
  justify-content: start;
  align-items: start;
  display: grid;
  gap: 6px;
  padding: 14px;
  text-align: left;
  background: #ffffff;
}

.project-card.active {
  border-color: var(--brand);
  box-shadow: inset 4px 0 0 var(--brand);
}

.card-title {
  color: var(--ink);
  font-weight: 800;
}

.card-slug,
.card-meta {
  color: var(--muted);
  font-size: 13px;
}

.detail-panel {
  min-width: 0;
}

.detail-form {
  display: grid;
  gap: 14px;
}

.grid {
  display: grid;
  gap: 12px;
}

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

.checkbox {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

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

.status-line {
  margin: 14px 0 10px;
  color: var(--muted);
  font-size: 13px;
  min-height: 18px;
}

.logs {
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  margin: 0;
  padding: 14px;
  border-radius: 8px;
  background: #111827;
  color: #d1fae5;
  font-size: 12px;
  line-height: 1.55;
}

.empty-state,
.empty-card {
  padding: 18px;
  color: var(--muted);
}

.hidden,
[hidden] {
  display: none !important;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .layout {
    grid-template-columns: minmax(220px, 320px) minmax(420px, 1fr);
  }

  .create-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .topbar,
  .token-form {
    align-items: stretch;
    flex-direction: column;
  }

  .layout,
  .grid.two {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 38px;
  }
}
