/* Settings: the one place things get set up. Section cards in up to three columns as the window
   grows (sources | school extras | you), a quiet row of jump links in the head, and the small
   shared pieces every section uses. Room tokens only. */

/* Several blocks here set their own display; `hidden` must still win. */
.pane [hidden] { display: none !important; }

/* ---- Head with jump links ----------------------------------------------------------------- */

.settings-head { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; }
.settings-head > div { min-width: 0; }
.jump { display: flex; flex-wrap: wrap; gap: 2px 4px; }
.jump a { padding: 5px 9px; border-radius: var(--r-pill); color: var(--ink-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.jump a:hover { background: var(--hover); color: var(--ink); }

/* ---- Columns --------------------------------------------------------------------------------
   One column on phones and small laptops; two from 1180px (the third group tucks under the
   first); three from 1680px. Each column stacks its own cards, so a card growing never moves
   the others sideways. */

.settings-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

@media (min-width: 1180px) {
  .settings-cols { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .col-sources { grid-area: 1 / 1; }
  .col-you { grid-area: 2 / 1; }
  .col-school { grid-area: 1 / 2 / 3 / 3; }
}
@media (min-width: 1680px) {
  .settings-cols { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.9fr); grid-template-rows: auto; }
  .col-sources, .col-school, .col-you { grid-area: auto; }
}
@media (max-width: 899px) {
  .settings-cols, .settings-col { gap: 12px; }
  .jump { flex-wrap: nowrap; max-width: 100%; margin: 0 -6px; padding-bottom: 2px; overflow-x: auto; scrollbar-width: none; }
  .jump::-webkit-scrollbar { display: none; }
  .settings-head { flex-direction: column; align-items: stretch; }
}

/* Jumping to #canvas etc. leaves a little air above the card. */
.set-card { scroll-margin-top: 18px; }
.set-card:target { box-shadow: 0 0 0 2px rgb(var(--accent-rgb) / 45%), var(--lift); }

/* ---- Shared bits -------------------------------------------------------------------------- */

.set-intro { max-width: 68ch; color: var(--ink-2); }
.set-intro + * { margin-top: 14px; }
.set-summary { max-width: 68ch; color: var(--ink-2); }
.set-summary b { color: var(--ink); font-weight: 600; }
.set-summary + .link-btn { margin-top: 8px; }

.set-sub { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.set-sub-title { color: var(--ink); font-size: 14.5px; font-weight: 650; }
.set-sub-title + .hint { margin-top: 2px; }

/* A folded list ("5 hidden Canvas spaces"). */
.set-more summary { width: fit-content; color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; }
.set-more summary:hover { color: var(--accent); }
.set-more summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.set-more[open] summary { margin-bottom: 6px; }
.set-more { scroll-margin-top: 18px; }

/* Rows: a term, a course. Text on the left, state and small actions on the right. */
.set-rows { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.set-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.set-row:first-child { border-top: 0; padding-top: 2px; }
.set-row-text { display: flex; flex-direction: column; min-width: 0; }
.set-row-text b { color: var(--ink); font-weight: 650; }
.set-row-text small { overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }

/* Checkbox list (Important dates). */
.set-checks { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 0; padding: 0; border: 0; }
.set-check { display: flex; align-items: center; gap: 10px; width: fit-content; color: var(--ink); cursor: pointer; }
.set-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }

/* Profile: who you're signed in as, under the form. */
.account-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.account-line p { overflow-wrap: anywhere; }

/* Room picker: four across, two in narrow cards and on phones. */
#room .rooms { max-width: none; grid-template-columns: repeat(auto-fill, minmax(min(100%, 128px), 1fr)); }

@media (max-width: 640px) {
  .set-row { grid-template-columns: minmax(0, 1fr); }
}
