/* Renter tools: calculators, checklists and the tools hub. */

/* ---------- hub ---------- */
.tool-hero-row {
  display: flex;
  gap: 22px;
  align-items: center;
}

.tool-hero-icon {
  flex: none;
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--gold);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

.tools-hero .lead {
  color: rgba(255,255,255,.85);
  max-width: 62ch;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 22px;
}

.tool-grid.small {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.tool-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 28px;
  box-shadow: var(--sh);
  color: var(--text);
  text-decoration: none;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--sh-lg);
  border-color: var(--line-2);
}

.tool-icon {
  display: inline-flex;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  align-items: center;
  justify-content: center;
  background: var(--gold-soft);
  color: #6d5c00;
  margin-bottom: 16px;
}

.tool-card h2,
.tool-card h3 {
  font-size: 1.15rem;
  margin: 0 0 6px;
  color: var(--ink);
}

.tool-card p {
  margin: 0 0 14px;
  font-size: .95rem;
}

.tool-go {
  margin-top: auto;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-weight: 700;
  color: var(--navy);
}

/* ---------- calculator layout ---------- */
.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.calc-form fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px 8px;
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  background: #fff;
}

.calc-form legend {
  font-weight: 800;
  color: var(--ink);
  padding: 0 8px;
  margin-left: -8px;
  font-size: 1.02rem;
}

.fld {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink);
}

.fld.wide,
.seg-pick,
.fld-help,
.chk-row {
  grid-column: 1 / -1;
}

.fld input,
.fld select {
  font: inherit;
  font-weight: 500;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  padding: 11px 12px;
  background: #fff;
  width: 100%;
  color: var(--ink);
}

.fld input:focus,
.fld select:focus {
  outline: 2px solid var(--navy);
  outline-offset: 1px;
}

.fld input[type=range] {
  padding: 0;
  border: 0;
  accent-color: var(--navy);
}

.money,
.pct {
  position: relative;
  display: block;
}

.money input {
  padding-left: 26px;
}

.money::before {
  content: "$";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.pct input {
  padding-right: 30px;
}

.pct::after {
  content: "%";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.chk-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 16px;
  font-weight: 600;
  color: var(--ink);
  font-size: .92rem;
}

.chk-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--navy);
}

.fld-help {
  color: var(--muted);
  font-size: .85rem;
  margin: -6px 0 14px;
}

.seg-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.seg-pick label {
  position: relative;
}

.seg-pick input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.seg-pick span {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
}

.seg-pick input:checked + span {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.seg-pick input:focus-visible + span {
  outline: 2px solid var(--gold);
}

[data-show][hidden] {
  display: none !important;
}

/* results panel */
.calc-out {
  position: sticky;
  top: 100px;
  background: var(--deep);
  color: #fff;
  border-radius: 22px;
  padding: 28px;
  box-shadow: var(--sh-lg);
}

.co-label {
  margin: 0;
  color: rgba(255,255,255,.7);
  font-weight: 600;
  font-size: .9rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.co-big {
  font-size: clamp(2.4rem, 1.8rem + 2vw, 3.2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  margin: 4px 0;
  color: #F5E79D;
}

.co-sub {
  color: rgba(255,255,255,.75);
  font-size: .9rem;
  margin: 0 0 16px;
}

.co-break {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}

.co-break li {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0 12px;
  border-bottom: 1px solid rgba(255,255,255,.1);
  font-size: .93rem;
}

.co-break small {
  display: block;
  color: rgba(255,255,255,.55);
  font-size: .78rem;
}

.co-break i {
  position: absolute;
  left: 0;
  bottom: 4px;
  height: 3px;
  width: var(--w);
  background: var(--gold-2);
  border-radius: 3px;
}

.co-rebate,
.co-income {
  font-size: .9rem;
  background: rgba(255,255,255,.07);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 10px;
  color: rgba(255,255,255,.88);
}

.co-rebate b {
  color: #F5E79D;
}

.calc-out .btn {
  margin-top: 8px;
}

.co-people {
  list-style: none;
  padding: 0;
  margin: 10px 0 14px;
}

.co-people li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.co-people small {
  display: block;
  color: rgba(255,255,255,.55);
}

.co-people b {
  font-size: 1.4rem;
  color: #F5E79D;
}

.co-people em {
  grid-column: 1 / -1;
  font-style: normal;
  font-size: .82rem;
  color: rgba(255,255,255,.6);
}

.co-options {
  display: grid;
  gap: 12px;
  margin: 14px 0;
}

.co-opt {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  padding: 14px 16px;
}

.co-opt.best {
  border-color: var(--gold-2);
  background: rgba(201,171,18,.12);
}

.co-opt p {
  margin: 0;
  font-weight: 600;
}

.co-opt p span {
  background: var(--gold-2);
  color: var(--deep);
  font-size: .72rem;
  font-weight: 800;
  border-radius: 99px;
  padding: 2px 8px;
  margin-left: 6px;
}

.co-opt b {
  display: block;
  font-size: 1.6rem;
  color: #fff;
}

.co-opt small {
  color: rgba(255,255,255,.6);
}

/* roommate rows */
.mates {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.mate {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0 14px;
  align-items: end;
  background: var(--soft);
  border-radius: 14px;
  padding: 14px 44px 0 14px;
}

.mate .chk-row {
  grid-column: auto;
}

.mate-x {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}

.calc-form fieldset > .btn {
  grid-column: 1 / -1;
  justify-self: start;
  margin-bottom: 16px;
}

/* info + notes */
.tool-info {
  max-width: 900px;
  margin: 44px 0 0;
  background: var(--soft);
  border-radius: var(--r);
  padding: 28px 32px;
}

.tool-info h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.tool-info li {
  margin-bottom: 10px;
}

.tool-note {
  color: var(--muted);
  font-size: .85rem;
  margin: 24px 0 0;
}

/* ---------- checklists ---------- */
.cl-bar {
  position: sticky;
  top: 84px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 12px 10px 22px;
  box-shadow: var(--sh);
  margin-bottom: 28px;
}

.cl-bar p {
  margin: 0;
  white-space: nowrap;
  font-size: .92rem;
}

.cl-progress {
  flex: 1;
  height: 10px;
  background: var(--soft-2);
  border-radius: 99px;
  overflow: hidden;
}

.cl-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-2));
  transition: width .3s;
}

.cl-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 22px;
}

