/* Nomination tracker — layout & responsive view (aligned with nomination_form.css) */

.nomination-tracker-page {
  padding-bottom: 0;
}
.nomination-tracker-page > .site-footer {
  width: 100%;
  flex-shrink: 0;
}

.track-layout {
  width: 100%;
  max-width: var(--maxw, 1100px);
  margin-left: auto;
  margin-right: auto;
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
}

.hero-banner {
  padding: 1.25rem 0 0.5rem;
}

.hero-banner .banner-wrap {
  text-align: center;
}

.hero-banner .track-banner-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: clamp(120px, 18vw, 200px);
  margin-inline: auto;
  object-fit: contain;
  object-position: center center;
  border-radius: var(--tocca-radius);
  box-shadow: var(--tocca-shadow);
}

.track-page-main {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
  flex: 1 0 auto;
}

.track-page-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.track-quick-points {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.quick-point {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #23406e;
  background: #eef5ff;
  border: 1px solid #d6e5fc;
}

.quick-point i {
  color: var(--tocca-primary);
}

.track-page-header .hero-title {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
  font-weight: 800;
  color: var(--tocca-navy);
  letter-spacing: -0.02em;
}

.track-page-header .hero-sub {
  color: var(--tocca-text-muted);
  font-size: clamp(0.9rem, 2.5vw, 1rem);
  line-height: 1.55;
  max-width: 36rem;
  margin-inline: auto;
}

/* Period bar uses shared .period-bar styles from nomination_form.css */

/* Search */
.track-search-card .card-body {
  padding: 1.25rem 1.35rem;
}

.track-search-card {
  border: 1px solid #d8e5fb;
  box-shadow: 0 10px 28px rgba(18, 58, 124, 0.08);
}

.track-search-card .form-label {
  font-weight: 600;
  color: var(--tocca-navy);
}

.track-search-card .track-input-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  width: 100%;
}

.track-search-card .ref-input {
  flex: 1 1 auto;
  min-width: 0;
  border-radius: 12px 0 0 12px;
  border-color: var(--tocca-border);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.track-search-card .ref-input::placeholder {
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
  opacity: 0.65;
}

.track-search-card .btn-track {
  flex: 0 0 auto;
  border-radius: 0 12px 12px 0;
  font-weight: 700;
  padding-inline: 1.25rem;
  white-space: nowrap;
  min-height: 3rem;
}

.track-hint {
  font-size: 0.875rem;
  color: var(--tocca-text-muted);
  margin-top: 0.65rem;
  line-height: 1.45;
}

.track-forgot-link {
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  margin-top: 0.15rem;
}

.track-forgot-link:hover,
.track-forgot-link:focus {
  text-decoration: underline;
}

.track-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1.5rem;
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
}

.track-footer-links .btn {
  min-height: 3rem;
  font-weight: 600;
}

/* Result card */
#resultCard {
  scroll-margin-top: 1rem;
  border: 1px solid #d8e5fb;
  box-shadow: 0 12px 30px rgba(16, 40, 83, 0.1);
}

#resultCard .card-body {
  padding: 1.35rem 1.25rem;
}

@media (min-width: 992px) {
  #resultCard .card-body {
    padding: 2rem 2.25rem;
  }
}

.result-header {
  text-align: center;
  padding-bottom: 1.15rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px dashed var(--tocca-border);
}

.ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tocca-primary);
  background: rgba(30, 64, 175, 0.08);
  border: 1px solid rgba(30, 64, 175, 0.15);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  margin-bottom: 0.75rem;
  word-break: break-all;
}

#businessName {
  font-size: clamp(1.2rem, 3.5vw, 1.65rem);
  font-weight: 800;
  color: var(--tocca-navy);
  margin: 0;
  line-height: 1.3;
  word-break: break-word;
}

/* Progress steps */
.tracker-steps {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  padding: 0;
  margin: 1.5rem auto 1.15rem;
  max-width: 520px;
}

.tracker-steps li {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  position: relative;
  z-index: 1;
}

.tracker-steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 19px;
  left: calc(50% + 22px);
  width: calc(100% - 44px);
  height: 3px;
  background: #e2e8f0;
  border-radius: 2px;
  z-index: -1;
}

.tracker-steps li.completed:not(:last-child)::after {
  background: linear-gradient(90deg, var(--tocca-primary), var(--tocca-accent));
}

.tracker-steps .step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tocca-surface);
  color: #94a3b8;
  font-size: 1rem;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.tracker-steps .step-label {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--tocca-text-muted);
  line-height: 1.25;
}

.tracker-steps .step-label-short {
  display: none;
}

.tracker-steps li.active .step-circle {
  border-color: var(--tocca-primary);
  color: var(--tocca-primary);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.12);
}

.tracker-steps li.active .step-label {
  color: var(--tocca-navy);
}

.tracker-steps li.completed .step-circle {
  border-color: transparent;
  background: linear-gradient(135deg, var(--tocca-primary), var(--tocca-primary-soft));
  color: #fff;
}

