/* ==================================================================
   IMCB F-10/4 · PROGRESS — the original maximalist design.
   Cream/tinted paper · Syne 800 · 2.5px ink borders · offset shadows ·
   marquee · colour-blocked attendance · GRID compact · light only.
   ================================================================== */

@property --hue {
  syntax: "<number>";
  inherits: true;
  initial-value: 262;
}

:root {
  --hue: 262;

  --bg: hsl(var(--hue) 60% 94%);         /* page ground — tinted with the ink */
  --surface: hsl(var(--hue) 55% 97%);    /* card fill */
  --ink: #14110a;
  --ink-strong: #14110a;

  --muted: color-mix(in srgb, var(--ink) 58%, var(--bg));
  --faint: color-mix(in srgb, var(--ink) 34%, var(--bg));
  --edge: color-mix(in srgb, var(--ink) 15%, var(--bg));
  --highlight: rgba(255, 255, 255, 0.85);

  --accent: hsl(var(--hue) 85% 55%);
  --accent-deep: hsl(var(--hue) 80% 42%);
  --accent-soft: hsl(var(--hue) 85% 88%);
  --accent-2: hsl(calc(var(--hue) + 42) 85% 55%);

  --red: #e8442a;
  --amber: #f2a71b;
  --green: #1f9d55;

  --font-display: "Syne", sans-serif;
  --font-body: "Space Grotesk", sans-serif;
  --font-mono: "Space Mono", monospace;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  transition: --hue 0.7s ease;
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(
    color-mix(in srgb, var(--ink) 13%, transparent) 1.1px,
    transparent 1.3px
  );
  background-size: 26px 26px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  animation: pagein 0.35s ease both;
}

@keyframes pagein {
  from { opacity: 0; }
}

::selection {
  background: var(--ink);
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--accent-deep);
  outline-offset: 2px;
  border-radius: 6px;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.micro {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}

kbd {
  padding: 0.1em 0.4em;
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: color-mix(in srgb, var(--ink) 10%, var(--bg));
  border-radius: 3px;
}

/* ---------- loading bar (shared) ---------- */
.loadbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 4px;
  z-index: 200;
  pointer-events: none;
  display: none;
  overflow: hidden;
}

body.is-loading .loadbar {
  display: block;
}

.loadbar i {
  display: block;
  height: 100%;
  width: 40%;
  margin-left: -40%;
  border-radius: 0 99px 99px 0;
  background: var(--accent);
  animation: loadslide 1.1s ease-in-out infinite;
}

@keyframes loadslide {
  to {
    margin-left: 100%;
  }
}

/* ---------- view transitions between pages ---------- */
@view-transition {
  navigation: auto;
}

.topbar {
  view-transition-name: topbar;
}

::view-transition-old(topbar),
::view-transition-new(topbar) {
  animation: none;
}

/* ---------- scrollbar ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--ink) transparent;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--ink);
  border: 3px solid var(--bg);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ==================================================================
   TOPBAR
   ================================================================== */
.topbar {
  padding-block: 0.85rem;
  background: var(--bg);
  border-bottom: 2.5px solid var(--ink);
}

.topbar-in {
  width: min(1240px, 100% - 3rem);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  border: 2px solid var(--ink);
  background: #fff;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--ink-strong);
  white-space: nowrap;
}

.brand-tag {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.58rem;
  letter-spacing: 0.16em;
  background: var(--ink);
  color: var(--accent);
  padding: 0.25em 0.6em;
  border-radius: 3px;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.flatbtn {
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  padding: 0.55em 1em;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
  text-decoration: none;
  display: inline-block;
}

.flatbtn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.flatbtn:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--ink);
}

.flatbtn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--ink);
}

.inkbtn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: var(--accent);
  color: var(--ink);
  font-size: 0;
}

.inkbtn svg {
  width: 16px;
  height: 16px;
}

.inkbtn:hover {
  transform: rotate(-12deg) scale(1.05);
}

/* ==================================================================
   HERO — two-column layout: content left, search card right
   ================================================================== */
