/* A member's lists of notes */

.member-header {
  padding-top: clamp(28px, 5vw, 44px);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
}
.member-header__title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 18px; }
.member-header__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.member-header h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.4rem); overflow-wrap: anywhere; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs__tab {
  padding: 10px 14px;
  border-bottom: 3px solid transparent;
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.tabs__tab:hover { color: var(--ink); }
.tabs__tab.is-current { border-bottom-color: var(--red); color: var(--ink); }
/* A second row of tabs under the main ones: the pages in the current section. */
.tabs--sub { margin-top: 2px; }
.tabs--sub .tabs__tab { padding: 6px 12px; font-size: 0.875rem; font-weight: 500; border-bottom-width: 2px; }
.tabs--sub .tabs__tab.is-current { font-weight: 700; }

.member-notes { padding-top: 24px; }
.member-notes__summary { font-size: 0.925rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.notes-table { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.notes-table th, .notes-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.notes-table tbody tr:last-child td { border-bottom: 0; }
.notes-table tbody tr:hover { background: var(--paper-2); }
.notes-table th { background: var(--paper-2); font-size: 0.8rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.notes-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.notes-table .nowrap { white-space: nowrap; }
.notes-table__comments { color: var(--ink-2); }
.notes-table__action { text-align: right; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover, .sort-link.is-active { color: var(--ink); }

.note-chip.note-chip--small { display: inline-block; min-width: 0; padding: 0.1em 0.45em; font-size: 0.8rem; margin-right: 4px; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 20px 0 0; }
.pager__page, .pager__step {
  min-width: 2.4em;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  color: var(--ink-2);
  text-align: center;
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}
.pager__page:hover, .pager__step:hover { border-color: var(--red); color: var(--ink); }
.pager__page.is-current { background: var(--red); border-color: var(--red); color: #fff; }

.button--outline { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.button--outline:hover { background: var(--paper-3); color: var(--ink); }
.note-header form.button_to { display: inline-block; margin-top: 14px; }

/* On phones, drop the less important columns so the table fits. */
@media (max-width: 640px) {
  .notes-table__comments, .notes-table__year { display: none; }
  .notes-table th, .notes-table td { padding: 8px 10px; }
}
@media (max-width: 480px) {
  .notes-table__place, .notes-table__entered { display: none; }
}

/* Member profiles */

.profile__tagline { margin: -8px 0 18px; color: var(--ink-2); font-size: 1.05rem; max-width: 46em; }
/* A member who has passed away (User#memorial?): the note an admin wrote, quietly. */
.profile__memorial { margin: -8px 0 18px; color: var(--ink-2); font-style: italic; max-width: 46em; }
.profile { padding-top: 24px; }
.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}
.profile-stat { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); }
.profile-stat dt { color: var(--ink-3); font-size: 0.825rem; }
.profile-stat dd { margin: 2px 0 0; font-size: 1.4rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.profile-stat dd a { color: var(--ink); text-decoration: none; }
.profile-stat dd a:hover { color: var(--red); }
.eyebrow a { color: inherit; }
.levels-table tr:target td, .levels-table tr.is-current td { background: var(--red-soft); }
.levels-table__you { margin-left: 8px; color: var(--ink-3); font-size: 0.8rem; font-weight: 400; }
.levels__rules { margin: 0 0 24px; }
.levels__other { margin-top: 24px; scroll-margin-top: 80px; }
.levels { padding-block: 24px 48px; }
.levels-table tr { scroll-margin-top: 80px; }
.levels-table tbody th { background: transparent; color: var(--ink); font-size: inherit; font-weight: 600; letter-spacing: normal; text-transform: none; }
.levels-table tr:target th, .levels-table tr.is-current th { background: var(--red-soft); }
.profile__columns { display: grid; grid-template-columns: minmax(260px, 1fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.profile__columns .card + .card { margin-top: 0; }
.profile-details { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: 0.925rem; }
.profile-details dt { color: var(--ink-3); }
.profile-details dd { margin: 0; overflow-wrap: anywhere; }
.profile__about { overflow-wrap: anywhere; }
.profile__expanded { margin-top: 20px; }
.profile__markdown > :first-child { margin-top: 0; }
.profile__markdown > :last-child { margin-bottom: 0; }
.profile__markdown h1, .profile__markdown h2 { font-size: 1.25rem; margin: 1.2em 0 0.4em; }
.profile__markdown h3, .profile__markdown h4, .profile__markdown h5, .profile__markdown h6 { font-size: 1.05rem; margin: 1em 0 0.3em; }
.profile__markdown hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.profile__markdown pre { overflow-x: auto; padding: 10px 12px; background: var(--paper-2); border-radius: 6px; font-size: 0.875rem; }
.profile__markdown table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.9rem; }
.profile__markdown th, .profile__markdown td { padding: 4px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.profile__markdown blockquote { margin: 0 0 1em; padding-left: 12px; border-left: 3px solid var(--line); color: var(--ink-2); }
.profile__about-empty { margin: 0; color: var(--ink-3); font-style: italic; }
.profile__report { margin: 20px 0 0; font-size: 0.875rem; text-align: right; }
.profile__report a { color: var(--ink-3); }
@media (max-width: 760px) {
  .profile__columns { grid-template-columns: 1fr; }
}


/* Search */

.search { padding-top: 24px; }
.search > * { max-width: 900px; }
.search-bar { display: flex; gap: 10px; margin-bottom: 24px; }
.search-bar input { flex: 1; }
.search-section { margin-bottom: 28px; }
.search-section h2 { font-size: 1.1rem; }
.search-list { list-style: none; padding: 0; margin: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.search-list li { padding: 10px 14px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.search-list li:last-child { border-bottom: 0; }
.report-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; }
.report-list__fact { color: var(--ink-3); font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.search-list__quote { display: block; margin-top: 2px; color: var(--ink-2); font-size: 0.925rem; }
.search-form { display: grid; gap: 14px; margin-bottom: 20px; }
.search-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.search-form legend { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.search-form__options { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.search-form > .button { justify-self: start; }
.search-form__hint { margin: 0; font-size: 0.85rem; }
.high-low__masked { margin-top: 16px; }
.notes-table__private { display: block; color: var(--ink-3); font-size: 0.85rem; }
.search-form .travel-form__side { display: block; }
.search-form .travel-form__side .field-row { margin: 0; }
.counterfeit-form { max-width: 420px; }
.counterfeit-form input.serial { text-transform: uppercase; }
.counterfeit-result { max-width: 46em; }

/* Top ten */

.top-ten { padding-top: 24px; }
.top-ten__snapshot { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.top-ten__snapshot .profile-stat p { margin: 2px 0 0; font-size: 0.875rem; }
.top-ten__groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.top-ten__groups .card + .card { margin-top: 0; }
.link-grid--stacked { grid-template-columns: 1fr; gap: 8px; }
.link-grid--stacked a { padding: 10px 12px; }
.top-ten__note { margin-top: 20px; font-size: 0.85rem; }
.top-ten__compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: start; }
.top-ten__compare-title { margin: 0 0 8px; font-size: 1.05rem; }
@media (max-width: 760px) { .top-ten__compare { grid-template-columns: 1fr; } }

/* Fitted to the report by frame_height_controller.js; the height here is only until it loads. */
.newsletter-frame { display: block; width: 100%; height: 80vh; border: 0; overflow: hidden; }

/* Profile photos */
.profile-photo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--paper-2); flex: none; }
.profile-photo--large { width: 160px; height: 160px; border-radius: var(--radius); object-fit: contain; }
.profile__name { display: flex; align-items: center; gap: 14px; }
.settings__photo-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.settings__photo-form { display: grid; gap: 8px; margin-bottom: 12px; }

/* Recruits */
.recruits__filter { margin-bottom: 16px; }
.recruits__filter label { color: var(--ink-3); font-size: 0.875rem; }
.family__title { margin-bottom: 0; font-size: 1.15rem; }
.family__title .muted { font-size: 0.925rem; font-weight: 400; }
.family, .family ul { margin: 0 0 0 4px; padding: 0; list-style: none; }
.family { margin-bottom: 16px; }
/* Lines join each member to whoever brought them in, and the member's own recruits to the
   title. Each entry draws its piece of the upright line, so it stops at the last one, and a
   line across to the middle of its first row. */
.family__member { --joint: calc(4px + 0.65em); position: relative; padding: 4px 0 4px 18px; }
.family__member::before, .family__member::after { content: ""; position: absolute; left: 0; }
.family__member::before { top: var(--joint); width: 12px; border-top: 2px solid var(--line); }
.family__member::after { top: 0; bottom: 0; border-left: 2px solid var(--line); }
.family__member:last-child::after { bottom: auto; height: calc(var(--joint) + 2px); }
.family__line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; margin: 0; font-size: 0.925rem; overflow-wrap: anywhere; }
.family__line span { color: var(--ink-3); }
.family__line--link { opacity: 0.6; }
.family summary { width: fit-content; padding: 2px 0; color: var(--ink-3); font-size: 0.85rem; cursor: pointer; }

/* Badges */
.badge { display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%; color: #fff; background: hsl(var(--badge-hue, 210) 55% 42%); font-style: normal; line-height: 1; }
.badge-pill { display: inline-block; margin: 2px 4px 2px 0; padding: 2px 10px; border-radius: 999px; color: #fff; background: hsl(var(--badge-hue, 210) 55% 42%); font-size: 0.875rem; text-decoration: none; }
.badge-pill:hover { color: #fff; }
.badge--yearly { --badge-hue: 50; } .badge--starter { --badge-hue: 150; }
.badge--entering { --badge-hue: 210; } .badge--hits { --badge-hue: 45; } .badge--finding { --badge-hue: 160; }
.badge--distance { --badge-hue: 190; } .badge--time { --badge-hue: 270; } .badge--popular { --badge-hue: 340; }
.badge--canada { --badge-hue: 0; } .badge--cities { --badge-hue: 25; } .badge--road { --badge-hue: 120; }
.badge--collector { --badge-hue: 95; } .badge--serial { --badge-hue: 240; } .badge--streaks { --badge-hue: 15; }
.badge--regular { --badge-hue: 180; } .badge--community { --badge-hue: 300; } .badge--membership { --badge-hue: 225; }
.badge--levels { --badge-hue: 260; } .badge--collection { --badge-hue: 320; } .badge--capitals { --badge-hue: 350; }
.badge--bigcities { --badge-hue: 75; } .badge--groups { --badge-hue: 130; }
.badge--levelchange { --badge-hue: 35; }
.badge--usernamechange { --badge-hue: 200; }
/* In Memory (Badge::MEMORIAL): a quiet grey rather than a colour. */
.badge.badge--memorial, .badge-pill.badge--memorial { background: hsl(220 8% 42%); }
.profile-stat dd.profile-stat__latest { margin-top: 4px; font-size: 1rem; font-weight: 400; }
.profile-stat__latest .badge-pill { display: block; width: fit-content; max-width: 100%; margin: 0; padding: 1px 8px; overflow: hidden; font-size: 0.775rem; text-overflow: ellipsis; white-space: nowrap; }
.badge-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px 24px; margin: 0 0 12px; padding: 0; list-style: none; }
.badge-categories summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; cursor: pointer; }
.badge-views { display: flex; gap: 14px; margin: 0 0 12px; font-size: 0.925rem; }
.badge-views a[aria-current="page"] { color: var(--ink); font-weight: 600; text-decoration: none; }
.badge-timeline { display: grid; gap: 0; margin: 0 0 12px; padding: 0; list-style: none; }
.badge-timeline__item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 0.925rem; }
.badge-list { margin: 8px 0 0; padding: 0; list-style: none; }
.badge-list__item { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-top: 1px solid var(--line); font-size: 0.925rem; }
.badge-list__item--earned { font-weight: 600; }
.badge-list__tick { color: hsl(140 55% 40%); }
.badge-compare__totals { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0 0 16px; }
.badge-compare__totals dt { font-size: 0.8rem; color: var(--ink-3); overflow-wrap: anywhere; }
.badge-compare__totals dd { margin: 0; font-size: 1.4rem; font-weight: 600; }
.badge-compare__categories { margin: 0 0 12px; padding: 0; list-style: none; }
.badge-compare__categories > li { padding: 8px 0; border-top: 1px solid var(--line); }
.badge-compare__categories summary { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; cursor: pointer; }
.badge-compare__highest { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; width: 100%; font-size: 0.925rem; overflow-wrap: anywhere; }
.badge-compare__table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 0.925rem; }
.badge-compare__table th, .badge-compare__table td { padding: 6px 4px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.badge-compare__table thead th { font-size: 0.8rem; color: var(--ink-3); }
.badge-compare__table tbody th { width: 50%; font-weight: 400; }
.badge-compare__only { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.75rem; }
@media (max-width: 520px) { .badge-compare__highest { grid-template-columns: 1fr; } }
.badge-list__next { margin-left: 4px; padding: 0 6px; border: 1px solid var(--line); border-radius: 999px; font-size: 0.75rem; font-weight: 400; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; align-items: start; padding-block: 24px; }
.badges .card + .card { margin-top: 0; }
.latest-badges, .next-badge { margin: 0 0 12px; }

/* A badge just earned (layouts/_badge_popup) and "just one more" (badges/_nudge). */
.badge-popup { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 20px 50px rgb(0 0 0 / 0.25); }
.badge-popup[open] { animation: badge-pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); }
.badge-popup::backdrop { background: rgb(0 0 0 / 0.4); }
.badge-popup h2 { margin: 4px 0 16px; }
.badge-popup__burst { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; background: hsl(45 90% 55%); color: #fff; font-size: 2rem; }
.badge-popup__burst--promotion { background: hsl(280 60% 55%); }
.badge-popup__level { margin: -8px 0 16px; font-size: 1.1rem; }
.badge-popup__also { margin: 0 0 8px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 0.95rem; }
.badge-popup__list { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.badge-popup__list li { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.badge-popup__list .muted { font-size: 0.8rem; }
.badge-popup__actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.badge-toast { position: fixed; right: 16px; bottom: 16px; left: 16px; z-index: 20; display: flex; align-items: center; gap: 12px; max-width: 380px; margin-left: auto; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 10px 30px rgb(0 0 0 / 0.18); animation: badge-toast-in 0.3s ease-out; transition: opacity 0.3s, transform 0.3s; }
.badge-toast.is-leaving { opacity: 0; transform: translateY(12px); }
.badge-toast p { margin: 0; flex: 1; }
.badge-toast__icon { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: hsl(210 55% 42%); color: #fff; font-size: 1.1rem; }
.badge-toast--prompt { max-width: 420px; }
.badge-toast__stop { display: inline; padding: 0; border: 0; background: none; color: var(--ink-3); font: inherit; font-size: 0.85rem; text-decoration: underline; cursor: pointer; }
.badge-toast p form { display: block; margin-top: 4px; }
.badge-toast__close { flex: none; padding: 0 4px; border: 0; background: none; color: var(--ink-3); font-size: 1.4rem; line-height: 1; cursor: pointer; }
@keyframes badge-pop { from { opacity: 0; transform: scale(0.85); } }
@keyframes badge-toast-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) { .badge-popup[open], .badge-toast { animation: none; } }
.badge-label { margin-left: 4px; color: var(--ink-3); font-size: 0.85em; font-weight: 400; }

/* The summary on the left, the search button on the right, with space before the table. */
.member-notes__bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; }
.member-notes__bar .member-notes__summary { margin: 0; }
.member-notes__bar .button { flex: none; }
