:root {
  --ibew-bg: #050505;
  --ibew-bg-2: #0d0d0d;
  --ibew-panel: #111111;
  --ibew-panel-2: #181818;
  --ibew-text: #f6f1df;
  --ibew-muted: #b8b0a0;
  --ibew-gold: #d4af37;
  --ibew-gold-2: #f4d76b;
  --ibew-line: rgba(212, 175, 55, 0.22);
  --ibew-line-soft: rgba(255, 255, 255, 0.09);
  --ibew-good: #52d273;
  --ibew-warn: #f4d76b;
  --ibew-bad: #ef6b6b;
  --ibew-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
  --ibew-radius: 8px;
  --ibew-max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--ibew-bg);
}

body {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 100vh;
  color: var(--ibew-text);
  background:
    radial-gradient(circle at top left, rgba(212, 175, 55, 0.12), transparent 20rem),
    linear-gradient(180deg, #050505 0%, #101010 52%, #050505 100%) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

a {
  color: var(--ibew-gold-2);
}

a:hover {
  color: #fff2b8;
}

img {
  max-width: 100%;
}

.ms-nav,
.pj-nav,
body > header {
  background: rgba(5, 5, 5, 0.9) !important;
  border-bottom: 1px solid var(--ibew-line-soft) !important;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
}

body > header {
  padding: 16px !important;
}

.public-nav,
body > header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.ms-nav {
  position: sticky;
  top: 0;
  z-index: 9999;
}

.ms-nav-inner,
.pj-nav-inner {
  max-width: var(--ibew-max) !important;
  padding: 12px 16px !important;
}

.ms-brand,
.pj-brand,
.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff !important;
  font-weight: 900;
  text-decoration: none;
}

.ms-brand img,
.pj-logo,
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--ibew-radius);
  object-fit: cover;
  border: 1px solid var(--ibew-line);
  background: #000;
  flex: 0 0 auto;
}

.ms-links {
  align-items: center;
}

.ms-links a,
.pj-link,
header nav a,
.public-nav a {
  color: var(--ibew-muted) !important;
  border: 1px solid transparent;
  border-radius: 999px !important;
  padding: 8px 10px !important;
  text-decoration: none !important;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.1;
}

.ms-links a:hover,
.ms-links a.active,
.pj-link:hover,
.pj-link-active,
header nav a:hover,
header nav a[aria-current="page"],
.public-nav a:hover,
.public-nav a.active {
  color: var(--ibew-gold-2) !important;
  border-color: var(--ibew-line);
  background: rgba(212, 175, 55, 0.08) !important;
  outline: 0 !important;
}

.ms-tools-btn,
button.primary,
a.primary {
  color: #050505 !important;
  background: var(--ibew-gold) !important;
  border-color: var(--ibew-gold) !important;
}

.ms-tools-btn:hover,
button.primary:hover,
a.primary:hover {
  background: var(--ibew-gold-2) !important;
}

.ms-nav-toggle span {
  background: var(--ibew-text) !important;
}

.wrap,
main,
body > h1,
body > p,
body > .sub,
body > .grid,
body > .card,
body > .result,
body > table,
body > .small {
  max-width: var(--ibew-max);
  margin-left: auto;
  margin-right: auto;
}

body > h1,
body > p,
body > .sub,
body > .grid,
body > .card,
body > .result,
body > table,
body > .small {
  width: min(calc(100% - 32px), var(--ibew-max));
}

body > h1 {
  margin-top: 28px;
}

h1,
h2,
h3,
.title,
.local,
.value,
.v {
  color: var(--ibew-gold-2);
  letter-spacing: 0;
}

p,
.sub,
.muted,
.lede,
.desc,
.hint,
.note,
.countline,
.small,
.k,
.label {
  color: var(--ibew-muted) !important;
}

.public-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.brand-panel,
.hero-brand-card,
.banner,
.notice,
.panel,
.card,
.job,
.metric,
.stat,
.table-wrap,
.status,
.message {
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.08), rgba(255, 255, 255, 0.035)) !important;
  border: 1px solid var(--ibew-line) !important;
  border-radius: var(--ibew-radius) !important;
  box-shadow: var(--ibew-shadow);
  color: var(--ibew-text);
}

.brand-panel,
.hero-brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.brand-panel strong,
.hero-brand-card strong {
  display: block;
  color: #fff;
  margin-bottom: 3px;
}

.brand-panel span,
.hero-brand-card span {
  display: block;
  color: var(--ibew-muted);
  line-height: 1.35;
}

.grid,
.cards,
.summary,
.stats {
  gap: 12px;
}

.card,
.job,
.panel,
.metric,
.stat {
  border-radius: var(--ibew-radius) !important;
}

input,
select,
button,
textarea {
  border: 1px solid var(--ibew-line-soft) !important;
  border-radius: var(--ibew-radius) !important;
  background: #0b0b0b !important;
  color: var(--ibew-text) !important;
  font: inherit;
}

