/* ==========================================================================
   Tools page specifics.

   Everything here is geometry the shared layer in app.css does not already
   cover, or a selected/hover state the prototype expresses as an inline
   `style-hover`. Loaded after app.css, so equal-specificity rules that
   restate a shared value (44px controls rather than 42px) win.
   ========================================================================== */

/* Flag SVGs are authored at a fixed size; let them fill whatever box the
   design asks for instead of being clipped by the wrapper's overflow. */
.tl-flag svg { width: 100%; height: 100%; display: block }

/* --------------------------------------------------------------------------
   Sticky section nav
   -------------------------------------------------------------------------- */
.tl-toolnav {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 32px;
  position: sticky;
  top: 120px;
  z-index: 50;
  background: var(--pc-white);
  padding: 8px 0;
}
.tl-pill {
  font-family: var(--font-body);
  font-size: 14px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--pc-white);
  color: var(--text-body);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.tl-pill:hover { border-color: var(--pc-blue-primary); color: var(--pc-blue-primary); text-decoration: none }

/* --------------------------------------------------------------------------
   Shared card furniture
   -------------------------------------------------------------------------- */
.tl-cardhead {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
}
.tl-cardtitle {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.tl-cardsub { font-size: 13px; color: var(--text-body); margin-top: 3px }
.tl-tier {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: #e6f1ec;
  color: var(--pc-green);
}

/* Field furniture: this page's controls stand 44px rather than the shared 42px. */
.tl-label  { margin-bottom: 8px }
.tl-select { height: 44px; padding: 0 34px 0 14px; background-position: right 12px center }
.tl-sechead { margin-bottom: 18px }

/* Section grids. No `align-items` — cards stretch so their footers line up. */
.tl-grid-300 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px }
.tl-grid-280 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px }
.tl-grid-240 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-bottom: 20px }

/* --------------------------------------------------------------------------
   Indemnity calculator
   -------------------------------------------------------------------------- */
.tl-rail {
  flex: 1 1 300px;
  max-width: 380px;
  padding: 24px 26px;
  background: var(--pc-mist);
  border-right: 1px solid var(--border);
}
.tl-cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px }
.tl-cbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--pc-white);
  color: var(--text-body);
  font-weight: 500;
}
.tl-cbtn.is-on {
  border-color: var(--pc-blue-primary);
  background: #e8f0fa;
  color: var(--pc-blue-primary);
  font-weight: 600;
}
.tl-seg { height: 44px; background: var(--pc-white) }
.tl-range { width: 100%; accent-color: var(--pc-blue-primary); cursor: pointer }
.tl-scale { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); margin-top: 4px }
.tl-wage { height: 44px; font-size: 15px }
.tl-help { font-size: 11px; color: var(--text-muted); margin-top: 6px }

.tl-result {
  background: var(--pc-navy-deep);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.tl-result__glow {
  position: absolute;
  right: -40px;
  top: -50px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(54, 119, 194, .24), transparent 70%);
}
.tl-result__eyebrow {
  font-family: var(--font-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8bb7e8;
  margin-bottom: 8px;
}
.tl-result__amt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 4vw, 44px);
  color: var(--pc-white);
  letter-spacing: var(--ls-display);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.tl-result__ccy { font-size: 15px; color: var(--pc-slate-300); font-weight: 600 }
.tl-result__meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}
.tl-result__k { font-size: 11px; color: var(--pc-slate-300); margin-bottom: 2px }
.tl-result__v { font-size: 13px; color: var(--pc-white); font-weight: 600 }

.tl-explain {
  background: #eeebf8;
  border: 1px solid #ddd6f3;
  border-radius: var(--radius-md);
  padding: 15px 17px;
  margin-bottom: 14px;
}
.tl-explain__head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px }
.tl-explain__title { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--text-primary) }
.tl-explain__body { font-size: 13px; color: var(--text-body); line-height: 1.65; margin-bottom: 8px }
.tl-explain__note { font-size: 13px; color: var(--text-primary); line-height: 1.6; font-weight: 500 }

/* --------------------------------------------------------------------------
   Labour law library
   -------------------------------------------------------------------------- */
.tl-lawcard {
  background: var(--pc-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
}
.tl-topic {
  font-size: 11px;
  color: var(--text-body);
  background: var(--pc-mist);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}
.tl-lawfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--pc-cloud);
}

/* --------------------------------------------------------------------------
   Country profiles
   -------------------------------------------------------------------------- */
.tl-prow { display: flex; align-items: center; justify-content: space-between; font-size: 13px }
.tl-prow span:first-child { color: var(--text-muted) }
.tl-prow span:last-child  { font-weight: 600; color: var(--text-primary) }

/* --------------------------------------------------------------------------
   Market comparison
   -------------------------------------------------------------------------- */
.tl-cmp {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  background: var(--pc-white);
}
.tl-cmp__chip {
  font-family: var(--font-label);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.tl-cmp__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 10px;
  line-height: 1.35;
}
.tl-cmp__row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--pc-cloud);
}
.tl-cmp__row span:first-child { color: var(--text-muted) }
.tl-cmp__row span:last-child  { font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums }
.tl-cmp__x {
  margin-top: auto;
  align-self: flex-start;
  font-family: var(--font-body);
  font-size: 12px;
  color: #c02626;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tl-cmp__add {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--pc-white);
  font-family: var(--font-body);
}
.tl-cmp__add:hover { border-color: var(--pc-blue-primary); color: var(--pc-blue-primary) }
.tl-cmp__add[hidden] { display: none }

/* --------------------------------------------------------------------------
   Alerts centre
   -------------------------------------------------------------------------- */
.tl-num {
  width: 90px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  font-variant-numeric: tabular-nums;
  background: var(--pc-white);
}
.tl-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--pc-mist);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
}
.tl-alert__icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  background: #e8f0fa;
  color: var(--pc-blue-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.tl-alert__t { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--text-primary); margin-bottom: 2px }
.tl-alert__p { font-size: 12px; color: var(--text-muted) }
.tl-alert__del {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 17px;
  display: flex;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
}
.tl-alert__del:hover { color: #c02626 }
.tl-toggle {
  width: 40px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--pc-line);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .2s;
  border: none;
  padding: 0;
}
.tl-toggle span {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left .2s;
}
.tl-toggle.is-on { background: var(--pc-green) }
.tl-toggle.is-on span { left: 20px }
.tl-note { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 6px }

/* --------------------------------------------------------------------------
   Preferences + promo column
   -------------------------------------------------------------------------- */
.tl-prefs {
  scroll-margin-top: 180px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  align-items: start;
}
.tl-promo {
  background: var(--pc-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.tl-promo__badge {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--pc-cloud);
  color: var(--text-muted);
}
.tl-navy { background: var(--pc-navy-deep); border-radius: var(--radius-xl); padding: 24px; position: relative; overflow: hidden }
.tl-navy__glow {
  position: absolute;
  right: -40px;
  bottom: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(54, 119, 194, .24), transparent 70%);
}

/* The persona segmented control runs a touch larger here than in the hub bar. */
#pref-view button { font-size: 14px }

@media (prefers-reduced-motion: reduce) {
  .tl-toggle, .tl-toggle span { transition: none }
}