.hero {
  padding: clamp(2.6rem, 7vw, 5.4rem) 0 2.4rem;
}

.wrap {
  width: min(1240px, 100% - 3rem);
  margin-inline: auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}

.hero-content {
  min-width: 0;
  max-width: 580px;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
    align-items: center;
    gap: clamp(2.5rem, 5vw, 4.5rem);
  }
  .hero-content {
    max-width: none;
  }
  .display {
    font-size: clamp(2rem, 4vw, 4.2rem);
  }
  .hero {
    padding-bottom: 5rem; /* keep the lookup card clear of the marquee */
  }
  .lookup {
    position: sticky;
    top: 100px;
    max-width: 420px;
    margin-top: 0;
  }
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.3rem;
}

.kicker span {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  padding: 0.3em 0.9em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--bg);
  box-shadow: 2px 2px 0 var(--ink);
}

.kicker span:nth-child(1) {
  background: var(--accent-soft);
  transform: rotate(-2deg);
}

.kicker span:nth-child(3) {
  background: color-mix(in srgb, var(--accent) 24%, var(--bg));
  transform: rotate(1.5deg);
}

.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.9rem, 5.6vw, 4.9rem);
  line-height: 0.97;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  color: var(--ink-strong);
  overflow-wrap: break-word;
}

.outline-word {
  color: transparent;
  -webkit-text-stroke: 2.5px var(--ink);
}

@supports not (-webkit-text-stroke: 2px black) {
  .outline-word {
    color: var(--accent-deep);
  }
}

.sticker-word {
  display: inline-block;
  padding: 0.02em 0.22em 0.06em;
  border: 2.5px solid var(--ink);
  border-radius: 4px;
  background: var(--accent);
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-1.6deg);
  font-size: 0.98em;
}

.lede {
  max-width: 46ch;
  margin: 1.6rem 0 0;
  font-weight: 500;
  font-size: 1.02rem;
  color: var(--muted);
}

.lede .mono {
  font-weight: 700;
  font-size: 0.9em;
}

/* ---------- search card ---------- */
.lookup {
  position: relative;
  width: 100%;
  max-width: 560px;
  margin-top: clamp(1.8rem, 4vw, 2.8rem);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 20px;
  box-shadow: 10px 10px 0 var(--accent);
  padding: 2rem 1.55rem 1.45rem;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  gap: 1.05rem;
}

.lookup-tab {
  position: absolute;
  top: -15px;
  left: 24px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  background: var(--accent);
  color: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.3em 0.95em;
}

.lf {
  display: grid;
  gap: 0.45rem;
}

.lf > .micro {
  color: var(--ink);
  opacity: 0.72;
}

.lf input,
.lf select {
  width: 100%;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--bg);
  padding: 0.72rem 0.95rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.lf input::placeholder {
  color: var(--faint);
  font-weight: 400;
}

