.phd {
  --phd-green: #123c48;
  --phd-yellow: #fbc64a;
  --phd-yellow-hover: #f9b82a;
  --phd-flora: #59b881;
  --phd-slate: #3e5460;
  --phd-ink: #444444;
  --phd-gray: #909090;
  --phd-light: #f3f3f3;
  --phd-rule: #eeeeee;
  --phd-soon: rgba(251, 198, 74, 0.2);
  color: #000;
}

.phd-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 18px;
}

.phd .phd-ptitle {
  margin: 0;
  color: var(--phd-green);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
  text-wrap: balance;
}

.phd-psub,
.phd-intro {
  margin: 4px 0 0;
  color: var(--phd-ink);
  font-size: 16px;
  line-height: 24px;
}

.phd-psub {
  margin-bottom: 24px;
}

/* detail page: the same 24px gap under the ad as the list page */
.phd-detail {
  margin-top: 24px;
}

.phd-side-related {
  margin-top: 20px;
}

.phd-intro {
  margin: 8px 0 0;
  max-width: 65ch;
}

/* the design's column: blocks 24px apart */
.phd-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.phd-stack > * {
  margin-bottom: 0;
}

.phd-frame {
  margin-bottom: 30px;
}

/* desktop: the search box grows so it ends where the ads column ends, like the undergrad table page */
@media (min-width: 768px) {
  .phd-frame-main {
    display: flex;
    flex-direction: column;
    /* the ad tiles keep a 30px bottom margin after the last one */
    padding-bottom: 30px;
  }

  .phd-frame-main .phd-stack {
    flex: 1;
  }

  .phd-frame-main .phd-sb {
    display: flex;
    flex: 1;
    flex-direction: column;
  }

  .phd-frame-main .phd-sb-grid {
    flex: 1;
    align-content: space-between;
  }
}

.phd-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.phd-stats li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--phd-light);
  color: var(--phd-green);
  font-size: 13px;
  line-height: 16px;
}

.phd-stats b {
  font-size: 16px;
  line-height: 20px;
  font-weight: 700;
}

.phd-stats li.is-soon {
  background: var(--phd-soon);
}

.phd-crumb {
  margin: 0 0 12px;
  color: var(--phd-slate);
  font-size: 16px;
  font-weight: 500;
}

.phd a.phd-link,
.phd a.phd-link:visited {
  color: #000;
  text-decoration: underline;
  text-decoration-color: var(--phd-gray);
  text-decoration-thickness: 2px;
  text-decoration-skip-ink: none;
  text-underline-offset: 2px;
}

.phd a.phd-link:hover {
  text-decoration-color: #000;
}

.phd-crumb a.phd-link {
  color: var(--phd-slate);
}

/* search block */
/* same box as the grad and undergrad table searches (.grad-table-form, #table-choices-label) */
.phd-sb {
  padding: 5px;
  border-radius: 4px;
  background: var(--phd-green);
}

.phd .phd-sb-tab {
  margin: 5px 5px 15px;
  padding: 0;
  color: #fff;
  font-size: 19.2px;
  font-weight: 600;
  line-height: 28.8px;
  text-align: left;
}

.phd-sb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  padding: 10px;
}

.phd-f {
  display: block;
  margin: 0;
}

.phd-f > span {
  display: block;
  color: #fff;
  font-size: 13px;
  line-height: 19.5px;
}

.phd-pick {
  display: block;
  width: 100%;
  height: 38px;
  margin-top: 1px;
  padding: 0 36px 0 12px;
  border: 0;
  border-radius: 8px;
  appearance: none;
  -webkit-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23444444' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  color: #16262b;
  font-size: 16px;
  cursor: pointer;
}

.phd-btn-view {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  align-self: end;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--phd-yellow);
  color: #000;
  font-size: 16px;
  font-weight: 600;
}

.phd-btn-view:hover {
  background: var(--phd-yellow-hover);
}

.phd-sc-actions {
  display: none;
}

/* panels */
.phd-panel {
  margin-bottom: 24px;
}

.phd .phd-panel-title {
  margin: 0;
  padding: 5px 15px;
  background: var(--phd-green);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 26px;
}

.phd-panel-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0 15px 10px;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.2);
}

.phd-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--phd-rule);
}

.phd-item:last-of-type {
  border-bottom: 0;
}

.phd-item > a,
.phd-item > a:visited {
  display: block;
  color: #000;
  font-size: 16px;
  line-height: 21px;
  text-decoration: none;
}

.phd-item > a:hover {
  text-decoration: underline;
}

.phd-item b {
  font-weight: 600;
}

.phd-legend .phd-item {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 4px 14px;
  align-items: start;
}

.phd-legend .phd-item .phd-label {
  justify-self: start;
  margin-top: 2px;
}

