:root {
  --wine: #741d2c;
  --wine-dark: #4b101b;
  --gold: #c99b3b;
  --cream: #fbf7ef;
  --ink: #241d1b;
  --muted: #6d625e;
  --line: #e5ddd2;
  --white: #fff;
  --green: #19764c;
  --shadow: 0 16px 45px rgba(62, 36, 25, .10);
  color: var(--ink);
  background: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 0; background: var(--cream); }
body {
  margin: 0;
  min-width: 0;
  overflow-x: hidden;
  background: linear-gradient(180deg, #fffaf2 0, var(--cream) 100%);
  font-size: 16px;
  line-height: 1.5;
}

a { color: var(--wine); }
button, input, select, textarea { font: inherit; }

/* Shared controls */
.eyebrow {
  color: var(--gold);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.brand-mark {
  display: inline-grid;
  min-width: 52px;
  height: 34px;
  place-items: center;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, .55);
  color: #fff;
  font-family: Georgia, serif;
  font-weight: 700;
  letter-spacing: .08em;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 8px;
  color: #433937;
  font-weight: 700;
}

label small {
  color: var(--muted);
  font-weight: 400;
}

label .malayalam-mark-note {
  margin-top: -3px;
  color: var(--wine);
  font-size: .78rem;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 14px;
  border: 1px solid #cec3b8;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
}

textarea {
  min-height: 132px;
  resize: vertical;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  outline: 3px solid rgba(201, 155, 59, .25);
}

input[readonly] { background: #f5f1ea; }

.btn {
  display: inline-flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 0;
  border-radius: 9px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.btn.primary { background: var(--wine); color: #fff; }
.btn.secondary { background: #eee8df; color: #3f3531; }
.btn.whatsapp { background: #168951; color: #fff; }
.btn.danger { background: #a52c32; color: #fff; }
.btn.compact { min-height: 38px; padding: 7px 11px; font-size: .82rem; }

.alert {
  margin: 0 0 22px;
  padding: 13px 16px;
  border-radius: 10px;
}

.alert.error {
  border: 1px solid #eebfbb;
  background: #fff0ef;
  color: #8e231f;
}

.alert.success {
  border: 1px solid #b7dfc8;
  background: #e9f7ef;
  color: #17633f;
}

.alert.warning {
  border: 1px solid #ead49c;
  background: #fff8df;
  color: #6f5314;
}

/* Public pages: phone layout is the default */
.site-header {
  display: flex;
  height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px;
  background: var(--wine-dark);
  color: #fff;
}

.public-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  align-items: center;
  color: #fff;
  text-decoration: none;
}
.header-whatsapp {
  color: #fff;
  font-size: .86rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.header-whatsapp:hover,
.header-whatsapp:focus-visible { text-decoration: underline; }

.public-nav {
  display: flex;
  align-items: center;
  gap: 3px;
}

.public-nav a {
  padding: 9px 8px;
  border-radius: 7px;
  color: #fff;
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
}

.public-nav a:hover,
.public-nav a:focus-visible {
  background: rgba(255, 255, 255, .12);
}

.page {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 14px 50px;
}

.page.narrow { max-width: 860px; }

.hero-banner {
  width: 100%;
  aspect-ratio: 1080 / 330;
  overflow: hidden;
  border-radius: 16px;
  background: #eee8df;
  box-shadow: var(--shadow);
}

.hero-banner img,
.hero-admin-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 18px;
}

.page > .choice-grid:first-child { margin-top: 0; }

.rules-heading {
  margin-bottom: 20px;
  padding: 4px 2px;
}

.rules-heading h1 {
  margin: 7px 0 10px;
  font: 700 2.15rem/1.08 Georgia, serif;
}

.rules-heading p { margin: 0; color: var(--muted); }

.language-switch {
  display: inline-flex;
  gap: 4px;
  margin-top: 20px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.language-switch a {
  min-width: 96px;
  padding: 9px 13px;
  border-radius: 7px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.language-switch a.active { background: var(--wine); color: #fff; }

.rules-content {
  min-height: 180px;
  padding: 24px 18px;
}

.rules-text {
  color: #332b28;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.rules-text > :first-child { margin-top: 0; }
.rules-text > :last-child { margin-bottom: 0; }
.rules-text h2 { margin: 1.25em 0 .45em; font: 700 1.65rem/1.2 Georgia, serif; }
.rules-text h3 { margin: 1.15em 0 .4em; font-size: 1.25rem; }
.rules-text p { margin: 0 0 1em; }
.rules-text ul, .rules-text ol { padding-left: 1.5em; }
.rules-text blockquote {
  margin: 1em 0;
  padding: .3em 0 .3em 1em;
  border-left: 4px solid var(--gold);
  color: #554944;
}

.empty-rules {
  margin: 0;
  color: var(--muted);
  font-style: italic;
}

.choice-card {
  display: block;
  padding: 22px 19px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 9px 28px rgba(62, 36, 25, .05);
  color: var(--ink);
  text-decoration: none;
  transition: .2s;
}

.choice-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin-bottom: 15px;
  place-items: center;
  border-radius: 50%;
  background: #f8ecd2;
  color: var(--wine);
  font-size: 1.55rem;
}

.choice-card h2 {
  margin: 2px 0 8px;
  font: 700 1.5rem Georgia, serif;
}

.choice-card p { margin: 0 0 14px; color: var(--muted); }
.text-link { color: var(--wine); font-weight: 750; }
.choice-card.registration-closed { opacity: .7; }
.choice-card.registration-closed .text-link { color: #8e5d28; }
.choice-card.topper-list .choice-icon { background: #f6e4b9; color: #82611c; }
.registration-deadline {
  margin: -4px 0 13px !important;
  color: #725416 !important;
  font-size: .86rem;
  font-weight: 750;
}

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 24px 15px;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

.site-footer a { color: var(--wine); font-weight: 700; }

.back {
  display: inline-block;
  margin-bottom: 16px;
  font-weight: 700;
  text-decoration: none;
}

.form-panel { padding: 23px 17px; }

.form-heading {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.form-heading h1,
.auth-card h1,
.success-card h1 {
  margin: 7px 0 10px;
  font: 700 2rem/1.08 Georgia, serif;
}

.form-heading p { margin: 0; color: var(--muted); }

label .contest-deadline-notice {
  margin-top: -2px;
  color: #a42d2a;
  font-size: .84rem;
  font-weight: 800;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.span-2 { grid-column: span 1; }
.form-grid .btn { width: 100%; }

.auth-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 18px 14px;
}

.site-header + .auth-shell { min-height: calc(100vh - 64px); }

.auth-card, .success-card {
  width: min(520px, 100%);
  padding: 27px 20px;
}
.whatsapp-launcher { text-align: center; }
.launcher-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin-top: 22px;
}
.launcher-actions .btn { width: 100%; }

.form-stack { display: grid; gap: 19px; }
.auth-card .back { margin: 22px 0 0; }
.success-card { text-align: center; }
.success-message { font-weight: 700; }
.success-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin: 22px 0;
  text-align: left;
}
.success-summary > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf8f4;
}
.success-summary dt {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 750;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.success-summary dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-weight: 850;
}

.success-check {
  display: grid;
  width: 66px;
  height: 66px;
  margin: 0 auto 20px;
  place-items: center;
  border-radius: 50%;
  background: #e5f6ec;
  color: var(--green);
  font-size: 2rem;
}

.support-contact {
  display: grid;
  gap: 3px;
  margin: 22px 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #faf4e7;
}

.support-contact span {
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.support-contact strong {
  color: var(--wine);
  font-size: 1.35rem;
}

/* Admin */
.admin-header {
  display: flex;
  height: auto;
  min-height: 64px;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 15px;
  background: var(--wine-dark);
  color: #fff;
}

.admin-header > div { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.admin-header > div > span { display: none; }
.admin-header nav { display: flex; gap: 12px; font-size: .9rem; }
.admin-header a { color: #fff; }

.admin-page {
  max-width: 1400px;
  margin: auto;
  padding: 25px 14px 50px;
}

.admin-title h1 { margin: 5px 0; font: 700 2.1rem Georgia, serif; }
.admin-title p { margin: 0; color: var(--muted); }
.stat-row { display: flex; gap: 12px; margin-top: 18px; }

.stat {
  flex: 1;
  min-width: 0;
  padding: 15px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.stat strong { display: block; color: var(--wine); font-size: 1.7rem; }
.stat span { color: var(--muted); font-size: .75rem; }

.tabs {
  display: flex;
  gap: 5px;
  margin-top: 34px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
}

.tabs a {
  padding: 13px 16px;
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.tabs a.active { border-bottom: 3px solid var(--wine); color: var(--wine); }
.tabs span { padding: 2px 7px; border-radius: 20px; background: #eee5dc; font-size: .75rem; }

.toolbar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 9px;
  margin: 20px 0;
}

.toolbar form {
  display: grid;
  width: 100%;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.toolbar form.has-contest-filter select {
  grid-column: 1 / -1;
  grid-row: 2;
}

.toolbar form.has-contest-filter button {
  grid-column: 2;
  grid-row: 1;
}

.toolbar > .btn { width: auto; }
.contest-entry-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: -6px 0 18px;
}
.contest-summary-card {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.contest-summary-card > span { display: block; color: var(--muted); font-size: .8rem; font-weight: 700; }
.contest-summary-card strong { display: block; margin: 2px 0; color: var(--wine); font: 700 1.75rem/1 Georgia, serif; }
.contest-summary-card small { color: var(--muted); font-size: .75rem; }
.contest-category-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.contest-category-counts span { padding: 3px 7px; border-radius: 20px; background: #f7efe0; color: #725416; font-size: .72rem; font-weight: 700; }
.contest-category-counts b { margin-left: 3px; color: var(--wine); }
.registration-controls-panel { margin-top: 22px; padding: 20px 16px; }
.registration-controls-copy h2 { margin: 5px 0 8px; font: 700 1.7rem Georgia, serif; }
.registration-controls-copy p { margin: 0 0 20px; color: var(--muted); }
.registration-controls-form { display: grid; gap: 14px; }
.registration-controls-form > .btn { width: 100%; }
.registration-card-visibility {
  display: grid;
  gap: 14px;
  padding: 15px;
  border: 1px solid #d9c287;
  border-radius: 12px;
  background: #fffdf8;
}
.registration-card-visibility h3 { margin: 0 0 5px; font: 700 1.08rem/1.2 Georgia, serif; }
.registration-card-visibility p { margin: 0; color: var(--muted); font-size: .86rem; }
.registration-card-toggles { display: grid; gap: 9px; }
.registration-card-toggles label { display: flex; align-items: center; gap: 9px; color: var(--ink); font-weight: 750; }
.registration-card-toggles input { width: 19px; min-height: 19px; height: 19px; margin: 0; padding: 0; accent-color: var(--wine); }
.annual-reset-panel {
  margin-top: 22px;
  padding: 20px 16px;
  border-color: #e9c4c1;
  background: #fff9f8;
}
.annual-reset-copy h2 { margin: 5px 0 8px; font: 700 1.7rem Georgia, serif; }
.annual-reset-copy p { margin: 0 0 12px; color: var(--muted); }
.annual-reset-warning {
  padding: 11px 13px;
  border: 1px solid #e9c4c1;
  border-radius: 9px;
  background: #fff0ef;
  color: #7a2926 !important;
  font-size: .88rem;
}
.annual-reset-history { font-size: .84rem; }
.annual-reset-form { display: grid; gap: 12px; max-width: 620px; }
.annual-reset-form .btn { width: 100%; }
.registration-control {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfaf8;
}
.registration-control.open { border-color: #b7dfc8; background: #f5fbf7; }
.registration-control.expired,
.registration-control.locked { border-color: #ead49c; background: #fffaf0; }
.registration-control legend { padding: 0 5px; color: var(--ink); font-weight: 850; }
.registration-control-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.registration-open-toggle { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.registration-open-toggle input { width: 18px; height: 18px; margin: 0; }
.registration-state { padding: 4px 8px; border-radius: 20px; font-size: .72rem; font-weight: 850; }
.registration-state.open { background: #dff3e8; color: #17633f; }
.registration-state.expired,
.registration-state.locked { background: #fff0c9; color: #725416; }
.registration-control p { margin: 9px 0 13px; color: var(--muted); font-size: .84rem; }
.submission-list { display: grid; gap: 16px; }

.submission-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.card-top h2 { margin: 4px 0; font: 700 1.4rem Georgia, serif; }
.card-top p { margin: 0; color: var(--muted); }
.reg-id { color: var(--wine); font-size: .78rem; font-weight: 900; letter-spacing: .06em; }
.card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; }
.card-actions form { margin: 0; }

.badge {
  display: inline-block;
  height: max-content;
  margin-top: 10px;
  padding: 5px 10px;
  border-radius: 20px;
  background: #f8ecd2;
  color: #684d18;
  font-size: .78rem;
  font-weight: 800;
}

.details {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 20px 0;
}

.details > div { padding: 10px 12px; border-radius: 8px; background: #faf8f4; }
.details dt { color: var(--muted); font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; }
.details dd { margin: 4px 0 0; font-weight: 700; }

.message-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.message-compose { display: grid; gap: 9px; }
.message-compose label { font-size: .82rem; }
.message-box > div:last-child { display: grid; grid-template-columns: 1fr; gap: 7px; }
.edit-submission-panel { padding: 23px 17px; }
.edit-submission-page { max-width: 920px; }
.edit-actions { display: grid; grid-template-columns: 1fr; gap: 9px; }
.empty { padding: 45px; color: var(--muted); text-align: center; }
.association-panel { margin-top: 22px; padding: 20px 16px; }
.hero-settings-panel { margin-top: 22px; padding: 20px 16px; }
.hero-settings-copy h2 { margin-top: 0; font: 700 1.7rem Georgia, serif; }
.hero-settings-copy p { color: var(--muted); }
.hero-admin-preview {
  width: 100%;
  max-width: 1080px;
  aspect-ratio: 1080 / 330;
  margin: 22px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f5f1ea;
}
.empty-hero {
  margin: 22px 0;
  padding: 28px 18px;
  border: 1px dashed #c9bdb1;
  border-radius: 10px;
  background: #faf8f4;
  color: var(--muted);
  text-align: center;
}
.hero-upload-form { display: grid; max-width: 720px; gap: 18px; }
.hero-upload-form .btn { width: 100%; }
.hero-remove-form { margin-top: 12px; }
.rules-editor-panel { margin-top: 22px; padding: 20px 16px; }
.rules-editor-copy h2 { margin-top: 0; font: 700 1.7rem Georgia, serif; }
.rules-editor-copy p { color: var(--muted); }
.rules-editor-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  margin-top: 24px;
}
.rules-editor-form .btn { width: 100%; }
.rule-editor-block { min-width: 0; }
.rule-editor-label { margin-bottom: 8px; color: #433937; font-weight: 800; }
.rules-toolbar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px;
  overflow-x: auto;
  border: 1px solid #cec3b8;
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: #f7f3ed;
}
.rules-toolbar button,
.rules-toolbar select {
  width: auto;
  min-width: 40px;
  min-height: 38px;
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid #d7cdc3;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: .85rem;
  cursor: pointer;
}
.rules-toolbar button:hover,
.rules-toolbar button:focus-visible,
.rules-toolbar select:focus-visible { border-color: var(--gold); background: #fffaf0; }
.toolbar-colour {
  display: flex;
  min-width: max-content;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 4px 7px;
  border: 1px solid #d7cdc3;
  border-radius: 7px;
  background: #fff;
  font-size: .8rem;
}
.toolbar-colour input {
  width: 30px;
  min-height: 28px;
  height: 28px;
  padding: 1px;
  border: 0;
  cursor: pointer;
}
.rules-editor-surface {
  min-height: 330px;
  max-height: 620px;
  padding: 16px;
  overflow: auto;
  border: 1px solid #cec3b8;
  border-radius: 0 0 10px 10px;
  background: #fff;
  color: var(--ink);
  line-height: 1.65;
  outline: none;
}
.rules-editor-surface:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 155, 59, .2); }
.rules-editor-surface:empty::before {
  color: #91857d;
  content: attr(data-placeholder);
  pointer-events: none;
}
.rules-editor-surface h2 { font: 700 1.6rem/1.2 Georgia, serif; }
.rules-editor-surface h3 { font-size: 1.22rem; }
.rule-editor-block > small { display: inline-block; margin-top: 8px; }
.templates-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 22px; }
.template-editor-panel { padding: 20px 16px; }
.template-editor-panel h2 { margin: 0 0 5px; font: 700 1.7rem Georgia, serif; }
.template-editor-panel p { margin: 0; color: var(--muted); }
.template-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin-top: 22px; }
.variable-picker {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 10px;
  background: #faf7f1;
}
.variable-picker > div { display: flex; flex-wrap: wrap; gap: 6px; }
.variable-picker button {
  padding: 6px 9px;
  border: 1px solid #d8c9bb;
  border-radius: 7px;
  background: #fff;
  color: var(--wine);
  font: 700 .78rem ui-monospace, SFMono-Regular, Consolas, monospace;
  cursor: pointer;
}
.checkbox-label { display: flex; grid-template-columns: none; align-items: center; gap: 9px; }
.checkbox-label input { width: 20px; min-height: 20px; height: 20px; flex: 0 0 20px; }
.template-form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.template-list { display: grid; align-content: start; gap: 13px; }
.template-card { padding: 18px; }
.template-card h3 { margin: 10px 0 0; font: 700 1.25rem Georgia, serif; }
.template-card pre {
  margin: 14px 0;
  padding: 12px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  border-radius: 8px;
  background: #faf8f4;
  font: inherit;
}
.default-badge {
  display: inline-block;
  margin-left: 5px;
  padding: 4px 9px;
  border-radius: 20px;
  background: #e5f6ec;
  color: var(--green);
  font-size: .76rem;
  font-weight: 800;
}
.template-card-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.template-card-actions form { margin: 0; }
.bulk-recipient {
  width: max-content;
  margin-bottom: 8px;
  color: var(--wine);
  font-size: .78rem;
  cursor: pointer;
}
.bulk-recipient input:checked + span { font-weight: 850; }
.topper-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 22px;
  padding: 20px 16px;
}
.topper-overview h2 {
  margin: 5px 0 8px;
  font: 700 1.7rem/1.15 Georgia, serif;
}
.topper-overview p { max-width: 850px; margin: 0; color: var(--muted); }
.topper-overview .btn { width: 100%; }
.topper-overview-actions { display: grid; gap: 8px; }
.topper-link-visibility-form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfaf7;
}
.topper-link-visibility-form label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: .83rem;
}
.topper-link-visibility-form input {
  width: 19px;
  min-height: 19px;
  height: 19px;
  margin: 0;
  padding: 0;
  accent-color: var(--wine);
}
.topper-link-visibility-form .btn { width: 100%; }
.topper-groups { display: grid; gap: 18px; margin-top: 18px; }
.topper-group {
  min-width: 0;
  padding: 18px 14px;
  scroll-margin-top: 16px;
}
.topper-group-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 17px;
}
.topper-group-header h2 {
  margin: 8px 0 4px;
  font: 700 1.38rem/1.2 Georgia, serif;
}
.topper-group-header p { margin: 0; color: var(--muted); font-size: .88rem; }
.topper-status {
  min-width: 88px;
  padding: 9px 10px;
  border: 1px solid #ead49c;
  border-radius: 10px;
  background: #fff8df;
  color: #6f5314;
  text-align: center;
}
.topper-status.complete {
  border-color: #b7dfc8;
  background: #e9f7ef;
  color: #17633f;
}
.topper-status strong { font-size: 1.28rem; }
.topper-status span { font-size: .75rem; font-weight: 700; }
.topper-status small { display: block; font-size: .68rem; font-weight: 800; text-transform: uppercase; }
.topper-candidates { display: grid; gap: 9px; }
.topper-candidate {
  display: grid;
  grid-template-columns: 24px 30px minmax(0, 1fr);
  gap: 7px 9px;
  align-items: start;
  padding: 13px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfaf7;
  color: var(--ink);
  font-weight: 400;
  cursor: pointer;
}
.topper-candidate.selected {
  border-color: #92c9a9;
  background: #f1faf5;
}
.topper-candidate > input {
  grid-column: 1;
  grid-row: 1 / span 4;
  width: 20px;
  min-height: 20px;
  height: 20px;
  margin: 3px 0 0;
  padding: 0;
  accent-color: var(--wine);
}
.topper-candidate > input:disabled { opacity: .4; cursor: not-allowed; }
.candidate-order {
  grid-column: 2;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: #eee8df;
  color: var(--wine);
  font-size: .78rem;
  font-weight: 850;
}
.candidate-main {
  grid-column: 3;
  display: grid;
  min-width: 0;
  gap: 2px;
  color: var(--muted);
  font-size: .8rem;
}
.candidate-name {
  overflow-wrap: anywhere;
  color: var(--ink);
  font: 700 1.04rem/1.25 Georgia, serif;
}
.candidate-marks,
.candidate-links,
.candidate-flags {
  grid-column: 3;
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}
.candidate-marks strong { color: var(--wine); font-size: 1.08rem; }
.candidate-marks span { color: var(--muted); font-size: .82rem; }
.candidate-links { font-size: .82rem; }
.candidate-links a { overflow-wrap: anywhere; }
.candidate-flags { min-height: 1px; }
.topper-rank-badge,
.tie-badge,
.duplicate-badge,
.topper-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 850;
}
.topper-rank-badge,
.topper-badge { background: #dff3e8; color: #17633f; }
.tie-badge { background: #fff0c9; color: #6f5314; }
.duplicate-badge { background: #fff0ef; color: #8e231f; }
.cutoff-warning {
  margin: 0 0 14px;
  padding: 11px 13px;
  border: 1px solid #ead49c;
  border-radius: 9px;
  background: #fff8df;
  color: #6f5314;
  font-size: .86rem;
}
.topper-empty {
  padding: 28px 16px;
  border: 1px dashed #c9bdb1;
  border-radius: 10px;
  color: var(--muted);
  text-align: center;
}
.topper-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 15px;
}
.topper-actions .btn { width: 100%; }
.topper-photo-admin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.topper-photo-admin > div { display: flex; min-width: 0; align-items: center; gap: 10px; }
.topper-photo-admin img,
.topper-photo-placeholder {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 2px solid #f1dfad;
  border-radius: 50%;
  background: #f6e4b9;
  color: #80611c;
  object-fit: cover;
}
.topper-photo-admin strong,
.topper-photo-admin span { display: block; }
.topper-photo-admin span { margin-top: 2px; color: var(--muted); font-size: .79rem; }
.topper-photo-page { max-width: 860px; }
.topper-photo-panel { margin-top: 18px; padding: 20px 16px; }
.topper-photo-layout { display: grid; gap: 18px; }
.topper-photo-preview {
  display: grid;
  min-height: 184px;
  place-items: center;
  gap: 10px;
  padding: 18px;
  border: 1px dashed #c9bdb1;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}
.topper-photo-preview img { display: block; width: 170px; height: 170px; border-radius: 50%; object-fit: cover; }
.topper-photo-preview > span { display: grid; width: 56px; height: 56px; place-items: center; border-radius: 50%; background: #f6e4b9; color: #80611c; font-size: 1.5rem; }
.topper-photo-preview p { margin: 0; }
.topper-photo-form { display: grid; gap: 13px; align-content: start; }
.topper-photo-form .btn,
.topper-photo-remove-form .btn { width: 100%; }
.topper-photo-remove-form { margin-top: 14px; }
.topper-public-page { max-width: 980px; padding-top: 12px; }
.topper-public-page > .back { margin-bottom: 12px; }
.topper-public-hero {
  margin-top: 0;
  padding: 28px 20px;
  border-color: #dcc9a0;
  background: linear-gradient(135deg, #fffaf0, #f7e7bd);
  text-align: center;
}
.topper-public-hero h1 {
  margin: 7px 0 10px;
  font: 700 2.1rem/1.08 Georgia, serif;
}
.topper-public-hero p { max-width: 670px; margin: 0 auto; color: #5d4d38; }
.topper-public-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 44px 20px;
  text-align: center;
}
.topper-public-empty > span,
.published-topper-star {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: #f6e4b9;
  color: #80611c;
  font-size: 1.45rem;
}
.topper-public-empty h2 { margin: 4px 0 0; font: 700 1.45rem Georgia, serif; }
.topper-public-empty p { max-width: 410px; margin: 0; color: var(--muted); }
.published-award-section { margin-top: 20px; padding: 19px 15px; }
.published-award-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.published-award-heading h2 { margin: 5px 0 0; font: 700 1.42rem/1.2 Georgia, serif; }
.published-award-count {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 20px;
  background: #f6e4b9;
  color: #694f16;
  font-size: .74rem;
  font-weight: 850;
}
.published-topper-grid { display: grid; gap: 10px; }
.published-topper-card {
  min-width: 0;
  padding: 17px 14px;
  border: 1px solid #e5dcd4;
  border-radius: 13px;
  background: #fcfaf7;
  text-align: center;
}
.published-topper-card.announced { border-color: #d9c287; background: #fffdf8; }
.published-topper-group { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 15px; }
.published-topper-group span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 7px;
  font-size: .74rem;
  font-weight: 850;
}
.published-topper-class { background: var(--wine); color: #fff; }
.published-topper-board { background: #f6e4b9; color: #684d18; }
.published-topper-card .published-topper-star { margin: 0 auto 10px; width: 39px; height: 39px; font-size: 1.08rem; }
.published-topper-photo,
.published-topper-photo-placeholder {
  display: block;
  width: 140px;
  height: 180px;
  aspect-ratio: 35 / 45;
  margin: 0 auto 13px;
  border: 4px solid #f1dfad;
  border-radius: 8px;
}
.published-topper-photo {
  object-fit: cover;
}
.published-topper-photo-wrap {
  position: relative;
  display: block;
  width: 140px;
  height: 180px;
  margin: 0 auto 13px;
}
.published-topper-photo-wrap .published-topper-photo { margin: 0; }
.topper-photo-download {
  position: absolute;
  right: 7px;
  bottom: 7px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.92);
  border-radius: 50%;
  background: var(--wine);
  box-shadow: 0 2px 7px rgba(44,25,21,.28);
  color: #fff;
  font-size: 1.18rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}
.topper-photo-download:hover,
.topper-photo-download:focus-visible { background: #53101d; color: #fff; }
.published-topper-photo-placeholder {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #f5f2ea, #e6e1d5);
}
.published-topper-photo-placeholder::before,
.published-topper-photo-placeholder::after {
  position: absolute;
  content: "";
  display: block;
  left: 50%;
  transform: translateX(-50%);
  background: #c8c2b6;
}
.published-topper-photo-placeholder::before {
  top: 31px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
}
.published-topper-photo-placeholder::after {
  bottom: 15px;
  width: 104px;
  height: 76px;
  border-radius: 58px 58px 0 0;
}
.published-topper-label { display: block; color: #78642c; font-size: .73rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.published-topper-card h3 { margin: 5px 0; overflow-wrap: anywhere; font: 700 1.2rem/1.2 Georgia, serif; }
.published-topper-score { margin: 0 0 5px; color: var(--wine); font-size: 1.08rem; font-weight: 850; }
.published-topper-association { margin: 0; color: var(--muted); font-size: .85rem; }
.published-pending-copy { margin: 5px 0 0; color: var(--muted); font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.inline-form { display: grid; gap: 8px; max-width: 680px; }
.association-list { margin: 25px 0 0; padding: 0; list-style: none; }
.association-list li { display: flex; justify-content: space-between; padding: 14px 3px; border-top: 1px solid var(--line); }
.link-danger { border: 0; background: none; color: #a42d2a; text-decoration: underline; cursor: pointer; }

/* Wider layouts progressively enhance the mobile base */
@media (min-width: 480px) {
  .public-nav { gap: 7px; }
  .public-nav a { padding-inline: 11px; font-size: .9rem; }
  .site-footer { flex-direction: row; justify-content: center; gap: 8px; }
  .site-footer span + span::before { content: "·"; margin-right: 8px; color: #b4a79d; }
  .message-box > div:last-child { grid-template-columns: 1fr 1fr; }
  .details { grid-template-columns: 1fr 1fr; }
  .details .wide { grid-column: span 2; }
}

@media (min-width: 721px) {
  .panel { border-radius: 20px; }
  .site-header {
    height: 76px;
    padding: 0 max(20px, calc((100vw - 1120px) / 2));
  }
  .header-whatsapp { font-size: .95rem; }
  .public-nav a { font-size: .95rem; }
  .page { padding: 54px 20px 70px; }
  .hero-banner { border-radius: 24px; }
  .choice-grid { grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 28px; }
  .choice-card { display: flex; gap: 22px; padding: 32px; border-radius: 20px; }
  .choice-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
  .choice-icon { flex: 0 0 58px; margin-bottom: 0; }
  .form-panel { padding: clamp(24px, 5vw, 50px); }
  .form-heading { margin-bottom: 30px; padding-bottom: 20px; }
  .form-heading h1, .auth-card h1, .success-card h1 {
    font-size: clamp(2rem, 5vw, 3rem);
  }
  .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .span-2 { grid-column: span 2; }
  .form-grid .btn { width: auto; }
  .auth-shell { padding: 25px; }
  .site-header + .auth-shell { min-height: calc(100vh - 76px); }
  .auth-card, .success-card { padding: 38px; }
  .launcher-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .success-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .admin-header { height: 76px; align-items: center; padding: 0 28px; }
  .admin-header > div > span { display: inline; }
  .admin-header nav { gap: 20px; font-size: 1rem; }
  .admin-page { padding: 35px 28px 70px; }
  .admin-title { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
  .admin-title h1 { font-size: 2.7rem; }
  .stat-row { margin-top: 0; }
  .stat { flex: none; min-width: 130px; }
  .stat span { font-size: .85rem; }
  .toolbar { align-items: center; }
  .toolbar form { display: flex; width: min(600px, 70%); }
  .toolbar form.has-contest-filter {
    display: grid;
    width: min(850px, 78%);
    grid-template-columns: minmax(0, 1fr) minmax(190px, .55fr) auto;
  }
  .toolbar form.has-contest-filter select,
  .toolbar form.has-contest-filter button { grid-column: auto; grid-row: auto; }
  .contest-entry-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .card-top { display: flex; justify-content: space-between; gap: 18px; }
  .card-actions { justify-content: flex-end; margin-top: 0; }
  .badge { margin-top: 0; }
  .details { grid-template-columns: repeat(4, 1fr); }
  .details .wide { grid-column: span 2; }
  .message-box { grid-template-columns: 1fr auto; }
  .message-box > div:last-child { display: flex; align-items: end; }
  .edit-submission-panel { padding: 38px; }
  .edit-actions { display: flex; }
  .association-panel { padding: 28px; }
  .registration-controls-panel { padding: 28px; }
  .registration-controls-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .registration-card-visibility { grid-column: 1 / -1; grid-template-columns: minmax(0, 1fr) minmax(230px, .7fr); align-items: center; }
  .registration-controls-form > .btn { width: auto; justify-self: start; grid-column: span 2; }
  .annual-reset-panel { padding: 28px; }
  .annual-reset-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
  .annual-reset-form .btn { width: auto; }
  .hero-settings-panel { padding: 28px; }
  .rules-editor-panel { padding: 28px; }
  .rules-editor-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rules-editor-form .btn { width: auto; grid-column: span 2; justify-self: start; }
  .template-editor-panel { padding: 28px; }
  .template-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .templates-layout { grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); }
  .topper-overview { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 28px; }
  .topper-overview .btn { width: auto; }
  .topper-overview-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; }
  .topper-link-visibility-form { grid-template-columns: auto auto; align-items: center; }
  .topper-link-visibility-form .btn { width: auto; }
  .topper-group { padding: 24px; }
  .topper-group-header h2 { font-size: 1.7rem; }
  .topper-candidate {
    grid-template-columns: 24px 34px minmax(240px, 1.4fr) minmax(100px, .55fr) minmax(145px, .65fr) minmax(150px, .75fr);
    align-items: center;
  }
  .topper-candidate > input { grid-column: 1; grid-row: 1; }
  .candidate-order { grid-column: 2; }
  .candidate-main { grid-column: 3; }
  .candidate-marks { grid-column: 4; display: grid; gap: 1px; }
  .candidate-links { grid-column: 5; display: grid; gap: 3px; }
  .candidate-flags { grid-column: 6; justify-content: flex-end; }
  .topper-actions { display: flex; flex-wrap: wrap; }
  .topper-actions .btn { width: auto; }
  .topper-photo-panel { padding: 30px; }
  .topper-photo-layout { grid-template-columns: minmax(220px, .8fr) minmax(0, 1fr); align-items: center; }
  .topper-photo-form .btn,
  .topper-photo-remove-form .btn { width: auto; }
  .topper-public-hero { padding: 40px; }
  .topper-public-hero h1 { font-size: 2.7rem; }
  .published-award-section { padding: 26px; }
  .published-topper-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-upload-form .btn { width: auto; justify-self: start; }
  .inline-form { display: flex; }
}
