/* The one place where the site's shapes are decided. This file loads after every
 * page stylesheet, so a radius here wins over the same selector elsewhere (the
 * older values left in the other files are only fallbacks).
 *
 * The rule: the smaller the thing, the tighter the corner, never a capsule or a
 * circle for something pressed.
 *   control   12px  buttons, icon buttons, anything pressed, 40-52px high
 *   chip       8px  tags, labels, small filters, up to ~34px high
 *   field     16px  search and form fields (dense filters: 12px)
 *   tabs      14px  a group of choices, its chosen item 10px (outer minus padding)
 *   card      16px  cards and rows; sheet 24px for the big surfaces
 *   cover      4px  covers (tokens.css)
 * Round stays round only where it means something: the author's letter,
 * bullets and the little counter on the cart. */
:root {
  --control-radius: 12px;
  --chip-radius: 8px;
  --field-radius: 16px;
  --tabs-radius: 14px;
  --tab-radius: 10px;
  --card-radius: 16px;
  --sheet-radius: 24px;
}

/* Primary and secondary actions across the catalogue and personal account. */
.pill-link, .jpop__go, .jdp__publish.pill-link, .jdp__card .jpop__go,
.jdp__subscribe, .pcard .jpop__go, .pcard__ghost, .pmatch-cta__go,
.pnotice__contacts a, .ppage .citation-copy, .pform__go, .acc-btn,
.acc-auth__alt, .acc__out, .dock__btn {
  border-radius: var(--control-radius);
}

/* Search inputs have the same softer frame, including on the phone. */
.hero-search, .search-row form, .phone-menu__search, .phone-find__field,
.bsearch, .psearch .bsearch, .acc-find input {
  border-radius: var(--field-radius);
}
.hero-search .hero-search__go, .bsearch .bsearch__go, .psearch .bsearch__go {
  border-radius: var(--control-radius);
}
.hero-search .hero-search__open { border-radius: inherit; }

/* A shared treatment for grouped choices; colour stays appropriate to the page. */
.jdp__tabs, .bpage__order, .acc__tabs, .psearch__scope {
  border-radius: var(--tabs-radius);
}
.jdp__tabs a, .bpage__order a, .acc__tabs a, .psearch__scope span {
  border-radius: var(--tab-radius);
}
.psearch__scope {
  gap: .25rem;
  padding: .25rem;
  border: 0;
  background: rgb(255 255 255 / .08);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / .12);
}
.psearch__scope span {
  min-height: 2.5rem;
  margin: 0;
  padding: 0 1rem;
  border: 0;
}
.psearch__scope label:hover span { background: rgb(255 255 255 / .12); }
.psearch__scope input:checked + span { background: #fff; color: var(--brand-deep); }
@media (max-width: 640px) {
  .psearch__scope { gap: 0; }
  .psearch__scope span { padding: 0 .5rem; font-size: .8125rem; }
}

/* ── the rest of the site, brought to the same shapes ── */

/* controls: pressed things, 12px */
.btn, .icon-btn, .phone-menu__close, .phone-menu__account a, .buy-box button, .buy-box .buy-cta,
.dock__btn, .acc__out, .pform__go, .acc-auth__alt, .acc-btn, .bpage__rail a, .bpager a,
.jpop__close, .screen__next, .pnotice__contacts a, .about-copy, .cart__remove button {
  border-radius: var(--control-radius);
}

/* chips: small tags, labels and filters, 8px */
.pill, .badge, .keyword, .ppage .keyword, .acc-status, .chron__age, .chip, .header-link, .pager a,
.citation-tab, .citation-copy, .ppage .citation-copy, .pchips a, .jdp .issue-tile {
  border-radius: var(--chip-radius);
}

/* fields: 16px; the dense filters 12px */
.acc-find input, .pfield input:not([type="checkbox"]), .pfield select, .pfield textarea, .search-suggestions {
  border-radius: var(--field-radius);
}
.search-filters input[type="search"], .search-filters select, .search-filters input[type="number"],
.catalog-filter input, .psearch__filters select, .psearch__filters input[type="number"] {
  border-radius: var(--control-radius);
}
.bsearch__reset { border-radius: var(--tab-radius); }
.search-suggestion { border-radius: var(--tab-radius); }

/* groups of choices: the frame, then the chosen item inside it */
.lang-switch, .phone-menu__lang, .cart__stepper { border-radius: var(--control-radius); }
.lang-switch { padding: 2px; }
.lang-switch a { min-height: 40px; border-radius: var(--tab-radius); }
.cart__stepper button { border-radius: var(--chip-radius); }
.screens-nav { border-radius: var(--tabs-radius); }

/* the trail of crumbs: a 12px frame, its steps 8px inside it */
.crumbs { border-radius: var(--control-radius); }
.crumbs > a, .crumbs > [aria-current] { border-radius: var(--chip-radius); }

/* cards: 16px, and 24px for the big surfaces */
.jdp .steps__list li, .jdp__year, .acc-note, .acc-paper, .bshelf__empty, .ppage .citation-text,
.search-suggestions, .particle__pager a, .article-pager a {
  border-radius: var(--card-radius);
}
.door, .dock, .jdp__issue, .phone-menu__inner { border-radius: var(--sheet-radius); }
