/*
 * Asio client portal (asio-portal#12). Same identity as asioservices.com (website repo,
 * src/layouts/BaseLayout.astro): a deep navy deck lit by a brand-blue glow, cyan as the signal
 * colour, Geist for display, Inter for text. Fonts come from Google Fonts, like the site
 * (allowed by the CSP in src/lib/portalStatic.ts); the system stack takes over if they fail.
 *
 * Hierarchy by radius: panel 22px, card 16px, icon tile 14px, controls 10px, pills round.
 * One elevated surface per screen (the "Vos apps" panel, or the app page panel); everything else
 * sits on borders.
 */
:root {
  --deck: #04182a;
  --deck-2: #062641;
  --deck-line: rgba(194, 208, 240, 0.16);
  --on-deck: #ffffff;
  --on-deck-2: #b8c9ea;
  --glow: #3966cf;
  --ground: #eef3fb;
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --ink: #062641;
  --ink-2: #2f4a5f;
  --ink-3: #66778a;
  --line: #dde5f0;
  --line-strong: #c2d0f0;
  --blue: #3966cf;
  --blue-deep: #284893;
  --blue-soft: #e8eefb;
  --on-blue: #ffffff;
  --cyan: #2ddae5;
  --cyan-ink: #0e7c86;
  --tile: #ffffff;
  --tile-ring: #dde5f0;
  --ok: #17663a;
  --ok-soft: #e1f3e8;
  --warn: #8a4f00;
  --warn-soft: #fcefd9;
  --err: #b42318;
  --err-soft: #fdecea;
  --free: #0e6b72;
  --free-soft: #dcf6f8;
  --muted-soft: #edf1f6;
  --lift: 0 1px 2px rgba(6, 38, 65, 0.06), 0 24px 48px -24px rgba(6, 38, 65, 0.28);
  /* Design tokens (#27): every radius, type size and spacing of the page comes from here. */
  --r-panel: 22px;
  --r-card: 16px;
  --r-control: 10px;
  --r-pill: 999px;
  --tile-radius: 27%;
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --fs-xs: 0.78rem;
  --fs-sm: 0.86rem;
  --fs-md: 0.94rem;
  --fs-lg: 1.06rem;
  --fs-xl: 1.35rem;
  --display: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --text: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}