input::placeholder,
textarea::placeholder {
  color: #8f8777 !important;
}

input:focus,
select:focus,
button:focus,
textarea:focus {
  border-color: var(--ibew-gold) !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.16);
  outline: 0;
}

button,
.filter-btn,
.state-btn {
  cursor: pointer;
}

table {
  color: var(--ibew-text);
}

th {
  background: #101010 !important;
  color: var(--ibew-gold-2) !important;
}

td,
th {
  border-color: var(--ibew-line-soft) !important;
}

.chip,
.pill,
.badge,
.stat,
.source-badge,
.warning-badge {
  border: 1px solid var(--ibew-line) !important;
  background: rgba(212, 175, 55, 0.08) !important;
  color: #f6e7ac !important;
}

.requirement-badge,
.pj-requirement-badge,
.req.requirement-badge {
  display: inline-flex !important;
  align-items: center;
  min-height: 30px;
  max-width: 100%;
  gap: 5px;
  border: 1px solid rgba(212, 175, 55, 0.38) !important;
  background: rgba(212, 175, 55, 0.12) !important;
  color: #fff0b8 !important;
  border-radius: 999px !important;
  padding: 6px 9px !important;
  font-size: 0.82rem !important;
  font-weight: 900 !important;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.requirement-action {
  min-height: 30px;
  padding: 6px 9px !important;
  font-size: 0.82rem !important;
}

.requirement-raw {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

body.tools-page .tools-landing {
  width: min(calc(100% - 32px), var(--ibew-max));
  margin: 0 auto;
  padding: 28px 0 48px;
}

body.tools-page .tools-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
}

body.tools-page .tools-brand-panel {
  min-height: 100%;
}

body.tools-page .tools-hero-copy {
  padding: 18px 0 4px;
}

body.tools-page .tools-eyebrow,
body.tools-page .tool-card-meta {
  margin: 0 0 8px;
  color: #f6e7ac !important;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

body.tools-page h1 {
  margin: 0 0 10px;
  color: var(--ibew-gold-2);
  font-size: clamp(2rem, 7vw, 3.45rem);
  line-height: 0.98;
}

body.tools-page .tools-hero-copy p:not(.tools-eyebrow) {
  max-width: 760px;
  margin: 0;
  color: var(--ibew-muted) !important;
  font-size: 1.05rem;
  line-height: 1.6;
}

body.tools-page .tools-hero-copy strong {
  color: #fff;
}

body.tools-page .tools-grid {
  width: 100%;
  max-width: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 14px;
  margin-top: 24px;
}

body.tools-page .tool-card {
  position: relative;
  display: flex;
  min-height: 156px;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 18px;
  overflow: hidden;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

body.tools-page .tool-card::after {
  content: "Open";
  align-self: flex-start;
  min-height: 36px;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(212, 175, 55, 0.42);
  border-radius: 999px;
  color: #050505;
  background: var(--ibew-gold);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
}

body.tools-page .tool-card:hover,
body.tools-page .tool-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(244, 215, 107, 0.62) !important;
  background: linear-gradient(180deg, rgba(212, 175, 55, 0.14), rgba(255, 255, 255, 0.045)) !important;
  color: var(--ibew-text);
}

body.tools-page .tool-card:focus-visible {
  outline: 3px solid rgba(244, 215, 107, 0.36);
  outline-offset: 3px;
}

body.tools-page .tool-card .title {
  font-size: 1.22rem;
  line-height: 1.15;
}

body.tools-page .tool-card .desc {
  margin-top: 4px;
  line-height: 1.45;
}

.good,
.ok {
  color: var(--ibew-good) !important;
}

.warn {
  color: var(--ibew-warn) !important;
}

.bad,
.error {
  color: var(--ibew-bad) !important;
}

@media (min-width: 760px) {
  .public-hero {
    grid-template-columns: minmax(0, 1fr) minmax(230px, 0.34fr);
  }
}

@media (max-width: 820px) {
  body {
    background:
      radial-gradient(circle at top, rgba(212, 175, 55, 0.14), transparent 16rem),
      linear-gradient(180deg, #050505 0%, #101010 58%, #050505 100%) !important;
  }

  .ms-nav-inner,
  .pj-nav-inner {
    align-items: flex-start !important;
  }

  .ms-links.open {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .ms-links a,
  .pj-link,
  header nav a,
  .public-nav a {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  body > h1,
  body > p,
  body > .sub,
  body > .grid,
  body > .card,
  body > .result,
  body > table,
  body > .small {
    width: min(calc(100% - 24px), var(--ibew-max));
  }

  body.tools-page .tools-landing {
    width: min(calc(100% - 24px), var(--ibew-max));
    padding-top: 20px;
  }

  body.tools-page .tools-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.tools-page .tool-card {
    min-height: 142px;
    padding: 16px;
  }
}
