/* TES Tool Portal – look of elixir-on.cloud (Inter, OKLCH palette, pill navigation, rounded cards) */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/inter-latin.woff2") format("woff2");
}

:root {
  --background: oklch(0.985 0.003 247);
  --foreground: oklch(0.21 0.03 265);
  --card: oklch(1 0 0);
  --primary: oklch(0.55 0.17 250);
  --primary-hover: oklch(0.49 0.17 250);
  --primary-foreground: oklch(0.99 0 0);
  --secondary: oklch(0.955 0.01 250);
  --muted: oklch(0.955 0.008 250);
  --muted-foreground: oklch(0.5 0.025 260);
  --border: oklch(0.9 0.012 250);
  --ring: oklch(0.62 0.15 250);
  --success: oklch(0.6 0.15 150);
  --warning: oklch(0.7 0.15 75);
  --destructive: oklch(0.577 0.245 27.325);
  --brand-orange: #ef7d00;
  --brand-teal: #24a9c4;
  --radius: 0.625rem;
  --header-bg: oklch(0.985 0.003 247 / 0.85);
  --hero-glow-1: oklch(0.85 0.09 240 / 0.55);
  --hero-glow-2: oklch(0.9 0.08 60 / 0.45);
  --shadow: 0 1px 2px oklch(0.21 0.03 265 / 0.05), 0 8px 24px -12px oklch(0.21 0.03 265 / 0.12);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.17 0.02 262);
    --foreground: oklch(0.96 0.005 250);
    --card: oklch(0.215 0.025 262);
    --primary: oklch(0.74 0.13 240);
    --primary-hover: oklch(0.8 0.12 240);
    --primary-foreground: oklch(0.17 0.02 262);
    --secondary: oklch(0.28 0.025 262);
    --muted: oklch(0.27 0.025 262);
    --muted-foreground: oklch(0.72 0.02 255);
    --border: oklch(0.32 0.025 262);
    --ring: oklch(0.6 0.12 245);
    --success: oklch(0.74 0.15 150);
    --warning: oklch(0.8 0.14 80);
    --destructive: oklch(0.704 0.191 22.216);
    --header-bg: oklch(0.17 0.02 262 / 0.85);
    --hero-glow-1: oklch(0.4 0.1 245 / 0.45);
    --hero-glow-2: oklch(0.4 0.08 60 / 0.25);
    --shadow: 0 1px 2px oklch(0 0 0 / 0.3), 0 8px 24px -12px oklch(0 0 0 / 0.5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font: 15px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 0.85em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--muted); padding: 0.1em 0.4em; border-radius: 0.35em; }
.wrap { max-width: 80rem; margin: 0 auto; padding-inline: 20px; }
.muted { color: var(--muted-foreground); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
img { max-width: 100%; }

/* logos: colour lock-up on light, mono (white) on dark */
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) { .logo-light { display: none; } .logo-dark { display: inline-block; } }

/* ---- header ------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0px);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--foreground); }
.brand:hover { text-decoration: none; }
.brand .logo-light { height: 48px; width: auto; }
.brand .logo-dark { height: 30px; width: auto; }
.brand-sub {
  font-weight: 600; font-size: 14px; letter-spacing: -0.01em; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border); color: var(--muted-foreground); white-space: nowrap;
}
.nav-links { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.pill {
  border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 500; color: var(--muted-foreground);
  transition: color .15s, background-color .15s; white-space: nowrap;
}
.pill:hover { color: var(--foreground); background: var(--muted); text-decoration: none; }
.ext { font-size: 11px; }
.user-chip { font-size: 13.5px; font-weight: 500; padding: 6px 12px; border-radius: 999px; background: var(--muted); margin-left: 6px; white-space: nowrap; }
.admin-tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); }

/* ---- buttons ------------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 14.5px; font-weight: 500; line-height: 1.2;
  padding: 10px 20px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--card); color: var(--foreground); cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--muted); text-decoration: none; }
.btn:focus-visible, .pill:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-ghost { background: transparent; }
.btn-sm { font-size: 13px; padding: 6px 13px; }
.btn-danger { color: var(--destructive); }

/* ---- hero --------------------------------------------------------------------------- */
.hero {
  position: relative; overflow: hidden; padding-block: 72px 56px; border-bottom: 1px solid var(--border);
  background:
    radial-gradient(60% 80% at 85% 10%, var(--hero-glow-1), transparent 70%),
    radial-gradient(45% 70% at 10% 100%, var(--hero-glow-2), transparent 70%);
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.6rem); line-height: 0.98; letter-spacing: -0.05em; font-weight: 600;
  margin: 14px 0 20px; max-width: 16ch;
}
.hero-lead { font-size: 17px; color: var(--muted-foreground); max-width: 62ch; margin: 0 0 24px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-login { padding-block: 96px 88px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-foreground);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px oklch(0.6 0.15 150 / 0.18); }
.facts { list-style: none; padding: 0; margin: 36px 0 0; display: flex; flex-wrap: wrap; gap: 8px 28px; color: var(--muted-foreground); font-size: 14px; }
.facts strong { color: var(--foreground); font-weight: 600; }