.lf input:focus,
.lf select:focus {
  outline: none;
  border-color: var(--accent-deep);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.lf select {
  cursor: pointer;
  appearance: none;
  padding-right: 2.6rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%2314110a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.submit {
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  box-shadow: 3px 4px 0 var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.submit:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 6px 0 var(--ink);
}

.submit:active {
  transform: translate(2px, 3px);
  box-shadow: 0 0 0 var(--ink);
}

.submit[disabled] {
  opacity: 0.55;
  cursor: progress;
}

.try-line {
  margin: 1.1rem 0 0;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--muted);
}

.textlink {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.textlink:hover {
  color: var(--accent-deep);
}

/* ---------- rotating badge ---------- */
.rot-badge {
  position: absolute;
  top: -34px;
  right: -30px;
  width: 92px;
  height: 92px;
  pointer-events: none;
}

@media (min-width: 900px) {
  .rot-badge {
    top: -36px;
    right: -8px;
  }
}

@media (max-width: 899px) {
  .rot-badge {
    top: -28px;
    right: 16px;
    width: 76px;
    height: 76px;
  }
}

.rot-badge svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  animation: c-spin 18s linear infinite;
}

.rot-badge text {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  fill: var(--ink);
}

.rot-badge .star {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: var(--accent-deep);
}

@keyframes c-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==================================================================
   MARQUEE — accent band, ink text
   ================================================================== */
.marquee {
  background: var(--accent);
  color: var(--ink);
  border-block: 2px solid var(--ink);
  overflow: hidden;
  padding-block: 0.75rem;
  margin-top: 2.6rem;
}

.marquee-track {
  display: inline-flex;
  white-space: nowrap;
  animation: c-ticker 24s linear infinite;
}

.marquee-track span {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.marquee-track i {
  font-style: normal;
  margin-inline: 1.2rem;
  opacity: 0.65;
}

@keyframes c-ticker {
  to {
    transform: translateX(-50%);
  }
}

/* ==================================================================
   RECORD — banner card, stat tiles, sections
   ================================================================== */
.main {
  width: min(1240px, 100% - 3rem);
  margin-inline: auto;
  padding-block: 2.4rem 3rem;
}

.micro {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.textlink,
.linklike {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.textlink:hover,
.linklike:hover {
  color: var(--accent-deep);
}

/* ---------- banner card ---------- */
.c-banner {
  background: var(--bg);
  border: 2px solid var(--ink);
  border-radius: 18px;
  box-shadow: 9px 10px 0 var(--accent);
  padding: 1.5rem 1.6rem;
}

.c-banner-in {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem 1.5rem;
}

.c-avatar {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.c-banner-info {
  flex: 1 1 260px;
}

.c-name {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--ink-strong);
  overflow-wrap: anywhere;
}

.c-father {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.c-father b {
  color: var(--ink);
  font-weight: 600;
}

.c-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.c-chip {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.76rem;
  padding: 0.22em 0.85em;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
}

.c-chip-ink {
  background: var(--ink);
  color: var(--bg);
}

.c-chip-tint {
  background: var(--accent-soft);
}

.c-banner-side {
  display: grid;
  gap: 0.4rem;
  justify-items: end;
  margin-left: auto;
  text-align: right;
}

.c-refresh {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45em 1em;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--bg);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.12s, box-shadow 0.12s;
}

.c-refresh:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0 var(--ink);
}

.c-refresh svg {
  width: 12px;
  height: 12px;
}

.c-live,
.c-verify {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.66rem;
  color: var(--muted);
}

.c-verify {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.c-verify:hover {
  color: var(--accent-deep);
}

/* ---------- stat tiles ---------- */
.c-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.2rem;
  margin-top: 1.6rem;
}

.c-stat {
  display: grid;
  align-content: center;
  gap: 0.25rem;
  min-width: 0;
  padding: 1rem 1.2rem;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 5px 5px 0 var(--accent);
}

.c-stat:nth-child(even) {
  box-shadow: 5px 5px 0 var(--accent-2);
}

.c-k {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--muted);
}

.c-v {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.4vw, 2.4rem);
  line-height: 1;
  color: var(--ink-strong);
}

.c-v.b-good { color: var(--green); }
.c-v.b-mid { color: var(--amber); }
.c-v.b-low { color: var(--red); }

.c-v.c-vt {
  font-size: clamp(0.95rem, 1.5vw, 1.25rem);
  line-height: 1.2;
  padding-block: 0.25rem;
  overflow-wrap: normal;
}

.c-s {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.64rem;
  color: var(--faint);
}

/* ---------- sections ---------- */
.c-sec {
  margin-top: clamp(2.2rem, 5vw, 3.4rem);
}

.c-sect {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.7rem;
  margin: 0 0 1.2rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--edge);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 3vw, 2rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--ink-strong);
}

.c-sect .c-star {
  font-style: normal;
  color: var(--accent);
  font-size: 0.8em;
}

.c-count {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--ink);
  background: var(--accent-soft);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0.2em 0.7em;
  transform: translateY(-0.12em);
}

/* ---------- subject cards ---------- */
.panel-grid {
  columns: 2;
  column-gap: 1.4rem;
}

@media (min-width: 1500px) {
  .panel-grid {
    columns: 3;
  }
}

