/*
 * First paint, before the React and Tailwind bundles arrive. Self-contained,
 * no remote fonts, no JavaScript-generated geometry, and no layout interaction
 * with the live page underneath the veil.
 */
#telaio-startup {
  /* First paint mirrors the shared Telaio/Control semantic palette. The
     fallbacks apply before the application CSS and design tokens load. */
  --startup-bg: var(--background, #f4f0e8);
  --startup-surface: var(--card, #fffdf9);
  --startup-border: var(--border, #ddd2c4);
  --startup-fill: var(--muted, #ede6dc);
  --startup-ink: var(--foreground, #1f1b16);
  --startup-accent: var(--primary, #9f3d27);
  --startup-font-display: "Sora Variable", "Inter Variable", Inter, system-ui, sans-serif;
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: hidden;
  background: var(--startup-bg);
  color: var(--startup-ink);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  pointer-events: none;
  opacity: 1;
  transition: opacity 160ms ease-out;
}
html[data-telaio-theme="dark"] #telaio-startup {
  --startup-bg: var(--background, #1f1b16);
  --startup-surface: var(--card, #2b2620);
  --startup-border: var(--border, #50463a);
  --startup-fill: var(--muted, #39322b);
  --startup-ink: var(--foreground, #f4f0e8);
  --startup-accent: var(--primary, #d77c5c);
}
#telaio-startup.is-leaving { opacity: 0; }
#telaio-startup * { box-sizing: border-box; }
.startup-layout { min-height: 100dvh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.startup-sidebar {
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  gap: 36px;
  border-right: 1px solid var(--startup-border);
  background: var(--startup-surface);
  padding: 22px 19px;
}
.startup-brand {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--startup-ink);
  font-family: var(--startup-font-display);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1.2;
}
.startup-brand-symbol {
  display: block;
  width: 28px;
  height: 28px;
  flex: none;
}
.startup-brand-word { display: inline-block; }
.startup-side-group { display: flex; flex-direction: column; gap: 16px; }
.startup-side-item { display: flex; align-items: center; gap: 12px; min-height: 28px; }
.startup-icon { display: inline-block; width: 19px; height: 19px; flex: 0 0 auto; border-radius: 6px; background: var(--startup-fill); opacity: .7; }
.startup-icon-circle { width: 32px; height: 32px; border-radius: 50%; }
.startup-bar { display: block; height: 12px; max-width: 100%; border-radius: 7px; background: var(--startup-fill); opacity: .73; }
.startup-bar-tiny { height: 8px; width: 65px; opacity: .5; }
.startup-bar-nav { width: 106px; }
.startup-bar-nav-short { width: 80px; }
.startup-workspace { min-width: 0; }
.startup-topbar { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 32px; border-bottom: 1px solid var(--startup-border); background: var(--startup-surface); }
.startup-bar-switch { height: 18px; width: 150px; }
.startup-topbar-right { display: flex; align-items: center; gap: 20px; }
.startup-bar-search { width: 145px; height: 34px; }
.startup-main { box-sizing: border-box; width: 100%; max-width: 1440px; padding: 34px 40px 72px; margin: 0 auto; }
.startup-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--startup-border); padding-bottom: 20px; margin-bottom: 24px; }
.startup-heading-copy { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.startup-bar-eyebrow { width: 118px; height: 10px; }
.startup-bar-title { width: min(330px, 75%); height: 29px; border-radius: 8px; }
.startup-bar-subtitle { width: min(420px, 85%); height: 12px; }
.startup-bar-action { width: 120px; height: 39px; }
.startup-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.startup-pill { width: 116px; height: 32px; border-radius: 20px; }
.startup-pill-wide { width: 140px; height: 32px; border-radius: 20px; }
.startup-cards { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(270px, .8fr); gap: 24px; align-items: start; }
.startup-card { border: 1px solid var(--startup-border); border-radius: 13px; background: var(--startup-surface); padding: 20px; }
.startup-bar-section { width: 180px; height: 18px; margin-bottom: 12px; }
.startup-rows { display: grid; gap: 18px; margin-top: 28px; }
.startup-row { display: block; height: 48px; border-bottom: 1px solid var(--startup-border); position: relative; }
.startup-row::before, .startup-row::after { content: ""; position: absolute; top: 3px; width: 55%; height: 11px; border-radius: 6px; background: var(--startup-fill); opacity: .68; }
.startup-row::after { top: 22px; width: 34%; height: 9px; opacity: .43; }
.startup-mobile-nav { display: none; }
.startup-public { display: none; }
html[data-startup-public="true"] .startup-staff { display: none; }
html[data-startup-public="true"] .startup-public { display: grid; }
.startup-public { min-height: 100dvh; place-items: center; padding: 24px; }
.startup-auth-card { display: grid; gap: 18px; width: min(440px, 100%); border: 1px solid var(--startup-border); border-radius: 16px; background: var(--startup-surface); padding: 36px 28px; }
.startup-auth-card .startup-brand { margin-bottom: 12px; }
.startup-auth-input { width: 100%; height: 48px; border-radius: 8px; }
.startup-auth-action { width: 100%; height: 48px; background: var(--startup-accent); border-radius: 8px; opacity: .6; }
html[data-startup-page="assistant"] .startup-filters, html[data-startup-page="assistant"] .startup-heading { display: none; }
html[data-startup-page="assistant"] .startup-main { max-width: 840px; padding-top: 64px; }
html[data-startup-page="assistant"] .startup-cards { grid-template-columns: 1fr; }
html[data-startup-page="assistant"] .startup-card-primary { min-height: 58dvh; }
html[data-startup-page="assistant"] .startup-card-aside { display: none; }
@media (max-width: 1199px) {
  .startup-cards { grid-template-columns: 1fr; }
  .startup-card-aside { display: none; }
}
@media (max-width: 1023px) {
  .startup-layout { display: block; }
  .startup-sidebar { display: none; }
  .startup-main { padding: 24px 24px 86px; }
  .startup-topbar { padding: 0 24px; }
  .startup-mobile-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    display: flex; justify-content: space-evenly; align-items: center;
    border-top: 1px solid var(--startup-border);
    background: var(--startup-surface);
  }
}
@media (max-width: 639px) {
  .startup-main { padding: 18px 16px 90px; }
  .startup-topbar { padding: 0 16px; }
  .startup-bar-search { display: none; }
  .startup-heading { padding-bottom: 16px; margin-bottom: 17px; }
  .startup-bar-title { height: 27px; width: 190px; }
  .startup-bar-subtitle { width: 230px; }
  .startup-bar-action { width: 42px; height: 38px; }
  .startup-cards { gap: 12px; }
  .startup-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) { #telaio-startup { transition: none; } }

/* Match the information architecture of the destination before JS is ready. */
html[data-startup-page="projects"] .startup-cards,
html[data-startup-page="project"] .startup-cards,
html[data-startup-page="clients"] .startup-cards,
html[data-startup-page="usage"] .startup-cards {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
html[data-startup-page="clients"] .startup-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html[data-startup-page="usage"] .startup-cards,
html[data-startup-page="project"] .startup-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-startup-page="projects"] .startup-cards::before,
html[data-startup-page="projects"] .startup-cards::after,
html[data-startup-page="clients"] .startup-cards::before,
html[data-startup-page="project"] .startup-cards::before,
html[data-startup-page="project"] .startup-cards::after,
html[data-startup-page="usage"] .startup-cards::before,
html[data-startup-page="usage"] .startup-cards::after {
  content: "";
  min-height: 290px;
  border: 1px solid var(--startup-border);
  border-radius: 13px;
  background:
    linear-gradient(var(--startup-fill), var(--startup-fill)) 16px 20px / 60% 13px no-repeat,
    repeating-linear-gradient(to bottom, transparent 0, transparent 52px, var(--startup-border) 53px, var(--startup-border) 54px),
    var(--startup-surface);
}
html[data-startup-page="projects"] .startup-card,
html[data-startup-page="projects"] .startup-cards::before,
html[data-startup-page="projects"] .startup-cards::after { min-height: 450px; }
html[data-startup-page="clients"] .startup-card { min-height: 210px; }
html[data-startup-page="clients"] .startup-cards::before { min-height: 210px; }
html[data-startup-page="tasks"] .startup-cards { grid-template-columns: 1fr; }
html[data-startup-page="tasks"] .startup-card-primary { max-width: 100%; }
html[data-startup-page="tasks"] .startup-card-aside { display: none; }
html[data-startup-page="tasks"] .startup-card-primary .startup-rows { gap: 4px; }
html[data-startup-page="inbox"] .startup-cards {
  grid-template-columns: minmax(18rem, .78fr) minmax(0, 1.45fr);
  gap: 12px;
}
html[data-startup-page="inbox"] .startup-card-primary,
html[data-startup-page="inbox"] .startup-card-aside { min-height: 480px; }
@media (max-width: 1023px) {
  html[data-startup-page="projects"] .startup-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-startup-page="projects"] .startup-cards::after,
  html[data-startup-page="project"] .startup-cards::after,
  html[data-startup-page="usage"] .startup-cards::after { display: none; }
  html[data-startup-page="clients"] .startup-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-startup-page="clients"] .startup-cards::before { display: none; }
  html[data-startup-page="inbox"] .startup-cards { grid-template-columns: 1fr; }
  html[data-startup-page="inbox"] .startup-card-aside { display: none; }
}
@media (max-width: 639px) {
  html[data-startup-page="projects"] .startup-cards,
  html[data-startup-page="clients"] .startup-cards,
  html[data-startup-page="project"] .startup-cards,
  html[data-startup-page="usage"] .startup-cards { grid-template-columns: 1fr; }
  html[data-startup-page="projects"] .startup-cards::before,
  html[data-startup-page="project"] .startup-cards::before,
  html[data-startup-page="usage"] .startup-cards::before { display: none; }
}

@media (min-width: 1024px) and (max-width: 1279px) {
  html[data-startup-page="projects"] .startup-cards,
  html[data-startup-page="clients"] .startup-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html[data-startup-page="projects"] .startup-cards::after { display: none; }
}

/* Respect the persisted sidebar width even during the pre-JS first paint. */
@media (min-width: 1024px) {
  html[data-startup-collapsed="true"] .startup-layout {
    grid-template-columns: 80px minmax(0, 1fr);
  }
  html[data-startup-collapsed="true"] .startup-sidebar {
    align-items: center;
    padding-inline: 9px;
  }
  html[data-startup-collapsed="true"] .startup-sidebar .startup-bar,
  html[data-startup-collapsed="true"] .startup-sidebar .startup-side-item {
    display: none;
  }
  html[data-startup-collapsed="true"] .startup-brand-word { display: none; }
  html[data-startup-collapsed="true"] .startup-side-group {
    width: 19px;
    min-height: 54px;
    border-top: 1px solid var(--startup-border);
  }
}

/* The commesse page defaults to list, not board. Mirror the selected view
   even in the CSS-only first paint, before routing code is ready. */
html[data-startup-page="projects"][data-startup-view="list"] .startup-cards {
  display: block;
}
html[data-startup-page="projects"][data-startup-view="list"] .startup-card-primary {
  min-height: 445px;
}
html[data-startup-page="projects"][data-startup-view="list"] .startup-card-aside,
html[data-startup-page="projects"][data-startup-view="list"] .startup-cards::before,
html[data-startup-page="projects"][data-startup-view="list"] .startup-cards::after {
  display: none;
}
html[data-startup-page="projects"][data-startup-view="list"] .startup-row {
  height: 62px;
}
