.circle-home {
  padding: 24px clamp(16px, 2.1vw, 32px) 20px;
  scrollbar-gutter: stable;
}
.circle-heading h2 {
  margin: 8px 0 5px;
  font: 400 clamp(34px, 3vw, 47px)/1.12 var(--serif);
  letter-spacing: -.05em;
}
.circle-heading em, .circle-center em { color: var(--accent); }
.circle-heading p { margin: 0; color: var(--ink2); font-size: 13px; }
.circle-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 430px);
  min-height: 42px;
  margin: 18px 0 14px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--paper);
}
.circle-search:focus-within { border-color: var(--accent); }
.circle-search:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.circle-search-icon { display: grid; place-items: center; }
.circle-search input {
  flex: 1;
  padding: 8px 1px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}
.circle-search input::placeholder { color: var(--muted); }
.circle-search input:focus-visible { outline: none; }
.circle-search kbd {
  color: var(--ink2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 5px;
  white-space: nowrap;
  font: 10px var(--sans);
}
.circle-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.circle-explorer {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}
.circle-orbit {
  --tile-width: clamp(178px, 21cqw, 208px);
  --tile-height: 114px;
  --tile-edge: calc(var(--tile-width) / 2 + 7px);
  --tile-top: calc(var(--tile-height) / 2 + 9px);
  --top-offset: calc(var(--tile-width) / 2 + 8px);
  position: relative;
  width: min(100%, 1180px);
  height: clamp(578px, 67vh, 655px);
  flex: none;
  isolation: isolate;
}
.circle-ring, .circle-center {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  border-radius: 50%;
  pointer-events: none;
}
.circle-ring-outer { width: 86%; height: 87%; border: 1px dashed #a9c5af7a; }
.circle-ring-inner { width: 59%; height: 68%; border: 1px solid var(--line-soft); }
.circle-center {
  --sphere-size: 282px;
  --sphere-light: #d5e2cd;
  --sphere-mid: #abc3a6;
  --sphere-edge: #67896d;
  --sphere-ink: #203b2b;
  --sphere-accent: #2c593f;
  display: grid;
  justify-items: center;
  align-content: center;
  width: var(--sphere-size);
  aspect-ratio: 1;
  border: 1px solid rgba(47, 83, 61, .2);
  color: var(--sphere-ink);
  background:
    radial-gradient(ellipse 52% 39% at 30% 24%, rgba(255, 255, 255, .43), transparent 91%),
    radial-gradient(circle at 40% 34%, var(--sphere-light), var(--sphere-mid) 52%, var(--sphere-edge) 97%);
  box-shadow: inset -11px -16px 40px rgba(32, 64, 43, .18),
    inset 7px 8px 22px rgba(255, 255, 255, .23), 8px 21px 28px -14px rgba(27, 62, 41, .37);
  transition: opacity .28s ease, scale .42s cubic-bezier(.18,.86,.22,1);
}
:root[data-theme="dark"] .circle-center {
  --sphere-light: #5f7a62;
  --sphere-mid: #415e48;
  --sphere-edge: #2b4434;
  --sphere-ink: #f4f8f0;
  --sphere-accent: #e3f0db;
  background:
    radial-gradient(ellipse 52% 39% at 30% 24%, rgba(233, 248, 224, .11), transparent 91%),
    radial-gradient(circle at 40% 34%, var(--sphere-light), var(--sphere-mid) 52%, var(--sphere-edge) 97%);
  box-shadow: inset -11px -16px 40px rgba(12, 23, 17, .38),
    inset 7px 8px 22px rgba(222, 240, 210, .09), 8px 21px 28px -14px rgba(0, 0, 0, .54);
}
.circle-center em, .circle-ornament { color: var(--sphere-accent); }
.circle-ornament { font-size: 23px; line-height: 1; }
.circle-center-title {
  margin: 10px 0 11px;
  text-align: center;
  font: 400 26px/1.18 var(--serif);
  letter-spacing: -.05em;
}
.circle-center-count { display: grid; gap: 2px; justify-items: center; font-size: 9px; letter-spacing: .1em; }
.circle-orbit.has-panel .circle-center { opacity: .035; scale: .73; }
.circle-tile {
  position: absolute;
  top: var(--tile-y, 50%);
  left: var(--tile-x, 50%);
  translate: -50% -50%;
  width: var(--tile-width);
  height: var(--tile-height);
  padding: 15px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper2);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(23,52,36,.07);
  text-align: left;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .3s;
}
/* Clockwise, starting with the two grammar categories at the top. */
.circle-tile[data-position="0"] { --tile-x: calc(50% - var(--top-offset)); --tile-y: var(--tile-top); }
.circle-tile[data-position="1"] { --tile-x: calc(50% + var(--top-offset)); --tile-y: var(--tile-top); }
.circle-tile[data-position="2"] { --tile-x: calc(100% - var(--tile-edge) - 14px); --tile-y: 25%; }
.circle-tile[data-position="3"] { --tile-x: calc(100% - var(--tile-edge)); }
.circle-tile[data-position="4"] { --tile-x: calc(100% - var(--tile-edge) - 14px); --tile-y: 75%; }
.circle-tile[data-position="5"] { --tile-y: calc(100% - var(--tile-top)); }
.circle-tile[data-position="6"] { --tile-x: calc(var(--tile-edge) + 14px); --tile-y: 75%; }
.circle-tile[data-position="7"] { --tile-x: var(--tile-edge); }
.circle-tile[data-position="8"] { --tile-x: calc(var(--tile-edge) + 14px); --tile-y: 25%; }
.circle-tile:hover, .circle-tile[aria-expanded=true] {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.circle-tile[aria-expanded=true] { opacity: .66; }
.circle-tile:focus-visible { opacity: 1; z-index: 2; }
.circle-tile-body, .circle-tile-bottom { display: flex; align-items: center; }
.circle-tile-body { min-height: 38px; gap: 11px; }
.circle-tile-icon, .circle-panel-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 33px;
  height: 33px;
  color: var(--accent-dark);
  border-radius: 10px;
  background: var(--accent-soft);
}
.circle-tile[aria-expanded=true] .circle-tile-icon { background: var(--paper); }
.circle-tile-icon .nav-icon { width: 19px; height: 19px; }
.circle-tile-icon svg { width: 19px; height: 19px; }
.circle-tile-title { font-size: 13.7px; line-height: 1.26; font-weight: 730; letter-spacing: -.012em; }
.circle-tile-bottom {
  justify-content: space-between;
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink2);
  font-size: 10.5px;
}
.circle-tile-arrow { display: inline-flex; transform: rotate(-45deg); }
.circle-tile-arrow :is(.nav-icon, svg) { width: 14px; height: 14px; }
.circle-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.circle-panel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(594px, calc(100% - 2 * var(--tile-width) - 58px));
  height: min(410px, calc(100% - 2 * var(--tile-height) - 42px));
  display: flex;
  flex-direction: column;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 23px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 34px 82px rgba(22,60,37,.28);
  overflow: hidden;
  pointer-events: auto;
}
.circle-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.circle-panel-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 19px 22px 17px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent-soft) 65%, var(--paper)), transparent 88%);
}
.circle-panel-icon { width: 45px; height: 45px; border-radius: 12px; }
.circle-panel-icon :is(.nav-icon, svg) { width: 24px; height: 24px; }
.circle-panel-heading { flex: 1; min-width: 0; }
.circle-panel-heading small { display: block; color: var(--accent); font-weight: 800; font-size: 9px; letter-spacing: .12em; }
.circle-panel-heading h3 {
  margin: 2px 0 0;
  font: 400 30px/1.08 var(--serif);
  letter-spacing: -.03em;
  overflow-wrap: anywhere;
}
.circle-panel-count {
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 6px 10px;
  background: var(--paper);
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.circle-panel-close {
  flex: none;
  display: grid;
  place-items: center;
  align-self: start;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--accent-dark);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.circle-panel-close:hover { background: var(--accent-soft); }
.circle-panel-meta {
  margin: 0;
  padding: 12px 22px 10px;
  color: var(--ink2);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.circle-results {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 9px;
  padding: 6px 21px 20px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}
.circle-results-many { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.circle-trainer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 50px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper2);
  color: var(--ink2);
  font-size: 11.7px;
  line-height: 1.32;
  font-weight: 650;
  text-decoration: none;
  transition: background .18s, border-color .18s;
}
.circle-trainer:hover, .circle-trainer:focus-visible { background: var(--accent-soft); border-color: var(--accent); }
.circle-trainer-title { min-width: 0; overflow-wrap: anywhere; }
.circle-trainer-level { color: var(--accent); font-size: 9px; font-weight: 800; text-align: right; }
.circle-empty { grid-column: 1/-1; text-align: center; color: var(--ink2); font-size: 13px; margin: 14px 0; }
.circle-instructions { text-align: center; margin: 0; color: var(--ink2); font-size: 12px; }
.circle-instructions-tap { display: none; }
@media (min-width: 1381px) and (min-height: 901px) {
  .circle-orbit { --tile-width: clamp(208px, 21cqw, 228px); }
}
@media (max-width: 1380px), (max-height: 900px) {
  .circle-center { --sphere-size: 252px; }
}
@media (max-width: 1270px) {
  .circle-center { --sphere-size: 226px; }
}
@media (max-width: 1150px), (hover: none) {
  .circle-explorer { display: block; padding: 16px; overflow: visible; }
  .circle-orbit { display: flex; flex-direction: column; width: 100%; height: auto; }
  .circle-ring, .circle-layer, .circle-instructions-mouse { display: none; }
  .circle-center {
    --sphere-size: clamp(116px, 24vw, 158px);
    position: static;
    order: 1;
    translate: none;
    align-self: center;
    margin-top: 16px;
  }
  .circle-orbit.has-panel .circle-center { opacity: 1; scale: 1; }
  .circle-center-title { margin: 5px 0; font-size: clamp(17px, 3vw, 21px); }
  .circle-ornament { font-size: 18px; }
  .circle-center-count { font-size: 8px; }
  .circle-instructions-tap { display: inline; }
  .circle-instructions { margin-top: 14px; }
  .circle-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .circle-tile[data-position] {
    position: relative;
    inset: auto;
    translate: none;
    width: 100%;
    height: 101px;
    padding: 12px;
    border-radius: 12px;
    box-shadow: none;
  }
  .circle-tile[aria-expanded=true] { opacity: 1; }
  .circle-tile-title { font-size: 13px; }
  .circle-panel {
    position: static;
    transform: none;
    grid-column: 1/-1;
    width: auto;
    height: auto;
    min-width: 0;
    scroll-margin: 12px;
    border-radius: 14px;
    box-shadow: 0 8px 30px #18412212;
  }
  .circle-panel-header { padding: 12px 15px; }
  .circle-panel-icon { width: 36px; height: 36px; }
  .circle-panel-icon :is(.nav-icon, svg) { width: 20px; height: 20px; }
  .circle-panel-heading h3 { font-size: 24px; }
  .circle-panel-close { width: 42px; height: 42px; }
  .circle-panel-meta { padding: 9px 15px 7px; }
  .circle-results { max-height: 250px; padding: 3px 14px 15px; }
  .circle-trainer { min-height: 46px; }
}
@media (max-width: 620px) {
  .circle-home { padding: 16px 12px; }
  .circle-explorer { padding: 12px 10px; border-radius: 14px; }
  .circle-tiles, .circle-results, .circle-results-many { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .circle-tile[data-position] { min-height: 102px; padding: 12px 9px; }
  .circle-tile-body { gap: 7px; }
  .circle-tile-title { font-size: 12.5px; }
  .circle-tile-icon { width: 28px; height: 28px; }
  .circle-panel-header { gap: 7px; padding: 10px; flex-wrap: wrap; }
  .circle-panel-icon { width: 31px; height: 31px; }
  .circle-panel-count { padding: 4px 6px; font-size: 10px; }
  .circle-panel-heading h3 { font-size: 20px; }
  .circle-panel-meta { padding: 8px 10px; }
  .circle-results { max-height: 310px; padding-inline: 10px; }
}
@media (max-width: 370px) {
  .circle-results, .circle-results-many { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 430px), (hover: none) {
  .circle-search kbd { display: none; }
}