.c-card {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin: 0 0 1.4rem;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--accent);
  padding: 1.1rem 1.2rem 1.2rem;
  transition: box-shadow 0.15s, transform 0.15s;
}

.c-card:nth-child(even) {
  box-shadow: 6px 6px 0 var(--accent-2);
}

.c-card:hover {
  transform: translate(-1px, -1px);
  box-shadow: 7px 7px 0 var(--ink);
}

.c-cardhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px dashed var(--edge);
  margin-bottom: 0.9rem;
}

.c-cardhead h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--ink-strong);
}

.c-prof {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  padding: 0.2em 0.7em;
  background: var(--bg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 46%;
}

/* ---------- test rows ---------- */
.c-test {
  padding-block: 0.55rem;
}

.c-test + .c-test {
  margin-top: 0.7rem;
}

.t-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

.t-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ink-strong);
}

.t-name em {
  display: block;
  font-style: normal;
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 0.62rem;
  color: var(--muted);
  margin-top: 1px;
}

.t-score {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-strong);
  white-space: nowrap;
}

.t-score i {
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  font-size: 0.85em;
}

.t-pct {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.66rem;
  margin-left: 0.45rem;
}

.t-remark {
  font-style: normal;
  font-weight: 700;
  font-size: 0.56rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--red);
  margin-left: 0.4rem;
}

/* ---------- flat meters ---------- */
.c-meter {
  display: block;
  height: 12px;
  border: 1.5px solid var(--ink);
  border-radius: 99px;
  background: var(--bg);
  overflow: hidden;
}

.c-meter i {
  display: block;
  height: 100%;
  width: var(--w);
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}

.c-meter.b-good i { background: var(--green); }
.c-meter.b-mid i { background: var(--amber); }
.c-meter.b-low i { background: var(--red); }

/* ==================================================================
   ATTENDANCE — thick rules, band %, band bars
   ================================================================== */
.c-att {
  border-top: 3px solid var(--ink);
}

.c-attrow {
  border-bottom: 3px solid var(--ink);
  padding-block: 0.9rem;
}

.c-attrow .t-line {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 0.6rem 1.6rem;
}

.a-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--ink-strong);
}

.a-nums {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

.a-nums b {
  color: var(--ink-strong);
}

.a-nums .cp { color: var(--green); }
.a-nums .cl { color: var(--amber); }
.a-nums .ca { color: var(--red); }

.a-pct {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  line-height: 1;
  white-space: nowrap;
}

.a-pct.b-good { color: var(--green); }
.a-pct.b-mid { color: var(--amber); }
.a-pct.b-low { color: var(--red); }

.c-att .c-meter {
  height: 12px;
  margin-top: 0.55rem;
}

/* ==================================================================
   RECENT DAYS — solid colour squares
   ================================================================== */
.c-heatwrap {
  overflow-x: auto;
  padding-bottom: 0.4rem;
}

.c-heat {
  border-collapse: separate;
  border-spacing: 5px;
  width: 100%;
  min-width: 640px;
}

.c-heat thead th {
  padding: 0 0.25rem 0.4rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--muted);
  vertical-align: bottom;
}

.c-heat thead th .d {
  display: block;
  color: var(--accent-deep);
  font-size: 0.62rem;
}

.c-heat thead th .n {
  display: block;
  font-size: 0.62rem;
}

.c-heat thead th.corner {
  text-align: left;
  color: var(--faint);
}

.c-heat thead th.wknd .d,
.c-heat thead th.wknd .n {
  color: var(--faint);
}

.c-heat tbody th {
  position: sticky;
  left: 0;
  background: var(--bg);
  padding-right: 1rem;
  font-weight: 600;
  font-size: 0.86rem;
  text-align: left;
  white-space: nowrap;
  color: var(--ink-strong);
}

.c-heat tbody td {
  padding: 0;
  text-align: center;
}

.c-heat tbody td.wknd {
  background: color-mix(in srgb, var(--ink) 5%, var(--bg));
  border-radius: 6px;
}

.c-heat tbody tr:hover td {
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
}

