/* The layout of every screen, built only from the kit's tokens: the page column, the page head, the card, columns,
   the stack, the toolbar, a row of buttons and the empty state. A screen is laid out with these alone; what one screen
   draws inside them is in app.css. One breakpoint: a phone is up to 760px wide. */

/* What the kit does not name, once. */
:root {
  --nasaq-page-narrow: 720px;    /* a form */
  --nasaq-page-default: 960px;   /* a list */
  --nasaq-rail: 250px;           /* a column of choices before the main one */
  --nasaq-aside: 300px;          /* a panel after the main column */
  --nasaq-row-h: 56px;           /* a list row of one line */
  --nasaq-row-h-2: 72px;         /* a list row of two lines */
  --nasaq-hair: 2px;             /* the gap between two lines that read as one */
  --nasaq-path-h: 24px;          /* the line above a title: the path, or the wizard's step */
  --nasaq-meta-h: 28px;          /* the line under a title */
  --nasaq-card-pad: var(--nasaq-space-5);
}
@media (max-width: 760px) {
  :root { --nasaq-card-pad: var(--nasaq-space-4); }
}

/* ---------- nasaq-page: the content column. A list by default, --narrow a form, --wide a board or a grid;
   --center in a frame with no side menu. Its first line is the path (empty on a first-level screen), so a title
   stands at the same height on every screen. ---------- */
.nasaq-page { display: flex; flex-direction: column; gap: var(--nasaq-space-5); inline-size: 100%; min-inline-size: 0;
  max-inline-size: var(--nasaq-page-default); }
.nasaq-page--narrow { max-inline-size: var(--nasaq-page-narrow); }
.nasaq-page--wide { max-inline-size: none; }
.nasaq-page--center { margin-inline: auto; }
.nasaq-page__path { display: flex; align-items: center; gap: var(--nasaq-space-3); min-block-size: var(--nasaq-path-h);
  margin-block-end: calc(var(--nasaq-space-2) - var(--nasaq-space-5)); color: var(--nasaq-muted);
  font-size: var(--nasaq-text-sm); line-height: 1.5; }

/* ---------- nasaq-pagehead ({% pagehead %}): the title, one line under it, the screen's actions at the end.
   The line under the title is kept when it is empty, so every head is the same height. ---------- */
.nasaq-pagehead { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start;
  gap: var(--nasaq-space-3) var(--nasaq-space-4); }
.nasaq-pagehead__titles { display: flex; flex-direction: column; min-inline-size: 0; }
.nasaq-title { min-block-size: var(--nasaq-control-h); font-size: var(--nasaq-text-2xl); overflow-wrap: anywhere; }
.nasaq-pagehead__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--nasaq-space-2);
  min-block-size: var(--nasaq-meta-h); color: var(--nasaq-muted); font-size: var(--nasaq-text-sm); line-height: 1.5; }
/* a link or a button in that line is a full-size target that does not make the line taller */
.nasaq-pagehead__meta > a, .nasaq-pagehead__meta .nasaq-iconbtn { margin-block: calc((var(--nasaq-meta-h) - var(--nasaq-control-h)) / 2); }
.nasaq-pagehead__meta > a { display: inline-flex; align-items: center; min-block-size: var(--nasaq-control-h); }
.nasaq-pagehead__actions { justify-content: flex-end; max-inline-size: 100%; }
.nasaq-pagehead__actions .nasaq-input { flex: 0 1 auto; inline-size: 220px; min-inline-size: 0; }

/* ---------- nasaq-actions: one row of buttons, anywhere. --end: at the row's end; --fill: the buttons share the
   row's width; __end on a button: it and what follows go to the row's end. On a phone the main button takes a row
   of its own, first, and the others share the next. ---------- */
.nasaq-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--nasaq-space-2); min-inline-size: 0; }
.nasaq-actions form { display: contents; }
.nasaq-actions--end { justify-content: flex-end; }
.nasaq-actions--fill > .nasaq-btn, .nasaq-actions--fill > form > .nasaq-btn { flex: 1 1 0; padding-inline: var(--nasaq-space-2); }
.nasaq-actions__end { margin-inline-start: auto; }

/* ---------- nasaq-card: the one surface (the kit's card). With parts (__head, __body, __foot) or --flush it has no
   padding of its own; the parts share one inline padding. ---------- */
