:root {
  --ink: #26364d;
  --muted: #435973;
  --accent: #155eae;
  --edge: #cbd9e5;
  --glass: rgb(247 252 255 / .72);
  --surface: #fff;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --latin: "Avenir Next", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: #e3eef4;
  font: 16px/1.48 var(--font);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { min-width: 0; margin: 0; }
p, h1, h2 { margin: 0; }
button, input, select { color: inherit; font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button, a[href], select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button { border: 0; }
:focus-visible { outline: 2px solid #145fae; outline-offset: 3px; }
.visually-hidden, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link:focus { position: fixed; inset: 10px auto auto 10px; z-index: 4; padding: .65rem 1rem; background: var(--surface); }

.directory-shell { position: relative; isolation: isolate; min-height: 100svh; }
.directory-shell::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgb(244 250 254 / .23), rgb(221 240 245 / .14) 39%, rgb(226 244 244 / .22)),
    url("assets/sea-coast.jpg") center center / cover no-repeat;
  content: "";
}
:root[data-background="solid"] .directory-shell::before { background: #e6eff4; }
:root[data-contrast="true"] { --glass: rgb(250 253 255 / .94); --ink: #182a3e; --muted: #344c64; }
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.47rem max(1.58vw, 1.1rem) 0 3.05vw;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: .61rem;
  flex-shrink: 0;
  font: 700 clamp(1.33rem, 2.05vw, 2rem)/1 var(--latin);
  letter-spacing: -.042em;
}
.wordmark i { color: #236b9b; font-size: 1.45em; }
.header-actions { display: flex; align-items: center; gap: .65rem; }
.header-button, .filter-toggle, .network-trigger, .roles, .search {
  border: 1px solid rgb(255 255 255 / .6);
  background: var(--glass);
  box-shadow: 0 3px 12px rgb(24 64 99 / .08), inset 0 1px 0 rgb(255 255 255 / .56);
  backdrop-filter: blur(15px) saturate(125%);
}
.header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  min-height: clamp(2.5rem, 3.16vw, 3.1rem);
  padding: .48rem .84rem;
  border-radius: .9rem;
  font-size: clamp(.82rem, 1.04vw, 1.04rem);
  font-weight: 635;
  white-space: nowrap;
}
.header-button i { font-size: 1.33em; }
.icon-only { width: 3.4rem; padding-inline: 0; flex: none; }
.header-button:hover, .filter-toggle:hover { background: rgb(255 255 255 / .94); }
.main { padding: 0 0 1.7rem; }
.start-hero { display: grid; justify-items: center; gap: clamp(1.45rem, 2.65vw, 2.6rem); padding: clamp(1.23rem, 1.94vw, 1.92rem) 1rem 0; }
.home-clock { display: grid; justify-items: center; text-align: center; }
.home-clock time {
  color: #27384e;
  font: 430 clamp(3.75rem, 5.45vw, 5.4rem)/.96 var(--latin);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.058em;
}
.home-clock p { margin-top: .27rem; color: #394f68; font-size: clamp(.93rem, 1.4vw, 1.36rem); letter-spacing: .025em; }
.search {
  display: flex;
  align-items: center;
  gap: clamp(.66rem, 1.32vw, 1.27rem);
  width: min(57.2vw, 57rem);
  min-height: clamp(3.1rem, 4.44vw, 4.32rem);
  padding-inline: clamp(.86rem, 1.58vw, 1.56rem) clamp(.7rem, 1.3vw, 1.25rem);
  border-radius: clamp(.86rem, 1.6vw, 1.43rem);
  color: #34475e;
}
.search > i { font-size: clamp(1.18rem, 2.19vw, 2.1rem); }
.search:focus-within { border-color: #88b3db; box-shadow: 0 0 0 3px rgb(70 137 198 / .17), 0 4px 16px #24374b10; }
.search input {
  flex: 1;
  min-width: 0;
  padding: .65rem 0;
  border: 0;
  outline: none;
  background: transparent;
  font-size: clamp(1rem, 1.52vw, 1.39rem);
}
.search input::placeholder { color: #475e78; }
.search input::-webkit-search-cancel-button { display: none; }
kbd, .search-clear {
  display: grid;
  place-items: center;
  min-width: clamp(1.65rem, 2.44vw, 2.4rem);
  min-height: clamp(1.65rem, 2.44vw, 2.4rem);
  padding: .15rem .3rem;
  border-radius: .57rem;
  background: rgb(169 194 213 / .24);
  color: #38516e;
  font-size: clamp(.96rem, 1.25vw, 1.16rem);
}
.search-clear:hover { background: rgb(149 178 202 / .32); }

.directory { width: min(88.9rem, calc(100% - 10.52vw)); margin: clamp(2.03rem, 4.1vw, 4.06rem) auto 0; }
.directory-header, .directory-title { display: flex; align-items: center; gap: .92rem; }
.directory-header { position: relative; z-index: 2; justify-content: space-between; flex-wrap: wrap; }
.directory-title h1 { font-size: clamp(1.38rem, 1.98vw, 1.92rem); font-weight: 730; letter-spacing: -.039em; line-height: 1.2; }
.total-count { color: #3e5671; font-size: clamp(.79rem, 1.28vw, 1.13rem); font-weight: 650; white-space: nowrap; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; }
.filter-toggle, .network-picker, .roles { border-radius: .82rem; }
.filter-toggle {
  display: grid;
  place-items: center;
  width: clamp(2.42rem, 2.8vw, 2.7rem);
  height: clamp(2.42rem, 2.8vw, 2.7rem);
  color: #334d69;
  font-size: 1.12rem;
}
.filter-toggle[aria-pressed="true"] { color: #8d6012; background: #fff6df; }
.network-picker { position: relative; display: flex; align-items: center; }
.network-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  min-width: clamp(7.1rem, 10.9vw, 10.9rem);
  min-height: clamp(2.45rem, 2.8vw, 2.65rem);
  border-radius: inherit;
  padding: .4rem .82rem;
  color: var(--ink);
  font-size: clamp(.79rem, 1.06vw, 1rem);
  font-weight: 615;
  transition: background .16s ease, scale .14s ease;
}
.network-trigger:hover, .network-trigger[aria-expanded="true"] { background: rgb(255 255 255 / .56); }
.network-trigger:active { scale: .96; }
.network-trigger i { flex: none; transition: rotate .16s ease; }
.network-trigger[aria-expanded="true"] i { rotate: 180deg; }
.network-panel {
  position: fixed;
  inset: var(--menu-top, 0) auto auto var(--menu-left, 0);
  width: min(15.75rem, calc(100vw - 24px));
  max-height: var(--menu-room, 100dvh);
  padding: .4rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgb(255 255 255 / .85);
  border-radius: 1rem;
  background: #f7fbfe;
  box-shadow: 0 15px 45px #1e3d6352, 0 2px 8px #293e5626;
}
.network-panel-title { padding: .26rem .56rem .37rem; color: var(--muted); font-size: .72rem; font-weight: 650; }
.network-options { display: grid; gap: .16rem; }
.network-options button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 1.05rem;
  align-items: center;
  gap: .47rem;
  min-height: 2.5rem;
  padding: .32rem .54rem;
  border-radius: .66rem;
  background: transparent;
  text-align: start;
  font-size: .88rem;
  font-weight: 610;
}
.network-options button:hover, .network-options button:focus-visible { background: #e6eff7; }
.network-options button:focus-visible { outline-offset: -2px; }
.network-options button[aria-checked="true"] { color: #164e88; background: #deedf9; }
.network-count { color: #47617b; font-size: .75rem; font-variant-numeric: tabular-nums; }
.network-check { visibility: hidden; color: var(--accent); text-align: center; }
.network-options button[aria-checked="true"] .network-check { visibility: visible; }
.roles { display: flex; gap: .12rem; padding: .15rem; }
.roles button {
  border-radius: .72rem;
  min-height: clamp(2.21rem, 2.55vw, 2.35rem);
  padding: .24rem clamp(.47rem, 1.6vw, 1.55rem);
  background: transparent;
  color: #3b526d;
  font-size: clamp(.78rem, 1.07vw, 1rem);
  font-weight: 610;
  white-space: nowrap;
}
.roles button:hover { background: rgb(245 251 255 / .66); }
.roles button[aria-pressed="true"] {
  color: #26384e;
  background: rgb(255 255 255 / .94);
  box-shadow: 0 1px 5px rgb(32 58 85 / .16);
  font-weight: 680;
}

.card-group { margin-top: clamp(1.17rem, 1.7vw, 1.7rem); }
.card-group h2 { margin-bottom: clamp(.65rem, .81vw, .81rem); font-size: clamp(1.02rem, 1.52vw, 1.4rem); font-weight: 715; letter-spacing: -.023em; }
.card-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(.61rem, .89vw, .88rem); }
.service-card {
  position: relative;
  isolation: isolate;
  display: flex;
  min-width: 0;
  min-height: clamp(4.5rem, 6.08vw, 6rem);
  border: 1px solid rgb(255 255 255 / .66);
  border-radius: clamp(.81rem, 1.34vw, 1.17rem);
  background: var(--glass);
  box-shadow: 0 7px 15px rgb(28 70 99 / .10), inset 0 1px 0 rgb(255 255 255 / .53);
  backdrop-filter: blur(13px) saturate(127%);
  transition: background .17s ease, box-shadow .17s ease, transform .17s ease;
}
.service-card:hover, .service-card:focus-within, .service-card.is-keyboard-selected {
  background: rgb(252 254 255 / .92);
  box-shadow: 0 9px 20px rgb(27 63 87 / .16), inset 0 1px 0 rgb(255 255 255 / .7);
}
@media (hover:hover) and (pointer:fine) {
  .service-card:hover { transform: translateY(-2px); }
}
.service-card.is-keyboard-selected { outline: 2px solid #2675c3; outline-offset: 2px; }
.service-main {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
  gap: clamp(.67rem, 1.35vw, 1.31rem);
  padding: clamp(.62rem, 1.06vw, 1.08rem) clamp(.65rem, 1.43vw, 1.41rem);
  border-radius: inherit;
}
.service-card:has(.admin-entry:not([hidden]), .direct-entry:not([hidden])) .service-main { padding-right: .15rem; }
.card-group-compact .service-card { min-height: clamp(4.42rem, 5.44vw, 5.42rem); }
.card-group-compact .service-main { padding-block: .72rem; }
.card-group-compact .service-icon { width: clamp(2.24rem, 3.7vw, 3.62rem); }
.service-icon {
  width: clamp(2.24rem, 3.86vw, 3.78rem);
  aspect-ratio: 1;
  flex: none;
  overflow: hidden;
  border-radius: 28%;
  background: rgb(247 252 255 / .76);
  box-shadow: 0 2px 4px rgb(43 80 108 / .12);
}
.service-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.service-copy { display: grid; align-content: center; gap: .16rem; min-width: 0; }
.service-name { color: #253447; font-size: clamp(.92rem, 1.48vw, 1.41rem); line-height: 1.29; font-weight: 730; letter-spacing: -.022em; overflow-wrap: anywhere; }
.service-network { color: var(--muted); font-size: clamp(.72rem, 1.1vw, 1rem); line-height: 1.22; white-space: nowrap; }
.service-network[data-network="v6"] { color: #2f587c; }
.card-tools { display: flex; align-items: end; justify-content: end; }
.tile-actions { position: absolute; top: .22rem; right: .29rem; display: flex; align-items: center; gap: .1rem; }
.tile-tool {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  padding: 0;
  border-radius: .56rem;
  background: transparent;
  color: #3d6283;
  font-size: 1.03rem;
}
.tile-tool:hover { background: #dfedf8; color: #2a4a70; }
.favorite-toggle { opacity: 0; }
.service-card:hover .favorite-toggle, .service-card:focus-within .favorite-toggle { opacity: 1; }
.favorite-toggle[aria-pressed="true"] { color: #7d591e; }
.more-endpoints {
  display: inline-flex;
  align-items: center;
  gap: .17rem;
  min-height: 1.82rem;
  padding: 0 .38rem;
  border-radius: .48rem;
  background: rgb(217 234 247 / .86);
  color: #315e84;
  font-size: .7rem;
  font-weight: 650;
  white-space: nowrap;
}
.more-endpoints:hover { color: #184674; background: #cee5f7; }
.admin-entry, .direct-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.73rem;
  min-height: 2.45rem;
  margin: 0 .37rem .38rem .08rem;
  padding: .24rem .36rem;
  border-radius: .55rem;
  color: var(--accent);
  font-size: clamp(.75rem, 1.06vw, .98rem);
  font-weight: 660;
  white-space: nowrap;
}
.admin-entry:hover, .direct-entry:hover { background: #deedfc; color: #154a80; }
.direct-entry { background: #deedfc; }
.directory-footer { display: flex; flex-wrap: wrap; gap: .35rem 1rem; margin-top: 1.5rem; color: #405a74; font-size: .75rem; }
.empty {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: .55rem;
  min-height: 12rem;
  margin-top: 1.35rem;
  padding: 1.05rem;
  border: 1px solid rgb(255 255 255 / .55);
  border-radius: 1rem;
  background: var(--glass);
  text-align: center;
}
.empty h2 { font-size: 1.17rem; }
.empty p { color: var(--muted); font-size: .87rem; }
.empty button { border-radius: .55rem; padding: .51rem .86rem; background: #225e9b; color: white; font-size: .84rem; font-weight: 650; }
.empty button:hover { background: #184778; }
.network-badge { flex: none; border-radius: .36rem; padding: .25rem .39rem; background: #e8f3ef; color: #2c614b; font-size: .73rem; font-weight: 650; }
.network-badge[data-network="v6"] { color: #285783; background: #eaf3fd; }
.network-badge[data-network="v4"] { color: #755316; background: #f8f0da; }

dialog { width: min(32rem, calc(100% - 1.4rem)); max-height: calc(100% - 1.4rem); margin: auto; padding: 0; overflow: hidden; border: 1px solid #cdd9e9; border-radius: .92rem; color: var(--ink); background: #fff; box-shadow: 0 1.3rem 4rem #1328493b; }
dialog::backdrop { background: #16263f94; backdrop-filter: blur(5px); }
.dialog-frame { display: flex; flex-direction: column; max-height: calc(100dvh - 1.55rem); overflow: hidden; }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding: 1.17rem 1.26rem .8rem; }
.dialog-header h2 { margin: 0; font-size: 1.48rem; font-weight: 670; line-height: 1.3; }
.dialog-header p { margin-top: .28rem; color: var(--muted); font-size: .77rem; line-height: 1.5; }
.close-button { width: 2.15rem; height: 2.15rem; border: 1px solid var(--edge); border-radius: .45rem; background: #f3f6fa; color: #2b4365; font-size: 1.28rem; line-height: 1; }
.close-button:hover { background: #e8f1fc; }
.dialog-footer { padding: .67rem 1.26rem; border-top: 1px solid var(--edge); color: var(--muted); background: #f5f8fc; font-size: .76rem; line-height: 1.5; }
.endpoint-list { margin: 0; padding-inline: 1.26rem; list-style: none; overflow: auto; overscroll-behavior: contain; }
.endpoint-list li { border-top: 1px solid var(--edge); }
.endpoint-list a { display: flex; align-items: center; justify-content: space-between; gap: .56rem; padding: .62rem .1rem; }
.endpoint-list a:hover .endpoint-name { text-decoration: underline; text-underline-offset: .2em; }
.endpoint-name, .endpoint-host { display: block; }
.endpoint-name { font-size: .87rem; font-weight: 650; }
.endpoint-host { margin-top: .12rem; color: var(--muted); font: 500 .76rem/1.38 var(--latin), var(--font); overflow-wrap: anywhere; }
.settings-body { padding: 0 1.26rem; overflow: auto; overscroll-behavior: contain; }
.background-options { min-width: 0; margin: 0; padding: .35rem 0 .83rem; border: 0; }
.background-options legend { padding: 0 .08rem; color: #304760; font-size: .87rem; font-weight: 680; }
.background-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .62rem; }
.background-option {
  position: relative;
  display: grid;
  gap: .36rem;
  min-width: 0;
  padding: .29rem .29rem .39rem;
  border: 1px solid #d8e3ec;
  border-radius: .94rem;
  background: #f7fafc;
  color: #344e68;
  font-size: .78rem;
  font-weight: 625;
  text-align: center;
  cursor: pointer;
}
.background-option:hover { background: #edf4fa; }
.background-option:has(input:checked) { color: #174f85; background: #eaf4fe; border-color: #4e94d0; box-shadow: 0 0 0 1px #4e94d0; }
.background-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.background-swatch { display: block; height: clamp(2.6rem, 9vh, 4.25rem); border-radius: .69rem; background: #e6eff4; }
.coast-swatch { background: #c5dce6 url("assets/sea-coast.jpg") center 46% / cover no-repeat; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: .7rem; min-height: 3.24rem; padding: .52rem .08rem; border-top: 1px solid var(--edge); color: #304760; font-size: .87rem; cursor: pointer; }
.setting-switch {
  appearance: none;
  position: relative;
  width: 2.55rem;
  height: 1.44rem;
  flex: none;
  margin: 0;
  border-radius: 2rem;
  background: #8397aa;
  cursor: pointer;
  transition: background .17s ease;
}
.setting-switch::after {
  position: absolute;
  inset: .15rem auto auto .15rem;
  width: 1.14rem;
  height: 1.14rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #334c6666;
  content: "";
  transition: transform .17s ease;
}
.setting-switch:checked { background: #2067aa; }
.setting-switch:checked::after { transform: translateX(1.11rem); }
.background-option:active, .more-endpoints:active { scale: .96; }
.compact-dialog .close-button i { font-size: .98rem; }

@media (max-width: 1180px) {
  .directory { width: calc(100% - 7vw); }
  .card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .search { width: min(76vw, 44rem); }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-height: 780px) and (min-width: 761px) {
  .site-header { padding-top: 1.06rem; }
  .start-hero { padding-top: .63rem; gap: 1.12rem; }
  .home-clock time { font-size: clamp(3.15rem, 4.3vw, 4.2rem); }
  .directory { margin-top: 1.95rem; }
  .card-group { margin-top: 1.06rem; }
}
@media (max-width: 650px) {
  .site-header { padding: .84rem .85rem 0; }
  .header-actions { gap: .41rem; }
  .header-button.icon-only { min-height: 2.5rem; width: 2.5rem; }
  .start-hero { gap: 1.13rem; padding: 1.39rem .87rem 0; }
  .home-clock time { font-size: clamp(3.48rem, 11.9vw, 4.33rem); }
  .search { width: 100%; max-width: 33rem; min-height: 3.15rem; }
  .directory { width: calc(100% - 1.7rem); margin-top: 1.52rem; }
  .directory-header { gap: .62rem .8rem; }
  .directory-title { gap: .54rem; }
  .toolbar { gap: .32rem; }
  .filter-toggle { width: 2.2rem; height: 2.22rem; }
  .network-trigger { min-width: 6.16rem; min-height: 2.48rem; padding-inline: .55rem; font-size: .75rem; }
  .roles button { min-height: 1.95rem; padding-inline: .37rem; font-size: .72rem; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .56rem; }
  .service-card { min-height: 4.6rem; }
  .service-main { padding-inline: .51rem; gap: .49rem; }
  .service-name { font-size: clamp(.82rem, 3.64vw, 1.01rem); }
  .admin-entry, .direct-entry { min-width: 2.26rem; min-height: 2.23rem; margin: 0 .15rem .15rem .03rem; padding-inline: .21rem; font-size: .72rem; }
  .direct-entry { position: absolute; right: .33rem; bottom: .25rem; z-index: 1; min-height: 1.72rem; margin: 0; padding-inline: .37rem; }
  .more-endpoints { min-height: 1.58rem; padding-inline: .27rem; font-size: .64rem; }
  .tile-actions { top: .11rem; right: .17rem; }
  .tile-tool { width: 1.64rem; height: 1.7rem; font-size: .89rem; }
}
@media (max-width: 365px) {
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .toolbar { gap: .28rem; }
  .roles button { padding-inline: .29rem; }
  .service-main { gap: .62rem; }
}
@media (pointer: coarse) {
  .favorite-toggle { opacity: 1; }
  kbd { display: none; }
}
@media (prefers-reduced-transparency: reduce) { :root { --glass: #f8fcff; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