.cl-group {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: var(--sh);
}

.cl-group h2 {
  font-size: 1.1rem;
  margin: 0 0 12px;
}

.cl-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cl-group li {
  border-top: 1px solid var(--line);
}

.cl-group label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  cursor: pointer;
  font-size: .95rem;
}

.cl-group input {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  accent-color: var(--navy);
}

.cl-group input:checked + span {
  color: var(--muted);
  text-decoration: line-through;
}

.cl-notes {
  display: block;
  margin-top: 26px;
  font-weight: 700;
  color: var(--ink);
}

.cl-notes textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 14px;
}

/* ---------- responsive + print ---------- */
@media (max-width: 960px) {
  .calc {
    grid-template-columns: 1fr;
  }

  .calc-out {
    position: static;
  }
}

@media (max-width: 600px) {
  .calc-form fieldset {
    grid-template-columns: 1fr;
    padding: 18px 16px 4px;
  }

  .tool-hero-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .cl-bar {
    flex-wrap: wrap;
    border-radius: 18px;
    top: 70px;
  }

  .cl-progress {
    flex-basis: 100%;
  }

  .cl-groups {
    grid-template-columns: 1fr;
  }
}

@media print {
  .site-header, .topbar, .site-footer, .ps.soft, .cl-bar button, .welcome, .page-hero .crumbs {
    display: none !important;
  }

  .page-hero {
    background: none !important;
    color: #000;
    padding: 0;
  }

  .page-hero h1 {
    color: #000;
  }

  .cl-group {
    box-shadow: none;
    break-inside: avoid;
  }
}

/* ---------- affordability + 3x calculators ---------- */
.mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: var(--soft);
  border-radius: 16px;
  padding: 6px;
  margin-bottom: 20px;
}

.mode-tabs label {
  position: relative;
}

.mode-tabs input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.mode-tabs span {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: background .2s, color .2s, box-shadow .2s;
}

.mode-tabs input:checked + span {
  background: #fff;
  color: var(--navy);
  box-shadow: var(--sh);
}

.mode-tabs input:focus-visible + span {
  outline: 2px solid var(--gold);
}

.co-label.sm {
  font-size: .78rem;
  margin-top: 18px;
  margin-bottom: 8px;
}

.co-gauge {
  position: relative;
  display: flex;
  height: 12px;
  border-radius: 99px;
  overflow: visible;
  margin: 14px 0 6px;
}

.co-gauge span {
  height: 100%;
}

