/* The page layout on pitimespi.com and the console (after tokens.css and base.css, which come
   from packages/ui). Layout adapted from intalg-site public/assets/site.css (the top bar, the page
   column); the course cards are new. Every width query is in em (packages/ui/tokens.css, tiers). */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  padding: 12px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 0;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wordmark);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.tagline {
  font-size: 0.875rem;
  color: var(--muted);
}
.topbar .tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  min-width: 0;
  margin-left: auto;
}

.page {
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 32px 48px;
}
.lead {
  font-size: 1.0625rem;
  color: var(--text-2);
  max-width: 40em;
}

.courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 16px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.course-card,
.panel {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
/* The course's name is its link: a 44px target like every other control. */
.course-card h2 a {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
  color: var(--text);
}
.course-card p:last-child {
  margin-bottom: 0;
}
.panel {
  margin-top: 24px;
}
.status:empty {
  margin: 0;
}

.section-heading {
  margin-top: 32px;
}
.past {
  padding-left: 1.25em;
}

/* Forms (the sign-in pages): one column, labels above their inputs, 44px controls. */
.stack {
  display: grid;
  gap: 8px;
  max-width: 30rem;
  margin-top: 16px;
}
.stack label {
  font-weight: 600;
}
.stack .button {
  justify-self: start;
  margin-top: 8px;
}
.stack p {
  margin: 0;
}
/* A grid item is at least as wide as its longest word by default; an email address at 200 % text on
   a 320 px phone is wider than the screen, so the items may shrink and a long word breaks anywhere. */
.stack > * {
  min-width: 0;
}
.stack p,
.notice {
  overflow-wrap: anywhere;
}
input:is([type="email"], [type="text"], :not([type])) {
  width: 100%;
  min-height: var(--hit);
  padding: 8px 12px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.choice {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--hit);
}
.choice input {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  accent-color: var(--accent);
}
.choice label {
  font-weight: 400;
}
.secondary {
  margin-top: 16px;
}
.signout {
  margin: 0;
}
/* A message under a heading: neutral, a warning, or an error; the words say which, not the colour. */
.notice {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--text);
}
.notice.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.notice.bad {
  background: var(--bad-soft);
  color: var(--bad);
}
.notice-sections section {
  margin-top: 20px;
}
.notice-sections ul {
  padding-left: 1.25em;
}
.notice-sections li + li {
  margin-top: 6px;
}

/* T1 Phone, and T2 up to 37.5em: narrower gutters (16px at the side, the 320px rule). */
@media (max-width: 37.5em) {
  .topbar {
    padding: 8px 16px;
  }
  .page {
    padding: 20px 16px 32px;
  }
}

/* The console's lists and inline forms (content, releases). */
.rows-plain {
  padding-left: 1.25em;
}
.rows-plain li + li {
  margin-top: 10px;
}
form.inline {
  display: inline-block;
  margin: 4px 8px 4px 0;
}
code {
  font-size: 0.95em;
  overflow-wrap: anywhere;
}

/* A page that shows the frame (the console's preview; next, the activity page). The iframe is as
   tall as its document (lti.frameResize), full width, no box of its own. */
