/* Course list, chips, estimator and agency catalog for course sites (runtime/app.js, the
   courses capability). Copied into the site by sbs-pkg-sync. Load it before the site's
   styles.css so the site can override any of it:
     <link rel="stylesheet" href="courses.css" /> … <link rel="stylesheet" href="styles.css" />
   Colors and fonts come from the theme tokens (--teal, --ink, --display…). */
/* Chips */
.filters,
.agency-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
.chip {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  align-items: center;
}
.chip:hover {
  border-color: var(--teal);
}
.chip.is-on {
  background: var(--deep);
  border-color: var(--deep);
  color: #fff;
}
.chip .n {
  font-size: 0.75rem;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
}
.chip.is-on .n {
  background: rgba(255, 255, 255, 0.18);
}
/* Courses */
.course-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.course {
  background: var(--paper);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  animation: rise 0.3s ease both;
}
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}
.course-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
}
.tag-rec {
  background: color-mix(in srgb, var(--teal) 12%, white);
  color: color-mix(in srgb, var(--teal) 65%, black);
}
.tag-sm {
  background: #e8eefc;
  color: #2a4fa8;
}
.tag-tech {
  background: var(--deep);
  color: color-mix(in srgb, var(--glow) 20%, white);
}
.tag-spec {
  background: color-mix(in srgb, var(--orange) 8%, white);
  color: color-mix(in srgb, var(--orange) 88%, black);
}
.agency {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.course h3 {
  font-size: 1.35rem;
}
.plan {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}
.plan li {
  padding-left: 16px;
  position: relative;
}
.plan li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}
.course-meta {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}
.course-meta b {
  color: var(--ink);
}
.course-meta a {
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.course-meta a:hover {
  text-decoration: underline;
}
.course-est {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--sand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
}
.est-ctrl {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}
.est-note {
  font-size: 0.9rem;
  color: var(--muted);
}
.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}
.stepper button {
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  width: 32px;
  height: 32px;
  border: 0;
  background: none;
  border-radius: 50%;
  color: var(--teal-ink);
  cursor: pointer;
}
.stepper button:hover:not(:disabled) {
  background: color-mix(in srgb, var(--teal) 12%, white);
}
.stepper button:disabled {
  color: var(--line);
  cursor: default;
}
.stepper output {
  min-width: 4.6ch;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}
.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
}
.mini-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--teal-ink);
}
.est-group {
  font: inherit;
  font-size: 0.88rem;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}
.course-book {
  margin-top: 12px;
  justify-content: center;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.course-book:hover,
.est-book:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--orange) 35%, transparent);
}
.est-book {
  justify-content: center;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.course-price {
  color: var(--teal-ink);
  white-space: nowrap;
  text-align: right;
  line-height: 1.1;
}
.course-price strong {
  display: block;
  font-family: var(--display);
  font-size: 1.6rem;
}
.course-price small {
  font-size: 0.75rem;
  color: var(--muted);
}
/* Estimator */
.est {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 48px;
  align-items: start;
}
.est > div p {
  color: var(--muted);
}
.est-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 16px;
}
.est-card label {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}
.est-card select,
.est-card input[type="number"] {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  width: 100%;
}
.combo {
  position: relative;
}
.est-card .combo input {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  padding: 10px 36px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  width: 100%;
  background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6b78' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E")
    no-repeat right 12px center / 16px;
}
.combo [role="listbox"] {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.combo [role="option"] {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--ink);
}
.combo [role="option"] small {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}
.combo [role="option"][aria-selected="true"] {
  font-weight: 600;
  color: var(--teal-ink);
}
.combo [role="option"].is-active {
  background: color-mix(in srgb, var(--teal) 12%, white);
}
.combo mark {
  background: none;
  padding: 0;
  border-radius: 0;
  color: var(--teal-ink);
  font-weight: 700;
}
.combo-group {
  padding: 10px 10px 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}
.combo-empty {
  padding: 12px 10px;
  font-size: 0.9rem;
  color: var(--muted);
}
.est-card input:disabled {
  background: #f3f5f7;
  color: var(--muted);
}
.est-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: end;
}
.est-card .check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  color: var(--ink);
  font-size: 0.95rem;
}
.est-card .check input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal-ink);
}
.est-card .check.muted {
  opacity: 0.45;
}
.est-out {
  background: var(--sand);
  border-radius: 12px;
  padding: 16px 18px;
  display: grid;
  gap: 8px;
}
.est-out div {
  display: flex;
  justify-content: space-between;
}
.est-out span {
  color: var(--muted);
}
.est-out .total {
  border-top: 1px solid color-mix(in srgb, var(--sand) 90%, black);
  padding-top: 10px;
  margin-top: 2px;
}
.est-out .total span {
  color: var(--ink);
  font-weight: 600;
}
.est-out .total strong {
  font-family: var(--display);
  font-size: 2rem;
  line-height: 1;
}
.fine {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}
/* Catalog */
.cat-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.seg {
  display: inline-flex;
  background: var(--sand);
  padding: 4px;
  border-radius: 999px;
}
.seg-btn {
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  border: 0;
  background: none;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
}
.seg-btn.is-on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.search {
  position: relative;
  flex: 1;
  max-width: 380px;
  min-width: 220px;
}
.search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: var(--muted);
}
.search input {
  width: 100%;
  font: inherit;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
}
.cat-count {
  color: var(--muted);
  font-size: 0.9rem;
  margin: -8px 0 16px;
}
.catalog {
  display: grid;
  gap: 28px;
}
.cat-group h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  font-size: 1.4rem;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--deep);
}
.cat-group h3 span {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--sand);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--muted);
}
.cat-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 3 260px;
  column-gap: 28px;
}
.cat-group li {
  break-inside: avoid;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.93rem;
}
.cat-group li a {
  color: inherit;
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.cat-group li a::after {
  content: "↗";
  color: var(--teal-ink);
  opacity: 0;
  transition: opacity 0.15s;
}
.cat-group li a:hover {
  color: var(--teal-ink);
}
.cat-group li a:hover::after,
.cat-group li a:focus-visible::after {
  opacity: 1;
}
mark {
  background: color-mix(in srgb, var(--glow) 34%, white);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}
.empty {
  color: var(--muted);
  padding: 24px;
  text-align: center;
  background: var(--sand);
  border-radius: 12px;
}
@media (max-width: 960px) {
  .est {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 620px) {
  .est-row {
    grid-template-columns: 1fr;
  }
  .search {
    max-width: none;
  }
}
