:root {
  --th-red: #c91f3a;
  --th-red-2: #ef3154;
  --th-red-dark: #6d1025;
  --th-red-deep: #360713;
  --th-ink: #24121a;
  --th-muted: #74656b;
  --th-line: rgba(169, 55, 79, .13);
  --th-glass: rgba(255, 255, 255, .78);
  --th-glass-strong: rgba(255, 255, 255, .92);
  --th-shadow: 0 22px 55px rgba(101, 16, 37, .10);
}

html { scroll-behavior: smooth; }
body { background: #fffafb; color: var(--th-ink); }

#preloader-active .preloader img,
.preloader img {
  width: 58px !important;
  height: 58px !important;
  max-width: 58px !important;
  object-fit: contain;
}

.th-tender-page {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding: 34px 0 80px;
  overflow: clip;
  background:
    linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,246,248,.92) 42%, rgba(255,255,255,.98)),
    #fff;
}

.th-tender-aurora {
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  filter: blur(12px);
  pointer-events: none;
}
.th-tender-aurora--one {
  width: 520px; height: 520px; right: -180px; top: 190px;
  background: radial-gradient(circle, rgba(239,49,84,.16), rgba(239,49,84,0) 70%);
}
.th-tender-aurora--two {
  width: 460px; height: 460px; left: -200px; top: 700px;
  background: radial-gradient(circle, rgba(201,31,58,.12), rgba(201,31,58,0) 72%);
}

.th-tender-wrap {
  width: min(1260px, calc(100% - 36px));
  margin: 0 auto;
}

.th-glass-panel {
  background: var(--th-glass);
  border: 1px solid rgba(255,255,255,.88);
  box-shadow: var(--th-shadow);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.th-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #6f5961;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 16px;
  text-decoration: none;
}
.th-back-link:hover { color: var(--th-red); }

