/* NeuroClarity Resources: the app's frame and layout, as the plan page draws it (docs/plan/resources-plan.html,
   "Screens"): the 48px top bar with the mark, the 200px side bar with the five lists and the Admin places, and the
   main area; plus the layout helpers every screen shares (row, title, split, fgrid). Controls are in controls.css,
   tables, cards and the screens' own parts in screens.css. Every colour comes from css/tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  background: var(--color-page);
  color: var(--color-text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-link); }
p { margin: 0; }
.muted { color: var(--color-muted); }

/* The frame: the top bar across, then the side bar beside the main area. */
.frame { display: grid; grid-template-rows: 48px minmax(0, 1fr); grid-template-columns: 200px minmax(0, 1fr); height: 100%; }
.frame.bare { grid-template-columns: minmax(0, 1fr); }
.frame.bare .side { display: none; }
.top {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  background: var(--color-card);
  border-bottom: 1px solid var(--color-line);
  min-width: 0;
}
.mark { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14.5px; letter-spacing: -0.01em; margin: 0; white-space: nowrap; color: var(--color-text); text-decoration: none; }
.mark i { width: 20px; height: 20px; border-radius: 6px; background: var(--color-main); display: inline-block; position: relative; flex: none; }
.mark i::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid var(--color-on-main); }
.mark span { color: var(--color-muted); font-weight: 500; }
.top .sp { flex: 1; }
.top .find { width: 260px; }
.me { display: flex; align-items: center; gap: 8px; color: var(--color-muted); font-size: 13px; white-space: nowrap; }
.av {
  width: 26px; height: 26px; border-radius: 50%; background: var(--color-panel); display: grid; place-items: center;
  font-weight: 600; font-size: 11px; color: var(--color-text); border: 1px solid var(--color-line); flex: none;
}

/* The side bar: "List" with the five lists and their counts, then "Admin" for admins, then who is signed in. */
.side { border-right: 1px solid var(--color-line); padding: 16px 10px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; }
.side .lab { font-size: 11.5px; font-weight: 600; color: var(--color-muted); padding: 14px 10px 6px; }
.side .lab:first-child { padding-top: 0; }
.side a {
  display: flex; justify-content: space-between; align-items: center; padding: 7px 10px; border-radius: 6px;
  color: var(--color-text); text-decoration: none; font-weight: 500;
}
.side a:hover { background: var(--color-panel); }
.side a:focus-visible { outline: 2px solid var(--color-selected); outline-offset: -2px; }
.side a.on { background: var(--color-selected-row); box-shadow: inset 2px 0 0 var(--color-main); }
.side a .c { font-size: 12px; color: var(--color-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.side a .nm { display: grid; gap: 1px; }
/* The foot: the person's name, their role here and (an admin) why. */
.side .who { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--color-line); display: grid; gap: 2px; font-size: 12.5px; }
.side .who .muted { font-size: 11.5px; }
/* A count beside a screen's title ("Review  123 waiting"). */
.title .count { font-size: 13px; font-weight: 500; color: var(--color-muted); letter-spacing: 0; margin-left: 8px; }

.main { overflow-y: auto; min-width: 0; position: relative; }
.content { padding: 22px 26px 40px; display: grid; gap: 16px; align-content: start; min-width: 0; max-width: 1400px; }
/* A screen's empty answer line takes no room, so the gap under the lines above the cards stays one gap (walk W3,
   minor 21). */
.content > div:empty { display: none; }

/* Layout helpers. */
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.row.end { justify-content: flex-end; }
.row.tight { gap: 8px; }
.title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin: 0 auto 0 0; min-width: 0; overflow-wrap: anywhere; }
/* The Item heading: a long title wraps on its own side; the status and the buttons stay together on the right. */
.head { display: flex; align-items: flex-start; gap: 16px; min-width: 0; }
.head .title { flex: 1 1 auto; margin: 0; padding-top: 2px; line-height: 1.4; }
.head .acts { display: flex; align-items: center; gap: 10px; flex: none; }
.split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.split.list { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); }
.stack { display: grid; gap: 14px; align-content: start; min-width: 0; }
.fgrid { display: grid; gap: 14px; min-width: 0; }
.c2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.c3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.sep { height: 1px; background: var(--color-line-soft); }

/* The idle warning: one line across the top of the main area. */
.idle-warn {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 26px;
  background: var(--color-chip-amber-bg); color: var(--color-chip-amber); font-weight: 500; border-bottom: 1px solid var(--color-line);
}
.idle-warn span { margin-right: auto; }

/* A narrower window: the item form keeps "In the report" and History beside it down to 900px, with a narrower right
   column; below that the two columns stack. */
@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1.7fr) minmax(250px, 1fr); }
  .top .find { width: 220px; }
}
@media (max-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr); }
}
/* Review (follow-up FZ2, walk W3 B1, M1, minor 1): the page itself never scrolls, so the title, the count, the filters
   and the chosen row's card stay in view; the rows scroll in their own column and the card in its own. */
@media (min-width: 901px) {
  .content.rv { height: 100%; display: flex; flex-direction: column; padding-bottom: 18px; }
  .content.rv > .split { flex: 1 1 auto; min-height: 0; grid-template-rows: minmax(0, 1fr); align-items: stretch; }
  .content.rv > .split > .stack { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
}
@media (max-width: 720px) {
  .frame { grid-template-rows: 48px auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
  .side { border-right: 0; border-bottom: 1px solid var(--color-line); flex-direction: row; flex-wrap: wrap; }
  .content { padding: 18px 16px 32px; }
  .c2, .c3 { grid-template-columns: minmax(0, 1fr); }
}