:root:not([data-theme="light"]) { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --deck: #020d16;
    --deck-2: #04182a;
    --ground: #031016;
    --surface: #071b26;
    --surface-2: #0a2230;
    --ink: #eaf0fb;
    --ink-2: #c2d0f0;
    --ink-3: #8ea6b4;
    --line: #14303e;
    --line-strong: #23476b;
    --blue: #7395e0;
    --blue-deep: #a4b9e9;
    --blue-soft: #0f2340;
    --on-blue: #031016;
    --cyan-ink: #6ee7ef;
    --tile: #eef4fb;
    --tile-ring: transparent;
    --ok: #7fd9a3;
    --ok-soft: #0e2b1d;
    --warn: #f0b862;
    --warn-soft: #2e2110;
    --err: #ff9a8f;
    --err-soft: #2e1412;
    --free: #72e6ee;
    --free-soft: #0b2a2e;
    --muted-soft: #0d2633;
    --lift: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 48px -24px rgba(0, 0, 0, 0.7);
  }
}
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
/* The hidden attribute must win over the display rules below (buttons are inline-flex). */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ground);
  color: var(--ink);
  font: 15.5px/1.6 var(--text);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'cv11', 'ss01';
}
h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
p { margin: var(--s-2) 0; }
a { color: var(--blue); text-underline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.wrap, .top-inner, .hero-inner, main, .foot-inner {
  width: 100%; max-width: 1080px; margin: 0 auto; padding-left: var(--s-5); padding-right: var(--s-5);
}

/* ------------------------------------------------------------ the deck: header and hero */

/* One dark band holds the header and the hero, lit from the upper right like the site. */
.deck {
  position: relative; color: var(--on-deck); overflow: hidden; isolation: isolate;
  background:
    radial-gradient(70% 140% at 78% -20%, rgba(76, 122, 230, 0.95), rgba(57, 102, 207, 0.35) 45%, transparent 72%),
    radial-gradient(45% 90% at 0% 110%, rgba(45, 218, 229, 0.16), transparent 70%),
    linear-gradient(180deg, var(--deck) 0%, var(--deck-2) 100%);
}
/* A faint grid, the texture of the site's hero panel. */
.deck::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.5;
  background-image:
    linear-gradient(var(--deck-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--deck-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(70% 90% at 80% 0%, #000 0%, transparent 75%);
  -webkit-mask-image: radial-gradient(70% 90% at 80% 0%, #000 0%, transparent 75%);
}
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); min-height: 72px; }
.brand { display: flex; flex: none; align-items: center; gap: var(--s-3); color: inherit; text-decoration: none; }
.logo { display: block; height: 38px; width: auto; flex: none; }
.brand-tag {
  font-size: var(--fs-sm); font-weight: 500; color: var(--on-deck-2);
  border-left: 1px solid rgba(255, 255, 255, 0.22); padding-left: var(--s-3);
}
.nav { display: flex; gap: var(--s-1); flex: none; }
.nav[hidden] { display: none; }
.nav a {
  color: var(--on-deck-2); text-decoration: none; font-weight: 500; font-size: var(--fs-md);
  padding: var(--s-2) var(--s-3); border-radius: var(--r-pill); transition: background 0.15s, color 0.15s;
}
.nav a:hover { color: var(--on-deck); }
.nav a[aria-current="page"] { color: var(--on-deck); background: rgba(255, 255, 255, 0.1); }
/* FR | EN (#27): the current language pressed, the other one a click away. */
.lang { display: inline-flex; flex: none; border: 1px solid var(--deck-line); border-radius: var(--r-pill); padding: 1px; }
.lang button {
  background: transparent; border: 0; color: var(--on-deck-2); font-size: var(--fs-xs); font-weight: 600;
  padding: var(--s-1) var(--s-2); border-radius: var(--r-pill); min-height: 0; box-shadow: none; letter-spacing: 0.04em;
}
.lang button:hover { background: rgba(255, 255, 255, 0.08); box-shadow: none; }
.lang button[aria-pressed="true"] { background: var(--on-deck); color: var(--deck-2); }
.who { display: flex; flex: 1 1 auto; justify-content: flex-end; align-items: center; gap: var(--s-3); min-width: 0; color: var(--on-deck-2); font-size: var(--fs-sm); }
.who button { flex: none; white-space: nowrap; }
.who-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30ch; }
.who-name:empty { display: none; }

.hero-inner { padding-top: 40px; padding-bottom: 112px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-4); padding: var(--s-1) var(--s-3) var(--s-1) var(--s-2);
  border: 1px solid rgba(45, 218, 229, 0.35); border-radius: var(--r-pill); background: rgba(4, 24, 42, 0.45);
  color: #bdf3f7; font-size: var(--fs-xs); font-weight: 500;
}
.eyebrow::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 3.6rem); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02;
  background: linear-gradient(180deg, #ffffff 30%, #c7f6f9 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lead { color: var(--on-deck-2); font-size: var(--fs-lg); max-width: 52ch; margin-top: var(--s-3); }

/* ------------------------------------------------------------ layout, panels, cards */

main { flex: 1; margin-top: -72px; padding-bottom: 72px; position: relative; }
#signed-in > * + * { margin-top: var(--s-5); }

.panel, .card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
}
.panel { box-shadow: var(--lift); padding: var(--s-5); }
.card { padding: var(--s-5) var(--s-5); border-radius: var(--r-card); }
.card h2 { font-size: var(--fs-lg); display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-1); }
.card-center { max-width: 560px; margin: 0 auto; text-align: center; padding: 40px var(--s-6); box-shadow: var(--lift); border-radius: var(--r-panel); }
.card-center h2 { justify-content: center; font-size: var(--fs-xl); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-4); }
.panel-head h2 { font-size: var(--fs-xl); }
.hint, .offer { color: var(--ink-3); font-size: var(--fs-sm); }