/* subject colour dots */
.c-heat tbody th .c-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--d, var(--accent));
  border: 1.5px solid var(--ink);
  margin-right: 0.5rem;
}

.c-heat .mk {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.9rem;
}

.c-heat .mk-P { background: var(--accent); color: var(--ink); }
.c-heat .mk-A { background: var(--red); color: #fff; }
.c-heat .mk-L { background: var(--amber); color: var(--ink); }

.c-heat .mk-x {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--edge);
  color: var(--faint);
}

.c-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.68rem;
  color: var(--muted);
}

.c-legend .mk {
  width: 22px;
  height: 22px;
  font-size: 0.6rem;
  margin-right: 0.5rem;
  vertical-align: middle;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
}

.c-legend .mk-P { background: var(--accent); color: var(--ink); }
.c-legend .mk-A { background: var(--red); color: #fff; }
.c-legend .mk-L { background: var(--amber); color: var(--ink); }
.c-legend .mk-x {
  background: transparent;
  box-shadow: inset 0 0 0 2px var(--edge);
  color: var(--faint);
}

/* ==================================================================
   STATES
   ================================================================== */
.c-state {
  padding: clamp(2.4rem, 6vw, 4rem) 1.5rem;
  text-align: center;
}

.c-state-mark {
  display: inline-block;
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  text-transform: uppercase;
  color: #fff;
  background: var(--red);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  transform: rotate(-2deg);
  animation: c-slam 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

.c-state.err .c-state-mark {
  background: var(--amber);
  color: var(--ink-strong);
}

@keyframes c-slam {
  from {
    opacity: 0;
    transform: rotate(-2deg) scale(1.5);
  }
}

.c-state h3 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
  text-transform: uppercase;
  color: var(--ink-strong);
}

.c-state p {
  max-width: 52ch;
  margin: 0 auto 1.6rem;
  color: var(--muted);
  font-weight: 500;
}

.c-state-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.c-state-actions .submit {
  width: auto;
  min-width: 15rem;
  padding-inline: 1.8rem;
}

/* ---------- loading ---------- */
.c-loading {
  padding: clamp(2rem, 5vw, 3rem) 0;
}

.c-loading .loading-label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.skel-bars {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.4rem;
}

.skel-bars i {
  height: 22px;
  border-radius: 4px;
  background: var(--edge);
  animation: c-pulse 1.1s ease-in-out infinite alternate;
}

.skel-bars i:nth-child(2) { width: 76%; }
.skel-bars i:nth-child(3) { width: 52%; }
.skel-bars i:nth-child(4) { width: 88%; }

@keyframes c-pulse {
  to {
    opacity: 0.45;
  }
}

/* ==================================================================
   FOOTER — ink band, giant wordmark
   ================================================================== */
.foot {
  background: var(--ink);
  color: var(--bg);
  margin-top: clamp(3rem, 8vw, 5rem);
  padding-block: clamp(2rem, 5vw, 3rem) 1.6rem;
}

.foot-mark {
  margin: 0 0 1.4rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  text-transform: uppercase;
}

.foot-mark em {
  font-style: normal;
  color: var(--accent);
}

.foot-cols {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.6rem 3rem;
}

.foot-sub {
  max-width: 44ch;
  margin: 0;
  color: color-mix(in srgb, var(--bg) 72%, transparent);
  font-size: 0.92rem;
}

.foot-links {
  display: grid;
  gap: 0.4rem;
  align-content: start;
  justify-items: start;
}

.foot-links .micro {
  color: var(--accent);
  margin-bottom: 0.2rem;
}

.foot-links a {
  font-weight: 600;
  color: color-mix(in srgb, var(--bg) 85%, transparent);
  transition: color 0.15s;
}

.foot-links a:hover {
  color: var(--accent);
}

.foot-legal {
  margin: 2rem 0 0;
  padding-top: 1.2rem;
  border-top: 2px solid color-mix(in srgb, var(--bg) 18%, transparent);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.64rem;
  color: color-mix(in srgb, var(--bg) 55%, transparent);
}

/* ---------- entrance animations ---------- */
.c-banner,
.c-stats,
.c-sec {
  animation: c-in 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both;
}

.c-stats { animation-delay: 0.08s; }
.c-sec:nth-of-type(1) { animation-delay: 0.14s; }
.c-sec:nth-of-type(2) { animation-delay: 0.2s; }
.c-sec:nth-of-type(3) { animation-delay: 0.26s; }

@keyframes c-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

/* ==================================================================
   GRID compact mode
   ================================================================== */
body.grid-view .panel-grid {
  column-gap: 1.2rem;
}

body.grid-view .c-card {
  padding: 0.9rem 1rem 1rem;
}

body.grid-view .c-cardhead h3 {
  font-size: 1rem;
}

body.grid-view .c-test {
  padding-block: 0.45rem;
}

body.grid-view .t-name {
  font-size: 0.86rem;
}

body.grid-view .c-meter {
  height: 8px;
}

body.grid-view .c-heat .mk {
  width: 30px;
  height: 30px;
  font-size: 0.74rem;
}

body.grid-view .c-att {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
}

body.grid-view .c-attrow {
  border: 2px solid var(--ink);
  border-radius: 14px;
  box-shadow: 5px 6px 0 var(--accent);
  padding: 0.8rem 1rem 0.9rem;
}

body.grid-view .c-attrow:nth-child(even) {
  box-shadow: 5px 6px 0 var(--accent-2);
}

body.grid-view .c-attrow .t-line {
  grid-template-columns: 1fr auto;
  gap: 0.3rem 0.8rem;
}

body.grid-view .c-attrow .a-nums {
  grid-column: 1 / -1;
  order: 3;
}

body.grid-view .c-attrow .a-pct {
  order: 2;
  font-size: 1.2rem;
}

body.grid-view .c-attrow .c-meter {
  order: 2;
  margin-top: 0.4rem;
}

/* ==================================================================
   RESPONSIVE
   ================================================================== */

/* phones: render ~20% denser so more fits on screen (≈80% zoom) */
@media (max-width: 700px) and (pointer: coarse) {
  html {
    zoom: 0.8;
  }
}

@media (max-width: 760px) {
  .lookup {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .panel-grid {
    columns: 1;
  }

  .c-banner {
    padding: 1.3rem 1.25rem;
    box-shadow: 6px 7px 0 var(--accent);
  }

  .c-banner-side {
    justify-items: start;
    text-align: left;
    margin-left: 0;
    width: 100%;
  }

  .c-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.95rem;
  }

  .c-stat {
    padding: 0.85rem 1rem;
  }

  .c-stat:nth-child(odd) {
    box-shadow: 5px 5px 0 var(--accent);
  }

  .c-stat:nth-child(even) {
    box-shadow: 5px 5px 0 var(--accent-2);
  }

  .c-meta {
    gap: 0.6rem 1.2rem;
  }

  .foot-cols {
    flex-direction: column;
  }

  .rot-badge {
    display: none;
  }
}

@media (max-width: 560px) {
  .wrap,
  .topbar-in,
  .main {
    width: calc(100% - 2.2rem);
  }

  .brand-tag {
    display: none;
  }

  .brand-name {
    font-size: 0.92rem;
  }

  .brand-logo {
    width: 28px;
    height: 28px;
  }

  .topnav {
    gap: 0.35rem;
  }

  .flatbtn {
    padding: 0.5em 0.7em;
  }

  .c-attrow .t-line {
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .c-attrow .a-nums {
    grid-column: 1 / -1;
    order: 3;
  }

  .c-heat .mk {
    width: 30px;
    height: 30px;
    font-size: 0.74rem;
  }
}

/* ==================================================================
   REDUCED MOTION
   ================================================================== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
    transition: none;
  }

  body {
    animation: none;
  }

  .marquee-track,
  .rot-badge svg,
  .c-state-mark,
  .c-banner,
  .c-stats,
  .c-sec,
  .skel-bars i {
    animation: none !important;
  }

  .c-meter i {
    transition: none;
    width: var(--w);
  }

  * {
    transition-duration: 0.01ms !important;
  }
}
