/* Screen presentation only. The report artwork and exported layout are unchanged. */
@media screen {
  :root {
    --navy: #192b40;
    --navy-2: #243b53;
    --blue: #294963;
    --ink: #202b37;
    --muted: #626d78;
    --surface: #f4f5f5;
    --radius: 8px;
    --shadow: none;
  }

  body { background: var(--surface); }
  [hidden] { display: none !important; }
  button, a, input, select { -webkit-tap-highlight-color: transparent; }
  button:focus-visible, a:focus-visible {
    outline: 2px solid #294963;
    outline-offset: 3px;
  }
  input, select, textarea { scroll-margin-block: 155px 24px; }

  .topbar {
    padding: max(16px, env(safe-area-inset-top)) 24px 16px;
    border-bottom: 1px solid #dce0e3;
    color: var(--navy);
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
  }
  .topbar-inner { max-width: 1360px; }
  .brand-title {
    font-size: 20px;
    font-weight: 750;
    letter-spacing: -.025em;
    line-height: 1.2;
  }
  .brand-subtitle {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.3;
  }
  .toolbar { overflow: visible; gap: 8px; }
  .btn {
    min-height: 44px;
    border-radius: 6px;
    font-weight: 650;
    transition: background .15s ease, border-color .15s ease;
  }
  .btn:hover, .btn:active { transform: none; box-shadow: none; }
  .btn.small { min-height: 40px; }
  .btn.secondary, .signature-actions .btn.secondary {
    border-color: #d3d9df;
    color: var(--navy);
    background: #fff;
  }
  .btn.secondary:hover { background: #f1f3f5; border-color: #aab6c2; }
  #pdfButton { color: #fff; background: var(--navy); }
  #pdfButton:hover { background: #2c425a; }
  #pngButton { min-width: 118px; }
  .app-main {
    width: min(1360px, calc(100% - 48px));
    margin: 32px auto 40px;
    gap: 28px;
  }
  .editor { gap: 20px; }
  .intro { padding: 0 0 8px; gap: 20px; }
  .eyebrow { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .12em; }
  h1 { font-size: 32px; font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
  .intro-copy { margin-top: 7px; font-size: 13px; }
  .report-meta { flex-shrink: 0; text-align: right; }
  .report-date-pill {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: none;
    font-size: 12px;
    font-weight: 600;
  }
  .save-state { display: block; margin: 5px 0 0; color: var(--muted); font-size: 11px; }
  .card { border: 1px solid #dce0e3; background: #fff; box-shadow: none; }
  .card-head { padding: 20px; align-items: flex-start; gap: 12px; border-bottom-color: #e7eaed; }
  .section-number {
    width: auto;
    min-width: 24px;
    height: auto;
    padding-top: 2px;
    color: #778390;
    background: none;
    border-radius: 0;
    font-size: 12px;
    font-weight: 550;
    font-variant-numeric: tabular-nums;
  }
  .card-title h2 { font-size: 16px; font-weight: 650; }
  .card-title p { margin-top: 5px; font-size: 12px; line-height: 1.45; }
  .card-body { padding: 20px; }
  .form-grid { gap: 18px 14px; }
  label { font-size: 12px; font-weight: 600; }
  input, select, textarea { border-radius: 5px; border-color: #cbd2d8; background: #fff; }
  input, select { min-height: 48px; }
  input::placeholder, textarea::placeholder { color: #7d8791; }
  input:focus, textarea:focus, select:focus {
    border-color: #526d88;
    box-shadow: 0 0 0 2px rgba(41,73,99,.1);
    background: #fff;
  }
  /* iOS 26 adds native date/time padding outside a 100% width input.
     Put the border and horizontal spacing on a regular container instead. */
  .date-time-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border: 1px solid #cbd2d8;
    border-radius: 5px;
    padding: 0 10px;
    background: #fff;
  }
  .date-time-control:focus-within {
    border-color: #526d88;
    box-shadow: 0 0 0 2px rgba(41,73,99,.1);
  }
  .date-time-control:has(input:disabled) { background: #f1f4f8; }
  .date-time-control > input[type="date"],
  .date-time-control > input[type="time"] {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-width: 0;
    min-inline-size: 0;
    max-width: 100%;
    min-height: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    font-size: 16px;
    line-height: 46px;
    text-align: left;
  }
  .date-time-control input::-webkit-date-and-time-value {
    min-width: 0;
    min-height: 1.5em;
    margin: 0;
    padding: 0;
    line-height: 46px;
    text-align: left;
  }
  .date-time-control input::-webkit-datetime-edit { padding: 0; }
  .field-hint { line-height: 1.5; }
  .print-color-options { border-radius: 6px; padding: 3px; gap: 3px; background: #f3f4f5; }
  .print-color-option { min-height: 40px; min-width: 92px; border-radius: 4px; }
  .print-color-option[aria-pressed="true"] { box-shadow: none; }
  .activity-pages { padding: 14px 20px; background: #fafbfb; gap: 12px; }
  .activity-page-label { font-weight: 600; }
  .activity-page-actions { gap: 6px; }
  .activity-page-actions .btn { color: var(--navy); border-color: #d3d9df; }
  .activity-page-actions .btn.add-page { color: #fff; background: var(--navy); }
  .activity-page-actions .btn.remove-page { border-color: #e3d4d2; color: #8a3830; background: #fff; }
  .log-head { padding-top: 12px; font-weight: 600; }
  .log-row { gap: 8px; border-bottom-color: #e6e9ec; }
  .row-index { color: #778390; background: none; font-size: 11px; font-weight: 500; }
  .log-row:focus-within { background: #f7f9fa; }
  .log-row > div { min-width: 0; }
  .handover-panel { border-radius: 6px; background: #f7f8f9; border-color: #dce0e3; }
  .signoff-grid { gap: 16px; }
  /* .field spans belong to the 12-column form, not these two-column rows. */
  .sign-card .two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sign-card .two-up > .field { grid-column: auto; min-width: 0; }
  .sign-card { border-radius: 6px; background: #fff; border-color: #dce0e3; }
  .sign-card h3 { font-weight: 650; }
  .signature-wrap { border-radius: 5px; border-color: #99a5b1; }
  .signature-label { color: #707c88; letter-spacing: .035em; }
  .requirement-note { margin-top: 5px; font-size: 11px; font-weight: 400; }
  .workflow-status, .workflow-status.locked {
    border-radius: 6px;
    border-color: #d3dae0;
    background: #f5f7f8;
  }
  .status-icon, .workflow-status.locked .status-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    color: var(--navy);
    background: #e4e9ed;
    font-size: 13px;
    font-weight: 600;
  }
  .acknowledgement { border-radius: 6px; background: #fff; border-color: #dce0e3; }
  .acknowledgement label { font-weight: 400; font-size: 13px; }
  .acknowledgement-note { font-size: 11px; }
  .delivery-box { padding: 16px 0 0; border: 0; border-radius: 0; background: #fff; }
  .delivery-box h3 { font-size: 13px; font-weight: 650; }
  .recipient-list { gap: 0; border-top: 1px solid #e6e9ec; }
  .recipient-row { border: 0; border-bottom: 1px solid #e6e9ec; border-radius: 0; padding: 12px 0; }
  .recipient-name { font-weight: 600; }
  .recipient-email { font-size: 12px; overflow-wrap: anywhere; white-space: normal; }
  .workflow-actions { gap: 10px; margin-top: 20px; }
  .workflow-actions .btn.email { color: var(--navy); background: #fff; border-color: #bfcbd5; }
  .workflow-actions .btn.correction { border-color: #bfcbd5; color: var(--navy); background: #fff; }
  .reset-action { margin-top: 20px; padding-top: 12px; border-top: 1px solid #e6e9ec; }
  .reset-action .btn.danger { border-color: transparent; padding-left: 0; color: #8a3830; background: none; font-size: 12px; }
  .preview-panel { top: 105px; border-radius: 8px; box-shadow: none; background: #e9ecee; }
  .preview-head { border-radius: 8px 8px 0 0; background: #fff; }
  .preview-stage { max-height: calc(100vh - 170px); }
  .site-credit {
    max-width: 640px;
    margin: 0 auto 32px;
    padding: 18px 0 0;
    border: 0;
    border-top: 1px solid #d3d9df;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  .credit-mark { width: 30px; height: 30px; border-radius: 4px; color: var(--navy); background: #e4e9ed; }
  .credit-copy strong { font-weight: 550; }
  .site-credit a { border: 0; min-height: 44px; padding: 6px 0 6px 10px; font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
  .site-credit a:hover { background: none; }
  .toast { border-radius: 6px; background: #243b53; box-shadow: none; font-weight: 500; }

  @media (max-width: 1050px) {
    .app-main { max-width: 760px; grid-template-columns: 1fr; }
    .intro { align-items: flex-start; }
    .preview-stage { max-height: none; }
  }

  @media (max-width: 720px) {
    .topbar { padding: max(14px, env(safe-area-inset-top)) 16px 12px; }
    .topbar-inner { gap: 13px; }
    .brand-title { font-size: 19px; }
    .toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 0; }
    .toolbar .btn { min-width: 0; min-height: 44px; padding: 8px 5px; font-size: 12px; line-height: 1.2; white-space: normal; }
    #pngButton { min-width: 0; }
    .app-main { width: calc(100% - 24px); margin: 24px auto 32px; }
    .editor { gap: 18px; }
    .intro { padding: 0 4px 4px; gap: 16px; }
    h1 { font-size: 29px; }
    .report-meta { width: 100%; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 12px; text-align: left; }
    .save-state { margin: 0; }
    .card { border-radius: 7px; }
    .card-head { padding: 18px 16px; gap: 10px; }
    .card-body { padding: 18px 16px; }
    .form-grid { gap: 16px 12px; }
    .field, .field.span-6, .field.span-8 { grid-column: span 6; }
    .field.span-12, .field:has(#officerName), .field:has(#employeeId), .field:has(#totalHours) { grid-column: 1 / -1; }
    input, select, textarea { min-width: 0; max-width: 100%; font-size: 16px; }
    .activity-pages { padding: 14px 16px; }
    .activity-page-label { width: 100%; }
    .activity-page-actions { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .activity-page-actions .btn { min-width: 0; min-height: 44px; padding: 8px 4px; font-size: 12px; }
    .activity-page-actions .remove-page { grid-column: 1 / -1; justify-self: end; padding-inline: 12px; }
    .log-head { display: none; }
    .log-row { grid-template-columns: 28px minmax(0, 1fr); gap: 8px; padding: 14px 16px 16px; }
    .row-index { width: 24px; height: 32px; margin: 0; align-self: center; }
    .log-row > div:nth-child(2) { display: flex; align-items: center; gap: 8px; justify-self: end; }
    .log-row > div:nth-child(2)::before { content: "Time"; color: var(--muted); font-size: 11px; }
    .log-row > div:nth-child(2) input { width: 88px; min-height: 36px; padding: 6px 9px; font-variant-numeric: tabular-nums; }
    .log-row > div:nth-child(3) { grid-column: 1 / -1; }
    .log-row input, .log-row textarea { padding-inline: 10px; font-size: 16px; }
    .log-row > div:nth-child(3) input { min-height: 48px; }
    .signoff-grid, .handover-panel { grid-template-columns: 1fr; }
    .sign-card { padding: 14px; }
    .two-up { gap: 8px; }
    .workflow-actions { display: grid; grid-template-columns: 1fr; }
    .workflow-actions .btn { min-height: 48px; }
    .preview-panel { border-radius: 7px; }
    .preview-head { flex-wrap: wrap; gap: 8px; }
    .site-credit { width: calc(100% - 32px); gap: 8px; align-items: center; }
    .credit-copy { flex: 1; }
    .site-credit a { width: auto; margin: 0 0 0 38px; padding: 4px 0; }
  }

  @media (min-width: 1051px) {
    .sign-card .two-up { grid-template-columns: minmax(0, 1fr); }
  }

  @media (max-width: 380px) {
    .form-grid > .field:has(#reportDate),
    .form-grid > .field:has(#reportDay) { grid-column: 1 / -1; }
    .sign-card .two-up { grid-template-columns: minmax(0, 1fr); }
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
  }
}
