/* Masthead and trip navigation have separate rows, at readable sizes. */
.header.wrap {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  grid-template-rows: 78px auto;
  align-items: center;
  column-gap: 32px;
  row-gap: 0;
  height: auto;
  padding-bottom: 14px;
}
.header > .brand { font-size: 36px; letter-spacing: -2px; white-space: nowrap; }
.header > .brand > svg { width: 34px; height: 34px; margin-right: 10px; }
.header .header-audio { display: flex; align-items: center; gap: 26px; }
.header .header-audio > a {
  display: inline-flex; align-items: center; gap: 9px; min-height: 44px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.header .header-audio .icon { width: 19px; height: 19px; }
.header .header-right {
  display: flex; align-items: center; gap: 10px; min-width: 0;
  margin: 0; padding-left: 22px; border-left: 1px solid var(--line);
}
.header .account-link, .header .saved-link, .header .plan-link {
  display: inline-flex; position: relative; align-items: center; justify-content: center;
  flex: none; gap: 0; min-width: 42px; min-height: 42px; width: 42px; height: 42px;
  padding: 0; border: 0; border-radius: 50%; background: transparent;
}
.header .account-link:hover, .header .saved-link:hover { background: var(--soft); }
.header .header-label, .header .account-link > span:not(.account-header-avatar):not(.header-icon) { display: none !important; }
.header .header-icon { display: inline-flex !important; align-items: center; justify-content: center; flex: none; }
.header .header-icon > .icon, .header .account-link > .icon { display: block; width: 21px; height: 21px; }
.header .account-link > .account-header-avatar { display: inline-flex !important; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; }
.header .account-header-avatar img { width: 30px; height: 30px; object-fit: cover; margin: 0; }
.header .plan-link { width: auto; gap: 9px; padding: 0 16px; border: 1px solid #ccd4c8; border-radius: 24px; font-size: 13px; font-weight: 650; }
.header .plan-link:hover { background: var(--soft); border-color: #a7b5a3; }
.header .plan-link > .header-plan-label { display: inline !important; white-space: nowrap; }
.header .saved-link > .counter, .header .plan-link > b {
  display: grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 10px; background: var(--soft); color: var(--ink); font-size: 10px; line-height: 1;
}
.header .saved-link > .counter { position: absolute; top: -1px; right: -2px; border: 2px solid var(--paper); background: #f5c6a5; }
.header .counter[hidden], .header .plan-link > b[hidden] { display: none !important; }
.header .desktop-nav {
  grid-column: 1 / -1; grid-row: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  margin: 0; padding: 0; border-top: 1px solid var(--line);
  min-width: 0; overflow: visible; white-space: nowrap;
}
.header .desktop-nav > a {
  display: inline-flex; align-items: center; min-height: 48px; padding: 1px 0 0;
  border-bottom: 2px solid transparent; font-size: 14px; font-weight: 600;
}
.header .desktop-nav > a.active { color: var(--ink); border-bottom-color: var(--orange); }
.header .desktop-nav > a:hover, .header .header-audio > a:hover, .header .header-audio > a.active { color: #9a5228; }
.header .desktop-nav > .header-mobile-saved { display: none; }
.header .header-menu-toggle { display: none; }

@media (min-width: 761px) and (max-width: 1040px) {
  .header.wrap { column-gap: 20px; grid-template-columns: minmax(160px, 1fr) auto auto; }
  .header > .brand { font-size: 33px; }
  .header > .brand > svg { width: 30px; height: 30px; margin-right: 8px; }
  .header .header-audio { gap: 20px; }
  .header .header-right { padding-left: 16px; gap: 4px; }
  .header .plan-link { width: 42px; padding: 0; border: 0; }
  .header .plan-link > .header-plan-label { display: none !important; }
  .header .plan-link > b { position: absolute; top: -1px; right: -2px; border: 2px solid var(--paper); }
  .header .desktop-nav { gap: 16px; }
}
@media (max-width: 760px) {
  .header.wrap {
    width: calc(100% - 40px); grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 70px auto auto; column-gap: 12px; padding-bottom: 12px;
  }
  .header > .brand { grid-column: 1; grid-row: 1; font-size: 32px; letter-spacing: -1.7px; }
  .header > .brand > svg { width: 29px; height: 29px; margin-right: 7px; }
  .header .header-right { grid-column: 2; grid-row: 1; gap: 3px; border: 0; padding: 0; }
  .header .account-link, .header .saved-link, .header .plan-link, .header .header-menu-toggle { min-width: 40px; min-height: 44px; width: 40px; height: 44px; padding: 0; border: 0; background: transparent; }
  .header .plan-link > .header-plan-label { display: none !important; }
  .header .plan-link > b { position: absolute; top: 0; right: -2px; border: 2px solid var(--paper); }
  .header .header-menu-toggle { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
  .header .header-menu-toggle svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
  .header .header-menu-toggle[aria-expanded="true"] { background: var(--soft); }
  .header .header-audio { grid-column: 1 / -1; grid-row: 2; gap: 0; justify-content: space-between; border-top: 1px solid var(--line); }
  .header .header-audio > a { font-size: 14px; min-height: 46px; gap: 8px; }
  .header .desktop-nav { grid-row: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; white-space: normal; padding: 10px 0; }
  .header.header-enhanced:not(.is-menu-open) .desktop-nav { display: none; }
  .header .desktop-nav > a, .header .desktop-nav > .header-mobile-saved { display: flex; min-height: 46px; padding: 8px 0; font-size: 14px; }
}
@media (max-width: 480px) {
  .header .saved-link { display: none; }
}
@media (max-width: 350px) {
  .header.wrap { width: calc(100% - 28px); column-gap: 4px; }
  .header > .brand { font-size: 29px; }
  .header > .brand > svg { width: 26px; height: 26px; margin-right: 6px; }
  .header .header-right { gap: 0; }
}