/* ------------------------------------------------------------ icon tiles */

/* One icon family on one tile (#27): an app's mark always sits on a light tile, on light and dark
   grounds alike. The radius is a share of the size, so every tile has the same shape. */
.tile {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--tile-radius);
  background: var(--tile); box-shadow: inset 0 0 0 1px var(--tile-ring);
}
.tile img { display: block; width: 76%; height: 76%; }
.tile-sm { width: 44px; height: 44px; }
.tile-lg { width: 84px; height: 84px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4), 0 18px 40px -18px rgba(45, 218, 229, 0.55); }

/* ------------------------------------------------------------ one title block for every app */

/* Eyebrow (the product family, or Asio) over the name: the same on cards, rows and app pages. */
.app-title { display: flex; flex-direction: column; min-width: 0; }
.app-eyebrow { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 500; line-height: 1.3; }
.app-name {
  font-family: var(--display); font-weight: 700; font-size: var(--fs-lg); letter-spacing: -0.02em; line-height: 1.25;
  color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-name:focus-visible { outline: none; }

/* ------------------------------------------------------------ "Vos apps": one card skeleton */

/* Tile and title on top, then status chip and "Ouvrir" on one baseline. Cards in a row share a
   height: the foot is pushed to the bottom. */
.my-apps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s-3); }
.my-app {
  position: relative; display: flex; flex-direction: column; gap: var(--s-4);
  padding: var(--s-4); border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.my-app:hover { border-color: var(--line-strong); background: var(--surface-2); }
.app-head { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
/* The whole card is the link to the app page: the name's ::after covers it. */
.my-app .app-name::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-card); }
.my-app:has(.app-name:focus-visible) { outline: 3px solid var(--cyan); outline-offset: 2px; }
.my-app-foot {
  margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  padding-top: var(--s-3); border-top: 1px solid var(--line);
}
.my-app-go { color: var(--blue); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.my-app:hover .my-app-go { color: var(--blue-deep); }

/* Nothing yet: the catalog's own marks, stacked, point down to where the apps are. */
.my-apps-empty {
  display: flex; align-items: center; gap: var(--s-4); margin: 0; padding: var(--s-5);
  border: 1px dashed var(--line-strong); border-radius: var(--r-card); background: var(--surface-2); color: var(--ink-2);
}
.stack { display: flex; flex: none; }
.stack .tile { width: 44px; height: 44px; box-shadow: 0 0 0 3px var(--surface-2), inset 0 0 0 1px var(--tile-ring); }
.stack .tile + .tile { margin-left: calc(-1 * var(--s-3)); }
.my-apps-empty p { margin: 0; }

/* ------------------------------------------------------------ catalog: one row component */

/* What can be added: one quiet card under the installed apps, one row per app. "Gratuite" at the
   end of a free app's row; the price is on the app's page. */
.catalog { padding-top: var(--s-4); }
.catalog > h2 { font-size: var(--fs-lg); color: var(--ink-2); margin: 0 0 var(--s-3); }
.catalog-list {
  list-style: none; margin: 0; padding: var(--s-2); display: flex; flex-direction: column; gap: var(--s-1);
  border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface-2);
}
.catalog-item {
  position: relative; display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3);
  border-radius: var(--r-card); transition: background 0.15s;
}
.catalog-item:hover { background: var(--surface); }
.catalog-text { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; flex: 1; }
.catalog-item .app-name { font-size: var(--fs-md); }
.catalog-item .app-name::after { content: ""; position: absolute; inset: 0; border-radius: var(--r-card); }
.catalog-item:has(.app-name:focus-visible) { outline: 3px solid var(--cyan); outline-offset: 1px; }
.catalog-brief {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  color: var(--ink-3); font-size: var(--fs-sm); line-height: 1.45;
}
.catalog-tag { flex: none; color: var(--ink-2); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.catalog-tag.is-free { color: var(--free); }

/* ------------------------------------------------------------ app page */

/* The app's header moves into the deck: big mark, name, status. */
.fiche-hero { display: flex; align-items: center; gap: var(--s-5); }
.fiche-hero-text { min-width: 0; }
.fiche-family { display: block; color: var(--on-deck-2); font-size: var(--fs-md); font-weight: 500; margin-bottom: var(--s-1); }
.fiche-name { font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 800; letter-spacing: -0.04em; color: #ffffff; line-height: 1.04; }
.fiche-brief { color: var(--on-deck-2); font-size: var(--fs-lg); max-width: 60ch; margin: var(--s-4) 0 0; }
.fiche-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-4); }
.pill-link {
  display: inline-flex; align-items: center; gap: var(--s-1); padding: var(--s-1) var(--s-3); border-radius: var(--r-pill);
  border: 1px solid rgba(194, 208, 240, 0.3); color: #ffffff; text-decoration: none; font-size: var(--fs-sm); font-weight: 500;
  background: rgba(4, 24, 42, 0.35); transition: border-color 0.15s, background 0.15s;
}
.pill-link:hover { border-color: var(--cyan); background: rgba(45, 218, 229, 0.08); }
.back {
  display: inline-flex; align-items: center; gap: var(--s-1); margin: 0 0 var(--s-5); color: var(--on-deck-2);
  text-decoration: none; font-size: var(--fs-md); font-weight: 500;
}
.back:hover { color: #ffffff; }
.back::before { content: ""; width: 7px; height: 7px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
.deck .badge { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08); }

/* One flow for every app (approved mockup): a numbered list of the steps this app has. */
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.flow[hidden] { display: none; }
.step[hidden] { display: none; }
.step > p, .setup-body > p { margin: 0 0 var(--s-2); color: var(--ink-2); line-height: 1.55; }
.step-num {
  display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: var(--r-control);
  background: var(--blue-soft); color: var(--blue); font-family: var(--display); font-weight: 700; font-size: var(--fs-md); line-height: 1;
}
.step-num[hidden] { display: none; }
/* Step 2: one card per environment, its type, what it costs there, and its install state. */
.env-list { list-style: none; margin: var(--s-3) 0 var(--s-2); padding: 0; display: grid; gap: var(--s-2); }
.env-list[hidden] { display: none; }
.env-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s-3) var(--s-3); background: var(--surface-2);
}
.env-main { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.env-name { font-weight: 700; overflow-wrap: anywhere; }
.env-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); }
.env-note { color: var(--ink-3); font-size: var(--fs-sm); }
.env-action { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; justify-content: flex-end; flex: none; max-width: 60%; }
.env-action .app-note { flex: 1 1 100%; text-align: right; }
.badge-prod { background: var(--blue-soft); color: var(--blue-deep); }
/* Step 3: the price in one sentence, then the companies. */
.price-line { margin: 0 0 var(--s-3); color: var(--ink-2); line-height: 1.55; }
.price-line strong { color: var(--ink); }
#step-activate > .hint { margin: var(--s-3) 0 0; }
.fiche-companies .app-note { margin: 0 0 var(--s-2); }
/* A plan button (#27, fix 2): the plan's name, its amount on a second, quieter line. */
button.plan {
  flex-direction: column; align-items: flex-start; gap: 0; min-width: 8.5em;
  border-radius: var(--r-control); padding: var(--s-2) var(--s-3); line-height: 1.2; font-size: var(--fs-sm);
}
.plan-amount { font-size: var(--fs-xs); font-weight: 500; opacity: 0.82; white-space: nowrap; }
.company-list { display: flex; flex-direction: column; gap: var(--s-2); margin: 0; padding: 0; list-style: none; }
.company-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s-3) var(--s-3); background: var(--surface-2);
}
.company-main { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.company-name { font-weight: 700; overflow-wrap: anywhere; }
.company-main .sub { color: var(--ink-3); font-size: var(--fs-xs); }
.company-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center; justify-content: flex-end; }
/* Companies grouped by Business Central environment (#57): a header button opens or closes each group. */
.company-groups { display: flex; flex-direction: column; gap: var(--s-3); }
.env-group { display: flex; flex-direction: column; gap: var(--s-2); }
button.env-group-toggle {
  display: flex; align-items: center; gap: var(--s-2); width: 100%; margin: 0; padding: var(--s-2) var(--s-1);
  background: none; border: 0; border-bottom: 1px solid var(--line); color: var(--ink); cursor: pointer;
  font: inherit; font-weight: 700; text-align: left;
}
button.env-group-toggle:hover { color: var(--blue); }
.env-group-name { overflow-wrap: anywhere; }
.env-group-count { color: var(--ink-3); font-size: var(--fs-xs); font-weight: 500; }
.env-group-chevron {
  margin-left: auto; width: 0.5em; height: 0.5em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform 0.15s ease;
}
button.env-group-toggle[aria-expanded="false"] .env-group-chevron { transform: rotate(-45deg); }
.company-list[hidden] { display: none; }
/* Billing (approved mockup): one card per company, its button, a table of its paid apps. */
#billing-page[hidden] { display: none; }
.bill-company { display: grid; gap: var(--s-3); margin-bottom: var(--s-4); }
.bill-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; }
.bill-head h2 { margin: 0; font-size: var(--fs-xl); }
.bill-head .sub { color: var(--ink-2); font-size: var(--fs-md); }
.bill-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.table-wrap { overflow-x: auto; }
.bill-table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); table-layout: fixed; }
.bill-table th:nth-child(1) { width: 45%; }
.bill-table th:nth-child(2) { width: 20%; }
.bill-table th { text-align: left; font-size: var(--fs-xs); color: var(--ink-3); font-weight: 500; padding: var(--s-2) 0; background: var(--surface-2); }
.bill-table th:first-child { padding-left: 0; }
.bill-table td { padding: var(--s-3) var(--s-3) var(--s-3) 0; border-top: 1px solid var(--line); vertical-align: middle; }
.bill-table td:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.bill-app { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; }
.tile-xs { width: 26px; height: 26px; }
.bill-empty { color: var(--ink-2); margin: 0; }
.bill-cancel { margin-top: var(--s-1); }
}
@keyframes spin { to { transform: rotate(360deg); } }