.th-tender-hero {
  border-radius: 30px;
  padding: 34px;
  position: relative;
  overflow: hidden;
}
.th-tender-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -110px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239,49,84,.15), rgba(239,49,84,0) 70%);
  pointer-events: none;
}
.th-tender-badges { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; position: relative; z-index: 1; }
.th-badge {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: .02em;
  border: 1px solid rgba(201,31,58,.12);
}
.th-badge--source { background: rgba(201,31,58,.08); color: var(--th-red-dark); }
.th-badge--active { background: #ecfff2; color: #137a3e; border-color: #cdeed8; }
.th-badge--archived { background: #f5f1f2; color: #75686d; border-color: #e6dfe1; }
.th-badge--soft { background: rgba(255,255,255,.78); color: #715b64; }
.th-badge--ra { background: #fff3f5; color: var(--th-red); }

.th-tender-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 34px;
  align-items: end;
  position: relative;
  z-index: 1;
}
.th-tender-eyebrow {
  margin: 0 0 10px;
  color: var(--th-red);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.th-tender-hero h1 {
  font-size: clamp(27px, 3.1vw, 46px);
  line-height: 1.12;
  letter-spacing: -.025em;
  color: #251018;
  margin: 0 0 16px;
  max-width: 900px;
}
.th-authority-link {
  color: var(--th-red-dark);
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}
.th-authority-link:hover { color: var(--th-red); text-decoration: underline; }
.th-location-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: #6c5d63;
  margin: 12px 0 20px;
  font-size: 14px;
}
.th-location-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--th-red); box-shadow: 0 0 0 5px rgba(201,31,58,.09); }
.th-location-separator { color: #cbbfc3; }
.th-hero-meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.th-hero-meta-strip > div {
  min-width: 145px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(201,31,58,.08);
}
.th-hero-meta-strip span { display: block; color: #8a747c; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; margin-bottom: 4px; }
.th-hero-meta-strip strong { color: #35151f; font-size: 14px; line-height: 1.35; }

.th-tender-actions { display: flex; flex-direction: column; gap: 10px; }
.th-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 17px;
  border-radius: 14px;
  border: 0;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}
.th-btn:hover { transform: translateY(-1px); }
.th-btn--primary { background: linear-gradient(135deg, #a70f2d, #ef3154); color: #fff !important; box-shadow: 0 12px 28px rgba(201,31,58,.22); }
.th-btn--primary:hover { box-shadow: 0 16px 34px rgba(201,31,58,.28); }
.th-btn--outline { background: rgba(255,255,255,.72); color: var(--th-red-dark) !important; border: 1px solid rgba(201,31,58,.22); }
.th-btn--muted { background: #efe9eb; color: #75686d !important; cursor: default; }
.th-btn--small { min-height: 38px; padding: 8px 13px; font-size: 12px; border-radius: 11px; }
.th-btn--full { width: 100%; }
.th-share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.th-icon-btn {
  flex: 1 1 auto;
  border: 1px solid rgba(201,31,58,.10);
  background: rgba(255,255,255,.58);
  color: #725d65 !important;
  min-height: 36px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  padding: 8px 10px;
  text-decoration: none !important;
  text-align: center;
  cursor: pointer;
}
.th-icon-btn:hover { background: #fff; color: var(--th-red) !important; }

.th-tender-anchor-nav {
  position: sticky;
  z-index: 25;
  top: 88px;
  display: flex;
  gap: 6px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 18px 0 24px;
  padding: 8px;
  border-radius: 18px;
}
.th-tender-anchor-nav::-webkit-scrollbar { display: none; }
.th-tender-anchor-nav a {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 11px;
  color: #6d5a61;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.th-tender-anchor-nav a:hover { background: rgba(201,31,58,.08); color: var(--th-red); }

.th-tender-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; align-items: start; }
.th-tender-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.th-tender-sidebar { min-width: 0; }
.th-sidebar-sticky { position: sticky; top: 150px; display: flex; flex-direction: column; gap: 16px; }

.th-timeline-card,
.th-detail-section,
.th-ready-card,
.th-side-card { border-radius: 24px; padding: 25px; }

.th-section-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 22px; }
.th-section-heading--compact { align-items: center; }
.th-kicker { display: block; color: var(--th-red); font-size: 11px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; margin-bottom: 6px; }
.th-section-heading h2,
.th-ready-card h2 { color: #32121d; font-size: clamp(20px, 2vw, 27px); letter-spacing: -.015em; margin: 0; }
.th-section-heading p,
.th-ready-card p { color: var(--th-muted); font-size: 14px; line-height: 1.65; margin: 8px 0 0; }
.th-status-dot { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 850; }
.th-status-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.th-status-dot.is-active { background: #edfff3; color: #16763e; }
.th-status-dot.is-active::before { background: #29a860; box-shadow: 0 0 0 4px rgba(41,168,96,.10); }
.th-status-dot.is-archived { background: #f4eff1; color: #75676c; }
.th-status-dot.is-archived::before { background: #8f8287; }

.th-timeline { display: grid; grid-template-columns: 1fr 70px 1fr 70px 1fr; align-items: start; }
.th-timeline-step { position: relative; text-align: center; padding-top: 27px; }
.th-timeline-node { position: absolute; top: 0; left: calc(50% - 8px); width: 16px; height: 16px; border-radius: 50%; background: #ddd1d5; border: 4px solid #fff; box-shadow: 0 0 0 2px #ddd1d5; }
.th-timeline-step.is-done .th-timeline-node { background: var(--th-red); box-shadow: 0 0 0 2px rgba(201,31,58,.24); }
.th-timeline-step.is-current .th-timeline-node { background: #fff; box-shadow: 0 0 0 3px var(--th-red); }
.th-timeline-step small { display: block; color: #957f87; font-size: 11px; text-transform: uppercase; font-weight: 800; letter-spacing: .055em; margin-bottom: 5px; }
.th-timeline-step strong { display: block; color: #3c222b; font-size: 13px; }
.th-timeline-line { height: 2px; background: #e7dfe2; margin-top: 7px; }
.th-timeline-line.is-done { background: rgba(201,31,58,.55); }

.th-summary-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.th-summary-card { border-radius: 20px; padding: 20px; min-height: 128px; }
.th-summary-card span { display: block; color: #957d85; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 9px; }
.th-summary-card strong { display: block; color: #2f101a; font-size: 20px; line-height: 1.25; margin-bottom: 7px; overflow-wrap: anywhere; }
.th-summary-card small { color: #8b787f; font-size: 12px; }

.th-unlock-banner { display: flex; justify-content: space-between; align-items: center; gap: 18px; background: linear-gradient(135deg, #fff3f5, #fff); border: 1px solid rgba(201,31,58,.15); border-radius: 18px; padding: 17px; margin-bottom: 20px; }
.th-unlock-banner strong { color: #5d1327; display: block; margin-bottom: 3px; }
.th-unlock-banner p { margin: 0; color: #856f77; font-size: 13px; line-height: 1.5; }

.th-work-description { padding: 18px; border-radius: 18px; background: rgba(255,255,255,.58); border: 1px solid var(--th-line); margin-bottom: 16px; }
.th-work-description h3 { font-size: 15px; color: #512030; margin: 0 0 8px; }
.th-work-description p { color: #5f5056; line-height: 1.7; margin: 0; }
.th-muted-copy { margin-top: 8px !important; color: #8a777e !important; font-size: 13px; }

.th-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.th-info-item { padding: 15px 16px; border-radius: 16px; background: rgba(255,255,255,.62); border: 1px solid var(--th-line); min-width: 0; }
.th-info-item--wide { grid-column: span 2; }
.th-info-item span { display: block; color: #947f86; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; margin-bottom: 5px; }
.th-info-item strong { display: block; color: #352027; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.th-redacted { display: inline-flex; color: transparent; border-radius: 7px; background: linear-gradient(90deg, #eee1e5 20%, #f8f1f3 45%, #eee1e5 70%); background-size: 220% 100%; min-width: 112px; user-select: none; animation: thShimmer 1.7s linear infinite; }
@keyframes thShimmer { to { background-position: -220% 0; } }

.th-financial-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.th-financial-card { padding: 18px; border-radius: 17px; border: 1px solid var(--th-line); background: linear-gradient(155deg, rgba(255,255,255,.78), rgba(255,247,249,.72)); min-width: 0; }
.th-financial-card span { display: block; color: #937b84; font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }
.th-financial-card strong { color: #3a1521; font-size: 17px; overflow-wrap: anywhere; }

.th-doc-list { display: flex; flex-direction: column; gap: 9px; }
.th-doc-row {
  width: 100%;
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 13px;
  border-radius: 16px;
  border: 1px solid rgba(201,31,58,.10);
  background: rgba(255,255,255,.62);
  text-align: left;
  text-decoration: none !important;
  cursor: pointer;
  color: inherit;
}
.th-doc-row:hover { background: #fff; border-color: rgba(201,31,58,.20); transform: translateY(-1px); }
.th-doc-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; color: var(--th-red); background: #fff0f3; font-size: 10px; font-weight: 900; letter-spacing: .04em; }
.th-doc-row strong { display: block; color: #391821; font-size: 14px; margin-bottom: 2px; }
.th-doc-row small { display: block; color: #8e7b82; font-size: 11px; }
.th-doc-action { color: var(--th-red); font-size: 12px; font-weight: 850; white-space: nowrap; }
.th-empty-state { text-align: center; padding: 26px 18px; border-radius: 17px; border: 1px dashed rgba(201,31,58,.22); background: rgba(255,255,255,.45); color: #8b747c; }

.th-boq-sheet + .th-boq-sheet { margin-top: 20px; }
.th-boq-sheet h3 { margin: 0 0 10px; color: #4d1a2a; font-size: 14px; }
.th-table-scroll { width: 100%; overflow-x: auto; border-radius: 15px; border: 1px solid var(--th-line); }
.th-boq-table { width: 100%; min-width: 620px; border-collapse: collapse; background: rgba(255,255,255,.80); font-size: 12px; }
.th-boq-table th { background: linear-gradient(135deg, #a80f2e, #df2948); color: #fff; text-align: left; padding: 11px 12px; white-space: nowrap; }
.th-boq-table td { padding: 10px 12px; border-bottom: 1px solid #f0e6e9; color: #514147; vertical-align: top; }
.th-boq-table tr:last-child td { border-bottom: 0; }
.th-boq-table tbody tr:nth-child(even) { background: rgba(255,246,248,.65); }
.th-boq-lock { position: relative; min-height: 230px; overflow: hidden; border-radius: 17px; border: 1px solid var(--th-line); }
.th-boq-skeleton { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; filter: blur(5px); opacity: .55; }
.th-boq-skeleton span { height: 42px; background: #f3e9ec; border: 1px solid #fff; }
.th-boq-lock-copy { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 12px; background: rgba(255,255,255,.52); backdrop-filter: blur(2px); color: #4f1b2b; }

.th-ready-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; background: linear-gradient(135deg, rgba(110,12,38,.96), rgba(224,37,70,.94)); border-color: rgba(255,255,255,.16); }
.th-ready-card .th-kicker { color: #ffd7df; }
.th-ready-card h2 { color: #fff; }
.th-ready-card p { color: rgba(255,255,255,.77); max-width: 680px; }
.th-ready-actions { display: flex; flex-direction: column; gap: 9px; min-width: 210px; }
.th-ready-card .th-btn--primary { background: #fff; color: var(--th-red-dark) !important; box-shadow: none; }
.th-ready-card .th-btn--outline { color: #fff !important; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.10); }

.th-side-card h3 { margin: 5px 0 8px; color: #36131f; font-size: 20px; line-height: 1.28; }
.th-side-card p { color: #7d6971; line-height: 1.6; font-size: 13px; margin: 0 0 17px; }
.th-side-card--accent { background: linear-gradient(160deg, rgba(255,255,255,.90), rgba(255,239,243,.84)); }
.th-assigned-pill { display: inline-flex; padding: 7px 10px; border-radius: 10px; background: #fff0f3; color: #7d1831 !important; font-weight: 750; }
.th-select-label { display: block; color: #7d6971; font-size: 11px; font-weight: 800; margin-bottom: 6px; }
.th-select { width: 100%; min-height: 44px; border: 1px solid rgba(201,31,58,.16); background: rgba(255,255,255,.78); color: #3f2830; border-radius: 12px; padding: 8px 11px; outline: 0; }
.th-select:focus { border-color: rgba(201,31,58,.44); box-shadow: 0 0 0 3px rgba(201,31,58,.07); }
.th-small-link { display: inline-flex; margin-top: 10px; color: var(--th-red) !important; font-size: 12px; font-weight: 750; }
.th-side-facts { display: flex; flex-direction: column; gap: 10px; }
.th-side-facts > div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 9px; border-bottom: 1px solid rgba(201,31,58,.08); }
.th-side-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.th-side-facts span { color: #927b83; font-size: 12px; }
.th-side-facts strong { color: #42202b; font-size: 12px; text-align: right; max-width: 58%; overflow-wrap: anywhere; }

.d-none { display: none !important; }

@media (max-width: 1100px) {
  .th-tender-layout { grid-template-columns: 1fr; }
  .th-sidebar-sticky { position: static; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .th-side-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .th-tender-page { padding-top: 22px; }
  .th-tender-wrap { width: min(100% - 22px, 1260px); }
  .th-tender-hero { padding: 24px; border-radius: 24px; }
  .th-tender-hero-grid { grid-template-columns: 1fr; gap: 23px; align-items: stretch; }
  .th-tender-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .th-share-row { grid-column: 1 / -1; }
  .th-summary-grid { grid-template-columns: 1fr; }
  .th-financial-grid { grid-template-columns: 1fr 1fr; }
  .th-ready-card { flex-direction: column; align-items: flex-start; }
  .th-ready-actions { width: 100%; flex-direction: row; min-width: 0; }
  .th-ready-actions .th-btn { flex: 1; }
}

@media (max-width: 620px) {
  .th-tender-wrap { width: min(100% - 16px, 1260px); }
  .th-tender-hero { padding: 19px; border-radius: 21px; }
  .th-tender-hero h1 { font-size: 26px; }
  .th-tender-actions { grid-template-columns: 1fr; }
  .th-share-row { grid-column: auto; }
  .th-hero-meta-strip { display: grid; grid-template-columns: 1fr 1fr; }
  .th-hero-meta-strip > div { min-width: 0; }
  .th-hero-meta-strip > div:last-child { grid-column: 1 / -1; }
  .th-tender-anchor-nav { top: 72px; margin: 12px 0 16px; }
  .th-timeline-card,
  .th-detail-section,
  .th-ready-card,
  .th-side-card { padding: 18px; border-radius: 20px; }
  .th-section-heading { flex-direction: column; margin-bottom: 17px; }
  .th-timeline { grid-template-columns: 1fr; gap: 11px; }
  .th-timeline-line { width: 2px; height: 24px; margin: -4px auto; }
  .th-timeline-step { text-align: left; padding: 0 0 0 35px; }
  .th-timeline-node { left: 4px; top: 4px; }
  .th-info-grid { grid-template-columns: 1fr; }
  .th-info-item--wide { grid-column: auto; }
  .th-financial-grid { grid-template-columns: 1fr; }
  .th-doc-row { grid-template-columns: 39px minmax(0,1fr); }
  .th-doc-action { grid-column: 2; }
  .th-sidebar-sticky { display: flex; }
  .th-ready-actions { flex-direction: column; }
  .th-unlock-banner { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
