    :root {
      --navy: #222E65;
      --cyan: #00ADEE;
      --green: #63BB46;
      --amber: #FFB81C;
      --gray: #61666A;
      --red: #D64545;
      /* functional status only, not a brand color */
      --bg: #EEF1F7;
      --card: #FFFFFF;
      --ink: #1A2140;
      --line: #DCE1EC;
      --shadow: 0 6px 24px rgba(34, 46, 101, .10);
    }

    * {
      box-sizing: border-box;
      -webkit-tap-highlight-color: transparent;
    }

    html,
    body {
      margin: 0;
      padding: 0;
    }

    body {
      font-family: 'Montserrat', sans-serif;
      background: var(--bg);
      color: var(--ink);
      min-height: 100dvh;
      display: flex;
      justify-content: center;
    }

    /* phone-shaped column; full width on real phones, framed on desktop */
    .app {
      width: 100%;
      max-width: 440px;
      min-height: 100dvh;
      background: var(--bg);
      display: flex;
      flex-direction: column;
      position: relative;
    }

    /* ---------- header ---------- */
    header {
      background: var(--navy);
      color: #fff;
      padding: calc(env(safe-area-inset-top) + 16px) 20px 16px;
      display: flex;
      align-items: center;
      gap: 10px;
      position: sticky;
      top: 0;
      z-index: 10;
    }

    header .mark {
      width: 30px;
      height: 30px;
      flex: none;
      display: grid;
      place-items: center;
      border: 2px solid var(--cyan);
      border-radius: 8px;
    }

    header .mark svg {
      width: 17px;
      height: 17px;
    }

    header h1 {
      font-size: 15px;
      font-weight: 800;
      letter-spacing: .14em;
      margin: 0;
      text-transform: uppercase;
    }

    header h1 span {
      color: var(--cyan);
    }

    main {
      flex: 1;
      padding: 20px;
    }

    /* ---------- capture screen ---------- */
    .capture {
      display: flex;
      flex-direction: column;
      gap: 18px;
      padding-top: 8px;
    }

    .capture .lede {
      font-size: 14px;
      color: var(--gray);
      line-height: 1.5;
      margin: 0 0 2px;
    }

    .shot {
      aspect-ratio: 4/5;
      border: 2px dashed var(--line);
      border-radius: 18px;
      background: #fff;
      display: grid;
      place-items: center;
      overflow: hidden;
      position: relative;
    }

    .shot img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
    }

    .shot .placeholder {
      text-align: center;
      color: var(--gray);
      padding: 24px;
    }

    .shot .placeholder svg {
      width: 46px;
      height: 46px;
      opacity: .5;
      margin-bottom: 10px;
    }

    .shot .placeholder p {
      margin: 0;
      font-size: 13px;
      font-weight: 600;
    }

    input[type=file] {
      display: none;
    }

    .btn {
      border: none;
      border-radius: 14px;
      cursor: pointer;
      font-family: inherit;
      font-weight: 700;
      font-size: 16px;
      padding: 17px;
      width: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      transition: transform .08s ease, opacity .15s ease;
    }

    .btn:active {
      transform: scale(.985);
    }

    .btn svg {
      width: 20px;
      height: 20px;
    }

    .btn-primary {
      background: var(--cyan);
      color: #fff;
    }

    .btn-navy {
      background: var(--navy);
      color: #fff;
    }

    .btn-ghost {
      background: transparent;
      color: var(--navy);
      border: 2px solid var(--line);
    }

    .btn[disabled] {
      opacity: .4;
      pointer-events: none;
    }

    /* ---------- loading ---------- */
    .loading {
      display: none;
      flex-direction: column;
      align-items: center;
      gap: 18px;
      padding: 64px 0;
    }

    .loading.show {
      display: flex;
    }

    .spinner {
      width: 46px;
      height: 46px;
      border-radius: 50%;
      border: 4px solid var(--line);
      border-top-color: var(--cyan);
      animation: spin .8s linear infinite;
    }

    @keyframes spin {
      to {
        transform: rotate(360deg);
      }
    }

    .loading p {
      color: var(--gray);
      font-weight: 600;
      font-size: 14px;
      margin: 0;
    }

    /* ---------- results screen ---------- */
    .results {
      display: none;
    }

    .results.show {
      display: block;
    }

    .reveal {
      opacity: 0;
      transform: translateY(10px);
      animation: rise .45s ease forwards;
    }

    @keyframes rise {
      to {
        opacity: 1;
        transform: none;
      }
    }

    /* gate-fail banner */
    .gatefail {
      background: #fff;
      border-radius: 18px;
      padding: 22px;
      box-shadow: var(--shadow);
      border-left: 6px solid var(--amber);
      text-align: center;
    }

    .gatefail .icon {
      font-size: 30px;
      line-height: 1;
    }

    .gatefail h2 {
      margin: 12px 0 6px;
      font-size: 18px;
      font-weight: 800;
    }

    .gatefail p {
      margin: 0;
      color: var(--gray);
      font-size: 14px;
      line-height: 1.5;
    }

    /* rating hero */
    .hero {
      border-radius: 20px;
      padding: 30px 22px;
      color: #fff;
      box-shadow: var(--shadow);
      position: relative;
      overflow: hidden;
      margin-bottom: 18px;
    }

    .hero::after {
      content: "";
      position: absolute;
      right: -40px;
      top: -40px;
      width: 150px;
      height: 150px;
      border-radius: 50%;
      background: rgba(255, 255, 255, .10);
    }

    .hero .eyebrow {
      font-size: 11px;
      font-weight: 700;
      letter-spacing: .18em;
      text-transform: uppercase;
      opacity: .85;
      margin: 0 0 8px;
    }

    .hero .grade {
      font-size: 38px;
      font-weight: 900;
      letter-spacing: -.01em;
      line-height: 1;
      margin: 0;
      text-transform: uppercase;
    }

    .hero .confidence {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      margin-top: 16px;
      background: var(--ink);
      color: #fff;
      padding: 6px 12px;
      border-radius: 999px;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: .03em;
    }

    .hero .confidence .dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #fff;
    }

    .grade-a {
      background: linear-gradient(135deg, #63BB46, #4E9E36);
    }

    .grade-b {
      background: linear-gradient(135deg, #FFB81C, #E59E00);
      color: #2A2300;
    }

    .grade-a .confidence,
    .grade-b .confidence {}

    /* keep readable */
    .grade-b .eyebrow {
      opacity: .8;
    }

    .grade-nb {
      background: linear-gradient(135deg, #D64545, #B5363B);
    }

    /* improvements */
    .section-label {
      font-size: 12px;
      font-weight: 800;
      letter-spacing: .1em;
      text-transform: uppercase;
      color: var(--gray);
      margin: 4px 4px 12px;
    }

    .imp-list {
      display: flex;
      flex-direction: column;
      gap: 10px;
      list-style: none;
      padding: 0;
      margin: 0;
    }

    .imp {
      background: var(--card);
      border-radius: 14px;
      padding: 16px;
      box-shadow: var(--shadow);
      display: flex;
      gap: 13px;
      align-items: flex-start;
      cursor: pointer;
      transition: background .15s ease;
    }

    .imp .num {
      flex: none;
      width: 26px;
      height: 26px;
      border-radius: 8px;
      background: var(--navy);
      color: #fff;
      display: grid;
      place-items: center;
      font-size: 13px;
      font-weight: 800;
      transition: background .15s ease;
    }

    .imp .txt {
      font-size: 14px;
      line-height: 1.45;
      font-weight: 500;
      padding-top: 2px;
    }

    .imp.done {
      background: #F4F7F1;
    }

    .imp.done .num {
      background: var(--green);
    }

    .imp.done .txt {
      color: var(--gray);
      text-decoration: line-through;
    }

    .all-clear {
      background: #F4F7F1;
      border-radius: 16px;
      padding: 24px;
      text-align: center;
      border: 1px solid #D9E8CF;
    }

    .all-clear .check {
      font-size: 28px;
    }

    .all-clear p {
      margin: 8px 0 0;
      font-weight: 700;
      color: #4E9E36;
    }

    .footer-actions {
      margin-top: 24px;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    footer.legal {
      text-align: center;
      color: var(--gray);
      font-size: 11px;
      padding: 14px 20px calc(env(safe-area-inset-bottom) + 18px);
    }