/* ---------- campus: hub, food runs, market, resources, events ----------
   The tokens, rows, forms, page and motion are shared with the cab screens
   (styles.css, "sharing a cab"); this file only adds what Campus has and they
   do not. */

/* the hub: a large title and four tiles */
.cp-title{ margin: 8px 6px 0; font-size: 32px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
.cp-grid{ display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 6px 0; }
.cp-card{
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; min-height: 124px; padding: 16px;
  text-align: left; font: inherit; color: #000; background: var(--ub-soft); border: none; border-radius: 12px;
}
.cp-ico{ display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: #fff; }
.cp-ico svg{ width: 22px; height: 22px; }
.cp-card b{ font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
#view-campus.active .cp-card{ animation: ub-in .5s var(--ub-out) both; }
#view-campus.active .cp-card:nth-child(2){ animation-delay: .04s; }
#view-campus.active .cp-card:nth-child(3){ animation-delay: .08s; }
#view-campus.active .cp-card:nth-child(4){ animation-delay: .12s; }

/* the location check */
.cp-gate{ padding-top: 72px; }
.cp-gate .ub-spin{ width: 28px; height: 28px; margin-bottom: 4px; }

.cp-price{ margin: 8px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.cp-rupee{ flex: none; font-size: 17px; color: var(--ub-ink2); }
.ub-fld select#cp-unit{ flex: none; width: auto; text-align: right; color: var(--ub-ink2); }
.cp-person .ub-row{ min-height: 64px; }

/* market: a two-column grid of things */
.cp-cards{ display: grid; grid-template-columns: 1fr 1fr; gap: 20px 12px; margin-top: 16px; padding-bottom: 8px; }
.cp-cards .ub-empty{ grid-column: 1 / -1; }
.cp-item{
  --ub-press: .97;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 0;
  text-align: left; font: inherit; color: #000; background: none; border: none;
}
.cp-item-pic{ position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; margin-bottom: 8px; overflow: hidden; border-radius: 12px; background: var(--ub-soft); }
.cp-item-pic img{ width: 100%; height: 100%; object-fit: cover; }
.cp-item-pic i{ display: block; width: 32px; height: 32px; color: var(--ub-ink3); }
.cp-item-pic i svg{ width: 32px; height: 32px; }
.cp-item-kind{ position: absolute; left: 8px; top: 8px; padding: 4px 8px; border-radius: 6px; background: #000; color: #fff; font-size: 12px; font-weight: 600; letter-spacing: 0; }
.cp-item-price{ font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-item-t{ max-width: 100%; font-size: 15px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.cp-item em{ font-style: normal; font-size: 13px; color: var(--ub-ink3); }
.cp-item.skel b{ display: block; height: 12px; width: 60%; border-radius: 6px; background: var(--ub-soft); margin-top: 6px; }
.cp-item.skel b + b{ width: 85%; }
.cp-gallery{ display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 16px; padding: 0 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.cp-gallery::-webkit-scrollbar{ display: none; }
/* A picture is a look at the thing, not the whole screen: about 190px tall on
   a phone, and never wider than 280px however wide the page is. */
.cp-gallery img{ flex: none; width: min(66%, 280px); min-width: 0; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; scroll-snap-align: center; background: var(--ub-soft); }
.cp-gallery img:only-child{ width: min(72%, 280px); margin: 0 auto; }
.cp-photos{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cp-photo, .cp-photo-add{ position: relative; width: 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--ub-soft); }
.cp-photo img{ width: 100%; height: 100%; object-fit: cover; }
.cp-photo button{ position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: none; border-radius: 50%; background: rgba(0,0,0,.65); color: #fff; }
.cp-photo button svg{ width: 12px; height: 12px; }
.cp-photo-add{ display: grid; place-items: center; color: var(--ub-ink2); }
.cp-photo-add svg{ width: 26px; height: 26px; }

/* resources: a row, a helpful count, and the rest behind "more" */
.cp-res-row{ display: flex; align-items: center; gap: 4px; }
.cp-res-row .ub-row{ flex: 1; min-width: 0; }
.cp-res-row .ub-main i, .cp-res-row .ub-main b{ white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cp-vote{
  flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; width: 44px; height: 52px;
  border: none; border-radius: 8px; background: var(--ub-soft); color: var(--ub-ink); padding: 0;
}
.cp-vote svg{ width: 18px; height: 18px; }
.cp-vote b{ font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-vote.on{ background: #000; color: #fff; }
.cp-vote.on svg{ fill: currentColor; }
.cp-more{ flex: none; display: grid; place-items: center; width: 44px; margin-right: -8px; height: 44px; border: none; background: none; padding: 0; color: var(--ub-ink3); }
.cp-more svg{ width: 20px; height: 20px; }
.cp-more.on{ color: var(--ub-ink); }
.cp-res-acts{ display: flex; gap: 8px; padding: 0 0 12px; }
.cp-res-acts:not([hidden]){ animation: ub-in .3s var(--ub-out) both; }
.cp-res{ position: relative; }
.ub-rows > .cp-res::after{ display: none; content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--ub-sep); }
.ub-rows > .cp-res:last-child::after{ display: none; }

/* events: one card each */
.cp-day{ margin-top: 32px; font-size: 20px; font-weight: 600; letter-spacing: -.015em; color: var(--ub-ink); }
.ub-screen > #cp-events > .cp-day:first-child{ margin-top: 24px; }
.cp-event{ margin-top: 8px; }
.cp-event-top{ display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; color: var(--ub-ink2); }
.cp-event-top span:last-child{ color: var(--ub-ink); font-variant-numeric: tabular-nums; }
.cp-event-title{ margin: 6px 0 0; font-size: 17px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.cp-event-venue{ display: flex; align-items: center; gap: 6px; margin: 6px 0 0; font-size: 14px; color: var(--ub-ink2); }
.cp-event-venue svg{ width: 16px; height: 16px; flex: none; }
.cp-event-body{ margin: 8px 0 0; font-size: 15px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cp-event-acts{ display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; }
.cp-event-count{ margin-left: auto; font-size: 13px; color: var(--ub-ink2); font-variant-numeric: tabular-nums; }
/* the whole card opens the event; its title is the button for keyboards */
.cp-event{ cursor: pointer; transition: transform .45s cubic-bezier(.2,1.4,.4,1); }
.cp-event:active:not(:has([data-act]:active)){ transform: scale(.985); }
button.cp-event-title{ display: block; width: 100%; padding: 0; border: none; background: none; text-align: left; color: inherit; --ub-press: 1; }
.cp-event-acts .ub-chev{ margin-left: 4px; }

/* one event */
.cp-title-row{ display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cp-event-club{ margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--ub-ink2); }
.cp-eventpage .ub-title{ margin-top: 4px; }
.cp-event-facts{ margin-top: 16px; }
.cp-eventpage-body{ white-space: pre-line; }
.cp-event-link{ width: 100%; margin-top: 16px; height: 52px; font-size: 17px; }
.cp-event-link svg{ width: 18px; height: 18px; }
.ub-cta.going{ background: var(--ub-soft); color: var(--ub-ink); }
.ub-cta.going svg{ width: 18px; height: 18px; }

/* an event's cover poster on its card: a fixed 4:3 box, full card width,
   cropped from the top (where a poster's title usually is), so the list
   never jumps while it loads. "1/3" when there are more inside. */
.cp-event-pic{
  position: relative; display: block; aspect-ratio: 4 / 3; margin: -16px -16px 12px; overflow: hidden;
  border-radius: 12px 12px 0 0; background: var(--ub-soft2);
}
.cp-event-pic img{ display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.cp-event-pic.wide img{ object-fit: contain; object-position: center; }
.cp-event-pics{
  position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 6px;
  background: rgba(0,0,0,.62); color: #fff; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
}

/* the posters on an event page: a carousel inside the page margins, slightly
   rounded (10px, a touch under the 12px cards). Every poster sits whole in
   the same square frame on the soft grey, portrait or landscape alike, so the
   page never jumps. With several, one stop each and the next peeks in. */
.cp-car{ position: relative; margin-top: 4px; }
.cp-car:focus-visible{ outline: 2px solid var(--ub-ink); outline-offset: 4px; border-radius: 12px; }
.cp-car-track{
  display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.cp-car-track::-webkit-scrollbar{ display: none; }
.cp-car-slide{
  --ub-press: .985;
  flex: 0 0 100%; aspect-ratio: 1 / 1; padding: 0; border: none; border-radius: 10px; overflow: hidden;
  background: var(--ub-soft); scroll-snap-align: start; scroll-snap-stop: always;
}
.cp-car.many .cp-car-slide{ flex-basis: calc(100% - 28px); }
.cp-car-slide img{ display: block; width: 100%; height: 100%; object-fit: contain; }
.cp-car-dots{ display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.cp-car-dots i{ width: 6px; height: 6px; border-radius: 50%; background: var(--ub-soft2); transition: background .2s ease, transform .3s var(--ub-spring); }
.cp-car-dots i.on{ background: var(--ub-ink); transform: scale(1.2); }
/* arrows only where there is a pointer that hovers */
.cp-car-arrow{
  position: absolute; top: 50%; z-index: 2; display: none; place-items: center; width: 44px; height: 44px; margin-top: -22px;
  border: none; border-radius: 22px; background: rgba(255,255,255,.92); color: #000; box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.cp-car-arrow svg{ width: 18px; height: 18px; }
.cp-car-arrow.prev{ left: 8px; } .cp-car-arrow.prev svg{ transform: rotate(180deg); }
.cp-car-arrow.next{ right: 8px; }
@media (hover: hover) and (pointer: fine){
  .cp-car:hover .cp-car-arrow:not([hidden]){ display: grid; }
}
.cp-car + .cp-event-club, .cp-car-dots + .cp-event-club{ margin-top: 16px; }

/* full size: every poster the width of the screen, swiping between them */
.cp-viewer{
  position: fixed; inset: 0; z-index: 950; background: #000; opacity: 0; transition: opacity .25s ease;
}
.cp-viewer.on{ opacity: 1; }
.cp-viewer-track{
  position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  overscroll-behavior: contain; scrollbar-width: none;
}
.cp-viewer-track::-webkit-scrollbar{ display: none; }
.cp-viewer.zoomed .cp-viewer-track{ overflow-x: hidden; }
/* each fits the width, scrolls if taller, centred while it fits */
.cp-viewer-scroll{
  flex: 0 0 100%; display: flex; overflow: auto; overscroll-behavior: contain; scroll-snap-align: start;
  -webkit-overflow-scrolling: touch;
}
.cp-viewer-scroll img{ display: block; flex: none; width: 100%; height: auto; margin: auto; cursor: zoom-in; }
.cp-viewer-scroll.zoom img{ width: 200%; cursor: zoom-out; }
.cp-viewer-n{
  position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 16px; padding: 4px 10px; border-radius: 6px;
  background: rgba(255,255,255,.16); color: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.cp-viewer-x{
  position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 8px; display: grid; place-items: center;
  width: 44px; height: 44px; border: none; border-radius: 22px; background: rgba(255,255,255,.16); color: #fff;
}
.cp-viewer-x svg{ width: 18px; height: 18px; }

/* the form's posters: up to four, the first the cover */
.cp-eposters{ display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.cp-eposter-add{
  flex: 1 1 100%; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px;
  border-radius: 12px; background: var(--ub-soft); font-size: 17px; color: var(--ub-ink);
}
.cp-eposter-add.tile{ flex: 0 0 80px; height: 100px; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; }
.cp-eposter-add svg{ width: 20px; height: 20px; }
.cp-eposter-add[hidden]{ display: none; }
.cp-eposter{ position: relative; flex: 0 0 80px; height: 100px; border-radius: 10px; overflow: hidden; background: var(--ub-soft); }
.cp-eposter img{ display: block; width: 100%; height: 100%; object-fit: contain; }
.cp-eposter-cover{
  position: absolute; left: 4px; bottom: 4px; padding: 2px 6px; border-radius: 4px; background: rgba(0,0,0,.62); color: #fff;
  font-size: 11px; font-weight: 600;
}
/* a 44px target in the corner, drawn as a small dark circle */
.cp-eposter-x{
  position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: none; background: none; color: #fff;
}
.cp-eposter-x i{ display: grid; place-items: center; width: 24px; height: 24px; border-radius: 12px; background: rgba(0,0,0,.65); }
.cp-eposter-x svg{ width: 12px; height: 12px; }
.cp-eposter-state{ display: flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 14px; font-weight: 600; color: var(--ub-ink2); }
.cp-eposter-state[hidden]{ display: none; }
.cp-eposter-state .ub-spin{ width: 16px; height: 16px; }
.cp-eposter-state.fail{ color: var(--ub-alert-ink); }

/* who can post events */
.cp-padd{ margin-top: 12px; }
.cp-ec-fixed{ text-align: right; color: var(--ub-ink2); }
.cp-premove.armed{ width: auto; padding: 0 12px; margin-right: 0; border-radius: 6px; background: var(--ub-alert); color: #fff; font-size: 15px; font-weight: 600; }
.ub-quiet.armed{ background: var(--ub-alert); color: #fff; font-weight: 600; }
.cp-event-acts .ub-btn.icon{ margin-left: 0; }

@media (min-width: 720px){
  /* on a wide screen the frame stays a sensible size: never taller than half
     the window, centred in the 640px page column */
  .cp-car-slide{ aspect-ratio: auto; height: min(60vh, 520px); }
  .cp-viewer-scroll img{ width: min(100%, 900px); }
  .cp-viewer-scroll.zoom img{ width: min(200%, 1800px); }
  .cp-title{ margin-left: 0; margin-right: 0; }
  .cp-grid{ grid-template-columns: repeat(4, 1fr); margin-left: 0; margin-right: 0; }
  .cp-cards{ grid-template-columns: repeat(3, 1fr); }
}

/* seven tabs across a phone: keep each label on one line */
@media (max-width: 719px){
  .tab-btn{ white-space: nowrap; font-size: 9.5px; letter-spacing: -.01em; }
}

@media (prefers-reduced-motion: reduce){
  .cp-car-track{ scroll-behavior: auto; }
}

/* ---------- food run items ---------- */
.cp-hint{ margin: -4px 0 0; font-size: 13px; color: var(--ub-ink2); }
.cp-fis .cp-fi{ margin-top: 12px; }
.cp-fi-top input{ min-width: 0; }
.cp-fi .ub-step{ background: var(--ub-page); }
.cp-fi .cp-fi-link{ box-shadow: none; }
.cp-fi-x{ flex: none; display: grid; place-items: center; width: 44px; height: 44px; margin-right: -12px; padding: 0; border: none; background: none; color: var(--ub-ink3); }
.cp-fi-x svg{ width: 16px; height: 16px; }
.cp-fi-x[hidden]{ display: none; }
.cp-fi-msg{ margin: -6px 0 0; padding: 0 0 12px 32px; font-size: 13px; font-weight: 600; color: var(--ub-alert-ink); }
.cp-fi-msg[hidden]{ display: none; }
.cp-fi-url[aria-invalid="true"]{ color: var(--ub-alert-ink); }
.cp-fi-add{ display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 8px; padding: 0; border: none; background: none; font-size: 15px; font-weight: 600; color: var(--ub-ink); }
.cp-fi-add svg{ width: 18px; height: 18px; }
.cp-fi-add[hidden]{ display: none; }

/* the host's list: count, name and size, then where the link goes */
.cp-h-row{ display: flex; align-items: center; justify-content: space-between; margin-top: 32px; }
.cp-h-row .ub-h{ margin: 0; }
.cp-h-row .ub-link{ padding-left: 16px; }
.cp-orders .cp-person{ padding-bottom: 8px; }
.cp-lines{ margin: 0; padding: 0 0 0 56px; list-style: none; }
.cp-lines li{ display: flex; gap: 8px; padding: 6px 0; }
.cp-qty{ flex: none; min-width: 28px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cp-line{ display: flex; flex-direction: column; min-width: 0; }
.cp-line b{ font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.cp-line b em{ font-style: normal; font-weight: 400; color: var(--ub-ink2); }
.cp-line > i{ font-style: normal; font-size: 13px; line-height: 44px; color: var(--ub-ink3); }
.cp-link{ display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; min-height: 44px; font-size: 15px; color: var(--ub-ink); text-decoration: underline; text-underline-offset: 3px; overflow-wrap: anywhere; }
.cp-link svg{ width: 16px; height: 16px; flex: none; color: var(--ub-ink2); }

/* ---------- which app a run is on ---------- */
/* The app's own icon fills the avatar; nothing drawn behind it. */
img.cp-app{ display: block; object-fit: cover; background: none; padding: 0; }
.cp-app.lg{ width: 56px; height: 56px; border-radius: 12px; }
.cp-run-head{ display: flex; align-items: center; gap: 12px; }
.cp-run-head .ub-title{ margin: 0; }
.cp-run-head .ub-sub{ margin-top: 2px; }
/* The filter by app: the Cabs chip row, a ring when chosen. A wordmark sits in
   a box of fixed height (FOOD_BRANDS.h) inside the same 44px chip. */
.cp-food-types .ub-chip{ display: inline-flex; align-items: center; padding: 0 16px; }
/* Chosen: a black ring outside the chip with a white gap, so it shows the
   same on the grey chips and on a brand's own colour. The row is padded so
   the ring is never clipped. */
.cp-food-types{ margin: 4px -16px 0; padding: 4px 16px; }
.cp-food-types .ub-chip.on{ background: var(--ub-soft); color: #000; font-weight: 600; box-shadow: 0 0 0 2px var(--ub-page), 0 0 0 4px #000; }
.cp-food-types .ub-chip.mark{ padding: 0 14px; }
.cp-food-types .ub-chip.filled, .cp-food-types .ub-chip.filled.on{ background: var(--brand); }
.cp-wordmark{ display: block; object-fit: contain; }
/* A window onto the middle of a square tile: the name shows, the tile's own
   colour runs into the chip's. */
.cp-mark-window{ position: relative; display: block; height: 44px; overflow: hidden; }
.cp-mark-window img{ position: absolute; left: 50%; top: 50%; max-width: none; transform: translate(-50%, -50%); }

/* ---------- resources: branch, year, subject ---------- */
/* The drill-down rows: a name and a chevron, one line, nothing at the left. */
.ub-row.cp-plain{ align-items: center; min-height: 52px; }
.ub-row.cp-plain .ub-main{ align-self: center; }
/* A long subject name wraps to a second line rather than being cut. */
.ub-row.cp-plain{ gap: 16px; padding: 14px 0; }
.ub-row.cp-plain .ub-main b{ font-weight: 400; font-size: 17px; line-height: 1.3; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ub-rows > .ub-row.cp-plain::after{ display: none; }
.cp-count{ flex: none; font-size: 15px; color: var(--ub-ink2); font-variant-numeric: tabular-nums; }
.cp-res-for{ padding: 12px 0; }
.cp-res-for .ub-v{ flex: 1; min-width: 0; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.cp-res-place{ flex: none; font-size: 15px; color: var(--ub-ink2); }
.cp-kind{ font-weight: 600; color: var(--ub-ink); }
.cp-kind.important{ color: var(--ub-alert-ink); }
#cp-rsub{ margin-top: 8px; }
#cp-ryear, #cp-rbranch{ margin-top: 8px; }
/* No heading on the first Resources screen: the search starts a step below the back button. */
.cp-res-top > .ub-where{ margin-top: 12px; }

/* Where a resource's link goes: the service's own logo, or our plain glyph. */
.cp-svc{ flex: none; display: block; width: 28px; height: 28px; object-fit: contain; }
.cp-svc.glyph{ display: grid; place-items: center; color: var(--ub-ink2); }
.cp-svc.glyph svg{ width: 24px; height: 24px; }

/* ---------- resources, grouped ---------- */
.ub-grouped .cp-res-row{ padding: 0 4px 0 16px; gap: 4px; }
.ub-grouped .cp-res-row > .ub-row{ min-height: 60px; padding: 10px 0; gap: 12px; isolation: isolate; }
.ub-grouped .cp-res-row > .ub-row::before{
  content: ""; position: absolute; top: 0; bottom: 0; left: -16px; right: -100px; z-index: -1;
  background: #d1d1d6; opacity: 0; transition: opacity .3s ease;
}
.page.uber .ub-grouped .cp-res-row > .ub-row:active{ opacity: 1; transform: none; }
.ub-grouped .cp-res-row > .ub-row:active::before{ opacity: 1; transition: none; }
.ub-grouped .cp-res .ub-main b{ font-size: 17px; font-weight: 400; line-height: 22px; }
.ub-grouped .cp-res .ub-main i{ font-size: 15px; line-height: 20px; color: rgba(60,60,67,.6); }
.ub-grouped .cp-res-acts{ padding: 0 16px 12px 56px; }
.ub-grouped .cp-vote{ background: #f2f2f7; }
.ub-grouped #cp-rsub{ margin-top: 16px; }
.ub-grouped .cp-res-for{ min-height: 52px; }
/* In a grouped list a title wraps as far as it needs; the vote is quiet: no
   fill, grey until it is yours, still a 44px target. */
.ub-grouped .cp-res-row .ub-main b, .ub-grouped .cp-res-row .ub-main i{ display: block; -webkit-line-clamp: unset; overflow: visible; overflow-wrap: anywhere; }
/* The upvote is a button you can see: a pill with the arrow and the count,
   filled black once it is yours. The pill is 36px tall; the ::after pads the
   touch area out to 44px. */
.ub-grouped .cp-vote{
  position: relative; flex-direction: row; gap: 5px; width: auto; min-width: 58px; height: 36px; padding: 0 12px;
  border-radius: 18px; background: #f2f2f7; color: #000;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.ub-grouped .cp-vote::after{ content: ""; position: absolute; inset: -4px 0; }
.ub-grouped .cp-vote:active{ transform: scale(.94); }
.ub-grouped .cp-vote svg{ width: 16px; height: 16px; }
.ub-grouped .cp-vote b{ font-size: 14px; font-weight: 600; }
.ub-grouped .cp-vote.on{ background: #000; color: #fff; }
@media (prefers-reduced-motion: reduce){ .ub-grouped .cp-vote{ transition: none; } .ub-grouped .cp-vote:active{ transform: none; } }
.ub-grouped .cp-more{ color: rgba(60,60,67,.3); }
.ub-grouped .cp-res-for .ub-v{ white-space: normal; overflow: visible; }

/* Branches and years: one rounded box each, with a gap between, the whole box
   answering a press. (Subjects stay as rows in one grouped section.) */
.ub-grouped .ub-rows.cp-boxes{ display: flex; flex-direction: column; gap: 12px; background: none; border-radius: 0; overflow: visible; }
.ub-grouped .cp-boxes > .ub-row{ background: #fff; border-radius: 10px; overflow: hidden; }
.ub-grouped .cp-boxes > .ub-row::after{ display: none; }
.ub-grouped .cp-boxes > .ub-row.cp-plain{ min-height: 52px; padding: 14px 16px; }
/* Branches: two columns of boxes, so ten or so short codes fit one screen. */
.ub-grouped .ub-rows.cp-boxes.grid{ display: grid; grid-template-columns: 1fr 1fr; }

/* ---------- breadcrumbs: where you are, small ---------- */
.cp-crumbs{ margin: 4px 0 0; }
.cp-crumbs ol{ display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; list-style: none; font-size: 15px; line-height: 20px; }
.cp-crumbs li{ display: inline-flex; align-items: center; min-width: 0; max-width: 100%; }
.cp-crumb{ display: inline-flex; align-items: center; min-height: 44px; margin: 0; padding: 0; border: none; background: none; font: inherit; color: rgba(60,60,67,.6); }
.cp-crumb.now{ min-height: 44px; color: var(--ub-ink); font-weight: 500; overflow-wrap: break-word; }
.cp-crumb-sep{ padding: 0 6px; color: rgba(60,60,67,.3); }
.cp-crumbs + .ub-sr + *{ margin-top: 8px; }
.cp-crumbs + .ub-sr + .ub-search{ margin-top: 8px; }

/* Subjects: rows in one section, padded so they read apart without lines. */
.ub-grouped #cp-ryear .ub-rows:not(.cp-boxes) .ub-row.cp-plain{ min-height: 52px; padding: 15px 16px; }
/* Items on a subject page: likewise, a little more air per row. */
.ub-grouped #cp-rsub .cp-res-row > .ub-row{ min-height: 64px; padding: 12px 0; }
.ub-grouped .cp-boxes > * + *{ margin-top: 0; }
.ub-grouped .ub-rows.cp-boxes > .ub-row + .ub-row{ margin-top: 0; }
/* Compact: the steps keep a 44px hit area that overlaps the space around them;
   the current step, not a button, takes only its own lines. */
.cp-crumbs{ padding: 12px 0 4px; }
.cp-crumbs ol{ row-gap: 4px; }
.cp-crumb{ margin: -12px 0; }
.cp-crumb.now{ min-height: 0; margin: 0; }

/* The subject page: its name, then the path it sits on, then the filter. */
.cp-res-title{ margin: 8px 0 0; font-size: 20px; line-height: 25px; font-weight: 600; letter-spacing: -.01em; color: var(--ub-ink); overflow-wrap: break-word; }
.cp-crumbs-path{ padding: 6px 0 2px; }
.cp-crumbs-path + *{ margin-top: 10px; }

/* Pictures on the Campus tiles and for a market item with no photo. */
.cp-art{ display: block; width: 64px; height: 64px; object-fit: contain; }
.cp-item-pic .cp-ph{ width: 56%; height: 56%; object-fit: contain; }

/* "Add material" under the list of branches: the way to a subject that has nothing yet. */
.cp-res-addall{ display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 24px; background: #fff; }
.cp-res-addall svg{ width: 18px; height: 18px; }

/* Share, on a market item (under the price) and in a material's actions. */
.cp-share{ display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; }
.cp-share svg, .cp-res-acts .ub-btn svg{ width: 18px; height: 18px; }