/* ------------------------------------------------------------ buttons and form */

button, .button {
  font: inherit; font-size: var(--fs-md); font-weight: 600; line-height: 1.2; cursor: pointer;
  border-radius: var(--r-pill); padding: var(--s-2) var(--s-4); border: 1px solid var(--blue);
  background: var(--blue); color: var(--on-blue); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
button:hover, .button:hover { background: var(--blue-deep); border-color: var(--blue-deep); box-shadow: 0 8px 22px -10px rgba(57, 102, 207, 0.9); }
button:focus-visible, .button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--cyan); outline-offset: 2px;
}
button.large { font-size: var(--fs-lg); padding: var(--s-3) var(--s-5); margin-top: var(--s-2); }
button.secondary, .button.secondary { background: var(--surface); color: var(--blue); border-color: var(--line-strong); }
button.secondary:hover, .button.secondary:hover { background: var(--blue-soft); border-color: var(--blue); box-shadow: none; }
button.ghost {
  background: transparent; color: var(--on-deck); border-color: rgba(255, 255, 255, 0.28);
  padding: var(--s-2) var(--s-3); font-size: var(--fs-sm);
}
button.ghost:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.6); box-shadow: none; }
button.link {
  border: none; background: none; color: var(--blue); padding: 0; font-weight: 500; border-radius: 4px;
  text-decoration: underline; text-underline-offset: 2px;
}
button.link:hover { background: none; color: var(--blue-deep); box-shadow: none; }
button:disabled, .button[aria-disabled="true"] { opacity: 0.42; cursor: not-allowed; pointer-events: none; }

