/* First-run empty state; every class is `ofr-` prefixed and owned here. Emitters:
   JS/features/org-first-run.js and altTBNoBoardAccessCard() in JS/alt/alt-team-board.js
   (`.ofr-stage-board` adapts the card to the board's scroll container). Uses Suite `--a-*`
   tokens and `.a-*` controls as-is; the modal reuses `.a-scrim` but self-centres. */

/* Standing in front of the board. Exception to "target only classes this file emits":
   `#altTeamCtx`/`#altTeamGlance`/`#altTeamPeople`/`#altMain` are team_board.html ids (owned by
   alt-team-context.js), hidden because a reader with no Organization has no board.
   `body.ofr-board-hidden` is toggled by ofrRender(); CSS only, never a JS `.hidden`. */
body.ofr-board-hidden #altTeamCtx,
body.ofr-board-hidden #altTeamGlance,
body.ofr-board-hidden #altTeamPeople,
body.ofr-board-hidden #altMain{
  display:none;
}

/* ---------- the empty state ---------- */

/* No fixed height: this replaces the board rather than sitting beside it, so it
   only needs to read as a proper page state, not fill an exact viewport fraction. */
.ofr-stage{
  display:grid; place-items:center;
  min-height:min(60vh, 520px);
  padding:var(--a-8) var(--a-4);
}

/* Second host: the board's no-access card, appended into `#altTBScroll` below the context bar.
   The 60vh floor above would push it off a laptop viewport, so a smaller floor still centres it. */
.ofr-stage.ofr-stage-board{
  min-height:min(38vh, 320px);
  padding:var(--a-6) var(--a-4);
}

/* Card centred edge to edge, as tasks.html's first-run card. firstRunCardCentreInViewport()
   assumes the stage reaches the viewport bottom, so `min-height:0` defeats the
   `min-height:min(60vh,520px)` floor (as CSS/alt/alt-tasks.css does for `#altFirstRun`).
   Gated with `:has()` on the `hidden` attribute so an empty `#orgFirstRun` reserves no column. */
#orgFirstRun:has(> #ofrStage:not([hidden])){
  display:flex; flex:1 1 auto; min-height:0; min-width:0;
}
#orgFirstRun:has(> #ofrStage:not([hidden])) > .ofr-stage{
  flex:1 1 auto; min-height:0; min-width:0;
}

.ofr-card{
  width:min(440px, 100%);
  padding:var(--a-6);
  border:1px solid var(--a-line);
  border-radius:var(--a-r-lg);
  background:var(--a-panel);
  box-shadow:var(--a-shadow-sm);
}

.ofr-icon{
  width:54px; height:54px; margin-bottom:var(--a-4);
  display:grid; place-items:center;
  border:1px solid var(--a-blue); border-radius:var(--a-r-lg);
  background:var(--a-blue-soft); color:var(--a-blue);
}
.ofr-icon svg{ width:26px; height:26px; }

.ofr-heading{
  margin:0; font-family:var(--a-display); font-weight:800; font-size:22px;
  line-height:1.2; color:var(--a-text);
}

.ofr-copy{ margin:var(--a-2) 0 0; color:var(--a-dim); font-size:14px; line-height:1.5; }

.ofr-sequence{
  margin:var(--a-5) 0; display:flex; flex-wrap:wrap; align-items:center; gap:7px;
  color:var(--a-dim); font-size:12px;
}
.ofr-sequence strong{ color:var(--a-text); font-weight:800; }

/* The button follows the copy directly on the Tasks/Notes cards (the org card has `.ofr-sequence` between). */
.ofr-copy + .ofr-full{ margin-top:var(--a-4); }
.ofr-full{ width:100%; }

/* Third host: an empty content type. JS/components/first-run-card.js renders "Create your first task"
   /"...note" with these rules; `.frc-*` marks the host. This rule is not shared:
   `.ofr-stage` sets `display:grid`, beating `hidden`, and this component toggles the stage on
   every list repaint. */
.frc-stage[hidden]{ display:none !important; }

@media (max-width:420px){
  .ofr-card{ padding:var(--a-5); }
}

/* ---------- the ready banner ---------- */

