/* DegreeOS Tutor: page layout. Colours and tutor cards come from base.css. */
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-family: var(--display); font-size: 1.12rem; }
.logo b { color: var(--accent); font-weight: 600; }
.topnav { display: flex; gap: 2px; }
.topnav a { padding: 8px 12px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .92rem; }
.topnav a.on { background: var(--accent-soft); color: var(--accent); }
.wrap { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 22px 16px 40px; display: grid; gap: 18px; align-content: start; }
.wrap > *, .qcard > *, .cols > *, .card > *, .tutor > *, .cgp .pagebody > *, .example > *, .steps2 li > * { min-width: 0; }
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 16px; font-size: .8rem; color: var(--ink-3); }
.foot a { color: var(--ink-2); }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }
.back { color: var(--ink-2); text-decoration: none; font-size: .9rem; width: fit-content; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: grid; gap: 8px; }
.narrow { max-width: 520px; width: 100%; justify-self: center; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 18px; align-items: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.lbl, label { font-weight: 500; font-size: .92rem; }
.status { min-height: 1.2em; margin-top: 8px; color: var(--ink-2); font-size: .9rem; }
.wide { width: 100%; }
textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); resize: vertical; }
input[type="email"] { width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
input:not([type]) { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); flex: 1 1 180px; min-width: 0; }

.hero { text-align: center; max-width: 640px; justify-self: center; padding: 10px 0 0; display: grid; gap: 10px; }
.hero h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); }
.lead { font-size: 1.05rem; color: var(--ink-2); }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .85rem; margin: 12px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#signin .btn.big { width: 100%; }

.steps3 ol { margin: 6px 0 0; padding-inline-start: 22px; display: grid; gap: 6px; }
.subj { --c: var(--accent); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: center; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); border-inline-start: 5px solid var(--c); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.subj:hover { border-color: var(--c); }
.subj .dot, .subjhead .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.subj .nm { font-family: var(--display); font-size: 1.12rem; font-weight: 600; overflow-wrap: anywhere; }
.subj .small { grid-column: 2; }
.subjhead { justify-content: flex-start; }
.subjhead h1 { flex: 1 1 auto; overflow-wrap: anywhere; }
.addsubj { display: grid; gap: 12px; }
.colors { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.colors legend { font-weight: 500; font-size: .92rem; margin-bottom: 6px; }
.swatch { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.swatch input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.swatch span { display: block; width: 32px; height: 32px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); pointer-events: none; }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--ink); }
.swatch input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }
.addsubj .btn { justify-self: start; }

.drop { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin: 12px 0; padding: 18px; border: 2px dashed var(--line); border-radius: var(--r); cursor: pointer; text-align: center; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; }
.list li { padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .empty { color: var(--ink-3); font-size: .9rem; }
.doc { display: flex; justify-content: space-between; gap: 10px; align-items: start; }
.nm { overflow-wrap: anywhere; }
.warnline { color: var(--warn); margin-top: 2px; }
.row-link { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; color: var(--ink); text-decoration: none; font-weight: 500; }
.row-link:hover .nm { color: var(--accent); }
.pending { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: var(--sunk); margin-bottom: 8px; }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.prow select { min-width: 0; }

.qlist { display: grid; gap: 18px; }
.qcard { --c: var(--accent); display: grid; gap: 14px; border-top: 4px solid var(--c); }
.qhead2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.qnum { font-family: var(--display); font-weight: 600; font-size: 1.1rem; color: var(--c); }
.qtext { font-size: 1.02rem; line-height: 1.6; overflow-x: auto; }
.qtext p + p, .qtext p + ol, .qtext p + ul { margin-top: 8px; }
.tutor { display: grid; gap: 16px; }
.tutor:empty { display: none; }
.qactions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qactions [data-left] { margin-inline-start: auto; }
.checkbox { display: grid; gap: 10px; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; }
.thumb img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }
.thumb button { position: absolute; top: 2px; inset-inline-end: 2px; min-height: 26px; padding: 0 6px; background: var(--surface); }
.confirm { display: grid; gap: 10px; }
.msg .txt { overflow-x: auto; }

.urow { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); }
.danger-zone { margin-top: 6px; }
.danger-zone summary { cursor: pointer; color: var(--bad); font-weight: 500; }
.danger-zone[open] { display: grid; gap: 10px; }

.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--paper); font-weight: 500; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.bad { background: var(--bad); color: #fff; }

@media (max-width: 640px) {
  .top { flex-wrap: wrap; padding-block: 8px; }
  .topnav { width: 100%; justify-content: space-between; }
  .topnav a { flex: 1; text-align: center; padding: 8px 6px; }
  .wrap { padding: 16px 12px 32px; }
  .card { padding: 14px; }
  .qactions .btn { flex: 1 1 calc(50% - 8px); }
  .qactions [data-left] { width: 100%; margin: 0; }
  .prow { grid-template-columns: minmax(0, 1fr) auto; }
  .prow .nm { grid-column: 1 / -1; }
}
[hidden] { display: none !important; }
/* Long inline maths scrolls on its own instead of being cut off. */
.msg .txt mjx-container:not([display]), .qtext mjx-container:not([display]), .cgp mjx-container:not([display]) { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; }
.asglist li { padding: 0; border-top: 0; }
.asglist li + li { margin-top: 8px; }
.asg { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 10px; align-items: center; padding: 14px 16px; border: 2px solid color-mix(in srgb, var(--c) 45%, var(--line)); border-inline-start: 6px solid var(--c); border-radius: 14px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 1.04rem; box-shadow: var(--shadow); }
.asg:hover, .asg:focus-visible { background: color-mix(in srgb, var(--c) 20%, var(--surface)); }
.asg .chev { color: var(--c); font-weight: 700; }
.asg .small { grid-column: 1; }
.asg .chev { grid-column: 2; grid-row: 1 / span 2; font-size: 1.6rem; }
.continue { justify-self: start; max-width: 100%; white-space: normal; text-align: start; }
.topright { display: flex; align-items: center; gap: 6px; }
.themebtn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); cursor: pointer; flex: 0 0 auto; }
.themebtn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }
@media (max-width: 640px) { .topright { width: 100%; } .topright .topnav { flex: 1; } .top .logo { flex: 1; } }
.pqchip { min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-family: var(--display); font-weight: 700; cursor: pointer; }
.pqchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.asghead { margin: 6px 0 2px; font-size: 1rem; }
.langsw { display: inline-flex; padding: 3px; gap: 2px; border-radius: 12px; background: var(--sunk); flex: 0 0 auto; }
.langsw button { min-width: 40px; height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-weight: 600; cursor: pointer; }
.langsw button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.driverow { margin: -4px 0 6px; }
.drivebtn { gap: 8px; }
.langfix { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 12px; }
.tile { display: grid; gap: 2px; padding: 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.tile b { font-size: 1.8rem; font-weight: 600; }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 2px 10px; align-items: center; }
.bar .track { height: 10px; border-radius: 99px; background: var(--sunk); overflow: hidden; }
.bar .track i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.bar .mono { grid-column: 2; }
.prow2 { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.prow2:first-child { border-top: 0; }
.fbrow { padding: 10px 0; border-top: 1px solid var(--line); display: grid; gap: 4px; }
.fbrow p { white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .topright { min-width: 0; }
  .topright .topnav { min-width: 0; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  .topright .topnav::-webkit-scrollbar { display: none; }
  .topnav a { flex: 0 0 auto; padding: 8px 10px; }
  .bar { grid-template-columns: 84px minmax(0, 1fr); }
}
