:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #16181d;
  --muted: #5c6472;
  --line: #e2e5ea;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --danger: #b42318;
  --ok: #067647;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141a;
    --card: #1a1d25;
    --text: #eef1f6;
    --muted: #9aa3b2;
    --line: #2a2f3a;
    --accent: #4d8dff;
    --danger: #ff6b5e;
    --ok: #4ade80;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
}

/* Brand mark: BIULD in front, "Technology & Ventures" underneath, product name alongside. */
.mark { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand { display: flex; flex-direction: column; line-height: 1.05; }
.brand strong { font-size: 20px; font-weight: 800; letter-spacing: 0.06em; }
.brand small {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.product-chip {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 8px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 13px;
}
.footer a { color: var(--muted); }

.session { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

main { max-width: 900px; margin: 0 auto; padding: 16px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

h1 { font-size: 20px; margin: 0 0 12px; }
h2 { font-size: 17px; margin: 0 0 8px; }

label { display: block; margin-bottom: 10px; font-weight: 500; }
label.inline { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }

input, select, textarea {
  width: 100%;
  margin-top: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

label.inline input[type="checkbox"] { width: auto; margin: 0; }

button {
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}

button[disabled] { opacity: 0.55; cursor: progress; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.tab.active { background: var(--accent); color: var(--accent-text); border-color: transparent; }

.muted { color: var(--muted); }
.error { color: var(--danger); }
.ok { color: var(--ok); }

.list { list-style: none; padding: 0; margin: 10px 0 0; }
.list li {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
}
.list li .meta { color: var(--muted); font-size: 13px; }
.list li .actions { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }

.grid { width: 100%; border-collapse: collapse; }
.grid th, .grid td { text-align: left; padding: 6px 6px 6px 0; font-size: 14px; }
.grid th { color: var(--muted); font-weight: 500; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--line);
}

progress { width: 100%; margin-top: 8px; }

.toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  max-width: 420px;
  margin: 0 auto;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgb(0 0 0 / 18%);
}

[hidden] { display: none !important; }
