/*
  resize.nirmaan.online: only what is Form Photo Kit's own.

  Everything shared with nirmaan.online (tokens, type, nav, menu, theme
  toggle, buttons, page head, section heads, step cards, FAQ, tables,
  inputs, notices, closing band, footer, dock, reveal motion) comes from
  /assets/nirmaan.css, nirmaan.online's stylesheet copied unchanged, so the
  sites cannot drift. This file adds the components only this site has: the
  tool (steps, picker, spec card, drop zone, crop frame, controls, result),
  the exam spec table on phones, and the exam and size cards. It uses
  nirmaan.css's tokens and type, never its own: no raw colours, no radius,
  no new fonts.
*/
@layer reset, base, layout, components, pages, motion;

@layer pages {

  /* ---------- Language switch: "हिंदी" / "English", beside the theme toggle and in the menu ---------- */
  .nav__lang {
    display: inline-grid; place-items: center; min-width: 2.5rem; height: 2.5rem; padding: 0 0.75rem;
    border: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-small); font-weight: 600; line-height: 1;
    text-decoration: none; white-space: nowrap; transition: color 0.2s, border-color 0.2s;
  }
  .nav__lang:hover { color: var(--ink); border-color: var(--line-2); }
  .menu__lang { justify-self: start; display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; color: var(--blue); font-weight: 600; text-decoration: none; }
  /* Phones: with the switch beside it the name can take two lines; keep them even ("Form / Photo Kit"). */
  @media (max-width: 30rem) {
    .nav__lang { padding-inline: 0.55rem; }
    .nav .brand__word { text-wrap: balance; }
  }
  .menu__lang:hover { text-decoration: underline; }

  /* ---------- Page head, compact on pages that carry the tool ---------- */
  .page-head--tool .page-head__inner {
    gap: var(--s3);
    padding-block: clamp(1.75rem, 1rem + 3vw, 4rem) clamp(1.5rem, 1rem + 2vw, 3rem);
  }
  .page-head--tool .page-head__copy { gap: var(--s2); }
  /* The tool's own top line closes the head, so the two hairlines never double up. */
  .page-head--tool { border-bottom: 0; }
  .page-head--tool .page-head__title { font-size: var(--fs-h2); margin-block: 0; }
  .page-head--tool .lede { max-width: 52ch; }
  .page-head--tool .page-head__glyph { width: clamp(5rem, 2rem + 8vw, 10rem); }
  @media (max-width: 48rem) {
    /* Phones: the mark moves to the corner, so the tool starts on the first screen. */
    .page-head--tool .page-head__inner { position: relative; }
    .page-head--tool .page-head__mark { order: 0; position: absolute; top: clamp(1.75rem, 1rem + 3vw, 4rem); right: max(var(--gutter), env(safe-area-inset-right, 0px)); }
    .page-head--tool .page-head__glyph { width: 2.5rem; }
    .page-head--tool .crumbs, .page-head--tool .eyebrow { padding-right: 3.5rem; }
    .page-head--tool .lede { font-size: var(--fs-body); }
  }

  /* ---------- The tool ---------- */
  .tool-band { padding-block: 0 var(--s5); }
  .tool { border: 1px solid var(--line-2); background: var(--paper); }
  .tool__grid { display: grid; grid-template-columns: minmax(0, 1fr); }
  .tool__col { display: flex; flex-direction: column; min-width: 0; background: var(--paper); }
  .tool__col + .tool__col { border-top: 1px solid var(--line-2); }
  @media (min-width: 60rem) {
    .tool__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1px; background: var(--line-2); }
    .tool__col + .tool__col { border-top: 0; }
  }
  @media (max-width: 40rem) {
    /* Phones: the tool runs edge to edge, so the crop frame gets the full width. */
    .tool-band > .wrap { padding-inline: 0; }
    .tool { border-inline: 0; }
  }
  .tool__noscript { margin: var(--s3); }

  .tool__step { padding: clamp(1.25rem, 0.9rem + 1.4vw, 2.25rem) max(var(--gutter), env(safe-area-inset-left, 0px)); }
  @media (min-width: 40.01rem) { .tool__step { padding-inline: clamp(1.25rem, 0.9rem + 1.4vw, 2.25rem); } }
  .tool__step + .tool__step { border-top: 1px solid var(--line-2); }
  .tool__col > .notice + .tool__step { border-top: 1px solid var(--line-2); }

  .tool__head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: var(--s2); }
  /* Step numbers: grey until it is your turn (ink), then the blue reached mark once done. */
  .tool__n {
    display: inline-grid; place-items: center; flex: none;
    width: 2.25rem; height: 2.25rem; border: 1px solid var(--line-2);
    font-family: var(--mono); font-size: var(--fs-mono); letter-spacing: 0.06em; color: var(--ink-3);
    transition: color 0.25s, border-color 0.25s, background-color 0.25s;
  }
  .tool__step.is-current .tool__n { border-color: var(--ink); color: var(--ink); }
  .tool__step.is-done .tool__n { border-color: var(--blue); background: var(--blue-wash); color: var(--blue); }
  .tool__title {
    font-family: var(--display); font-weight: 800; font-stretch: 104%;
    font-size: 1.25rem; letter-spacing: -0.015em; line-height: 1.15;
  }
  .tool__title label { cursor: pointer; }
  .tool__hint, .tool__wait { font-size: var(--fs-small); color: var(--ink-2); max-width: 52ch; }
  .tool__hint { margin-bottom: var(--s2); }

  .tool__foot {
    display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem;
    padding: 0.9rem max(var(--gutter), env(safe-area-inset-left, 0px));
    border-top: 1px solid var(--line-2);
  }
  @media (min-width: 40.01rem) { .tool__foot { padding-inline: clamp(1.25rem, 0.9rem + 1.4vw, 2.25rem); } }
  .tool__foot span { display: inline-flex; align-items: center; gap: 0.5rem; }
  .tool__foot span::before { content: ""; width: 0.4rem; height: 0.4rem; background: var(--blue); }

  /* ---------- 01 The picker: a searchable list grouped by exam ---------- */
  .picker { position: relative; }
  .picker__box { position: relative; }
  .picker__icon { position: absolute; left: 0.95rem; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
  .picker__input { min-height: 3.25rem; padding-left: 2.6rem; padding-right: 3.25rem; font-weight: 600; text-overflow: ellipsis; }
  .picker__toggle {
    position: absolute; top: 1px; right: 1px; bottom: 1px; width: 3rem;
    display: grid; place-items: center; color: var(--ink-2);
  }
  .picker__toggle:hover { color: var(--blue); }
  .picker__toggle span { width: 0.5rem; height: 0.5rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-25%) rotate(45deg); transition: transform 0.25s var(--ease-out); }
  .picker-open .picker__toggle span { transform: translateY(25%) rotate(-135deg); }
  .picker-open .picker__input { border-color: var(--ink); }
  .picker__panel {
    position: absolute; left: 0; right: 0; top: calc(100% - 1px); z-index: 30;
    max-height: min(24rem, 55vh); overflow-y: auto; overscroll-behavior: contain;
    background: var(--paper); border: 1px solid var(--ink);
  }
  .picker__list { list-style: none; padding: 0; margin: 0; }
  .picker__group + .picker__group { border-top: 1px solid var(--line); }
  .picker__gname { position: sticky; top: 0; z-index: 1; padding: 0.65rem 0.95rem 0.35rem; background: var(--paper); }
  .picker__option {
    display: flex; align-items: baseline; justify-content: space-between; gap: 0.25rem var(--s2); flex-wrap: wrap;
    min-height: 2.75rem; padding: 0.6rem 0.95rem 0.6rem calc(0.95rem - 2px);
    border-left: 2px solid transparent; cursor: pointer;
  }
  .picker__option[aria-selected="true"] { background: var(--blue-wash); border-left-color: var(--blue); }
  .picker__label { font-weight: 600; }
  .picker__option.is-chosen .picker__label::before { content: ""; display: inline-block; width: 0.5rem; height: 0.5rem; margin-right: 0.5rem; background: var(--blue); vertical-align: 0.1em; }
  .picker__meta { font-family: var(--mono); font-size: var(--fs-mono); letter-spacing: 0.04em; color: var(--ink-3); }
  .picker__empty { padding: 1rem 0.95rem; font-size: var(--fs-small); color: var(--ink-2); }

  /* The official rule for the chosen file, as a hairline card */
  .spec-card { margin-top: var(--s2); border: 1px solid var(--line-2); }
  .spec-card:empty { display: none; }
  .spec-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem var(--s2); padding: 0.7rem 0.95rem; border-bottom: 1px solid var(--line-2); }
  .spec-card__head span:first-child { display: inline-flex; align-items: center; gap: 0.6rem; color: var(--ink); }
  .spec-card__head span:first-child::before { content: ""; width: 0.5rem; height: 0.5rem; background: var(--blue); flex: none; }
  .spec-card__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
  .spec-card__grid > div { display: grid; gap: 0.2rem; align-content: start; padding: 0.7rem 0.95rem; background: var(--paper); }
  .spec-card dt { font-family: var(--mono); font-size: var(--fs-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
  .spec-card dd { margin: 0; font-family: var(--display); font-weight: 750; font-stretch: 104%; font-size: 1.05rem; letter-spacing: -0.01em; line-height: 1.3; font-variant-numeric: tabular-nums; }
  .spec-card dd a { color: var(--blue); text-decoration-thickness: 1px; }
  .spec-card__note { padding: 0.7rem 0.95rem; border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--ink-2); }
  .spec-card__note--first { border-top: 0; }
  .spec-card__also { display: grid; gap: 0.6rem; padding: 0.8rem 0.95rem; border-top: 1px solid var(--line); }
  .spec-card__more { margin: 0.1rem 0.95rem 0.3rem; font-size: var(--fs-small); }

  /* One-tap preset switches (spec card, exam pages) */
  .chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0; }
  .chip-btn {
    display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 0.9rem;
    border: 1px solid var(--line-2); background: var(--paper); color: var(--ink);
    font-weight: 600; font-size: var(--fs-small); text-decoration: none;
    transition: border-color 0.2s, color 0.2s, background-color 0.2s;
  }
  .chip-btn:hover { border-color: var(--ink); color: var(--blue); }
  .chip-btn .btn__arrow { width: 0.7rem; height: 0.7rem; }

  /* ---------- 02 Drop zone ---------- */
  .drop {
    position: relative; isolation: isolate;
    display: grid; justify-items: center; gap: 0.3rem;
    padding: clamp(1.5rem, 1rem + 2vw, 2.5rem) 1rem; text-align: center; cursor: pointer;
    border: 1px solid var(--line-2); background: var(--paper-2);
    transition: border-color 0.2s, background-color 0.2s;
  }
  .drop__grid {
    position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 1rem 1rem;
  }
  .drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
  .drop__glyph { width: 2rem; height: 2rem; margin-bottom: 0.5rem; color: var(--ink); }
  .drop__glyph rect:last-child { fill: var(--blue); }
  .drop__title { font-family: var(--display); font-weight: 800; font-stretch: 104%; font-size: 1.3rem; letter-spacing: -0.015em; line-height: 1.15; }
  .drop__sub { font-size: var(--fs-small); color: var(--ink-2); }
  .drop:hover { border-color: var(--ink); }
  .drop.is-over { border-color: var(--blue); background: var(--blue-wash); }
  .drop:focus-within { outline: 2px solid var(--blue); outline-offset: 3px; }

  .loaded { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
  .loaded__name { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; color: var(--ink-2); }
  .loaded__name::before { content: ""; width: 0.5rem; height: 0.5rem; background: var(--blue); flex: none; }
  .loaded__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; letter-spacing: 0.04em; }
  .loaded .btn { flex: none; min-height: 2.75rem; }

  /* ---------- 03 Crop frame ---------- */
  .crop { display: grid; justify-items: center; gap: 0.6rem; }
  .viewport {
    position: relative; overflow: hidden;
    width: min(100%, 22rem); aspect-ratio: 3.5 / 4.5;
    touch-action: none; cursor: grab;
    background-color: var(--paper-2);
    background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size: 1rem 1rem;
  }
  /* The frame line sits on top of the photo, so it never changes the crop maths. */
  .viewport::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--ink); pointer-events: none; }
  .viewport:active { cursor: grabbing; }
  .viewport canvas { width: 100%; height: 100%; }
  /* Before a photo: a small frame that only shows the shape, so the steps stay close together. */
  .tool:not(.has-image) .viewport { cursor: default; width: min(100%, 11rem); }
  .tool:not(.has-image) .viewport canvas { visibility: hidden; }
  .viewport__thirds {
    position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.2s;
    background-image:
      linear-gradient(90deg, transparent calc(33.333% - 0.5px), color-mix(in srgb, var(--paper) 80%, transparent) calc(33.333% - 0.5px) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px) calc(66.666% - 0.5px), color-mix(in srgb, var(--paper) 80%, transparent) calc(66.666% - 0.5px) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px)),
      linear-gradient(transparent calc(33.333% - 0.5px), color-mix(in srgb, var(--paper) 80%, transparent) calc(33.333% - 0.5px) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px) calc(66.666% - 0.5px), color-mix(in srgb, var(--paper) 80%, transparent) calc(66.666% - 0.5px) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px));
  }
  .tool.is-dragging .viewport__thirds, .viewport:focus-visible .viewport__thirds { opacity: 1; }
  .hint { position: absolute; inset: 0; display: grid; place-items: center; padding: 1rem; text-align: center; font-size: var(--fs-small); color: var(--ink-2); pointer-events: none; }
  .tool.has-image .hint { display: none; }
  .crop__dims { letter-spacing: 0.08em; }

  .controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; margin-top: var(--s2); }
  .ctl {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    min-width: 2.75rem; height: 2.75rem; border: 1px solid var(--line-2); color: var(--ink);
    font-weight: 600; font-size: 1.25rem; line-height: 1;
    transition: border-color 0.2s, color 0.2s;
  }
  .ctl--text { padding: 0 1rem; font-size: var(--fs-small); }
  .ctl:hover { border-color: var(--ink); color: var(--blue); }
  .ctl[disabled], .zoom input[disabled] { opacity: 0.55; pointer-events: none; }
  .zoom { display: inline-flex; align-items: center; }

  /* Range inputs: a hairline track and a square block, like everything else here. */
  .tool input[type="range"] { -webkit-appearance: none; appearance: none; width: 9.5rem; height: 2.75rem; background: transparent; cursor: pointer; }
  .tool input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--line-2); }
  .tool input[type="range"]::-moz-range-track { height: 2px; background: var(--line-2); }
  .tool input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 1.25rem; height: 1.25rem; margin-top: calc(-0.625rem + 1px); border: 0; border-radius: 0; background: var(--ink); transition: background-color 0.2s; }
  .tool input[type="range"]::-moz-range-thumb { width: 1.25rem; height: 1.25rem; border: 0; border-radius: 0; background: var(--ink); }
  .tool input[type="range"]:hover::-webkit-slider-thumb, .tool input[type="range"]:focus-visible::-webkit-slider-thumb { background: var(--blue); }
  .tool input[type="range"]:hover::-moz-range-thumb, .tool input[type="range"]:focus-visible::-moz-range-thumb { background: var(--blue); }

  .adjust { margin-top: var(--s3); border-top: 1px solid var(--line); }
  .adjust summary {
    display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
    min-height: 3rem; padding-top: 0.5rem; cursor: pointer; list-style: none; font-weight: 600;
  }
  .adjust summary::-webkit-details-marker { display: none; }
  .adjust summary:hover { color: var(--blue); }
  .adjust .faq__icon { width: 1rem; height: 1rem; }
  .adjust .faq__icon::before, .adjust .faq__icon::after { height: 2px; margin-top: -1px; }
  .adjust[open] .faq__icon::after { transform: rotate(0deg); }
  .adjust__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr)); gap: var(--s2); padding-block: var(--s1) var(--s2); }
  .strength input[type="range"] { width: 100%; }

  /* Square tick box */
  .tick { display: flex; align-items: flex-start; gap: 0.75rem; min-height: 2.75rem; padding-block: 0.6rem; font-size: var(--fs-small); cursor: pointer; }
  .tick input {
    -webkit-appearance: none; appearance: none; flex: none; display: grid; place-content: center;
    width: 1.25rem; height: 1.25rem; margin: 0.1rem 0 0; border: 1px solid var(--ink-3); border-radius: 0; background: var(--paper); cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
  }
  .tick input::before { content: ""; width: 0.75rem; height: 0.75rem; background: var(--blue-ink); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); transform: scale(0); transition: transform 0.15s var(--ease-out); }
  .tick input:checked { background: var(--blue); border-color: var(--blue); }
  .tick input:checked::before { transform: scale(1); }
  .tick:hover input { border-color: var(--ink); }

  /* ---------- 04 Result ---------- */
  .tool__col > .notice { margin: 0 max(var(--gutter), env(safe-area-inset-left, 0px)) var(--s3); }
  @media (min-width: 40.01rem) { .tool__col > .notice { margin-inline: clamp(1.25rem, 0.9rem + 1.4vw, 2.25rem); } }
  .result__top { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--s3); }
  .result__fig {
    display: grid; place-items: center; margin: 0; padding: 0.5rem;
    width: clamp(6.5rem, 28vw, 9rem); aspect-ratio: 1;
    border: 1px solid var(--line-2); background: var(--paper-2);
  }
  .result__fig img { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; outline: 1px solid var(--line-2); }
  .result__kb { font-size: clamp(2.25rem, 1.6rem + 2.4vw, 3.25rem); font-variant-numeric: tabular-nums; }
  .result__meta { margin-top: 0.6rem; letter-spacing: 0.06em; }

  /* The checks: a hairline list; each passed check gets the blue reached mark. */
  .checks { list-style: none; padding: 0; margin: var(--s3) 0; border-top: 1px solid var(--line-2); }
  .checks li {
    display: grid; grid-template-columns: 0.75rem minmax(0, 6.5rem) minmax(0, 1fr); align-items: baseline; gap: 0.25rem 0.75rem;
    padding-block: 0.75rem; border-bottom: 1px solid var(--line); font-size: var(--fs-small);
  }
  .checks li::before { content: ""; width: 0.75rem; height: 0.75rem; background: var(--blue); transform: translateY(0.05em); }
  .checks li.is-info::before { background: var(--line-2); }
  .checks__k { font-family: var(--mono); font-size: var(--fs-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
  .checks li.is-info .checks__v { color: var(--ink-2); }
  .result__download { width: 100%; }
  .result__download:hover .btn__arrow, .tool-dock .dock__cta:hover .btn__arrow { transform: translateY(0.2rem); }

  /* The download dock reuses nirmaan.css's .dock; tool.js shows it. */
  .tool-dock .dock__cta { font-variant-numeric: tabular-nums; }

  /* ---------- Exam spec table (nirmaan.css .compare), stacked on phones ---------- */
  .spec-table { min-width: 44rem; }
  .spec-table tbody th { width: auto; }
  .spec-table td.spec-table__rules { min-width: 16rem; font-size: 0.875rem; }
  .spec-table td b { font-size: 1.05rem; white-space: nowrap; }
  .spec-table td[data-label="Dimensions"] { white-space: nowrap; }
  /* position: relative keeps the button's screen-reader text inside the scrolling table. */
  .spec-table__use { white-space: nowrap; position: relative; }
  .spec-table .chip-btn { min-height: 2.5rem; }
  /* Phones and small tablets: each file becomes its own block of label and value rows. */
  @media (max-width: 56rem) {
    .compare-wrap:has(.spec-table) { overflow: visible; border: 0; border-top: 1px solid var(--line-2); }
    .spec-table { min-width: 0; }
    .spec-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .spec-table tr { display: block; padding-block: var(--s2) var(--s3); border-bottom: 1px solid var(--line-2); }
    .spec-table tbody th { display: block; padding: 0 0 0.6rem; border: 0; font-family: var(--display); font-weight: 800; font-stretch: 104%; font-size: 1.3rem; letter-spacing: -0.015em; }
    .spec-table td { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.75rem; padding: 0.45rem 0; border: 0; white-space: normal; }
    .spec-table td::before { content: attr(data-label); font-family: var(--mono); font-size: var(--fs-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); padding-top: 0.2rem; }
    .spec-table td.spec-table__rules { min-width: 0; }
    .spec-table td.spec-table__use { display: block; padding-top: 0.75rem; }
    .spec-table td.spec-table__use::before { content: none; }
    .spec-table td:empty { display: none; }
  }
  /* Exam KB limits on the Hindi how-to page: three short columns, so no sideways scroll on phones. */
  .limits-table { min-width: 0; }
  .limits-table tbody th { width: auto; }
  .limits-table td b { white-space: nowrap; }
  @media (max-width: 40rem) { .limits-table th, .limits-table td { padding: 0.75rem 0.6rem; } .limits-table td b { font-size: 1rem; } }
  .source-line { margin-top: var(--s2); font-size: var(--fs-small); color: var(--ink-2); max-width: 72ch; }
  .source-line a { color: var(--blue); }

  /* ---------- Exam cards and size tiles: hairline grids ---------- */
  .exam-grid, .size-grid {
    display: grid; list-style: none; padding: 0; margin: 0;
    border-top: 1px solid var(--line-2); border-left: 1px solid var(--line-2);
  }
  .exam-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); }
  .exam-card, .size-tile {
    position: relative; display: grid; align-content: start;
    border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
    background: var(--paper); transition: background-color 0.25s;
  }
  .exam-card { gap: 0.5rem; padding: clamp(1rem, 0.8rem + 0.8vw, 1.5rem); }
  .exam-card:hover, .size-tile:hover { background: var(--paper-2); }
  .exam-card:has(a:focus-visible), .size-tile:has(a:focus-visible) { outline: 2px solid var(--blue); outline-offset: -2px; }
  .exam-card__name { font-family: var(--display); font-weight: 800; font-stretch: 106%; font-size: clamp(1.2rem, 1.05rem + 0.5vw, 1.5rem); letter-spacing: -0.02em; line-height: 1.1; }
  .exam-card__name a { color: inherit; text-decoration: none; }
  .exam-card__name a:focus-visible { outline: none; }
  .exam-card__name a::before { content: ""; position: absolute; inset: 0; }
  .exam-card__specs { display: grid; gap: 0.15rem; list-style: none; padding: 0; margin: 0; font-size: 0.875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
  .exam-card__specs b { font-weight: 600; color: var(--ink); }
  .exam-card__more { margin-top: 0.35rem; color: var(--ink-3); transition: color 0.2s; }
  .exam-card:hover .exam-card__more { color: var(--blue); }
  .exam-card--other { background: var(--paper-2); }
  @media (max-width: 40rem) {
    .exam-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .exam-card__more { display: none; }
  }

  .size-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .size-tile { gap: 0.2rem; padding: 1.1rem 1rem 1rem; }
  .size-tile__n { font-family: var(--display); font-weight: 800; font-stretch: 112%; font-size: clamp(2rem, 1.5rem + 1.6vw, 3rem); letter-spacing: -0.03em; line-height: 0.95; font-variant-numeric: tabular-nums; }
  .size-tile__n a { color: inherit; text-decoration: none; }
  .size-tile__n a:focus-visible { outline: none; }
  .size-tile__n a::before { content: ""; position: absolute; inset: 0; }
  .size-tile__n small { margin-left: 0.2rem; font-family: var(--mono); font-weight: 400; font-stretch: 100%; font-size: var(--fs-mono); letter-spacing: 0.12em; color: var(--ink-3); }
  .size-tile__t { font-size: 0.875rem; color: var(--ink-2); }
  .size-tile[aria-current="page"], .size-tile.is-current { background: var(--blue-wash); }
  .size-tile.is-current .size-tile__n { color: var(--blue); }
  @media (max-width: 56rem) { .size-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .size-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } /* Hindi pages: the sizes with a Hindi page */

  .more-links { margin-top: var(--s3); }

  /* Section bits this site uses inside nirmaan.css sections */
  .section__head--tight { margin-bottom: var(--s4); }
  .section__title--sm { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.5rem); }
  .copy { display: grid; gap: var(--s2); max-width: 62ch; color: var(--ink-2); }
  .copy strong { color: var(--ink); font-weight: 600; }
  .copy a, .faq__answer a { color: var(--blue); }

  /* 404 */
  .lost .actions { margin-top: var(--s2); }
}

/* Touch: the small text links here get an invisible 44px hit area, as in nirmaan.css. */
@media (pointer: coarse) {
  .spec-card__head a, .source-line a, .spec-card dd a { position: relative; }
  .spec-card dd a::after, .source-line a::after { content: ""; position: absolute; inset: -0.75rem -0.5rem; }
}

@layer motion {
  @media (prefers-reduced-motion: no-preference) {
    /* Latch: each passed check's mark lands in turn as the result arrives. */
    .motion .checks li::before { animation: fp-latch 0.4s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
    @keyframes fp-latch { from { transform: translateY(0.05em) scale(0); } }
    /* The reached mark on a step number stamps in once. */
    .motion .tool__step.is-done .tool__n { animation: fp-stamp 0.35s var(--ease-out); }
    @keyframes fp-stamp { from { transform: scale(1.18); } }
    /* The drop zone's glyph assembles bottom row first. */
    .motion .drop__glyph rect { animation: cell-drop 0.7s var(--ease-out) both; animation-delay: calc(250ms + var(--i) * 45ms); }
  }
}