.install { margin: var(--s-3) 0 var(--s-1); }
.install label { display: block; font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: var(--s-1); }
.install-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.install input {
  font: inherit; flex: 1 1 12em; min-width: 0; padding: var(--s-2) var(--s-3); border: 1px solid var(--line-strong);
  border-radius: var(--r-control); background: var(--surface); color: var(--ink);
}

/* ------------------------------------------------------------ environments */

.consent { margin: var(--s-3) 0; padding: var(--s-3); border-radius: var(--r-card); background: var(--blue-soft); border: 1px solid var(--line-strong); }
.consent p { margin-top: 0; }
.manual { margin: var(--s-3) 0 var(--s-1); }
.manual summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: var(--fs-md); border-radius: 4px; }
.manual[open] summary { margin-bottom: var(--s-1); }

.badge {
  display: inline-flex; align-items: center; gap: var(--s-2); border-radius: var(--r-pill); padding: var(--s-1) var(--s-3);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.35; background: var(--muted-soft); color: var(--ink-2);
  white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
/* The date next to an Active chip: same place, same size everywhere (#27). */
.status-note { color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; }
.badge-ok::before { box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-todo { background: var(--blue-soft); color: var(--blue); }
.badge-free { background: var(--free-soft); color: var(--free); }
.badge-wait { background: var(--muted-soft); color: var(--ink-2); }

/* ------------------------------------------------------------ footer */

.foot { border-top: 1px solid var(--line); color: var(--ink-3); font-size: var(--fs-sm); }
.foot-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-5); padding-top: var(--s-5); padding-bottom: var(--s-5); }
.foot-brand { margin: 0; }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin: 0; padding: 0; }
.foot a { color: var(--ink-2); text-decoration: none; }
.foot a:hover { color: var(--blue); text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .spinner { animation-duration: 3s; }
}

