/* The request page (mockups/intake/request.html). Loads after
   design-system.css and app.css (the AP chrome: top nav, .over-head, .doc,
   .paper, .rail-r, .card, .btn). Only what this page adds: the request list,
   the email card and photo frame in the document pane, and the field rows
   by confidence. Nothing below 11px outside .paper. */

  .req-main { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: calc(100vh - var(--top-h)); min-height: 0; }

  /* ── the list ─────────────────────────────────────────────────────────── */
  .req-list { overflow: auto; border-right: 1px solid var(--color-border-subtle); background: var(--color-bg-app); }
  .req-list .head { display: flex; align-items: baseline; gap: 8px; padding: 14px 14px 8px; }
  .req-list .head h2 { margin: 0; font-size: 14px; font-weight: 600; color: var(--color-text-primary); }
  .req-list .head .count { font-size: 11px; color: var(--color-text-tertiary); }
  .req-list .row { display: block; padding: 10px 14px; border-top: 1px solid var(--color-border-subtle); text-decoration: none; color: inherit; }
  .req-list .row:hover { background: var(--color-bg-hover); }
  .req-list .row[aria-selected="true"] { background: var(--color-bg-active); box-shadow: inset 2px 0 0 var(--color-accent); }
  .req-list .l1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .req-list .id { font-size: 13px; font-weight: 600; color: var(--color-text-primary); font-variant-numeric: tabular-nums; }
  .req-list .l2 { font-size: 12px; color: var(--color-text-primary); margin-top: 3px; }
  .req-list .l3, .req-list .l4 { font-size: 11px; color: var(--color-text-tertiary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .pill.ok { background: color-mix(in srgb, var(--color-status-done) 14%, transparent); color: var(--color-status-done); }
  .pill.warn { background: color-mix(in srgb, var(--color-status-progress) 14%, transparent); color: var(--color-status-progress); }

  /* ── the page ─────────────────────────────────────────────────────────── */
  .req-page { display: flex; flex-direction: column; min-height: 0; background: var(--color-bg-base); }
  .req-page .over-head { border-top-left-radius: 0; }
  .req-page .over-head .why { font-size: 12px; color: var(--color-text-tertiary); }
  .req-page .over-head .links a { text-decoration: none; }
  .req-page .over-body { grid-template-columns: minmax(0, 1fr) 520px; }
  .req-page .doc .docs { padding: 16px; display: flex; flex-direction: column; gap: 14px; align-items: center; }

  /* The email, as a card: not paper, it is a message. The marks are the
     spans a field points back to. */
  .mailcard { width: 100%; max-width: 640px; border: 1px solid var(--color-border-default); border-radius: var(--radius-lg); background: var(--color-bg-elevated); padding: 12px 14px; }
  .mailcard .mh { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin-bottom: 8px; }
  .mailcard .who { font-size: 12px; font-weight: 600; color: var(--color-text-primary); }
  .mailcard .tm { font-size: 11px; color: var(--color-text-tertiary); text-align: right; }
  .mailcard .tm .later { color: var(--color-status-progress); }
  .mailcard .subj { grid-column: 1 / -1; font-size: 12px; color: var(--color-text-secondary); }
  .mailcard .mb { font-size: 13px; line-height: 1.55; color: var(--color-text-primary); }
  .mailcard .mb .quoted { display: block; margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--color-border-default); color: var(--color-text-secondary); font-size: 12px; }
  .mailcard .atts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .mailcard .att { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-full); background: var(--color-bg-active); color: var(--color-text-secondary); }
  .doc mark { background: color-mix(in srgb, var(--color-accent) 18%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; transition: background-color 200ms; }
  .paper mark { background: #fff3b0; }
  .doc .flash { animation: flash 1.2s ease-out; }
  .doc mark.flash { animation: markflash 1.2s ease-out; }
  @keyframes flash { 0% { box-shadow: 0 0 0 3px var(--color-accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
  @keyframes markflash { 0% { background: var(--color-accent); color: var(--color-primary-foreground); } 100% { } }

  /* A document in the pane: a short sheet, not a letter page. */
  .paper.req { width: 100%; max-width: 640px; min-height: 0; padding: 26px 30px; }
  .paper.req .lh h3 { font-size: 13px; letter-spacing: .08em; }
  .paper.req table.facts2 { margin-top: 12px; }
  .paper.req table.facts2 th { width: 120px; text-align: left; font-size: 10px; letter-spacing: .08em; color: #5a5a63; border-bottom: 1px solid #e4e4e0; padding: 6px 0; text-transform: uppercase; font-weight: 600; vertical-align: top; }
  .paper.req table.facts2 td { padding: 6px 0; font-size: 11px; border-bottom: 1px solid #e4e4e0; }
  .paper.req .hand { margin-top: 14px; font-family: "Bradley Hand", "Segoe Print", "Comic Sans MS", cursive; font-size: 13px; color: #1d3f8f; transform: rotate(-1.5deg); }
  .paper.req .hand mark { background: #fff3b0; }

  /* A photo: a frame with what the picture shows written under it. The
     prototype carries no customer photos. */
  .photo { width: 100%; max-width: 640px; margin: 0; }
  .photo .frame { height: 180px; border-radius: var(--radius-lg); border: 1px dashed var(--color-border-strong); background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--color-border-subtle) 60%, transparent) 10px 11px); display: grid; place-items: center; color: var(--color-text-tertiary); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
  .photo figcaption { font-size: 12px; color: var(--color-text-secondary); margin-top: 6px; line-height: 1.5; }

  /* ── the right column ─────────────────────────────────────────────────── */
  .reqpair .cell .v { font-size: 20px; }
  .card.fields { padding: 2px 0; }
  .fr { display: grid; grid-template-columns: 108px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 7px 12px; border-top: 1px solid var(--color-border-subtle); font-size: 12px; }
  .fr:first-child { border-top: 0; }
  .fr .k { color: var(--color-text-tertiary); padding-top: 1px; }
  .fr .v { color: var(--color-text-primary); display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
  .fr .s { font-size: 11px; color: var(--color-text-tertiary); text-decoration: none; border-bottom: 1px dotted var(--color-border-strong); }
  .fr .s:hover { color: var(--color-text-accent); border-bottom-color: var(--color-text-accent); }
  .fr .s.you { border: 0; }
  .fr .hint { flex-basis: 100%; font-size: 11px; color: var(--color-status-progress); }
  .fr .alt { flex-basis: 100%; font-size: 11px; color: var(--color-text-secondary); display: flex; align-items: center; gap: 6px; }
  .fr .act { display: flex; gap: 4px; }
  .fr.medium .pip { width: 7px; height: 7px; border-radius: 50%; background: var(--color-status-progress); align-self: center; }
  .fr.medium { background: color-mix(in srgb, var(--color-status-progress) 6%, transparent); }
  .fr.low .v { color: var(--color-text-secondary); }
  .fr .sug { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-tertiary); padding: 1px 5px; border: 1px solid var(--color-border-default); border-radius: var(--radius-sm); }
  .fr.ask .none { color: var(--color-text-tertiary); }
  .fr .chip { font-size: 11px; padding: 1px 7px; border-radius: var(--radius-full); background: var(--color-bg-active); color: var(--color-text-secondary); }
  .fr .tick { font-size: 11px; color: var(--color-status-done); white-space: nowrap; }
  .fr .edit { font: inherit; font-size: 12px; width: 100%; height: 24px; padding: 0 6px; border-radius: var(--radius-sm); border: 1px solid var(--color-accent); background: var(--color-bg-base); color: var(--color-text-primary); }
  .mini { height: 22px; padding: 0 8px; border-radius: var(--radius-sm); border: 1px solid var(--color-border-default); background: transparent; color: var(--color-text-secondary); font-size: 11px; cursor: pointer; white-space: nowrap; }
  .mini:hover { background: var(--color-bg-hover); color: var(--color-text-primary); }
  .mini.primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-primary-foreground); }
  .mini.primary:hover { background: var(--color-accent-hover); }
  .mini.ghost { opacity: 0; }
  .fr:hover .mini.ghost { opacity: 1; }

  .kvl { padding: 4px 0; }
  .kvl > div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 12px; border-top: 1px solid var(--color-border-subtle); font-size: 12px; }
  .kvl > div:first-child { border-top: 0; }
  .kvl .k { color: var(--color-text-tertiary); }
  .kvl .v { color: var(--color-text-primary); text-align: right; }
  .kvl .v b { font-weight: 600; }

  .card.reply { padding: 10px 12px; font-size: 12px; }
  .card.reply .to { font-size: 11px; color: var(--color-text-tertiary); margin-bottom: 6px; }
  .card.reply p { margin: 0 0 6px; color: var(--color-text-primary); line-height: 1.5; }
  .card.reply ul { margin: 0; padding-left: 16px; color: var(--color-text-primary); }
  .card.reply li { margin: 2px 0; background: color-mix(in srgb, var(--color-accent) 14%, transparent); border-radius: 3px; padding: 1px 4px; width: fit-content; }

  .req-page .over-foot { gap: 8px; align-items: center; flex-wrap: wrap; }
  .req-page .over-foot .foot-note { font-size: 12px; color: var(--color-text-tertiary); margin-left: auto; }
  .req-page .over-foot .auto { font-size: 12px; color: var(--color-status-done); margin-right: auto; }
  .req-page .over-foot .done { flex-basis: 100%; border-top: 0; padding: 6px 0 0; background: none; }

  .top .lnk { margin-left: 8px; }
