:root {
  --picit-red: #E81D2B;
  --picit-blue: #007CB4;
  --picit-blue-dark: #00669A;
  --picit-charcoal: #434749;
  --picit-gray: #6F7479;
  --picit-bg-light: #F5F6F7;
  --picit-white: #FFFFFF;
  --color-border: #E2E5E8;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --radius: 12px;
  --radius-sm: 8px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--picit-bg-light);
  color: var(--picit-charcoal);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 0 24px;
  flex: 1;
}

.header {
  padding: 40px 0 32px;
  display: flex;
  justify-content: center;
}

.logo img {
  height: 56px;
  width: auto;
  display: block;
}

.main {
  padding-bottom: 60px;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.card {
  background: var(--picit-white);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.form {
  display: flex;
  gap: 12px;
}

.field {
  flex: 1;
  min-width: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font: inherit;
  color: var(--picit-charcoal);
  background: var(--picit-white);
  border: 1px solid #C5CACE;
  border-radius: var(--radius-sm);
}

.input:focus {
  outline: none;
  border-color: var(--picit-blue);
  box-shadow: 0 0 0 3px rgb(0 124 180 / 0.2);
}

.button {
  height: 44px;
  padding: 0 24px;
  font: inherit;
  font-weight: 600;
  color: var(--picit-white);
  background: var(--picit-blue);
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}

.button:hover {
  background: var(--picit-blue-dark);
}

.button:focus-visible {
  outline: 3px solid rgb(0 124 180 / 0.4);
  outline-offset: 2px;
}

.button:disabled {
  background: var(--picit-gray);
  cursor: progress;
}

.result {
  margin-top: 20px;
  text-align: left;
  overflow-x: auto;
}

.result:empty {
  display: none;
}

.result table {
  margin: 0;
  border-collapse: collapse;
}

.result td {
  padding: 3px;
  text-align: left;
  color: var(--picit-charcoal);
}

.result td.location {
  padding: 20px 0;
  color: var(--picit-blue);
  font-weight: bold;
}

.result td b {
  color: var(--picit-blue);
  font-weight: bold;
  padding: 5px 0;
}

.prose h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 24px 0 8px;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose p,
.prose ul {
  margin-bottom: 12px;
}

.prose ul {
  padding-left: 24px;
}

.prose a,
.page-links a {
  color: var(--picit-blue);
}

.prose code {
  font-size: 0.9em;
  background: var(--picit-bg-light);
  padding: 1px 5px;
  border-radius: 4px;
}

.prose .meta {
  margin-top: 24px;
  color: var(--picit-gray);
  font-size: 0.875rem;
}

mark.placeholder {
  background: #FFD939;
  color: var(--picit-charcoal);
  padding: 0 3px;
  border-radius: 3px;
}

.page-links {
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--picit-gray);
}

.noscript {
  margin: 1em 0;
  color: var(--picit-red);
}

.footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid var(--color-border);
  color: var(--picit-gray);
  font-size: 0.875rem;
}

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

.footer a:hover,
.footer a:focus-visible {
  color: var(--picit-blue);
  text-decoration: underline;
}

.modal {
  margin: auto;
  inset: 0;
  width: calc(100% - 32px);
  max-width: 640px;
  max-height: min(600px, calc(100vh - 64px));
  padding: 0;
  border: 0;
  border-top: 4px solid var(--picit-red);
  border-radius: var(--radius);
  box-shadow: 0 20px 40px -8px rgb(0 0 0 / 0.3), 0 8px 16px -8px rgb(0 0 0 / 0.2);
  background: var(--picit-white);
  color: var(--picit-charcoal);
  overflow: hidden;
}

.modal[open] {
  display: flex;
  flex-direction: column;
  animation: modal-in 0.18s ease-out;
}

.modal::backdrop {
  background: rgb(30 34 38 / 0.55);
  animation: fade-in 0.18s ease-out;
}

/* Gray out and soften the page behind the overlay, and stop it scrolling */
.page,
.footer {
  transition: filter 0.18s ease-out;
}

body:has(.modal[open]) {
  overflow: hidden;
}

body:has(.modal[open]) .page,
body:has(.modal[open]) .footer {
  filter: grayscale(1) blur(2px);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 16px 24px;
  background: var(--picit-bg-light);
  border-bottom: 1px solid var(--color-border);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--picit-gray);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover,
.modal-close:focus-visible {
  background: var(--color-border);
  color: var(--picit-charcoal);
  outline: none;
}

.modal-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  font-size: 0.925rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.modal-body h2 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--picit-blue);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@media (max-width: 640px) {
  .page {
    padding: 0 16px;
  }

  .header {
    padding: 24px 0 20px;
  }

  .logo img {
    height: 44px;
  }

  .card {
    padding: 20px;
  }

  .form {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
