/* Design-lab only. Not imported by apps/web. Colours and font come from the running app (apps/web/src/styles.css). */
:root {
  --paper: #f7f8fb;
  --paper-2: #eeecf8;
  --ink: #22263d;
  --ink-2: #62677a;
  --rule: #dddfea;
  --blue: #5650b4;
  --blue-dark: #494395;
  --red: #b32636;
  --green: #26745f;
  --mark: #ffe7a0;
  --serif: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* The app's top bar: tilted bookmark mark, wordmark, All apps, workspace, account */
.appbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  padding: 14px max(20px, calc((100vw - 860px) / 2));
  background: #fff;
  border-bottom: 1px solid var(--rule);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.8px;
  line-height: 1.15;
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 42px;
  background: var(--blue);
  color: #fff;
  border-radius: 12px 12px 12px 3px;
  transform: rotate(-3deg);
}
.brand-mark svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-caption {
  display: block;
  margin: 4px 0 0 1px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.6px;
  color: var(--ink-2);
}
.allapps {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ink-2);
  border-radius: 10px;
  color: var(--ink);
  font-size: 15px;
  text-decoration: none;
}
.allapps svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}
.appbar .org,
.appbar .who {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}
.appbar .org {
  margin-left: auto;
}
.appbar .demo {
  padding: 2px 8px;
  border-radius: 4px;
  background: #e8eaf0;
  color: var(--ink-2);
  font-size: 12px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--paper-2);
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
}
a {
  color: var(--blue);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--blue-dark);
}
:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 2px;
}
.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  z-index: 10;
}

/* Sketch banner: states honestly what this is */
.sketch {
  background: var(--ink);
  color: #f5efe2;
  font-size: 13px;
  padding: 8px 16px;
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
  align-items: center;
}
.sketch a {
  color: #ffe7a0;
}
.sketch strong {
  font-weight: 600;
}

.wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 72px;
}
.wrap.wide {
  max-width: 1040px;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
}
h1 {
  font-size: clamp(28px, 5vw, 40px);
  margin-top: 36px;
}
h2 {
  font-size: 24px;
  margin-top: 44px;
}
h3 {
  font-size: 18px;
  margin-top: 24px;
}
p {
  margin: 10px 0 0;
}
.lede {
  font-size: 18px;
  color: var(--ink-2);
  max-width: 62ch;
}
.small {
  font-size: 14px;
  color: var(--ink-2);
}
.eyebrow {
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 600;
  margin: 0;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--ink);
  margin-top: 28px;
  flex-wrap: wrap;
}
.tab {
  font: inherit;
  font-weight: 600;
  background: none;
  border: 0;
  border-bottom: 4px solid transparent;
  margin-bottom: -2px;
  padding: 10px 14px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  min-height: 44px;
}
.tab[aria-selected='true'] {
  color: var(--ink);
  border-bottom-color: var(--blue);
}
.tab:hover {
  color: var(--ink);
}
.panel[hidden] {
  display: none;
}

/* Buttons */
.btn {
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 18px;
  border-radius: 10px;
  border: 2px solid var(--blue);
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
  color: #fff;
}
.btn.quiet {
  background: transparent;
  color: var(--blue);
}
.btn.quiet:hover {
  background: var(--paper-2);
  color: var(--blue-dark);
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: center;
  margin-top: 16px;
}

/* Status uses words, not colour alone */
.tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 4px;
  border: 1.5px solid currentColor;
  vertical-align: 1px;
}
.tag.open {
  color: var(--red);
}
.tag.done {
  color: var(--green);
}
.tag.next {
  color: var(--blue);
}
.tag.neutral {
  color: var(--ink-2);
}

/* Ruled sections instead of cards */
.sec {
  border-top: 1px solid var(--rule);
  padding-top: 8px;
  margin-top: 28px;
}
.sec > h2:first-child,
.sec > h3:first-child {
  margin-top: 12px;
}

.mark {
  background: var(--mark);
  padding: 0 3px;
}

/* Teacher margin note */
.margin-note {
  border-left: 4px solid var(--red);
  padding: 4px 0 4px 14px;
  margin-top: 14px;
}
.margin-note .who {
  font-size: 13px;
  font-weight: 600;
  color: var(--red);
}

/* AI output: always labelled, editable, rejectable */
.ai {
  border: 2px dashed var(--ink-2);
  border-radius: 6px;
  padding: 12px 16px 14px;
  margin-top: 16px;
  background: #fff;
}
.ai .label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.ai .label span {
  font-weight: 500;
  color: var(--ink-2);
}

/* Forms */
label,
.label-text {
  display: block;
  font-weight: 600;
  margin-top: 16px;
}
.hint {
  font-weight: 400;
  color: var(--ink-2);
  font-size: 14px;
  display: block;
}
textarea,
input[type='text'],
select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 2px solid var(--ink-2);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 6px;
}
textarea {
  min-height: 110px;
  resize: vertical;
}

/* Fraction bars: real maths, drawn in CSS */
.bars {
  display: grid;
  gap: 6px;
  max-width: 360px;
  margin-top: 12px;
}
.bar {
  height: 30px;
  border: 2px solid var(--ink);
  border-left: 0;
  position: relative;
  background: #fff;
}
.bar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--mark);
}
.bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    to right,
    var(--ink) 2px,
    transparent 2px
  );
  background-size: calc(100% / var(--n, 2)) 100%;
}
.bar-label {
  font-size: 13px;
  color: var(--ink-2);
  margin: 0;
}

/* Plain lists */
.plain {
  list-style: none;
  padding: 0;
  margin: 0;
}
.plain > li {
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.plain > li:last-child {
  border-bottom: 0;
}

.cols {
  display: grid;
  gap: 8px 36px;
  grid-template-columns: 1fr;
}
@media (min-width: 760px) {
  .cols.two {
    grid-template-columns: 1.4fr 1fr;
  }
  .cols.even {
    grid-template-columns: 1fr 1fr;
  }
}

details {
  border-top: 1px solid var(--rule);
  padding: 10px 0;
  margin-top: 16px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 32px;
}

.build {
  background: var(--paper-2);
  border-radius: 6px;
  padding: 12px 16px;
  margin-top: 40px;
  font-size: 14px;
  color: var(--ink-2);
}
.build strong {
  color: var(--ink);
}
.build ul {
  margin: 6px 0 0;
  padding-left: 20px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15px;
  margin-top: 14px;
}
th,
td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--rule);
}
th {
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.scroll {
  overflow-x: auto;
}

@media (prefers-reduced-motion: no-preference) {
  .tab,
  .btn {
    transition: background 0.12s;
  }
}