/* ------------------------------------------------------------ narrow screens */

@media (max-width: 760px) {
  .wrap, .top-inner, .hero-inner, main, .foot-inner { padding-left: var(--s-4); padding-right: var(--s-4); }
  .panel { padding: var(--s-4) var(--s-4); border-radius: var(--r-panel); }
  .card { padding: var(--s-4) var(--s-4); }
  .brand-tag, .who-name { display: none; }
  .top-inner { flex-wrap: wrap; gap: var(--s-2) var(--s-4); padding-top: var(--s-2); padding-bottom: var(--s-2); }
  .nav { order: 3; width: 100%; }
  .bill-table th:nth-child(2), .bill-table td:nth-child(2) { display: none; }
  /* The install state goes under the environment, never squeezes its name. */
  .env-row { flex-wrap: wrap; }
  .env-main { flex: 1 1 100%; }
  .env-action { width: 100%; max-width: none; justify-content: flex-start; }
  .env-action .app-note { text-align: left; }
  .logo { height: 32px; }
  .top-inner { min-height: 64px; }
  .hero-inner { padding-top: var(--s-5); padding-bottom: 96px; }
  .panel-head { flex-wrap: wrap; }
  .my-apps { grid-template-columns: 1fr; }
  .fiche-hero { flex-direction: column; align-items: flex-start; gap: var(--s-4); }
  .tile-lg { width: 68px; height: 68px; }
  .my-apps-empty { flex-direction: column; align-items: flex-start; }
  /* A company line: name on top, then its status and its buttons, left aligned, on one row. */
  .company-actions { justify-content: flex-start; width: 100%; }
  /* The status on its own line, then the buttons side by side: a zero-height break between them. */
  .company-actions::before { content: ""; order: 1; flex-basis: 100%; height: 0; }
  .company-actions > button { order: 2; }
  .company-actions button.plan { flex: 1 1 0; min-width: 0; }
  .plan-amount { white-space: normal; }
}
