:root {
  color-scheme: light;
  --page: #f4f7f6;
  --white: #fff;
  --ink: #142739;
  --navy: #132b3c;
  --muted: #526472;
  --line: #d8e3e0;
  --mint: #bdedd8;
  --green: #135b4a;
  --danger: #8c3330;
  --shadow: 0 12px 32px -24px #14273955;
  --radius: 18px;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--page);
  line-height: 1.55;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

h1 { font-size: clamp(2rem, 4vw, 3.25rem); }
h2 { font-size: clamp(1.35rem, 2.5vw, 1.85rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; overflow-wrap: anywhere; }
a { color: var(--green); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #237a63; outline-offset: 3px; }
button, input, select, textarea { font: inherit; }

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.topbar-inner, .container, .footer-inner {
  width: min(100% - 3rem, 72rem);
  margin-inline: auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .65rem 1.5rem;
  min-height: 4.65rem;
  padding-block: .65rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--ink);
  font-size: 1.1rem;
  font-weight: 750;
  letter-spacing: -.035em;
  text-decoration: none;
}

.brand-mark {
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  background: var(--navy);
  color: var(--mint);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
}

.brand-mark:empty::after {
  content: "";
  width: .8rem;
  height: 1rem;
  background: currentColor;
  clip-path: polygon(0 0, 28% 0, 50% 65%, 75% 0, 100% 0, 64% 100%, 36% 100%);
}

.nav, .account, .actions, .form-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.nav { gap: .25rem; }
.nav-link, .nav > a:not(.button) {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  padding: .45rem .75rem;
  border-radius: 8px;
  color: var(--muted);
  font-size: .89rem;
  font-weight: 650;
  text-decoration: none;
}

.nav-link:hover, .nav > a:not(.button):hover { background: var(--page); color: var(--ink); }
.nav-link[aria-current="page"], .nav-link.active { background: #e5f4ed; color: var(--green); }
.account { color: var(--muted); font-size: .86rem; }

main { flex: 1 0 auto; }
main.container { padding-block: clamp(1.5rem, 4vw, 3rem) 3.5rem; }
.narrow { width: min(100%, 45rem); margin-inline: auto; }
.stack { display: grid; gap: 1rem; }
.stack > * { min-width: 0; }

.hero {
  position: relative;
  isolation: isolate;
  min-height: 18.5rem;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  padding: clamp(1.5rem, 4.5vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  align-items: center;
  gap: 1.5rem;
  border-radius: 26px;
  overflow: hidden;
  background: linear-gradient(117deg, #122a3b 28%, #193e48 100%);
  color: var(--white);
  box-shadow: 0 14px 35px -27px #143a44b3;
}

.hero:not(:has(.hero-art)) { grid-template-columns: 1fr; }
.hero-content { position: relative; z-index: 1; max-width: 41rem; }
.hero h1 { font-size: clamp(2.1rem, 5vw, 4rem); line-height: 1.05; max-width: 14ch; }
.hero p { max-width: 50ch; color: #d6e5e6; }
.hero a:not(.button) { color: var(--mint); }
.hero :focus-visible { outline-color: var(--mint); }
.hero .button { background: var(--mint); color: var(--ink); border-color: var(--mint); }
.hero .button:hover { background: #d2f4e3; border-color: #d2f4e3; }
.hero .button.button-secondary { background: transparent; color: var(--white); border-color: #8fb0b1; }
.hero .button.button-secondary:hover { background: #254c54; border-color: #afd6d2; }

.eyebrow, .kicker {
  margin: 0 0 .75rem;
  color: var(--green);
  font-size: .72rem;
  font-weight: 750;
  line-height: 1.4;
  letter-spacing: .115em;
  text-transform: uppercase;
}

.hero .eyebrow, .hero .kicker { color: var(--mint); }

.hero-art {
  position: relative;
  min-height: 14.5rem;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.hero-art::before, .hero-art::after {
  content: "";
  position: absolute;
  width: min(105%, 21rem);
  aspect-ratio: 1;
  border: 1px solid #a3e8cc2b;
  border-radius: 50%;
}

.hero-art::after {
  width: min(130%, 26rem);
  border-style: dashed;
  border-color: #a3e8cc26;
}

.hero-illustration {
  z-index: 1;
  position: relative;
  width: min(76%, 11.75rem);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  transform: rotate(-8deg);
}

.hero-sheet, .hero-art:empty::before {
  width: 82%;
  aspect-ratio: 5 / 6;
  padding: 18% 15%;
  display: grid;
  align-content: start;
  gap: .65rem;
  border: 1px solid #baebd581;
  border-radius: 16px;
  background: linear-gradient(145deg, #c9f0de24, #73c9ae13);
  box-shadow: 1rem 1.3rem 0 -.25rem #80c4a929, 1.05rem 1.35rem 0 -.25rem #a3e8cc55;
}

.hero-art:empty::before { width: 42%; padding: 0; transform: rotate(-8deg); }
.hero-sheet-title, .hero-sheet-line {
  height: .34rem;
  border-radius: 1rem;
  background: #b8e7d565;
}

.hero-sheet-title { width: 72%; height: .55rem; margin-bottom: .4rem; background: var(--mint); }
.hero-sheet-line:last-child { width: 62%; }
.hero-signal {
  position: absolute;
  right: -1.05rem;
  bottom: -.6rem;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--mint);
  color: var(--green);
  border: 4px solid #244851;
  border-radius: 17px;
  font-size: 1.55rem;
  font-weight: 800;
  transform: rotate(8deg);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  margin: 1.75rem 0 1rem;
}

.section-head :is(h1, h2, h3, p):last-child { margin-bottom: 0; }
.grid, .form-grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.grid-2, .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.card, .tender-card, .metric, .rank-card, .empty {
  min-width: 0;
  padding: clamp(1.05rem, 2.4vw, 1.55rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.card > :last-child, .tender-card > :last-child, .rank-card > :last-child, .empty > :last-child { margin-bottom: 0; }
.tender-card { display: flex; flex-direction: column; }
.tender-card .actions { margin-top: auto; padding-top: .6rem; }
.tender-card .badge { align-self: flex-start; }
.metric-value { display: block; font-size: clamp(1.45rem, 3vw, 2.15rem); font-weight: 750; line-height: 1.15; }
.metric-label, .muted, .hint, .meta { color: var(--muted); }
.meta, .hint { font-size: .87rem; }
.hint { margin: .35rem 0 0; }
.text-block { white-space: pre-wrap; overflow-wrap: anywhere; }

.badge, .pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  max-width: 100%;
  padding: .21rem .61rem;
  border-radius: 999px;
  background: #ebf0f2;
  color: #334d5f;
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.45;
}

.badge::before { content: ""; width: .38rem; height: .38rem; flex: 0 0 auto; border-radius: 50%; background: currentColor; }
.badge-open, .badge-complete { background: #e0f4e9; color: #145d49; }
.badge-draft, .badge-pending, .badge-running { background: #fff0d6; color: #76500e; }
.badge-closed { background: #e7eef4; color: #3a536a; }
.badge-failed { background: #fce8e6; color: var(--danger); }

.button, button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  min-height: 2.7rem;
  padding: .52rem .94rem;
  border: 1px solid var(--navy);
  border-radius: 9px;
  background: var(--navy);
  color: var(--white);
  font-size: .89rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.button:hover, button[type="submit"]:hover { background: #245063; border-color: #245063; }
.button.button-secondary, button.button-secondary { border-color: #bccdcb; background: var(--white); color: var(--ink); }
.button.button-secondary:hover, button.button-secondary:hover { border-color: #7ba49b; background: #ecf7f2; }
.button.button-small, button.button-small { min-height: 2.25rem; padding: .35rem .65rem; font-size: .82rem; }
button:disabled { opacity: .65; cursor: not-allowed; }
.form-actions { margin-top: 1.15rem; }
.field { display: grid; align-content: start; gap: .35rem; margin-bottom: .9rem; min-width: 0; }
.form-grid > .field, .stack > .field { margin-bottom: 0; }
.field-full, .span-2 { grid-column: 1 / -1; }

label, legend { font-weight: 650; font-size: .92rem; }
fieldset { min-width: 0; margin: 0; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; }
input:not([type="checkbox"], [type="radio"], [type="hidden"]), select, textarea {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  padding: .54rem .72rem;
  border: 1px solid #b6c8c6;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}

textarea { min-height: 7.25rem; resize: vertical; }
input::placeholder, textarea::placeholder { color: #657782; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--green); }
[aria-invalid="true"] { border-color: var(--danger); }

.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--white); font-size: .91rem; }
th, td { padding: .75rem .85rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
th { background: #eef4f2; font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fbfa; }

.notice {
  margin: 0 0 1rem;
  padding: .8rem 1rem;
  border: 1px solid #c7d7dc;
  border-left-width: 4px;
  border-radius: 8px;
  background: #edf4f7;
  color: #244457;
  overflow-wrap: anywhere;
}

.notice > :last-child { margin-bottom: 0; }
.notice-error { border-color: #d99a96; background: #fff0ed; color: var(--danger); }
.notice-success { border-color: #8fc8b0; background: #e7f7ed; color: #18523e; }
.empty { padding: 2rem 1.25rem; border-style: dashed; text-align: center; box-shadow: none; }
.ranking { display: grid; gap: 1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rank-card { border-top: 3px solid #87c6ae; }
.rank-card:first-child { border-top-color: var(--green); }
.rank-number { display: inline-flex; margin: 0 0 .7rem; color: var(--green); font-size: .77rem; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }

.footer {
  padding: 1.25rem max(1.5rem, calc((100% - 72rem) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--white);
  font-size: .83rem;
}

.footer-inner { width: 100%; display: flex; justify-content: space-between; gap: .4rem 1.25rem; flex-wrap: wrap; }
.footer p { margin: 0; }

@media (max-width: 790px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .topbar-inner, .container { width: calc(100% - 1.5rem); }
  .nav { order: 3; flex-basis: 100%; }
  .hero { min-height: auto; grid-template-columns: 1fr; gap: .75rem; border-radius: 18px; }
  .hero-art { min-height: 8.5rem; width: min(70%, 13rem); justify-self: end; margin: -1rem 0 -.75rem; }
  .hero-illustration { width: 5.5rem; }
  .hero-sheet { gap: .3rem; }
  .hero-sheet-title { height: .35rem; margin-bottom: .15rem; }
  .hero-sheet-line { height: .2rem; }
  .hero-signal { width: 2.3rem; height: 2.3rem; font-size: .93rem; border-radius: 11px; }
  .grid-2, .grid-3, .form-grid, .ranking { grid-template-columns: minmax(0, 1fr); }
  .section-head { align-items: flex-start; }
  th, td { padding: .6rem; }
  .footer { padding-inline: .75rem; }
}
.skip-link {
  position: fixed;
  top: .5rem;
  left: .5rem;
  z-index: 5;
  padding: .65rem 1rem;
  background: white;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.container > .grid + .card, .container > .card + .card, .container > .card + .notice {
  margin-top: 1rem;
}

summary { cursor: pointer; font-weight: 650; }
details > :not(summary):first-of-type { margin-top: .65rem; }