.co-gauge .g-safe { width: 60%; background: #3fb27f; border-radius: 99px 0 0 99px; }
.co-gauge .g-ok { width: 20%; background: #e7c63a; }
.co-gauge .g-high { width: 20%; background: #e06a5a; border-radius: 0 99px 99px 0; }

.co-gauge i {
  position: absolute;
  top: 50%;
  left: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid var(--deep);
  box-shadow: 0 0 0 2px #fff, 0 4px 10px rgba(0,0,0,.35);
  transform: translate(-50%, -50%);
  transition: left .35s ease;
}

.co-gauge-legend {
  display: grid;
  grid-template-columns: 60% 20% 20%;
  font-size: .75rem;
  color: rgba(255,255,255,.6);
  margin: 0 0 6px;
}

.co-stack {
  display: flex;
  height: 16px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}

.co-stack span {
  width: var(--w);
  transition: width .35s ease;
}

.s1 { background: #F5E79D; }
.s2 { background: #7fb3d5; }
.s3 { background: #e06a5a; }
.s4 { background: #b39ddb; }
.s5 { background: #3fb27f; }
.s6 { background: rgba(255,255,255,.35); }

.co-legend {
  list-style: none;
  padding: 0;
  margin: 10px 0 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 14px;
  font-size: .84rem;
  color: rgba(255,255,255,.8);
}

.co-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.co-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.co-legend b {
  margin-left: auto;
  color: #fff;
}

.co-checks {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 8px;
}

.co-checks li,
.co-status {
  font-size: .88rem;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(63,178,127,.14);
  color: #d6f5e6;
  margin: 0;
}

.co-checks li.bad,
.co-status.bad {
  background: rgba(224,106,90,.16);
  color: #ffd9d3;
}

.co-status {
  margin: 0 0 12px;
}

.co-rules {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  display: grid;
  gap: 6px;
}

.co-rules li {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  font-size: .9rem;
}

.co-rules li.on {
  background: rgba(201,171,18,.2);
  outline: 1px solid var(--gold-2);
}

.calc-out .btn + .btn {
  margin-top: 10px;
}

.calc [hidden] {
  display: none !important;
}

.calc-out b {
  color: #fff;
}

.co-rules li b {
  color: #F5E79D;
}

.co-big {
  color: #F5E79D !important;
}

/* ---------- commute apartment finder ---------- */
.commute {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.commute-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px;
  box-shadow: var(--sh);
}

.commute-form > .btn {
  margin: -4px 0 16px;
}

.commute [hidden] {
  display: none !important;
}

.cm-dot {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-size: .72rem;
  font-weight: 800;
  color: #fff;
  background: var(--navy);
  margin-right: 6px;
  vertical-align: middle;
}

.cm-dot.b { background: #7b5ea7; }

.cm-map-wrap {
  position: relative;
  min-height: 560px;
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: var(--sh);
  border: 1px solid var(--line);
}

.cm-map {
  position: absolute;
  inset: 0;
  background: var(--soft);
}

.cm-loading {
  display: grid;
  place-items: center;
  height: 100%;
  margin: 0;
  color: var(--muted);
}

.cm-hint {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: var(--deep);
  color: #fff;
  padding: 10px 16px;
  border-radius: 99px;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: var(--sh-lg);
  margin: 0;
}

.cm-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 500;
  display: flex;
  gap: 12px;
  background: rgba(255,255,255,.94);
  padding: 8px 12px;
  border-radius: 12px;
  font-size: .8rem;
  box-shadow: var(--sh);
}

.cm-legend i,
.cm-time {
  --c: #2e9e6b;
}

.cm-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
  margin-right: 5px;
}

.t1 { --c: #2e9e6b; }
.t2 { --c: #d9a90f; }
.t3 { --c: #e0703a; }

.cm-pin {
  display: flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  border: 3px solid #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
  animation: cm-pulse 2.4s ease-out infinite;
}

.cm-pin.b { background: #7b5ea7; }

@keyframes cm-pulse {
  0% { box-shadow: 0 0 0 0 rgba(29,68,99,.45), 0 6px 16px rgba(0,0,0,.35); }
  70% { box-shadow: 0 0 0 16px rgba(29,68,99,0), 0 6px 16px rgba(0,0,0,.35); }
  100% { box-shadow: 0 0 0 0 rgba(29,68,99,0), 0 6px 16px rgba(0,0,0,.35); }
}

.cm-results {
  margin-top: 28px;
}

.cm-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
  background: var(--soft);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 18px;
}

.cm-summary p {
  margin: 0;
}

.cm-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.cm-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--sh);
  scroll-margin-top: 120px;
}

.cm-img {
  background: var(--soft);
}

.cm-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cm-body {
  padding: 14px 16px;
  min-width: 0;
}

.cm-body h3 {
  font-size: 1rem;
  margin: 0 0 4px;
}

.cm-body h3 a {
  color: var(--ink);
  text-decoration: none;
}

.cm-meta {
  font-size: .82rem;
  color: var(--muted);
  margin: 0 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cm-times {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.cm-time {
  display: inline-flex;
  align-items: center;
  font-size: .8rem;
  font-weight: 700;
  padding: 3px 10px 3px 3px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--c) 14%, #fff);
  color: color-mix(in srgb, var(--c) 70%, #000);
}

.cm-time .cm-dot {
  width: 18px;
  height: 18px;
  font-size: .65rem;
}

.cm-links {
  display: flex;
  gap: 14px;
  margin: 0;
  font-size: .85rem;
  font-weight: 600;
}

@media (max-width: 960px) {
  .commute {
    grid-template-columns: 1fr;
  }

  .cm-map-wrap {
    min-height: 420px;
  }
}

.cm-links a {
  white-space: nowrap;
}

.cm-links {
  flex-wrap: wrap;
  gap: 4px 14px;
}
