:root {
  color-scheme: light;
  --brand-50: #fff8dc;
  --brand-100: #fff0ad;
  --brand-600: #ffc100;
  --brand-700: #e6ae00;
  --brand-800: #8a6800;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --red-50: #fef2f2;
  --red-600: #dc2626;
  --red-800: #991b1b;
  --amber-50: #fffbeb;
  --amber-800: #92400e;
  --font-size: 16px;
  --content-pad: 1rem;
}

*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: var(--font-size);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow-x: clip;
}
body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  background: var(--gray-50);
  color: var(--gray-900);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 1rem;
  line-height: 1.5;
}
a { color: var(--brand-800); }
button, input, textarea { color: inherit; font: inherit; }
button, [role="button"] { cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 56px;
  padding: .75rem var(--content-pad);
  background: var(--brand-600);
  color: var(--gray-900);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
  box-shadow: 0 1px 3px rgb(0 0 0 / 10%);
}
.site-header a, .link-button { color: var(--gray-900); text-decoration: none; }
.brand { font-size: 1.25rem; font-weight: 700; }
.site-header nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem 1rem;
  font-size: 1rem;
}
.language-switcher { display: flex; align-items: center; gap: .375rem; }
.language-switcher form { margin: 0; }
.language-switcher button {
  min-height: 0;
  min-width: 0;
  padding: .15rem;
  border: 2px solid transparent;
  border-radius: .3rem;
  background: transparent;
}
.language-switcher button[aria-current="true"] { border-color: var(--gray-900); }
.language-switcher img { width: 28px; height: 18px; object-fit: contain; box-shadow: 0 0 0 1px rgb(17 24 39 / 25%); }
.inline-form { display: inline; }
.link-button { border: 0; padding: 0; background: none; min-height: 0; }

.page-shell {
  width: min(100% - (var(--content-pad) * 2), 64rem);
  max-width: 100%;
  margin: 0 auto;
  padding: 1.25rem 0 5rem;
}
.hero { max-width: 48rem; padding: .5rem 0 1rem; }
.hero.compact { padding-bottom: .5rem; }
.hero h1 {
  margin: 0 0 .5rem;
  font-size: clamp(1.6rem, 5.5vw + .8rem, 2.5rem);
  line-height: 1.2;
  font-weight: 700;
}
.hero p { font-size: 1.05rem; }
.hero p:last-child { color: var(--gray-600); }
.eyebrow {
  margin: 0 0 .25rem;
  color: var(--brand-800);
  font-size: .8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.uuid {
  color: var(--gray-500);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8125rem;
  overflow-wrap: anywhere;
}

.card {
  margin: 1rem 0;
  padding: 1.1rem;
  border: 1px solid var(--gray-100);
  border-radius: .75rem;
  background: white;
  box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}
.card.narrow { max-width: 28rem; margin-inline: auto; }
.card h2 { margin: 0 0 .75rem; font-size: 1.2rem; line-height: 1.4; font-weight: 600; }
.card p { font-size: 1rem; }
.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; }
.summary-grid div { padding: .75rem; border-radius: .5rem; background: var(--gray-50); }
.summary-grid span { display: block; color: var(--gray-500); font-size: .8125rem; }
.summary-grid strong { display: block; margin-top: .125rem; font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }

