@layer views {
  /* ── "ask for anything": one line on a page that goes to the tutor ── */
  .ask-box { display: grid; gap: 8px; }
  .ask-row { display: flex; align-items: center; gap: 8px; }
  .ask-input { flex: 1 1 0; min-width: 0; }
  .ask-class { flex: 0 1 200px; width: auto; min-width: 0; }
  /* on a phone the class picker gets its own line; the field and its button stay together */
  @media (max-width: 560px) {
    .ask-row { flex-wrap: wrap; }
    .ask-class { flex: 1 1 100%; }
  }
  /* as tall as the field beside it */
  .ask-row > .pill { flex: none; min-height: 44px; }

  /* ── what the tutor makes, drawn in the chat ── */
  .make-pending { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-meta); color: var(--muted); }
  .make-pending .spin { width: 14px; height: 14px; }
  .make {
    display: grid; gap: 12px; margin: 4px 0; padding: var(--pad-row); border-radius: var(--r-tile);
    border: 1px solid var(--line-2); background: var(--surface); color: var(--fg-2);
    &:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
  }
  .make-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
  .make-head > div { display: grid; gap: 2px; min-width: 0; }
  .make-title { font-weight: 800; font-size: var(--fs-row); letter-spacing: -0.02em; color: var(--fg); }
  .make-sub { font-size: var(--fs-meta); color: var(--fg-2); }
  .make-count { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
  .make-row { display: flex; flex-wrap: wrap; gap: 8px; }
  .make-foot { display: flex; gap: 16px; font-size: var(--fs-meta); }
  .make-foot .link-btn { color: var(--muted); font-weight: 500; }
  .make-body { display: grid; gap: 10px; }
  .make-done { display: grid; gap: 10px; }
  .make-list { display: grid; gap: 10px; padding-left: 20px; font-size: var(--fs-body-sm); max-height: 360px; overflow-y: auto; }
  .make-list li { display: grid; gap: 2px; }

  /* a notecard: the front, then on a press the back under it */
  .flash {
    display: grid; min-height: 132px; padding: 18px 16px; border-radius: var(--r-tile); text-align: center;
    border: 1px solid var(--line); background: var(--bg-raise); color: var(--fg); cursor: pointer;
    transition: border-color var(--t-fast), transform var(--t-fast) var(--ease-spring);
    &:hover { border-color: var(--line-2); }
    &:active { transform: scale(.99); }
  }
  .flash-face { display: grid; align-content: center; gap: 10px; }
  .flash-front { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.02em; }
  .flash-small { font-size: var(--fs-meta); color: var(--muted); }
  .flash-back { font-size: var(--fs-md); color: var(--fg); }
  .flash-face .rich > :first-child { margin-top: 0; }
  .flash-face .rich > :last-child { margin-bottom: 0; }

  /* ── saved notecard decks (parts/decks.js) ── */

  /* a class's decks, on its page: a quiet label, then one list, each row opening its deck */
  .nc-sec { display: grid; gap: 10px; }
  .nc-sec[hidden] { display: none; }
  .nc-list { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); overflow: hidden; }
  .nc-row {
    display: grid; gap: 2px; width: 100%; min-height: 44px; padding: var(--pad-row); text-align: left;
    border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--fg-2); cursor: pointer;
    transition: background var(--t-fast);
    &:last-child { border-bottom: 0; }
    &:hover { background: var(--surface-2); }
    &:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
  }
  .nc-row-title { font-weight: 700; font-size: var(--fs-row); color: var(--fg); overflow-wrap: anywhere; }
  .nc-row-meta { font-size: var(--fs-meta); color: var(--muted); overflow-wrap: anywhere; }
  .nc-due { color: var(--due); }

  /* on a topic's sheet: a row like its neighbours', without their dot */
  .cx-node.nc-node { grid-template-columns: minmax(0, 1fr) auto; }

  /* a deck's sheet (built from the topic sheet's parts): each card, front over back, when it's next and its pen */
  .nc-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: var(--pad-row); }
  .nc-card-main { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
  .nc-front { font-weight: 700; color: var(--fg); }
  .nc-back { font-size: var(--fs-body-sm); color: var(--fg-2); }
  :is(.nc-front, .nc-back) > :first-child { margin-top: 0; }
  :is(.nc-front, .nc-back) > :last-child { margin-bottom: 0; }
  .nc-card-side { display: flex; align-items: center; gap: 4px; margin: -4px -6px 0 0; }
  .nc-card-side .label[data-when="due"] { color: var(--due); }

  /* reviewing what's due: the chat's notecards, in a dialog of their own */
  dialog.nc-review { width: min(520px, calc(100vw - 32px)); }
  dialog.nc-review:focus { outline: none; }
  .nc-review-head { display: flex; align-items: center; gap: 12px; padding: 14px 12px 0 var(--pad-card); }
  .nc-where { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nc-review > .make-body { padding: 12px var(--pad-card) var(--pad-card); }
}
