:root {
  color-scheme: dark;
  --bg: #111318; --panel: #191c23; --panel2: #1f232c; --border: #303541;
  --text: #f4f6fb; --muted: #b9c0cc; --accent: #c5f36a; --danger: #ff6b6b;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); min-height: 100vh;
  display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { color: var(--accent); font-size: .9em; }

.topbar { display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 22px;
  letter-spacing: -.04em; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: block; }
.org-logo { display: inline-flex; align-items: center; }
.org-logo img { height: 36px; max-width: 200px; width: auto; object-fit: contain; display: block; }
.branding-row { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.branding-preview { flex: 0 0 200px; min-height: 72px; display: flex; align-items: center; justify-content: center;
  background: var(--panel2); border: 1px dashed var(--border); border-radius: 12px; padding: 12px; }
.branding-preview img { max-height: 72px; max-width: 100%; object-fit: contain; }
.branding-form { flex: 1 1 280px; }
.status-admin { background: #1a2436; color: #a9d8ff; }
.card h3.mt { margin-top: 26px; }
.nav { display: flex; align-items: center; gap: 18px; }
.nav .who { color: var(--muted); font-size: 14px; }
.nav .slug { color: var(--accent); }
.link { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; }
.link:hover { color: var(--text); }

.wrap { width: min(1040px, calc(100% - 48px)); margin: 28px auto; flex: 1; }
.foot { border-top: 1px solid var(--border); padding: 18px 28px; color: var(--muted);
  font-size: 12px; line-height: 1.5; }

.flash { width: min(1040px, calc(100% - 48px)); margin: 16px auto -6px; padding: 12px 16px;
  border-radius: 12px; font-size: 14px; }
.flash-success { background: #1c2a17; border: 1px solid #3c5a2a; color: #d4f5b6; }
.flash-error { background: #2a1717; border: 1px solid #5a2a2a; color: #ffc9c9; }
.flash-info { background: var(--panel2); border: 1px solid var(--border); }

.hero { text-align: center; padding: 8vh 0; }
.hero h1 { display: flex; align-items: center; justify-content: center; gap: .16em;
  font-size: clamp(46px, 9vw, 82px); letter-spacing: -.06em; margin: 0 0 8px; }
.hero-mark { width: 1.05em; height: 1.05em; display: block; }
.tagline { font-size: clamp(18px, 3vw, 24px); font-weight: 600; letter-spacing: -.02em; margin: 0 0 20px; }
.lede { color: var(--muted); font-size: 18px; max-width: 520px; margin: 0 auto 28px; line-height: 1.6; }

.card { background: var(--panel); border: 1px solid var(--border); border-radius: 18px;
  padding: 22px; margin-bottom: 18px; }
.card h3 { margin-top: 0; }
.dev-card { max-width: 460px; margin: 0 auto; text-align: left; }
.badge { display: inline-block; background: #3a2a12; color: #ffcf8f; border-radius: 8px;
  padding: 2px 10px; font-size: 12px; font-weight: 700; }
.center { text-align: center; max-width: 520px; margin: 6vh auto; }

.btn { display: inline-block; background: var(--panel2); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px; padding: 8px 14px; cursor: pointer;
  font: inherit; font-size: 14px; }
.btn:hover { border-color: #4a5162; text-decoration: none; }
.btn.primary { background: var(--accent); color: #10130a; border-color: var(--accent); font-weight: 700; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.big { font-size: 16px; padding: 12px 22px; }
.btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.inline { display: inline; }

.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600;
  letter-spacing: .01em; color: var(--muted); }
.stack input[type=text], .stack input[type=email], .stack input[type=password],
.stack input[type=number], .stack input[type=url], .stack select, .stack textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; font: inherit; font-size: 15px; color: var(--text); transition: border-color .12s, box-shadow .12s; }
.stack input:focus, .stack select:focus, .stack textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(197, 243, 106, .18); }
.stack input::placeholder { color: #6b7280; }
/* The submit button reads as the primary action: full width, comfortable hit area. */
.stack > .btn.primary { width: 100%; padding: 12px; font-size: 15px; margin-top: 4px; }
.check { flex-direction: row !important; align-items: center; gap: 8px !important;
  font-weight: 500 !important; }

/* Auth screens (login / reset / forgot / request): a tidy centered card instead
   of a full-width strip, with left-aligned form fields. */
.hero .card { max-width: 420px; margin-left: auto; margin-right: auto; text-align: left; padding: 26px; }
.hero .or-sep { max-width: 420px; margin: 6px auto; }
.hero .muted { max-width: 420px; margin-left: auto; margin-right: auto; }

.cols { display: grid; grid-template-columns: 1fr 340px; gap: 24px; }
@media (max-width: 820px) { .cols { grid-template-columns: 1fr; } }
.projects { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.project { background: var(--panel); border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; }
.project-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.route { color: var(--muted); }
.pill { background: var(--panel2); border: 1px solid var(--border); border-radius: 20px;
  padding: 2px 10px; font-size: 12px; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.team { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.muted { color: var(--muted); }

.grid { width: 100%; border-collapse: collapse; margin-bottom: 26px; font-size: 14px; }
.grid th, .grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.grid th { color: var(--muted); font-weight: 600; }
.status { border-radius: 8px; padding: 2px 8px; font-size: 12px; }
.status-active { background: #1c2a17; color: #d4f5b6; }
.status-disabled { background: #2a1717; color: #ffc9c9; }
.status-denied { background: #2a1717; color: #ffc9c9; }

/* File manager */
.crumbs { margin: 8px 0 18px; color: var(--muted); font-size: 14px; }
.crumbs a { color: var(--accent); }
.filemgr { display: flex; flex-direction: column; gap: 16px; }
.dropzone { border: 2px dashed var(--border); border-radius: 16px; padding: 28px;
  text-align: center; background: var(--panel); transition: border-color .15s, background .15s; }
.dropzone.dragging { border-color: var(--accent); background: #1b1f27; }
.dropzone code { color: var(--accent); }
.dropzone label.btn { cursor: pointer; }
.inline-form { display: flex; gap: 8px; align-items: center; }
.inline-form input[type=text] { background: var(--bg); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; color: var(--text); font: inherit; }
.grid.files td { vertical-align: middle; }
.grid.files td:first-child { font-size: 15px; }
.filetitle { word-break: break-all; }
.filecontent { background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 18px; overflow-x: auto; white-space: pre; font-family: ui-monospace, SFMono-Regular,
  Menlo, Consolas, monospace; font-size: 13px; line-height: 1.5; color: #e6e9f0; }
.fileedit { width: 100%; box-sizing: border-box; background: var(--panel);
  border: 1px solid var(--border); border-radius: 12px; padding: 18px; color: #e6e9f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  line-height: 1.5; white-space: pre; overflow-wrap: normal; resize: vertical; tab-size: 4; }

/* Sharing controls */
.sharing { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.vis-badge { font-size: 12px; padding: 2px 10px; border-radius: 20px; border: 1px solid var(--border); }
.vis-public { color: #ffcf8f; border-color: #5a4a2a; }
.vis-private { color: var(--muted); }
.btn.small { font-size: 12px; padding: 5px 10px; }
.share-url { flex: 1; min-width: 200px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; color: var(--accent); font-family: ui-monospace, monospace;
  font-size: 12px; }
.vis-team { color: #9ec5ff; border-color: #2a4a5a; }
.vis-set { display: inline-flex; gap: 4px; }
.btn.small.current { background: var(--accent); color: #10130a; border-color: var(--accent);
  cursor: default; font-weight: 700; }
.transfer-form input[type=email] { background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px; color: var(--text); font: inherit; font-size: 12px; width: 170px; }

/* Project card ... overflow menu */
.actions .menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-toggle { padding: 8px 12px; font-weight: 700; letter-spacing: 1px; line-height: 1; }
.menu[open] > summary.menu-toggle { border-color: #4a5162; }
.menu-items { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px; min-width: 230px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 14px 44px #000a; }
.menu-item { margin: 0; }
.menu-btn { width: 100%; text-align: left; }
.menu-item.transfer-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 4px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.menu-item.transfer-form input[type=email] { width: 100%; }

/* Integrations sidebar */
.integration { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.int-name { font-weight: 600; }
.int-status { font-size: 12px; color: var(--muted); }
.int-status.connected { color: #d4f5b6; }
.int-hint { font-size: 12px; margin: 6px 0 14px; }
.int-hint code { font-size: 11px; }