/* ---- sections & cards --------------------------------------------------------------- */
.section { padding-block: 56px 8px; }
.section-head { margin-bottom: 22px; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -0.035em; font-weight: 600; line-height: 1.1; margin: 6px 0 8px; }
.section-head p.muted { max-width: 70ch; margin: 0; }
.row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-foreground); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.6);
  padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.card:hover { border-color: oklch(0.62 0.15 250 / 0.5); transform: translateY(-1px); }
.card-top { display: flex; align-items: center; gap: 12px; }
.card h3 { font-size: 18px; letter-spacing: -0.02em; margin: 0; font-weight: 600; }
.card p { margin: 0; color: var(--muted-foreground); }
.card .meta { margin-top: auto; padding-top: 4px; }
.card .btn { align-self: flex-start; margin-top: 6px; }
.tool-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  font-weight: 700; font-size: 18px; color: #fff; background: var(--primary);
}
.tool-rstudio-tesk { background: #4b8bbe; }
.tool-jupyter-tesk { background: var(--brand-orange); }
.error { color: var(--destructive); font-weight: 600; }

/* ---- TES picker ----------------------------------------------------------------- */
.picker-title { font-size: 14px; font-weight: 600; margin: 8px 0 12px; color: var(--muted-foreground); }
.tes-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; margin-bottom: 28px; }
.tes-option {
  display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.6);
  transition: border-color .15s, box-shadow .15s;
}
.tes-option:hover { border-color: oklch(0.62 0.15 250 / 0.5); }
.tes-option:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px oklch(0.62 0.15 250 / 0.18); }
.tes-option.disabled { cursor: not-allowed; opacity: .65; }
.tes-option input { margin-top: 4px; accent-color: var(--primary); }
.tes-body { display: grid; gap: 4px; min-width: 0; }
.tes-name { font-weight: 600; }
.tes-desc { color: var(--muted-foreground); font-size: 14px; }
.tes-url code { font-size: 12px; }
.tes-status { font-size: 12.5px; color: var(--muted-foreground); display: inline-flex; gap: 6px; align-items: center; }
.tes-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--border); flex: none; }
.tes-status.ok { color: var(--success); }
.tes-status.ok::before { background: var(--success); }
.tes-status.bad { color: var(--destructive); }
.tes-status.bad::before { background: var(--destructive); }
.tag-login { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--primary); border: 1px solid currentColor; border-radius: 999px; padding: 0 7px; margin-left: 4px; vertical-align: 1px; }

/* ---- sessions table ---------------------------------------------------------------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.6); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); font-weight: 600; background: var(--muted); }
tr:last-child td { border-bottom: none; }
.actions { white-space: nowrap; text-align: right; }
.actions > * { margin-left: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; background: var(--muted); white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.running { color: var(--success); }
.badge.starting, .badge.stopping { color: var(--warning); }
.badge.failed { color: var(--destructive); }
.badge.stopped { color: var(--muted-foreground); }

dialog { width: min(900px, 94vw); border: 1px solid var(--border); border-radius: calc(var(--radius) * 1.6); background: var(--card); color: var(--foreground); padding: 0; box-shadow: var(--shadow); }
dialog::backdrop { background: oklch(0.21 0.03 265 / 0.45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); }
dialog pre { margin: 0; padding: 16px; max-height: 70vh; overflow: auto; font-size: 12px; white-space: pre-wrap; }

.center { text-align: center; padding-block: 72px; }
.center .hero-lead { margin-inline: auto; }
.spinner { width: 38px; height: 38px; margin: 24px auto; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- footer ------------------------------------------------------------------------- */
.site-footer { margin-top: 80px; border-top: 1px solid var(--border); background: var(--card); padding-bottom: env(safe-area-inset-bottom, 0px); }
.footer-grid { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 32px; padding-block: 48px 32px; }
.footer-about p { color: var(--muted-foreground); max-width: 42ch; font-size: 14px; }
.footer-about .logo-light { height: 56px; width: auto; }
.footer-about .logo-dark { height: 29px; width: auto; margin-block: 10px; }
.site-footer h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-foreground); margin: 6px 0 12px; font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14px; }
.site-footer li { color: var(--muted-foreground); }
.site-footer ul a { color: var(--foreground); }
.site-footer ul a:hover { color: var(--primary); }
.footer-bottom { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 18px 28px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted-foreground); }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .brand .logo-light { height: 34px; }
  .pill { padding: 6px 10px; font-size: 13.5px; }
  .nav-links { width: 100%; overflow-x: auto; flex-wrap: nowrap; margin-inline: -8px; }
  .hero { padding-block: 48px 40px; }
  .footer-grid { grid-template-columns: 1fr; }
  th:nth-child(4), td:nth-child(4) { display: none; }
}

/* official Life Science Login button (image, not scaled up; min. width 200 / 100 px) */
.ls-login { display: inline-flex; align-items: center; border-radius: 10px; line-height: 0;
  transition: transform .15s ease, box-shadow .15s ease; }
.ls-login img { display: block; height: auto; }
.ls-login:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgb(0 0 0 / .12); }
.ls-login:focus-visible { outline: 2px solid #1fb6e8; outline-offset: 3px; }
.ls-login-sm { border-radius: 6px; }
.login-help { margin-top: 18px; font-size: 13px; color: var(--muted-foreground); }
.login-help a { color: inherit; text-decoration: underline; }