.form-row { margin-bottom: 1rem; }
label { display: block; margin-bottom: .35rem; font-size: 1rem; font-weight: 600; }
input[type="text"], input[type="email"], input[type="password"], textarea {
  width: 100%;
  max-width: 100%;
  padding: .75rem .85rem;
  border: 1px solid var(--gray-300);
  border-radius: .5rem;
  background: white;
  font-size: 1rem;
}
input:focus, textarea:focus { border-color: var(--brand-600); outline: 2px solid rgb(255 193 0 / 35%); outline-offset: 1px; }
input[type="file"] { width: 100%; max-width: 100%; }
small { display: block; margin-top: .5rem; color: var(--gray-500); font-size: .875rem; }
button, .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 0;
  border-radius: .5rem;
  min-height: 3rem;
  padding: .85rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 600;
  transition: background-color .15s, border-color .15s, opacity .15s;
  text-decoration: none;
  touch-action: manipulation;
}
.primary { background: var(--brand-600); color: var(--gray-900); }
.primary:hover { background: var(--brand-700); }
.primary:disabled,
.secondary:disabled,
.danger:disabled,
button.is-busy {
  cursor: wait;
  opacity: .65;
  pointer-events: none;
}
.secondary { background: var(--gray-200); color: #1f2937; }
.secondary:hover { background: var(--gray-300); }
.danger { background: var(--red-600); color: white; }
.danger:hover { background: var(--red-800); }
.text-action {
  min-height: 0;
  padding: .25rem 0;
  background: none;
  color: var(--brand-800);
  font-size: .875rem;
}
.btn-spinner {
  flex: 0 0 auto;
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
.upload-form > .primary,
[data-draft-form] > .primary,
.card > form > .primary,
.actions .button-link,
.actions button,
.actions-inline .button-link,
.actions-inline button,
.log-list-item .button-link {
  width: 100%;
}
.file-picker {
  position: relative;
  min-height: 6.5rem;
  margin-bottom: 1rem;
  border: 2px dashed var(--gray-300);
  border-radius: .75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: border-color .15s;
}
.file-picker:hover { border-color: var(--brand-600); }
.file-picker.has-file { border-color: var(--brand-600); background: var(--brand-50); }
.file-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-picker span { color: var(--brand-800); font-size: 1.05rem; font-weight: 600; pointer-events: none; padding: 0 .75rem; }

.error-box, .warning-box { margin: 1rem 0; padding: .85rem 1rem; border-radius: .5rem; font-size: 1rem; }
.error-box { border: 1px solid #fca5a5; background: var(--red-50); color: var(--red-800); }
.warning-box { border: 1px solid #fde68a; background: var(--amber-50); color: var(--amber-800); }
.error-box h3, .warning-box h3 { margin: 0 0 .5rem; }
.push-panel { margin: 1rem 0; padding: .85rem; border-radius: .5rem; background: var(--brand-50); color: var(--gray-900); }
.push-panel h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.push-panel .secondary, .push-panel .primary { margin: .75rem 0; width: 100%; }
.push-panel p { margin-bottom: .25rem; }
.push-panel.is-ready { border: 1px solid #86efac; background: #f0fdf4; color: #166534; }
.reviewer-push { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
th, td { padding: .625rem .5rem; border-bottom: 1px solid var(--gray-200); text-align: left; white-space: nowrap; }
th { color: var(--gray-500); font-size: .8125rem; font-weight: 600; }
.qso-details { margin-top: 1rem; }
.qso-details summary { color: var(--brand-800); cursor: pointer; font-weight: 600; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: .75rem; }
.image-grid img { width: 100%; max-height: 430px; border-radius: .75rem; object-fit: cover; }
.contact { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1rem; }
.contact dt { color: var(--gray-500); }
.contact dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-direction: column; align-items: stretch; gap: .75rem; }
.actions form { width: 100%; min-width: 0; }
.actions-inline { display: flex; flex-direction: column; gap: .75rem; margin-top: 1rem; }
a.button-link.primary { color: var(--gray-900); }
a.button-link.secondary { color: #1f2937; }
.file-selected { margin: 0 0 .75rem; font-weight: 600; color: var(--gray-700); }
.log-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.log-list-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: .85rem 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--gray-200);
}
.log-list-item .button-link { grid-column: 2; justify-self: start; }
.log-list-item:last-child { border-bottom: 0; }
.log-list-meta { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.log-list-meta strong { overflow-wrap: anywhere; font-size: 1.05rem; }
.log-list-meta span { color: var(--gray-500); font-size: .9375rem; }
.log-list-status { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }

.status-heading {
  display: flex;
  align-items: center;
  gap: .75rem;
}
.status-heading.compact-status {
  gap: .5rem;
  text-transform: none;
  letter-spacing: normal;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gray-900);
}
.status-heading.compact-status .status-icon {
  width: 1.35rem;
  height: 1.35rem;
}
.status-icon {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  display: inline-grid;
  place-items: center;
  position: relative;
  box-shadow: inset 0 0 0 2px rgb(0 0 0 / 8%);
}
.status-heading .status-icon {
  width: 2.5rem;
  height: 2.5rem;
}
.status-icon::before,
.status-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
}
/* Pending / draft: yellow clock-style disc */
.status-pending { background: #fbbf24; color: #78350f; }
.status-draft { background: #fde68a; color: #92400e; }
.status-pending::before,
.status-draft::before {
  width: .2rem;
  height: .45rem;
  top: 28%;
  left: 50%;
  border-radius: 1px;
  transform: translateX(-50%);
}
.status-pending::after,
.status-draft::after {
  width: .4rem;
  height: .2rem;
  top: 50%;
  left: 50%;
  border-radius: 1px;
  transform: translateY(-50%);
}
/* Rejected: red X */
.status-rejected { background: #dc2626; color: #fff; }
.status-rejected::before,
.status-rejected::after {
  width: .7rem;
  height: .2rem;
  border-radius: 1px;
  top: 50%;
  left: 50%;
}
.status-rejected::before { transform: translate(-50%, -50%) rotate(45deg); }
.status-rejected::after { transform: translate(-50%, -50%) rotate(-45deg); }
/* Accepted: green check */
.status-accepted { background: #16a34a; color: #fff; }
.status-accepted::before {
  width: .28rem;
  height: .55rem;
  border-right: .2rem solid currentColor;
  border-bottom: .2rem solid currentColor;
  background: transparent;
  top: 28%;
  left: 38%;
  transform: rotate(40deg);
}
.status-accepted::after { display: none; }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: .15rem .55rem;
  border-radius: 9999px;
  font-size: .8125rem;
  font-weight: 700;
  line-height: 1.3;
}
.status-badge.status-pending {
  background: #fef3c7;
  color: #92400e;
}
.status-badge.status-draft {
  background: #fff7ed;
  color: #9a3412;
}
.status-badge.status-rejected {
  background: #fee2e2;
  color: #991b1b;
}
.status-badge.status-accepted {
  background: #dcfce7;
  color: #166534;
}

.count { display: inline-flex; min-width: 1.5rem; height: 1.5rem; align-items: center; justify-content: center; border-radius: 9999px; background: var(--brand-100); color: var(--gray-900); font-size: .8125rem; }
.muted { color: var(--gray-500); }
.message { padding: .75rem 1rem; border-radius: .5rem; background: var(--brand-100); color: var(--gray-900); }
.push-recipient { max-width: 16rem; overflow-wrap: anywhere; }
.push-recipient .endpoint { font-size: .75rem; word-break: break-all; }
.push-result { font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .04em; }
.push-result-success { color: #166534; }
.push-result-failure { color: var(--red-800); }
.push-result-no_recipients,
.push-result-skipped { color: var(--amber-800); }
.push-log-table th,
.push-log-table td { white-space: normal; vertical-align: top; }
td.muted { max-width: 14rem; overflow-wrap: anywhere; }

/* Phones / touch: keep readable type even if "Desktop site" forces a wide layout. */
@media (hover: none) and (pointer: coarse) {
  :root { --font-size: 17px; }
}

@media (min-width: 700px) {
  .site-header {
    flex-direction: row;
    align-items: center;
    padding-block: 0;
  }
  .site-header nav {
    width: auto;
    font-size: .875rem;
    justify-content: flex-end;
  }
  .brand { font-size: 1.125rem; }
  .page-shell { padding-top: 2rem; }
  .card { padding: 1.5rem; }
  .actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
  }
  .actions form { width: auto; min-width: min(100%, 20rem); }
  .actions .button-link,
  .actions button { width: auto; }
  .actions-inline {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .actions-inline .button-link,
  .actions-inline button { width: auto; }
  .upload-form > .primary,
  [data-draft-form] > .primary,
  .card > form > .primary {
    width: auto;
    min-width: 14rem;
  }
  .log-list-item {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
  .log-list-item .button-link {
    grid-column: auto;
    width: auto;
    justify-self: end;
  }
}