.nasaq-card { min-inline-size: 0; }
.nasaq-card--flush, .nasaq-card:has(> .nasaq-card__head, > .nasaq-card__body, > .nasaq-card__foot) { padding: 0; }
.nasaq-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--nasaq-space-2) var(--nasaq-space-3); min-block-size: var(--nasaq-row-h);
  padding: var(--nasaq-space-1) var(--nasaq-card-pad); border-block-end: 1px solid var(--nasaq-border); }
h2.nasaq-card__title, .nasaq-card__title { font-size: var(--nasaq-text-base); line-height: var(--nasaq-leading-display); }
.nasaq-card__body { padding: var(--nasaq-card-pad); }
.nasaq-card__foot { padding: var(--nasaq-space-3) var(--nasaq-card-pad); border-block-start: 1px solid var(--nasaq-border); }

/* ---------- nasaq-cols: columns side by side, one under the other on a phone. --2: two halves; --aside: the main
   column and a panel after it; --rail: a column of choices and the main one. ---------- */
.nasaq-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--nasaq-space-4); align-items: start; }
.nasaq-cols > * { min-inline-size: 0; }
.nasaq-cols--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.nasaq-cols--aside { grid-template-columns: minmax(0, 1fr) var(--nasaq-aside); }
.nasaq-cols--rail { grid-template-columns: var(--nasaq-rail) minmax(0, 1fr); }

/* ---------- nasaq-stack: things one under the other. ---------- */
.nasaq-stack { display: flex; flex-direction: column; gap: var(--nasaq-space-4); min-inline-size: 0; }

/* ---------- nasaq-toolbar: one row of filters over a list or a board; __end: what stands at the row's end.
   On a phone: the search first on a row of its own, the choices share rows, the end on its own row. ---------- */
.nasaq-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--nasaq-space-3); min-inline-size: 0; }
.nasaq-toolbar__end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--nasaq-space-3);
  margin-inline-start: auto; min-inline-size: 0; }

/* ---------- nasaq-emptystate: nothing to show, in the card it would have filled: an icon, one line, and at most
   one row of actions. ---------- */
.nasaq-emptystate { display: flex; flex-direction: column; align-items: center; gap: var(--nasaq-space-3);
  padding: var(--nasaq-space-6) var(--nasaq-card-pad); color: var(--nasaq-muted); text-align: center; }
.nasaq-emptystate > .nasaq-i { inline-size: var(--nasaq-space-6); block-size: var(--nasaq-space-6); }
.nasaq-emptystate__text { font-size: var(--nasaq-text-sm); line-height: var(--nasaq-leading-display); }

@media (max-width: 760px) {
  .nasaq-page { gap: var(--nasaq-space-4); }
  .nasaq-page__path { margin-block-end: calc(var(--nasaq-space-2) - var(--nasaq-space-4)); }
  .nasaq-title { font-size: var(--nasaq-text-xl); }
  .nasaq-pagehead { grid-template-columns: minmax(0, 1fr); }
  .nasaq-pagehead__meta:empty { display: none; }
  .nasaq-pagehead__actions { justify-content: flex-start; }
  .nasaq-pagehead__actions .nasaq-input { flex: 1 1 100%; inline-size: auto; order: -2; }
  .nasaq-actions > .nasaq-btn, .nasaq-actions > form > .nasaq-btn, .nasaq-actions > .nasaq-more { flex: 1 1 auto; }
  .nasaq-actions > .nasaq-more > summary { inline-size: 100%; }
  .nasaq-actions > .nasaq-btn:not(.nasaq-btn--outline), .nasaq-actions > form > .nasaq-btn:not(.nasaq-btn--outline) {
    flex-basis: 100%; order: -1; }
  .nasaq-actions__end { margin-inline-start: 0; }
  /* «More» stands first in its row: its menu opens from the row's start, inside the screen */
  .nasaq-actions > .nasaq-more--end .nasaq-menu { inset-inline-start: 0; inset-inline-end: auto; }
  .nasaq-cols--2, .nasaq-cols--aside, .nasaq-cols--rail { grid-template-columns: minmax(0, 1fr); }
  .nasaq-toolbar > .nasaq-search { flex: 1 1 100%; order: -1; max-inline-size: none; }
  .nasaq-toolbar > .nasaq-select, .nasaq-toolbar > .nasaq-field { flex: 1 1 140px; min-inline-size: 0; }
  .nasaq-toolbar__end { flex: 1 1 100%; margin-inline-start: 0; }
}
@media print {
  .nasaq-page { display: block; max-inline-size: none; }
  .nasaq-page__path { display: none; }
}