.tracker-steps li.completed .step-label {
  color: var(--tocca-primary);
}

.tracker-steps li.rejected .step-circle {
  border-color: transparent;
  background: #dc3545;
  color: #fff;
}

.tracker-steps li.rejected .step-label {
  color: #dc3545;
}

/* Status */
.status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 1.35rem;
}

.status-row .status-label {
  font-weight: 600;
  color: var(--tocca-text-muted);
}

.status-badge {
  display: inline-block;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
  text-align: center;
}

.track-status-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin: 0 0 1.25rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #d8e3f7;
  background: #f3f7fe;
}

.track-status-actions:empty,
.track-status-actions.is-empty {
  display: none;
}

.status-help-text {
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  text-align: left;
  color: #3c4f6f;
  font-size: 0.9rem;
  line-height: 1.45;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
}

.status-help-text:empty {
  display: none;
}

.track-edit-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  text-align: center;
}

.track-edit-actions.d-none {
  display: none !important;
}

.track-edit-actions .btn {
  font-weight: 700;
  min-height: 2.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
  border-radius: 0.75rem;
  white-space: nowrap;
}

.track-edit-hint {
  color: var(--tocca-text-muted);
  font-size: 0.84rem;
  line-height: 1.4;
  max-width: 28rem;
}

.section-count {
  display: inline-block;
  margin-left: 0.25rem;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.status-pending  { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.status-review   { background: #dbeafe; color: #1e3a8a; border: 1px solid #93c5fd; }
.status-evaluation { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.status-approved { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.status-rejected { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.status-neutral  { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }

/* Details layout */
.details-grid {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 1fr);
  gap: 1.25rem 2rem;
  align-items: start;
}

@media (min-width: 768px) {
  .details-grid {
    grid-template-columns: 180px 1fr;
    gap: 1.5rem 2rem;
  }
}

.logo-box {
  width: 100%;
  max-width: 160px;
  aspect-ratio: 1;
  border: 1px dashed var(--tocca-border);
  border-radius: var(--tocca-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  overflow: hidden;
  background: linear-gradient(145deg, #f8fafc, #eef4fc);
  color: var(--tocca-text-muted);
  text-align: center;
  padding: 0.75rem;
  margin-inline: auto;
}

.logo-box.has-logo {
  border-style: solid;
  background: #fff;
  padding: 0;
  cursor: pointer;
}

.logo-box.has-logo:focus-visible {
  outline: 2px solid var(--tocca-primary);
  outline-offset: 2px;
}

.logo-box i {
  font-size: 2rem;
  opacity: 0.45;
}

.logo-box span {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  padding-inline: 0.25rem;
}

.logo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.section-block {
  margin-bottom: 1.35rem;
  background: #fff;
  border: 1px solid #deebfb;
  border-radius: 12px;
  padding: 0.95rem 0.95rem 0.8rem;
}

.section-block:last-child {
  margin-bottom: 0;
}

.section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tocca-primary);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid rgba(30, 64, 175, 0.12);
}

.kv-grid {
  display: grid;
  grid-template-columns: minmax(130px, 200px) 1fr;
  gap: 0.65rem 1.25rem;
  align-items: baseline;
}

.kv-k {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tocca-text-muted);
}

.kv-v {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--tocca-text);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.kv-v a:not(.doc-link) {
  color: var(--tocca-primary);
  text-decoration: none;
}

.kv-v a:not(.doc-link):hover {
  text-decoration: underline;
}

.doc-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tocca-primary) !important;
  background: rgba(30, 64, 175, 0.06);
  border: 1px solid rgba(30, 64, 175, 0.2);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  text-decoration: none !important;
  transition: background 0.15s ease;
  max-width: 100%;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.doc-link--image {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 0.45rem;
}

.doc-thumb {
  display: block;
  max-width: min(100%, 11rem);
  max-height: 7.5rem;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.doc-link:hover {
  background: rgba(30, 64, 175, 0.12);
}

.doc-link span {
  overflow: hidden;
  text-overflow: ellipsis;
}

#awardTables,
.award-tables-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 768px) {
  .award-tables-row {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.award-table-panel {
  border: 1px solid var(--tocca-border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem 0.9rem;
  background: #fff;
  min-width: 0;
}

.award-table-panel--removed {
  background: #fff8f8;
}

.award-table-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tocca-navy);
  margin: 0 0 0.55rem;
}

.award-table-help {
  margin: -0.2rem 0 0.7rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #64748b;
}

.award-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.award-table th,
.award-table td {
  border: 1px solid var(--tocca-border);
  padding: 0.45rem 0.6rem;
  text-align: left;
  vertical-align: top;
}

.award-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #64748b;
  background: #f8fafc;
  white-space: nowrap;
}

#errorMsg {
  border-radius: var(--tocca-radius);
  font-size: 0.95rem;
}

/* ============================================================
   Mobile & small screens
   ============================================================ */
@media (max-width: 767.98px) {
  .hero-banner {
    padding: 0.65rem 0 0.25rem;
  }

  .hero-banner .track-banner-img {
    max-height: clamp(120px, 18vw, 200px);
    border-radius: 12px;
  }

  .track-page-main {
    padding-top: 0.75rem;
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
  }

  .track-quick-points {
    justify-content: flex-start;
  }

  .track-search-card .card-body {
    padding: 1rem 1rem;
  }

  .track-search-card .track-input-row {
    flex-direction: column;
    gap: 0.65rem;
  }

  .track-search-card .ref-input,
  .track-search-card .btn-track {
    width: 100%;
    border-radius: 12px;
    min-height: 3rem;
    font-size: 1rem;
  }

  .track-search-card .ref-input {
    padding: 0.65rem 0.85rem;
  }

  .track-search-card .btn-track {
    padding-block: 0.7rem;
  }

  .track-footer-links {
    flex-direction: column;
    align-items: stretch;
  }

  .track-footer-links .btn {
    width: 100%;
    justify-content: center;
  }

  .details-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .logo-box {
    max-width: 140px;
  }

  .kv-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .kv-grid .kv-k {
    margin-top: 0.85rem;
    margin-bottom: 0.2rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  .kv-grid .kv-k:first-child {
    margin-top: 0;
  }

  .kv-grid .kv-v {
    padding: 0.65rem 0.85rem;
    background: rgba(30, 64, 175, 0.04);
    border: 1px solid var(--tocca-border);
    border-radius: 0.5rem;
    font-size: 0.95rem;
  }

  .doc-link {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 0.85rem;
  }

  .tracker-steps {
    max-width: 100%;
    padding-inline: 0;
    margin-top: 1.25rem;
  }

  .tracker-steps .step-label-full {
    display: none;
  }

  .tracker-steps .step-label-short {
    display: block;
  }

  .tracker-steps .step-label {
    font-size: 0.68rem;
    margin-top: 0.4rem;
  }

  .tracker-steps .step-circle {
    width: 34px;
    height: 34px;
    font-size: 0.9rem;
  }

  .tracker-steps li:not(:last-child)::after {
    top: 16px;
    left: calc(50% + 19px);
    width: calc(100% - 38px);
    height: 2px;
  }

  #resultCard .card-body {
    padding: 1.1rem 1rem;
  }

  .status-row {
    flex-direction: column;
    gap: 0.35rem;
    text-align: center;
  }

  .status-badge {
    font-size: 0.9rem;
    padding: 0.5rem 1.1rem;
  }

  .status-help-text {
    flex: 0 0 auto;
    width: 100%;
    font-size: 0.86rem;
  }

  .track-status-actions {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
  }

  .track-edit-actions {
    flex: 0 0 auto;
    width: 100%;
  }

  .track-edit-actions .btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .award-cat {
    font-size: 0.9rem;
  }
}

@media (max-width: 380px) {
  .tracker-steps .step-label {
    font-size: 0.6rem;
  }

  .ref-chip {
    font-size: 0.72rem;
    padding-inline: 0.65rem;
  }

  .tracker-steps .step-circle {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .tracker-steps li:not(:last-child)::after {
    top: 14px;
    left: calc(50% + 17px);
    width: calc(100% - 34px);
  }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .tracker-steps .step-label-full {
    display: block;
  }

  .tracker-steps .step-label-short {
    display: none;
  }

  .tracker-steps .step-label {
    font-size: 0.75rem;
  }
}

body.photo-lightbox-open {
  overflow: hidden;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1080;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  background: rgba(15, 23, 42, 0.88);
}

.photo-lightbox[hidden] {
  display: none !important;
}

.photo-lightbox-panel {
  width: min(100%, 40rem);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.photo-lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.photo-lightbox-title {
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-lightbox-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2.75rem;
  padding: 0.45rem 0.9rem;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-weight: 700;
  font-size: 0.9rem;
}

.photo-lightbox-close:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.photo-lightbox img {
  display: block;
  width: 100%;
  max-height: min(78vh, 36rem);
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
}

.track-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.track-media-tile {
  border: 1px solid var(--tocca-border, #d7e0ef);
  border-radius: 10px;
  overflow: hidden;
  background: #f8fafc;
}

.track-media-tile img,
.track-media-tile video {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #fff;
}

.track-media-tile img[data-open-photo] {
  cursor: zoom-in;
}

.track-media-caption {
  font-size: 0.75rem;
  line-height: 1.3;
  padding: 0.4rem 0.5rem;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-media-form {
  margin-top: 0.35rem;
  padding: 1rem;
  border: 1px dashed #93c5fd;
  border-radius: 12px;
  background: #f8fbff;
}

.track-media-form .form-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--tocca-navy, #1e3a5f);
  margin-bottom: 0.25rem;
}