.ofr-ready{
  width:100%; max-width:980px; margin:0 auto;
  padding:var(--a-4);
  display:flex; align-items:center; gap:var(--a-4);
  border:1px solid var(--a-green); border-radius:var(--a-r);
  background:var(--a-green-soft);
}
.ofr-ready-icon{
  width:42px; height:42px; flex:0 0 auto;
  display:grid; place-items:center;
  border-radius:var(--a-r); background:var(--a-green); color:#fff;
}
.ofr-ready-icon svg{ width:20px; height:20px; }
.ofr-ready-copy{ min-width:0; flex:1 1 auto; }
.ofr-ready-copy strong{ display:block; color:var(--a-text); font-size:15px; font-weight:800; }
.ofr-ready-copy span{ display:block; margin-top:2px; color:var(--a-dim); font-size:13px; }
.ofr-ready-open{ flex:0 0 auto; margin-left:auto; }

@media (max-width:720px){
  .ofr-ready{ align-items:flex-start; flex-wrap:wrap; }
  .ofr-ready-open{ width:100%; margin-left:0; }
}

/* ---------- the name dialog ---------- */

.ofr-name-dialog{
  position:fixed; top:50%; left:50%; transform:translate(-50%,-50%);
  width:min(500px, calc(100vw - 32px));
  max-height:calc(100vh - 32px); overflow:auto;
  background:var(--a-float); border:1px solid var(--a-line-strong);
  border-radius:var(--a-r-lg); box-shadow:var(--a-shadow-lg);
  z-index:calc(var(--z-dialog, 300) + 1);
}
.ofr-modal-accent{
  height:3px; border-radius:var(--a-r-lg) var(--a-r-lg) 0 0;
  /* #28a1ff and #2fd2b0 are not invented — the same measured values
     CSS/alt/alt-settings-stride.css paints the org settings ribbon with. */
  background:linear-gradient(90deg, var(--a-blue), #28a1ff 55%, #2fd2b0);
}
.ofr-modal-body{ padding:var(--a-6); }
.ofr-eyebrow{
  margin:0 0 7px; font-size:11px; font-weight:850; letter-spacing:.13em;
  text-transform:uppercase; color:#6ed7c5;
}
.ofr-name-title{
  margin:0; font-family:var(--a-display); font-weight:800; font-size:20px;
  line-height:1.25; color:var(--a-text);
}
.ofr-name-copy{ margin:8px 0 20px; color:var(--a-dim); font-size:13px; line-height:1.5; }
.ofr-modal-body .a-hint{ margin-top:var(--a-2); }
.ofr-dialog-actions{
  margin-top:var(--a-5); display:flex; justify-content:flex-end; align-items:center; gap:var(--a-2);
}
/* THE SAVE SLOT (§20f) BESIDE THE CONFIRM BUTTON: .cfg-status carries margin-top:8px for use under
   a field, which in a centred flex row shifts the slot below the button's centre. */
.ofr-dialog-actions .cfg-status{ margin-top:0; }

@media (max-width:720px){
  /* The same bottom-sheet treatment the wireframe uses, self-contained so it does
     not depend on `.a-scrim` ever becoming a centring flex/grid parent. */
  .ofr-name-dialog{
    top:auto; bottom:0; left:0; right:0; transform:none;
    width:100%; max-width:none; max-height:85vh;
    border-radius:var(--a-r-lg) var(--a-r-lg) 0 0;
  }
  /* The accent's own radius already matches the dialog's top corners in both layouts — nothing
     to override here; a bottom sheet still has rounded top corners like the centred dialog. */
}

@media (max-width:420px){
  .ofr-dialog-actions{ display:grid; grid-template-columns:1fr 1fr; }
  .ofr-dialog-actions .a-btn{ width:100%; }
  /* The slot wraps to a row of its own: under the confirm button (right column), right-aligned
     to it, rather than left-aligned under Cancel. */
  .ofr-dialog-actions .cfg-status{ grid-column:2; justify-self:end; margin-top:var(--a-2); }
}

/* The optional second action on a first-run card sits centred under the full-width primary, as the Customize button does. */
.frc-secondary{ display:flex; width:fit-content; margin:var(--a-3) auto 0; }