.preview-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.frame-slot {
  margin-top: 12px;
}
.doenet-frame {
  display: block;
  width: 100%;
  min-height: 300px;
  height: 600px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

/* The course page and the activity page (src/pages/activity.tsx). */
.crumbs {
  margin: 0 0 8px;
}
.crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
}
.activity-list {
  display: grid;
  gap: 12px;
  margin: 8px 0 24px;
  padding: 0;
  list-style: none;
}
.activity-list li {
  display: grid;
  gap: 2px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.activity-link,
.activity-title {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
  font-weight: 600;
}
.due-line {
  color: var(--text-2);
}
.activity-status {
  min-height: 1.5em;
}
.save-status,
.provisional {
  margin: 4px 0;
}
.save-status:empty,
.provisional:empty {
  margin: 0;
}
/* The notice hold's link in the status line (activity.js, pcp.19): a 44px target like every other. */
.save-status a {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
}
.restart {
  margin: 16px 0;
}
.restart summary {
  list-style: none;
  width: fit-content;
}
.restart summary::-webkit-details-marker {
  display: none;
}
.restart-panel {
  margin-top: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.attribution {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--text-2);
}
.attribution h2 {
  font-size: 1rem;
}

/* The console's forms and tables (src/assignments/index.tsx). */
fieldset.stack {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.window-fields {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}
.window-section {
  font-weight: 600;
}
select,
input[type="number"],
input[type="datetime-local"] {
  min-height: var(--hit);
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--control-border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.table-scroll {
  overflow-x: auto;
  /* Holds its visually hidden text (absolutely placed) inside the scroll area, not beside the page. */
  position: relative;
}
.table-scroll:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
table {
  border-collapse: collapse;
  min-width: 100%;
}
th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.table-scroll a {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
}
/* A fieldset is as wide as its widest content by default, and a datetime-local input has a wide
   intrinsic size: at 200 % text on a phone both must shrink to the column. */
fieldset {
  min-width: 0;
}
input[type="datetime-local"],
select {
  width: 100%;
  min-width: 0;
}
legend {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* The homework stepper (src/pages/homework.tsx, public/assets/homework.js). Phones: the Problems card
 * is a strip of circles above the problem; from 56.25em (T3 up) it sits beside the problem. */
.hw-layout {
  display: grid;
  gap: 16px;
  margin-top: 12px;
}
@media (min-width: 56.25em) {
  .hw-layout {
    grid-template-columns: minmax(11rem, 14rem) minmax(0, 1fr);
    align-items: start;
  }
}
.hw-problems,
.hw-problem {
  min-width: 0;
}
.hw-problems {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.hw-problems h2,
.hw-problem h2 {
  margin: 0 0 8px;
  font-size: 1.125rem;
}
.hw-circles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.hw-circle {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: var(--hit);
  min-height: var(--hit);
  padding: 2px 8px;
  border: 2px solid var(--control-border);
  border-radius: calc(var(--hit) / 2);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
}
.hw-circle .hw-glyph:not(:empty) {
  margin-left: 2px;
}
.hw-circle .hw-version {
  font-size: 0.75rem;
  font-weight: 500;
}
.hw-circle .hw-version:empty {
  display: none;
}
.hw-circle[data-state="tried"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.hw-circle[data-state="exhausted"] {
  border-color: var(--warn);
  background: var(--warn-soft);
  color: var(--warn);
}
.hw-circle[data-state="done"] {
  border-color: var(--good);
  background: var(--good);
  color: var(--bg);
}
.hw-circle[data-state="excused"] {
  border-style: dashed;
  color: var(--muted);
}
/* The problem on screen: a ring (box-shadow), so the focus outline stays its own. */
.hw-circle[aria-current="step"] {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 5px var(--text);
}
.hw-legend {
  margin: 8px 0 0;
  font-size: 0.875rem;
}
.hw-progress {
  margin: 0 0 4px;
}
.hw-similar {
  margin: 16px 0 8px;
}
.hw-similar p {
  margin: 6px 0;
}
.button[aria-disabled="true"] {
  border-color: var(--control-border);
  background: var(--sunken);
  color: var(--muted);
  cursor: not-allowed;
}
.hw-nav,
.hw-confirm-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
/* In-class work: the gate and the group panel (src/pages/activity.tsx). */
.gate-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.gate-choices form {
  margin: 0;
}
.group-panel {
  margin: 16px 0;
}
.group-members {
  padding-left: 1.25em;
}

/* Today on the console (src/console/today.tsx): its links are 44px targets. */
.today-section a {
  display: inline-flex;
  align-items: center;
  min-height: var(--hit);
}
.today-section {
  margin-bottom: 16px;
}
