/* Same tokens as stephdl/ns8-apps and forge.de-labrusse.fr */
:root {
  color-scheme: dark;
  --bg: #0d1117;
  --bg-raised: #161b22;
  --bg-hover: #1c232d;
  --border: #2a313c;
  --text: #e6edf3;
  --text-dim: #9aa5b1;
  --text-faint: #6b7682;
  --accent: #4cc2ff;
  --accent-soft: rgba(76, 194, 255, 0.12);
  --danger: #ff7b72;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(13, 17, 23, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; gap: 10px; align-items: center; font-size: 17px; font-weight: 650; white-space: nowrap; }
.brand-mark { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); object-fit: cover; background: var(--bg-raised); }
.topbar-end { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-left: auto; }
.user { color: var(--text-dim); font-size: 14px; }

select, input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
input { width: 100%; min-height: 40px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-hover);
  color: var(--text);
  font: inherit; font-size: 14px; font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--text-faint); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #04121b; }
.btn.primary:hover { background: #7fd6ff; }
.btn:disabled { opacity: .6; cursor: wait; }

main { flex: 1; }
.hero { padding: 56px 0 32px; border-bottom: 1px solid var(--border); }
.hero h1 { margin: 10px 0 0; font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.hero p { margin: 12px 0 0; color: var(--text-dim); max-width: 60ch; }
.eyebrow { color: var(--text-faint); font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }

.panel { padding: 24px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: var(--radius); }

.login { display: flex; justify-content: center; padding: 40px 0; }
.login .panel { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--text-dim); }
.field input { background: var(--bg); }
.password { position: relative; }
.password input { padding-right: 48px; }
.reveal {
  position: absolute; top: 0; right: 0;
  width: 44px; height: 100%;
  display: grid; place-items: center;
  border: 0; border-radius: 0 8px 8px 0;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
}
.reveal:hover { color: var(--text); }
.reveal svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.reveal .eye-off, .reveal[aria-pressed="true"] .eye { display: none; }
.reveal[aria-pressed="true"] .eye-off { display: block; }
.error { margin: 0; color: var(--danger); font-size: 14px; }
.remember { display: flex; gap: 10px; align-items: center; min-height: 32px; font-size: 14px; color: var(--text-dim); cursor: pointer; }
.remember input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); cursor: pointer; }
.login .btn.primary { min-height: 44px; }

.apps { padding: 32px 0 44px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.toolbar input { width: 260px; max-width: 100%; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font: inherit; font-size: 13px;
  cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.group { margin-top: 24px; }
.group h2 { margin: 0 0 12px; color: var(--text-faint); font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card {
  display: flex; gap: 14px; align-items: center;
  padding: 18px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
}
.card:hover { border-color: #3a4350; text-decoration: none; background: var(--bg-hover); }
.logo {
  width: 48px; height: 48px; flex: none;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #f4f6f8;
  padding: 6px;
  color: #1c232d;
  font-weight: 700;
}
.logo img { max-width: 100%; max-height: 100%; }
.card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.card-name { font-weight: 650; }
.card-host { font: 13px var(--mono); color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { flex: none; padding: 1px 8px; border-radius: 999px; background: var(--bg-hover); border: 1px solid var(--border); color: var(--text-dim); font-size: 12px; }
.empty { color: var(--text-faint); padding: 24px 0; }

.support { padding-top: 32px; padding-bottom: 32px; border-top: 1px solid var(--border); }
.support-panel { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.support-panel > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.support-panel span { color: var(--text-dim); font-size: 14px; }
.support-links { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 14px; }

@media (max-width: 600px) {
  .hero { padding: 32px 0 24px; }
  .toolbar input { width: 100%; }
}