.phd-legend .phd-item span:last-child {
  color: var(--phd-ink);
  font-size: 14px;
  line-height: 21px;
}

.phd .phd-more,
.phd .phd-more:visited {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  width: calc(100% + 30px);
  min-height: 30px;
  margin: auto -15px -10px;
  padding: 0 5px 0 15px;
  border: 0;
  border-radius: 0 0 4px 4px;
  background: var(--phd-yellow);
  color: #000;
  font-size: 16px;
  line-height: 24px;
  text-decoration: none;
}

.phd .phd-more:hover {
  text-decoration: underline;
}

.phd-label {
  display: inline-block;
  padding: 1px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #e6e6e6;
  color: #222;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}

.phd-label[data-tone="darkest"] {
  background: #2e2e2e;
  color: #fff;
}

.phd-label[data-tone="dark"] {
  background: #4a4a4a;
  color: #fff;
}

.phd-label[data-tone="light"] {
  background: #d0d2d3;
}

.phd-label[data-tone="lightest"] {
  border-color: #d0d2d3;
  background: var(--phd-light);
}

.phd-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 6px 5px 0 0;
  padding: 5px 5px 4px;
  border-radius: 8px;
  background: var(--phd-flora);
  color: #000;
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
  vertical-align: middle;
}

.phd-badge[data-state="expired"] {
  background: var(--phd-gray);
}

.phd-date {
  padding-left: 5px;
  color: var(--phd-gray);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
}

/* results table (the table itself is the React app, styled like the undergrad table) */
.phd-tbl-sec {
  padding-top: 10px;
  scroll-margin-top: 12px;
}

/* Edu and the guide: one row, both boxes as tall as the taller one */
.phd-pair {
  margin-top: 24px;
  row-gap: 24px;
}

.phd-pair-cell {
  display: flex;
}

.phd-pair-cell > * {
  flex: 1;
  min-width: 0;
}

.phd-pair .phd-panel {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.phd-pair .phd-panel-body {
  flex: 1;
}

.phd-pair .phd-legend .phd-item {
  grid-template-columns: 150px minmax(0, 1fr);
}

.phd-pair .phd-chat {
  display: flex;
}

/* only the closed (compact) widget stretches, and no taller than 220px however long the guide gets;
   the opened chat keeps its own height */
.phd-pair .phd-chat {
  align-items: flex-start;
}

/* the chat always takes the cell's full width; as a flex item it would otherwise shrink to nothing once opened */
.phd-pair .phd-chat #edu-chat-container {
  flex: 1;
  min-width: 0;
}

.phd-pair .phd-chat #edu-chat-container.edu-compact {
  flex: 1;
  align-self: stretch;
  height: auto !important;
  max-height: 220px;
}

.phd-pair .phd-chat .edu-compact .edu-compact-card {
  flex: 1;
  justify-content: center;
}

/* detail page */
.phd-facts {
  margin: 0;
}

.phd-fact {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 4px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--phd-rule);
}

.phd-fact dt {
  padding-top: 1px;
  color: var(--phd-ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 21px;
}

.phd-fact dd {
  min-width: 0;
  margin: 0;
}

.phd-fact .v {
  font-size: 16px;
  line-height: 24px;
}

.phd-fact .v b {
  font-weight: 600;
}

.phd-fact .v .phd-badge {
  margin: 0 8px 0 0;
}

.phd-fact .vsub {
  color: var(--phd-ink);
  font-size: 14px;
  line-height: 21px;
}

.phd-fact.lead .v b {
  font-size: 18px;
  line-height: 26px;
}

.phd-acts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  padding: 16px 0 6px;
}

.phd-act {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.phd-act small {
  color: #6f6f6f;
  font-size: 12px;
  line-height: 18px;
}

.phd a.phd-btn,
.phd a.phd-btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 18px;
  border: 1.5px solid transparent;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  text-decoration: none;
}

.phd-act a.phd-btn {
  width: 100%;
}

.phd a.phd-btn.yellow {
  background: var(--phd-yellow);
  color: #000;
}

.phd a.phd-btn.yellow:hover {
  background: var(--phd-yellow-hover);
}

.phd a.phd-btn.secondary {
  border-color: var(--phd-green);
  background: #fff;
  color: var(--phd-green);
}

.phd a.phd-btn.secondary:hover {
  background: #eef3f5;
}

.phd-cblock {
  padding: 12px 0 6px;
}

.phd-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 2px;
}

.phd .phd-ctitle {
  margin: 4px 0 0;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.phd .phd-ctext {
  margin: 12px 0 0;
  font-size: 16px;
  line-height: 24px;
}

.phd .phd-ctext a,
.phd .phd-ctext a:visited {
  color: #1a5fb4;
  text-decoration-line: underline;
  text-decoration-color: currentColor !important;
}

.phd-cacts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: 20px;
}

