:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: #25303b;
  background: #f7f8fa;
  font-size: 14px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

/* Shared header */
.topbar, .site-header {
  height: 62px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid #e7eaee;
}
.topbar { max-width: 1220px; margin: auto; }
.brand, .site-brand { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.topbar nav, .header-actions { display: flex; gap: 28px; align-items: center; color: #65717d; font-size: 13px; }
.topbar nav a:hover, .header-actions a:hover, .nav-current { color: #25303b; }
.nav-current { font-weight: 700; }

/* Site directory */
.directory-body { background: #f7f8fa; }
.directory-wrap { max-width: 1220px; margin: 0 auto; padding: 32px 28px 70px; }
.directory-hero {
  background: #f0f3f6;
  border: 1px solid #e5e9ed;
  border-radius: 8px;
  padding: 42px 46px;
}
.eyebrow { color: #75818d; font-size: 12px; font-weight: 600; }
.directory-hero h1 { font-size: 31px; letter-spacing: -.03em; margin: 15px 0 8px; line-height: 1.4; }
.directory-hero p { margin: 0; color: #64717d; line-height: 1.8; }
.hero-meta { margin-top: 22px; color: #8a96a1; font-size: 12px; }
.collection { padding-top: 37px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-heading h2 { margin: 0; font-size: 18px; }
.heading-count { color: #8d98a2; font-size: 13px; font-weight: 400; margin-left: 7px; }
.site-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.site-card {
  min-height: 181px;
  background: #fff;
  border: 1px solid #e4e8ec;
  border-radius: 7px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, background .15s;
}
.site-card:hover { border-color: #aab5bf; background: #fcfdfd; }
.site-card-top { display: flex; justify-content: space-between; align-items: start; }
.site-icon, .site-brand-icon, .admin-site-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 5px;
  color: var(--accent, #496886);
  background: color-mix(in srgb, var(--accent, #496886), white 91%);
  font-size: 15px;
  font-weight: 700;
}
.card-arrow { color: #9ba5af; font-size: 15px; }
.site-card-main { flex: 1; padding: 16px 0 18px; }
.site-card h3 { font-size: 16px; margin: 0 0 8px; }
.site-card p { color: #697682; font-size: 12px; line-height: 1.65; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.site-card-bottom { border-top: 1px solid #edf0f2; padding-top: 12px; display: flex; justify-content: space-between; gap: 8px; color: #8b96a0; font-size: 11px; }
.site-card-bottom span:last-child { color: #455b70; white-space: nowrap; }
.directory-footer { max-width: 1220px; margin: 0 auto; padding: 22px 28px; border-top: 1px solid #e5e9ed; color: #87939d; font-size: 12px; }

/* Public site */
.site-header { position: sticky; top: 0; z-index: 10; }
.site-brand { display: inline-flex; align-items: center; gap: 10px; }
.site-brand-icon { --accent: #4d6175; width: 31px; height: 31px; font-size: 13px; }
.header-admin { border: 1px solid #dce2e7; border-radius: 5px; padding: 7px 11px; }
.site-layout { display: flex; max-width: 1500px; margin: 0 auto; min-height: calc(100vh - 62px); }
.sidebar { width: 225px; flex: none; padding: 26px 14px; background: #fff; border-right: 1px solid #e7eaee; position: sticky; top: 62px; height: calc(100vh - 62px); overflow: auto; }
.sidebar-label { padding: 0 11px 12px; color: #8a95a0; font-size: 12px; font-weight: 600; }
.side-link { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 37px; padding: 7px 11px; border-left: 2px solid transparent; color: #53616d; font-size: 12px; line-height: 1.5; }
.side-link:hover { background: #f6f8fa; color: #243344; }
.side-link.active { border-left-color: var(--accent, #506b83); background: #f3f6f8; color: #243344; font-weight: 700; }
.side-link small { color: #a0aab4; font-size: 11px; font-weight: 400; }
.site-content { flex: 1; min-width: 0; padding: 28px 32px 0; }
.site-hero { background: #fff; border: 1px solid #e5e9ed; border-top: 3px solid var(--accent, #506b83); border-radius: 6px; padding: 30px 34px 27px; }
.site-hero-content { max-width: 730px; }
.hero-badge { font-size: 11px; color: #83909b; }
.site-hero h1 { margin: 10px 0 6px; font-size: 27px; letter-spacing: -.03em; line-height: 1.4; }
.site-hero p { margin: 0; color: #687581; line-height: 1.7; font-size: 13px; }
.search-box { display: flex; width: 100%; max-width: 585px; height: 43px; margin: 22px 0 13px; }
.search-box input { flex: 1; min-width: 0; border: 1px solid #d8dee4; border-radius: 5px 0 0 5px; padding: 0 13px; outline: none; background: #fff; color: #25303b; font-size: 13px; }
.search-box input:focus { border-color: #91a0ae; }
.search-box button { border: 1px solid #435a6d; background: #435a6d; color: #fff; border-radius: 0 5px 5px 0; padding: 0 20px; font-size: 12px; }
.search-box button:hover { background: #34495b; }
.hero-stat { color: #8a96a0; font-size: 11px; }
.content-section { margin-top: 31px; scroll-margin-top: 83px; }
.content-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 13px; padding-bottom: 10px; border-bottom: 1px solid #e5e9ed; }
.content-heading h2 { font-size: 17px; margin: 0; }
.section-count { color: #8b97a1; font-size: 11px; }
.link-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.link-card { min-height: 78px; display: flex; align-items: center; gap: 11px; padding: 13px; background: #fff; border: 1px solid #e5e9ed; border-radius: 5px; transition: border-color .15s; }
.link-card:hover { border-color: #aab7c1; }
.link-card-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: none; border: 1px solid #e4e9ed; border-radius: 4px; background: #f6f8fa; color: #526879; font-size: 14px; font-weight: 700; }
.link-card-text { min-width: 0; flex: 1; display: block; }
.link-title, .link-description { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-title { font-size: 12px; font-weight: 700; }
.link-description { color: #8b96a0; font-size: 11px; margin-top: 5px; }
.pin-tag { color: #697986; background: #f0f3f5; border-radius: 3px; font-size: 10px; padding: 2px 4px; font-weight: 400; }
.link-out { align-self: start; color: #9aa5ae; font-size: 14px; }
.search-note { padding: 20px 0; color: #788590; font-size: 12px; }
.search-note a { color: #425e77; text-decoration: underline; }
.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin: 26px 0; color: #87939d; font-size: 12px; }
.pager a { background: #fff; border: 1px solid #dce2e7; border-radius: 4px; padding: 8px 12px; color: #435a6d; }
.pager a:hover { border-color: #879aa8; }
.site-footer { border-top: 1px solid #e5e9ed; padding: 23px 0 28px; margin-top: 45px; color: #89959f; font-size: 11px; }

/* Local management */
.admin-body { background: #f7f8fa; }
.admin-wrap { max-width: 1220px; margin: auto; padding: 32px 28px 80px; }
.admin-intro { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 26px; }
.admin-intro h1 { font-size: 24px; margin: 8px 0; }
.admin-intro p { margin: 0; color: #71808b; font-size: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; background: #435a6d; color: #fff; border: 1px solid #435a6d; border-radius: 5px; min-height: 36px; padding: 8px 14px; font-size: 12px; font-weight: 600; }
.btn:hover { background: #34495b; }
.btn.secondary { color: #435a6d; background: #fff; border-color: #dbe1e6; }
.btn.small { min-height: 32px; padding: 6px 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.flash { background: #eef4ef; color: #486a50; border: 1px solid #d2e3d5; border-radius: 5px; padding: 11px 14px; margin-bottom: 16px; font-size: 12px; }
.admin-grid { display: grid; grid-template-columns: 235px minmax(0, 1fr); gap: 18px; align-items: start; }
.admin-side, .admin-panel { background: #fff; border: 1px solid #e4e8ec; border-radius: 6px; }
.admin-side { padding: 14px; position: sticky; top: 18px; }
.admin-side-title { display: flex; justify-content: space-between; color: #46545f; font-weight: 700; font-size: 12px; padding: 8px 9px 13px; }
.admin-side-title span { color: #9aa6b0; }
.admin-site { display: flex; align-items: center; gap: 9px; padding: 8px; border-radius: 4px; }
.admin-site:hover, .admin-site.selected { background: #f1f4f6; }
.admin-site-icon { width: 28px; height: 28px; font-size: 12px; }
.admin-site b, .admin-site small { display: block; }
.admin-site b { font-size: 11px; }
.admin-site small { margin-top: 3px; color: #91a0ab; font-size: 10px; }
.admin-site-arrow { margin-left: auto; color: #9ca7b0; }
.new-site { border-top: 1px solid #e9edf0; margin-top: 12px; padding: 15px 8px 5px; }
.new-site summary, .add-block summary { color: #435a6d; cursor: pointer; font-size: 12px; font-weight: 600; }
.new-site .stack-form { padding-top: 15px; }
.admin-main { display: grid; gap: 17px; }
.admin-panel { padding: 22px 25px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 19px; }
.panel-heading h2 { font-size: 17px; margin: 6px 0 0; }
.panel-chip { padding: 5px 8px; border: 1px solid #e2e7ea; border-radius: 4px; color: #7c8a95; font-size: 10px; }
.muted { color: #95a2ac; font-size: 12px; font-weight: 400; }
.stack-form { display: flex; flex-direction: column; align-items: flex-start; gap: 13px; }
.stack-form label { display: flex; flex-direction: column; gap: 6px; width: 100%; color: #596772; font-size: 11px; font-weight: 600; }
.stack-form input:not([type=checkbox]), .stack-form textarea, .stack-form select, .admin-search input { width: 100%; min-height: 37px; padding: 8px 10px; background: #fff; color: #25303b; border: 1px solid #dbe1e6; border-radius: 4px; outline: none; font-size: 12px; }
.stack-form input:focus, .stack-form textarea:focus, .stack-form select:focus, .admin-search input:focus { border-color: #8da0ad; }
.stack-form input[type=color] { height: 37px; padding: 3px; }
.form-row { display: flex; gap: 12px; width: 100%; }
.form-row label { flex: 1; min-width: 0; }
.domain-note { color: #8896a0; font-size: 11px; }
.edit-list { display: grid; gap: 6px; }
.edit-item { border: 1px solid #e6eaee; border-radius: 4px; }
.edit-item summary { list-style: none; display: flex; align-items: center; gap: 9px; padding: 9px 10px; cursor: pointer; }
.edit-item summary::-webkit-details-marker { display: none; }
.edit-icon { width: 26px; height: 26px; display: grid; place-items: center; flex: none; border-radius: 4px; background: #f0f3f5; color: #596d7d; font-size: 12px; }
.edit-item b { font-size: 12px; }
.edit-item small { color: #96a3ad; font-size: 10px; }
.edit-chevron { margin-left: auto; color: #98a5ae; }
.edit-body { border-top: 1px solid #e8ecef; padding: 15px; display: flex; gap: 15px; align-items: end; justify-content: space-between; }
.edit-body .stack-form { flex: 1; }
.text-danger { border: 0; padding: 6px 0; color: #a74646; background: transparent; font-size: 11px; white-space: nowrap; }
.add-block { border: 1px dashed #cbd5dc; border-radius: 4px; padding: 13px; margin-top: 12px; }
.add-block .stack-form { margin-top: 14px; }
.admin-category-label { margin: 15px 0 8px; color: #677783; font-size: 11px; font-weight: 700; }
.mini-pin { color: #5e7281 !important; background: #f0f3f5; padding: 2px 4px; border-radius: 3px; }
.check-label { flex-direction: row !important; align-items: center; gap: 7px !important; }
.check-label input { accent-color: #435a6d; }
.admin-search { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-search input { flex: 1; min-width: 0; }
.admin-search a { align-self: center; color: #435a6d; font-size: 11px; }

@media (max-width: 1000px) {
  .site-grid, .link-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar, .site-header { height: 56px; padding: 0 16px; }
  .topbar nav, .header-actions { gap: 14px; font-size: 12px; }
  .directory-wrap { padding: 18px 15px 45px; }
  .directory-hero { padding: 28px 23px; }
  .directory-hero h1 { font-size: 25px; }
  .collection { padding-top: 28px; }
  .site-grid, .link-grid { grid-template-columns: 1fr; }
  .site-card { min-height: 155px; }
  .directory-footer { padding: 18px 15px; }
  .site-layout { display: block; }
  .sidebar { width: auto; height: auto; position: static; display: flex; gap: 4px; overflow-x: auto; padding: 9px 15px; border-right: 0; border-bottom: 1px solid #e7eaee; white-space: nowrap; }
  .sidebar-label { display: none; }
  .side-link { flex: none; border-left: 0; border-bottom: 2px solid transparent; min-height: 32px; padding: 5px 9px; }
  .side-link.active { border-bottom-color: var(--accent, #506b83); }
  .side-link small { display: none; }
  .site-content { padding: 16px; }
  .site-hero { padding: 23px 20px; }
  .site-hero h1 { font-size: 23px; }
  .content-section { margin-top: 25px; }
  .admin-wrap { padding: 22px 15px 55px; }
  .admin-intro { align-items: start; }
  .admin-intro h1 { font-size: 21px; }
  .admin-intro .btn { font-size: 11px; }
  .admin-grid { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .admin-panel { padding: 18px 15px; }
  .edit-body { display: block; }
  .edit-body > form:last-child { margin-top: 10px; }
  .form-row { flex-wrap: wrap; }
  .form-row label { min-width: 120px; }
}

/* ip438.com public-page layout */
.directory-body, .site-body { min-height: 100vh; background: #f4f6fa; color: #1d1f20; font-size: 14px; }
.public-header { border-top: 3px solid #3576d2; border-bottom: 1px solid rgba(29,31,32,.16); background: #fff; }
.public-header-inner { max-width: 1280px; min-height: 70px; padding: 12px 48px; margin: auto; display: flex; align-items: center; gap: 28px; }
.public-logo { display: inline-flex; align-items: center; flex: none; gap: 10px; min-width: 155px; }
.public-logo-image { display: block; flex: none; width: 36px; height: 36px; }
.public-logo-type { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.public-logo-type strong { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; line-height: 1.15; letter-spacing: .04em; }
.public-logo-type small { color: #22509a; font-size: 10px; font-weight: 600; letter-spacing: .08em; white-space: nowrap; }
.header-search { width: min(300px, 25vw); height: 36px; margin-right: auto; display: flex; background: #f4f6fa; border: 1px solid rgba(29,31,32,.16); }
.header-search:focus-within { border-color: #3576d2; }
.header-search input { min-width: 0; flex: 1; padding: 0 10px; border: 0; outline: 0; background: transparent; font-size: 12px; }
.header-search button { width: 36px; border: 0; background: transparent; color: #22509a; font-size: 23px; line-height: 1; }
.public-nav { display: flex; align-items: center; gap: 22px; margin-left: auto; white-space: nowrap; }
.public-nav a { font-size: 13px; }
.public-nav a:hover, .public-nav a.current { color: #3576d2; }
.public-main { max-width: 1280px; min-height: calc(100vh - 150px); margin: auto; padding: 0 48px 54px; }
.directory-heading { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 38px; align-items: end; padding: 42px 0 20px; }
.directory-heading-title { min-width: 0; }
.kicker { display: block; color: #22509a; font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.heading-rule { display: block; width: 100%; height: 1px; margin: 13px 0 20px; background: rgba(29,31,32,.16); }
.directory-heading h1 { margin: 0; font-size: clamp(29px,3.4vw,44px); font-weight: 600; line-height: 1.13; letter-spacing: .01em; }
.directory-heading p { margin: 12px 0 0; color: rgba(29,31,32,.58); font-size: 13px; }
.main-search { width: min(500px,43vw); height: 44px; display: flex; border: 1px solid rgba(29,31,32,.16); background: #fff; box-shadow: 0 1px 2px rgba(22,41,75,.05); }
.main-search:focus-within { border-color: #3576d2; }
.main-search input { min-width: 0; flex: 1; padding: 0 14px; border: 0; outline: 0; background: transparent; font-size: 13px; }
.main-search button { padding: 0 23px; border: 0; border-left: 1px solid #2b64b8; background: #3576d2; color: #fff; font-weight: 600; }
.main-search button:hover { background: #2b64b8; }
.directory-total { min-width: 132px; padding: 10px 18px; display: flex; flex-direction: column; border: 1px solid rgba(29,31,32,.12); border-top: 2px solid #3576d2; background: #fff; }
.directory-total strong { font-size: 29px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.directory-total span { margin-top: 8px; color: rgba(29,31,32,.55); font-size: 11px; }
.directory-summary { padding: 11px 0 17px; color: rgba(29,31,32,.55); font-size: 12px; }
.directory-summary b { color: #1d1f20; font-variant-numeric: tabular-nums; }
.summary-divider { margin: 0 9px; color: rgba(29,31,32,.3); }
.category-tabs { display: flex; flex-wrap: wrap; gap: 0 24px; padding: 11px 0; border-top: 1px solid rgba(29,31,32,.16); border-bottom: 1px solid rgba(29,31,32,.16); scroll-margin-top: 20px; }
.category-tabs a { padding: 6px 0; color: #464c52; font-size: 13px; white-space: nowrap; }
.category-tabs a:hover, .category-tabs a.current { color: #3576d2; }
.category-tabs a.current { font-weight: 700; }
.directory-group { display: grid; grid-template-columns: 180px minmax(0,1fr); border-bottom: 1px solid rgba(29,31,32,.16); scroll-margin-top: 16px; }
.featured-group { border-top: 2px solid #3576d2; }
.group-heading { padding: 18px 18px 18px 0; display: flex; align-items: baseline; gap: 11px; border-right: 1px solid rgba(29,31,32,.16); }
.group-index { color: #22509a; font-size: 12px; font-weight: 700; flex: none; }
.group-heading h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.25; }
.group-heading small { display: block; margin-top: 5px; color: rgba(29,31,32,.45); font-size: 11px; }
.group-content { min-width: 0; padding: 10px 0 10px 24px; }
.directory-links { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); column-gap: 13px; }
.directory-link { min-width: 0; min-height: 37px; display: flex; align-items: center; gap: 7px; font-size: 13px; }
.directory-link:hover .directory-link-name { color: #3576d2; text-decoration: underline; text-underline-offset: 3px; }
.directory-link-mark { flex: none; width: 19px; height: 19px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(29,31,32,.1); background: #fff; color: #22509a; font-size: 10px; font-weight: 700; line-height: 1; }
.directory-link-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pin-dot { margin-left: -3px; color: #e07b39; font-size: 17px; }
.group-more { display: inline-block; margin: 7px 0 4px; color: #22509a; font-size: 11px; }
.group-more:hover { color: #3576d2; }
.search-note { padding: 12px 0; color: rgba(29,31,32,.58); font-size: 12px; }
.search-note a { margin-left: 10px; color: #22509a; text-decoration: underline; }
.pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 30px 0; font-size: 12px; }
.pager a { padding: 7px 12px; border: 1px solid rgba(29,31,32,.16); background: #fff; color: #22509a; }
.pager a:hover { border-color: #3576d2; }
.directory-collection { margin-top: 12px; scroll-margin-top: 20px; }
.collection-heading { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-top: 1px solid rgba(29,31,32,.16); }
.collection-heading > span:last-child { color: rgba(29,31,32,.5); font-size: 11px; }
.site-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.site-card { min-height: 171px; display: flex; flex-direction: column; padding: 16px 18px 12px; border: 1px solid rgba(29,31,32,.12); border-top: 2px solid #3576d2; background: #fff; box-shadow: 0 1px 2px rgba(22,41,75,.04); }
.site-card:hover { border-color: #7fadea; box-shadow: 0 3px 12px rgba(22,41,75,.08); }
.site-card-top { display: flex; justify-content: space-between; align-items: start; }
.site-card-icon { width: 30px; height: 30px; display: grid; place-items: center; background: #ecf3fd; color: #22509a; font-size: 14px; font-weight: 700; }
.site-card-arrow { color: #a0a8b1; font-size: 14px; }
.site-card h2 { margin: 12px 0 5px; font-size: 17px; font-weight: 600; }
.site-card p { flex: 1; margin: 0 0 15px; color: rgba(29,31,32,.6); font-size: 12px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.site-card-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid rgba(29,31,32,.08); color: rgba(29,31,32,.48); font-size: 11px; }
.public-footer { max-width: 1184px; margin: 0 auto; padding: 22px 0 30px; display: flex; justify-content: space-between; border-top: 1px solid rgba(29,31,32,.16); color: rgba(29,31,32,.48); font-size: 11px; }
.public-footer a { color: #22509a; }

@media (max-width: 1040px) {
  .public-header-inner, .public-main { padding-left: 28px; padding-right: 28px; }
  .public-footer { margin-left: 28px; margin-right: 28px; }
  .directory-links { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .public-nav { gap: 14px; }
}
@media (max-width: 800px) {
  .public-header-inner { flex-wrap: wrap; gap: 11px; padding-top: 10px; padding-bottom: 10px; }
  .public-logo { margin-right: auto; }
  .public-nav { order: 3; width: 100%; overflow-x: auto; padding-top: 7px; border-top: 1px solid rgba(29,31,32,.08); }
  .header-search { order: 2; margin-right: 0; width: min(260px,40vw); }
  .directory-heading { grid-template-columns: minmax(0,1fr); gap: 20px; padding-top: 30px; }
  .main-search { width: 100%; max-width: 540px; }
  .directory-total { width: 140px; }
  .directory-links { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .site-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 540px) {
  .public-header-inner, .public-main { padding-left: 16px; padding-right: 16px; }
  .public-footer { margin-left: 16px; margin-right: 16px; }
  .public-logo-image { width: 31px; height: 31px; }
  .public-logo-type strong { max-width: 160px; font-size: 15px; }
  .header-search { order: 3; width: 100%; }
  .public-nav { order: 2; width: auto; border: 0; padding: 0; }
  .public-nav a { font-size: 12px; }
  .directory-heading h1 { font-size: 30px; }
  .category-tabs { flex-wrap: nowrap; overflow-x: auto; gap: 18px; }
  .directory-group { display: block; }
  .group-heading { border-right: 0; padding: 13px 0 3px; }
  .group-heading small { display: inline; margin-left: 7px; }
  .group-content { padding: 4px 0 12px; }
  .directory-links { grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 12px; }
  .site-grid { grid-template-columns: 1fr; }
  .site-card { min-height: 155px; }
}

/* Each site's chosen color stays available within the shared layout. */
.site-body .public-header { border-top-color: var(--brand, #3576d2); }
.site-body .main-search button { background: var(--brand, #3576d2); }
.site-body .public-nav a.current,
.site-body .public-nav a:hover, .site-body .category-tabs a.current,
.site-body .category-tabs a:hover, .site-body .group-index,
.site-body .group-more, .site-body .directory-link:hover .directory-link-name { color: var(--brand, #3576d2); }
.site-body .featured-group { border-top-color: var(--brand, #3576d2); }

/* Local management follows the same blue and square-edged controls. */
.admin-body .topbar { border-top: 3px solid #3576d2; height: 65px; }
.admin-body .btn { background: #3576d2; border-color: #2b64b8; border-radius: 3px; }
.admin-body .btn:hover { background: #2b64b8; }
.admin-body .btn.secondary { color: #22509a; background: #fff; border-color: rgba(29,31,32,.16); }
.admin-body .admin-side, .admin-body .admin-panel { border-radius: 3px; }
.admin-body .admin-panel { border-top: 2px solid #3576d2; }
.admin-body .new-site summary, .admin-body .add-block summary,
.admin-body .admin-search a { color: #22509a; }
.admin-body input, .admin-body textarea, .admin-body select { border-radius: 3px !important; }
.brand-with-logo { display: inline-flex; align-items: center; gap: 10px; line-height: 1.15; }
.brand-with-logo img { display: block; flex: none; width: 36px; height: 36px; }
.brand-with-logo span { display: flex; flex-direction: column; gap: 2px; font-size: 17px; letter-spacing: .04em; }
.brand-with-logo small { color: #22509a; font-size: 10px; letter-spacing: .08em; }
@media (max-width: 540px) { .brand-with-logo img { width: 31px; height: 31px; } .brand-with-logo span { font-size: 15px; } }
