@font-face {
  font-family: "Bricolage Grotesque";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("https://devlhub.com/fonts/bricolage-grotesque-800.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("https://devlhub.com/fonts/source-sans-3-400.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("https://devlhub.com/fonts/source-sans-3-600.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("https://devlhub.com/fonts/source-sans-3-700.woff2") format("woff2");
}

:root {
  --bg: #101114;
  --bg-2: #17181c;
  --card: #1a1b20;
  --line: #2a2c33;
  --text: #f2f3f5;
  --muted: #9a9ea8;
  --red: #e2231a;
  --red-hover: #c81e16;
  --accent-text: #ff6b63;
  --line-control: #6b6f7a;
  --surface-btn: #2a2c33;
  --surface-btn-hover: #34363e;
  --placeholder: #8a8e98;
  --focus: #ff8a84;
  --ok: #6ee7a1;
  --warn: #e6c65a;
  --header-h: 64px;
  --radius: 10px;
  --r-btn: 9px;
  --r-tag: 6px;
  --font-display: "Bricolage Grotesque", "Source Sans 3", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --surface-hover: #1f2127;
  --line-strong: #3a3d46;
  color-scheme: dark;
}

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

html, body {
  min-height: 100%;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: auto;
  width: 55vw;
  height: 55vw;
  max-width: 720px;
  max-height: 720px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  filter: blur(80px);
  opacity: 0.35;
}

body::before {
  top: -12%;
  left: -8%;
  background: rgba(226, 35, 26, 0.28);
}

body::after {
  bottom: -18%;
  right: -10%;
  background: rgba(226, 35, 26, 0.18);
}

.site {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 20, 0.86);
  backdrop-filter: blur(14px);
}

.header-inner,
.container,
.footer-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-cube {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  background: var(--red);
  box-shadow: 4px 4px 0 #8a140f;
  transform: rotate(12deg);
  flex: none;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.brand-name span {
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
  margin-left: 6px;
}

.account {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--surface-btn);
  flex: none;
}

.avatar-fallback {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.account-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.main {
  flex: 1;
  padding: 28px 0 48px;
}

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

.page-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.page-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  max-width: 42rem;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: var(--bg-2);
  margin-bottom: 20px;
}

.segmented button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 7px;
  cursor: pointer;
}

.segmented button[aria-selected="true"] {
  background: var(--card);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--line);
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-red {
  background: var(--red);
  color: #fff;
}

.btn-red:hover:not(:disabled) {
  background: var(--red-hover);
}

.btn-ghost {
  background: var(--surface-btn);
  border-color: var(--line-control);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-btn-hover);
}

.btn-danger {
  background: transparent;
  border-color: var(--line-control);
  color: var(--accent-text);
}

.btn-danger:hover:not(:disabled) {
  border-color: var(--red);
  background: rgba(226, 35, 26, 0.12);
}

.btn-sm {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.field input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r-btn);
  border: 1px solid var(--line-control);
  background: var(--bg-2);
  color: var(--text);
  font: inherit;
}

.field input:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.create-row {
  display: flex;
  gap: 10px;
  align-items: end;
  margin-bottom: 20px;
}

.create-row .field {
  flex: 1;
  min-width: 0;
}

.card-list {
  display: grid;
  gap: 10px;
}

.script-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.script-meta {
  min-width: 0;
}

.script-name {
  font-weight: 700;
  font-size: 15px;
}

.script-sub {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.script-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-tag);
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-btn);
  color: var(--muted);
}

.tag-ok {
  background: rgba(110, 231, 161, 0.12);
  color: var(--ok);
}

.tag-warn {
  background: rgba(230, 198, 90, 0.12);
  color: var(--warn);
}

.state {
  padding: 28px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
}

.state strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  margin-bottom: 6px;
}

.gate {
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.gate-card {
  width: min(420px, 100%);
  text-align: center;
}

.gate-card h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 10px;
}

.gate-card p {
  color: var(--muted);
  margin-bottom: 20px;
}

.soon {
  color: var(--muted);
  font-size: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 18px 0 28px;
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: space-between;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.toast-wrap {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: grid;
  gap: 8px;
}

.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: var(--r-btn);
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  font-size: 14px;
}

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

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

.code-area {
  width: 100%;
  min-height: 180px;
  padding: 12px;
  border-radius: var(--r-btn);
  border: 1px solid var(--line-control);
  background: var(--bg-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
}

.code-area:focus {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.key-form {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  align-items: end;
}

.notice {
  margin-top: 16px;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--bg-2);
}

.mono-block {
  display: block;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--r-btn);
  background: var(--bg);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 14px;
}

.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-family: var(--font-display); font-size: 28px; font-weight: 800; margin-top: 4px; }
.stat-value.ok { color: var(--ok); }
.stat-value.warn { color: var(--warn); }

.table-wrap { overflow-x: auto; }
.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.stats-table th,
.stats-table td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
}
.stats-table th { color: var(--muted); font-weight: 600; }

.docs-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.docs-grid code,
.soon code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  color: var(--accent-text);
}

@media (max-width: 720px) {
  .page-head {
    flex-direction: column;
  }
  .create-row {
    flex-direction: column;
    align-items: stretch;
  }
  .script-row {
    flex-direction: column;
    align-items: stretch;
  }
  .account-name {
    display: none;
  }
  .brand-name span {
    display: none;
  }
}