.phd .phd-flead {
  margin: 12px 0 0;
  max-width: 70ch;
  font-size: 16px;
  line-height: 24px;
  color: #444;
}

.phd .phd-fnote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: 8px;
  background: #f3f3f3;
  font-size: 14px;
  line-height: 21px;
  color: #444;
}

.phd .phd-fnote i {
  margin-top: 3px;
  color: #000;
}

.phd-ftools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin: 14px 0 4px;
}

.phd .phd-finput {
  flex: 1 1 100%;
  height: 38px;
  max-width: 100%;
  padding: 0 12px;
  border: 1px solid #c3c7ca;
  border-radius: 8px;
  background: #fff;
  color: #000;
  font-size: 16px;
}

.phd .phd-finput:focus {
  outline: none;
  border-color: #2b4650;
  box-shadow: 0 0 0 3px rgba(43, 70, 80, 0.2);
}

.phd-fgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 30px;
}

.phd-fitem {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px 0;
  border-bottom: 1px solid #eee;
}

.phd-fitem[hidden] {
  display: none;
}

.phd .phd-fname {
  margin: 0;
  color: #000;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.phd-frank {
  font-size: 14px;
  line-height: 21px;
  color: #444;
}

.phd-flbl {
  margin-top: 2px;
  font-size: 12px;
  line-height: 18px;
  color: #6f6f6f;
}

.phd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.phd .phd-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 0;
  border-radius: 8px;
  background: #f3f3f3;
  color: #3e5460;
  font-size: 13px;
  font-weight: 600;
  line-height: 19.5px;
  text-align: left;
}

.phd .phd-tag:hover {
  background: #e7e7e7;
}

.phd .phd-tag.is-hit {
  background: rgba(251, 198, 74, 0.2);
  color: #000;
}

.phd-fprof {
  margin-top: 4px;
  font-size: 14px;
  line-height: 21px;
}

.phd-fna {
  color: #6f6f6f;
}

.phd-fempty {
  padding: 28px 12px;
  text-align: center;
  color: #444;
}

.phd-fempty b {
  display: block;
  color: #000;
}

.phd-fac .phd-more {
  margin-top: 14px;
}

.phd .phd-checked {
  margin: 10px 0 2px;
  font-size: 12px;
  line-height: 18px;
  color: #555;
}

.phd .phd-checked span {
  font-style: italic;
}

.phd-past {
  margin-top: 22px;
  padding-top: 4px;
  border-top: 1px solid #e6e6e6;
}

.phd .phd-sub {
  margin: 14px 0 10px;
  color: #000;
  font-size: 16px;
  font-weight: 600;
}

.phd-past-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 8px 0;
}

.phd-past-title {
  flex: 1 1 360px;
  min-width: 0;
}

.phd .phd-past-title a,
.phd .phd-past-title a:visited {
  color: #000;
  font-size: 15px;
  line-height: 1.35;
  text-decoration: none;
}

.phd .phd-past-title a:hover {
  text-decoration: underline;
}

.phd-past-title b {
  display: block;
  font-weight: 600;
}

.phd-past-title > span {
  font-size: 14px;
  color: #555;
}

.phd-past-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* phones */
@media (max-width: 700px) {
  .phd .phd-ptitle {
    font-size: 24px;
  }

  .phd-stats li {
    padding: 4px 10px;
    font-size: 12px;
  }

  .phd-stats b {
    font-size: 14px;
  }

  .phd-sb {
    padding-top: 10px;
    border-radius: 14px;
  }

  .phd .phd-sb-tab {
    display: none;
  }

  .phd-sc-actions {
    display: flex;
    gap: 8px;
    margin: 0 10px;
    padding-bottom: 12px;
  }

  .phd-sc-actions button {
    flex: 1;
    height: 44px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
  }

  .phd-sc-filters {
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: transparent;
    color: #fff;
  }

  .phd-sc-view {
    border: 1px solid transparent;
    background: var(--phd-yellow);
    color: #0c2a33;
  }

  .phd-sb-grid {
    display: none;
    grid-template-columns: 1fr;
    padding: 0 12px 16px;
  }

  .phd-sb-grid.is-open {
    display: grid;
  }

  .phd-btn-view {
    display: none;
  }

  .phd-legend .phd-item,
  .phd-pair .phd-legend .phd-item,
  .phd-fact,
  .phd-acts {
    grid-template-columns: 1fr;
  }

  .phd-fact {
    gap: 2px;
  }

  .phd-cacts a.phd-btn {
    width: 100%;
  }

  .phd-fgrid {
    grid-template-columns: 1fr;
  }

}
