:root {
  --rk-black: #1D1D1B;
  --rk-purple: #6300FF;
  --rk-pink: #FFE6FF;
  --rk-blue: #E6FFFF;
  --rk-yellow: #FFFF00;
  --rk-green: #E6FFCC;
  --rk-bg: #FAF7FB;
  --rk-surface: #FFFFFF;
  --rk-border: #E9E2EE;
  --rk-text: #1D1D1B;
  --rk-muted: #6B6470;
  --rk-radius-lg: 24px;
  --rk-radius-md: 16px;
  --rk-shadow: 0 18px 45px rgba(29, 29, 27, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Montserrat", Arial, sans-serif;
  font-weight: 400;
  background: var(--rk-bg);
  color: var(--rk-text);
}

a { color: inherit; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px clamp(18px, 5vw, 64px);
  background: var(--rk-surface);
  border-bottom: 1px solid var(--rk-border);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
  font-weight: 600;
}

.brand img { max-width: 170px; max-height: 42px; }
.brand-fallback { display: none; color: var(--rk-purple); }

nav { display: flex; gap: 18px; color: var(--rk-muted); font-size: 0.95rem; }
nav a { text-decoration: none; }
nav a:hover { color: var(--rk-purple); }

.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero {
  min-height: 260px;
  display: flex;
  align-items: center;
  padding: clamp(32px, 8vw, 76px);
  border-radius: var(--rk-radius-lg);
  background:
    linear-gradient(135deg, rgba(255,230,255,0.9), rgba(230,255,255,0.92)),
    var(--rk-surface);
  border: 1px solid var(--rk-border);
  box-shadow: var(--rk-shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--rk-purple);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}

h1, h2 {
  font-weight: 600;
  margin: 0;
  letter-spacing: 0;
}

h1 { font-size: clamp(2.2rem, 6vw, 4.5rem); line-height: 1.02; }
h2 { font-size: 1.45rem; }

.subtitle {
  max-width: 680px;
  margin: 18px 0 0;
  font-size: 1.2rem;
  color: var(--rk-muted);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 24px;
}

.choice-card, .panel {
  background: var(--rk-surface);
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius-lg);
  box-shadow: var(--rk-shadow);
}

.choice-card {
  padding: 30px;
}

.choice-card.accent { background: var(--rk-green); }
.choice-card p { color: var(--rk-muted); line-height: 1.6; min-height: 76px; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 2px solid var(--rk-purple);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  background: var(--rk-purple);
}

.button.secondary {
  color: var(--rk-purple);
  background: #fff;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.panel {
  padding: clamp(24px, 6vw, 42px);
}

.panel.narrow {
  max-width: 760px;
  margin: 0 auto;
}

.hero + .lookup-panel,
.hero + .lookup.panel.narrow {
  margin: 48px auto 0;
}

.lookup-panel .code-form,
.lookup.panel.narrow .code-form {
  margin-top: 0;
}

.code-form {
  margin-top: 28px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 10px;
}

.input-row {
  display: flex;
  gap: 12px;
}

input {
  width: 100%;
  min-height: 50px;
  border-radius: 999px;
  border: 1px solid var(--rk-border);
  padding: 0 18px;
  font: inherit;
  background: #fff;
}

input:focus {
  outline: 3px solid rgba(99, 0, 255, 0.16);
  border-color: var(--rk-purple);
}

.message {
  margin: 20px 0 0;
  color: var(--rk-muted);
  line-height: 1.5;
}

.message.error { color: #9b1c31; }
.message.success { color: #1f6b3a; }

.file-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.file-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius-md);
  background: #fff;
}

.file-meta {
  color: var(--rk-muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.drop-zone {
  position: relative;
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 210px;
  margin-top: 26px;
  border: 2px dashed var(--rk-purple);
  border-radius: var(--rk-radius-lg);
  background: var(--rk-blue);
  text-align: center;
  color: var(--rk-muted);
}

.drop-zone strong {
  color: var(--rk-text);
  font-size: 1.2rem;
}

.drop-zone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-zone.dragover {
  background: var(--rk-pink);
}

.upload-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 22px 0;
}

.collision-help {
  flex-basis: 100%;
  margin: -6px 0 0;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.segmented label, .check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--rk-border);
  border-radius: 999px;
  background: #fff;
  font-weight: 400;
}

.segmented input, .check input {
  width: auto;
  min-height: auto;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rk-border);
  border-radius: var(--rk-radius-md);
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th, td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rk-border);
  text-align: left;
}

th {
  font-weight: 600;
  color: var(--rk-muted);
}

tr:last-child td { border-bottom: 0; }

.status-valid { color: #1f6b3a; }
.status-collision { color: #8a5b00; }
.status-error { color: #9b1c31; }

.site-footer {
  padding: 28px;
  text-align: center;
  color: var(--rk-muted);
}

@media (max-width: 760px) {
  .site-header, .input-row, .upload-controls {
    flex-direction: column;
    align-items: stretch;
  }

  nav { justify-content: center; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice-card p { min-height: 0; }
  .file-row { grid-template-columns: 1fr; }
  .button { width: 100%; }
}


.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.button.ghost {
  min-height: 42px;
  border-color: var(--rk-border);
  color: var(--rk-muted);
  background: #fff;
}

.button.ghost:hover:not(:disabled) {
  border-color: var(--rk-purple);
  color: var(--rk-purple);
}

.button.small {
  min-height: 34px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.upload-submit {
  margin-top: 20px;
}

.upload-management-panel {
  margin-top: 28px;
}

.section-copy {
  margin: 12px 0 0;
  color: var(--rk-muted);
  line-height: 1.6;
}

.upload-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.upload-heading form {
  margin: 0;
}

.logout-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--rk-border);
  border-radius: 999px;
  color: var(--rk-muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  background: var(--rk-surface);
}

.logout-link:hover {
  color: var(--rk-purple);
  border-color: var(--rk-purple);
}

.hero-accent {
  color: var(--rk-purple);
}
