:root {
  color-scheme: light;
  --ink: #18212f;
  --muted: #667085;
  --line: #d9e0e8;
  --soft: #f4f7f9;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --accent-soft: #e5f4f2;
  --warn: #b45309;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: #edf2f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

input,
select,
textarea,
button {
  font: inherit;
}

.app-shell,
.wrap {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 12px 48px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -12px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(217, 224, 232, 0.8);
  background: rgba(237, 242, 245, 0.94);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-block;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-decoration: none;
}

.tagline {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav a {
  padding: 6px 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  font-size: 13px;
  text-decoration: none;
}

.database-layout {
  display: grid;
  gap: 14px;
}

.home-shell {
  max-width: 1040px;
}

.home-layout {
  display: grid;
  gap: 18px;
}

.home-hero {
  position: relative;
  display: grid;
  gap: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(15, 118, 110, 0.92), rgba(16, 42, 67, 0.92)),
    radial-gradient(circle at 82% 22%, rgba(255, 247, 230, 0.38), transparent 28%);
  color: #fff;
  padding: 48px 38px 34px;
}

.home-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -120px;
  width: 360px;
  height: 360px;
  border: 46px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.home-hero-copy,
.home-search {
  position: relative;
  z-index: 1;
}

.home-hero .eyebrow {
  color: #d7fff5;
}

.home-hero h1 {
  max-width: 720px;
  margin: 6px 0 12px;
  font-size: 42px;
  line-height: 1.16;
}

.home-hero p {
  max-width: 740px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 16px;
}

.home-search {
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 14px;
  color: var(--ink);
  box-shadow: 0 18px 36px rgba(16, 24, 40, 0.18);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.mode-grid a {
  display: grid;
  gap: 2px;
  min-height: 70px;
  border: 1px solid #d7eadf;
  border-radius: 6px;
  background: #f8fcfa;
  padding: 10px;
  color: inherit;
  text-decoration: none;
}

.mode-grid strong {
  color: var(--accent-dark);
  font-size: 15px;
}

.mode-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.home-search-fields {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) 128px;
  gap: 10px;
  align-items: end;
}

.home-search label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.home-search label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-search input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  padding: 9px 12px;
}

.home-quick {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 2px;
}

.home-quick label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid #cce3df;
  border-radius: 6px;
  background: #f0faf8;
  color: #0f5f59;
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.meter-search {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  border-top: 1px solid #e3edf2;
  padding-top: 10px;
}

.meter-search label {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.meter-search span,
.meter-search small {
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

.meter-search small {
  color: var(--muted);
  text-align: right;
}

.meter-search select {
  width: 100%;
  min-height: 38px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  padding: 7px 9px;
}

.home-stats {
  display: grid;
  grid-template-columns: 1.35fr repeat(4, 1fr);
  border: 2px solid var(--accent);
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel);
}

.stat-tile {
  display: grid;
  align-content: center;
  min-height: 122px;
  border-left: 2px solid var(--accent);
  padding: 16px;
  color: var(--accent);
  text-align: center;
}

.stat-tile:first-child {
  border-left: 0;
}

.stat-tile span {
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.stat-tile strong {
  font-size: 46px;
  line-height: 1;
  letter-spacing: 0;
}

.stat-large strong {
  font-size: 60px;
}

.stat-tile small {
  color: var(--accent);
  font-size: 16px;
  font-weight: 900;
}

.home-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 14px;
}

.section-head h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.section-head > a {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.home-area-grid,
.home-purpose-grid {
  display: grid;
  gap: 8px;
}

.home-area-grid {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.home-purpose-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.home-area-grid a,
.home-purpose-grid a {
  display: grid;
  gap: 3px;
  min-height: 58px;
  border: 1px solid #d7eadf;
  border-radius: 6px;
  background: #f8fcfa;
  padding: 10px;
  text-decoration: none;
}

.home-area-grid strong,
.home-purpose-grid strong {
  color: #0f5f59;
  font-size: 15px;
}

.home-area-grid span,
.home-purpose-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.search-panel,
.result-head,
.link-hub,
.empty,
.notice,
.form,
.detail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.search-panel {
  padding: 18px;
}

.seo-lead h1 {
  margin: 4px 0 10px;
  font-size: 28px;
  line-height: 1.3;
}

.seo-lead p {
  max-width: 820px;
  margin-bottom: 16px;
  color: #475467;
}

.page-freshness {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0 16px;
}

.page-freshness span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid #d7eadf;
  border-radius: 6px;
  background: #f2fbf5;
  color: #166534;
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 800;
}

.panel-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.eyebrow {
  display: block;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

.panel-title h1,
.result-head h2 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.25;
}

.search {
  display: grid;
  gap: 10px;
}

.static-search {
  margin: 12px 0 10px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 96px;
  gap: 10px;
}

.search input[type="search"],
.search select,
.form input,
.form select,
.form textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  padding: 9px 12px;
}

.btn,
.detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--accent-dark);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.area-tabs,
.filter-bar,
.sort-links,
.badges {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 2px;
}

.area-tabs a,
.filter-bar a,
.filter-bar label,
.sort-links a,
.badge,
.use-label {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 5px 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
}

.area-tabs .active,
.filter-bar .active,
.sort-links .active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.filter-bar input {
  margin: 0 6px 0 0;
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
}

.ranking-list {
  display: grid;
  gap: 8px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) minmax(260px, 0.72fr) 72px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.ranking-row > * {
  min-width: 0;
}

.rank {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 6px;
  background: #102a43;
  color: #fff;
  font-weight: 900;
  min-height: 58px;
}

.rank span {
  font-size: 24px;
  line-height: 1;
}

.rank small {
  font-size: 13px;
}

.workspace-main {
  min-width: 0;
}

.workspace-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.workspace-title h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-title a {
  text-decoration: none;
}

.workspace-title a:hover {
  text-decoration: underline;
}

.use-label {
  border-color: #f0c36d;
  background: #fff7e6;
  color: var(--warn);
  min-height: 26px;
  padding: 3px 8px;
  font-size: 12px;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.badges {
  margin-top: 6px;
}

.badge {
  min-height: 24px;
  border-color: #cce3df;
  background: #f0faf8;
  color: #0f5f59;
  padding: 2px 7px;
  font-size: 12px;
}

.desc {
  margin: 6px 0 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-meter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.mini-meter {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.mini-meter div {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: #344054;
  font-size: 11px;
  font-weight: 900;
}

.mini-meter strong {
  color: var(--accent-dark);
}

.mini-meter i,
.profile-meter i {
  display: block;
  overflow: hidden;
  height: 7px;
  border-radius: 999px;
  background: #e7edf3;
}

.mini-meter b,
.profile-meter b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #d97706);
}

.compare {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}

.compare dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.compare div {
  min-width: 0;
  border-radius: 6px;
  background: var(--soft);
  padding: 6px 8px;
}

.compare dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.compare dd {
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.row-action {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.row-action span {
  color: var(--muted);
  font-size: 11px;
  text-align: center;
  white-space: nowrap;
}

.link-hub {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.link-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.link-hub-block h2 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 16px;
  line-height: 1.35;
}

.link-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.link-cloud a {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid #d7eadf;
  border-radius: 5px;
  background: #f8fcfa;
  color: #0f5f59;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.link-cloud a.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.area-table {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.area-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 7px 0;
  border-top: 1px solid #edf1f5;
}

.area-row:first-of-type {
  border-top: 0;
}

.area-row strong {
  color: #344054;
  font-size: 13px;
}

.empty,
.notice,
.detail,
.form {
  padding: 22px;
}

.detail {
  display: grid;
  gap: 18px;
}

.detail .desc {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 18px;
  align-items: start;
}

.detail-hero h1 {
  margin: 4px 0 6px;
  font-size: 34px;
  line-height: 1.2;
}

.fit-box {
  display: grid;
  gap: 5px;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  background: #fff9ed;
  padding: 14px;
}

.fit-box span {
  color: var(--warn);
  font-size: 12px;
  font-weight: 900;
}

.fit-box strong {
  color: #78350f;
  font-size: 18px;
  line-height: 1.35;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-meter {
  display: grid;
  gap: 8px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #f8fcfa;
  padding: 12px;
}

.profile-meter-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 900;
}

.profile-meter-head span {
  color: #344054;
}

.profile-meter-head strong {
  color: var(--accent-dark);
}

.profile-meter small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.review-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 14px;
}

.review-prompt h2 {
  margin: 2px 0 0;
  font-size: 18px;
  line-height: 1.35;
}

.two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form {
  display: grid;
  gap: 12px;
}

.form-lead h1 {
  margin: 4px 0 6px;
  font-size: 28px;
  line-height: 1.25;
}

.form-lead p {
  margin-bottom: 0;
  color: #475467;
}

.celebration-panel {
  position: relative;
  display: grid;
  gap: 14px;
  overflow: hidden;
  border: 2px solid #f0c36d;
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 18%, rgba(245, 158, 11, 0.34), transparent 28%),
    radial-gradient(circle at 86% 20%, rgba(219, 39, 119, 0.22), transparent 24%),
    linear-gradient(135deg, #fff8e8, #f6fffb 54%, #fff1f5),
    #fff;
  padding: 18px;
  box-shadow: 0 14px 34px rgba(180, 83, 9, 0.16);
  animation: celebration-glow 1800ms ease-out both;
}

.celebration-copy {
  position: relative;
  z-index: 1;
}

.celebration-copy h1 {
  max-width: 720px;
  margin: 4px 0 6px;
  color: #78350f;
  font-size: 30px;
  line-height: 1.22;
}

.celebration-copy p {
  margin-bottom: 0;
  color: #475467;
  font-weight: 800;
}

.celebration-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.celebration-burst span {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: #f59e0b;
  opacity: 0;
  animation: celebrate-pop 1700ms ease-out forwards;
}

.celebration-burst span:nth-child(1) { left: 8%; top: 26%; background: #0f766e; animation-delay: 20ms; }
.celebration-burst span:nth-child(2) { left: 20%; top: 8%; background: #f97316; animation-delay: 120ms; }
.celebration-burst span:nth-child(3) { right: 22%; top: 12%; background: #db2777; animation-delay: 60ms; }
.celebration-burst span:nth-child(4) { right: 8%; top: 38%; background: #0f766e; animation-delay: 170ms; }
.celebration-burst span:nth-child(5) { left: 7%; bottom: 16%; background: #f59e0b; animation-delay: 230ms; }
.celebration-burst span:nth-child(6) { right: 34%; bottom: 10%; background: #2563eb; animation-delay: 310ms; }
.celebration-burst span:nth-child(7) { left: 42%; top: 4%; background: #84cc16; animation-delay: 90ms; }
.celebration-burst span:nth-child(8) { left: 54%; bottom: 4%; background: #ef4444; animation-delay: 190ms; }
.celebration-burst span:nth-child(9) { right: 4%; bottom: 18%; background: #7c3aed; animation-delay: 260ms; }
.celebration-burst span:nth-child(10) { left: 31%; bottom: 30%; background: #06b6d4; animation-delay: 340ms; }
.celebration-burst span:nth-child(11) { right: 48%; top: 28%; background: #f59e0b; animation-delay: 410ms; }
.celebration-burst span:nth-child(12) { left: 14%; top: 56%; background: #db2777; animation-delay: 480ms; }

@keyframes celebration-glow {
  0% {
    transform: scale(0.985);
    box-shadow: 0 0 0 rgba(180, 83, 9, 0);
  }
  42% {
    transform: scale(1.006);
    box-shadow: 0 18px 50px rgba(219, 39, 119, 0.22);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 14px 34px rgba(180, 83, 9, 0.16);
  }
}

@keyframes celebrate-pop {
  0% {
    opacity: 0;
    transform: translateY(18px) scale(0.4) rotate(0deg);
  }
  20% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translateY(-92px) translateX(28px) scale(1.55) rotate(280deg);
  }
}

.submit-ritual {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(24, 33, 47, 0.56);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.submit-ritual.active {
  opacity: 1;
  pointer-events: auto;
}

.submit-ritual-card {
  position: relative;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 40px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.38), transparent 38%),
    linear-gradient(145deg, #ffffff, #f0faf8);
  padding: 26px 18px 20px;
  text-align: center;
  transform: translateY(14px) scale(0.96);
  animation: ritual-card-in 1150ms cubic-bezier(.2, .9, .2, 1) forwards;
}

.submit-ritual-card strong {
  position: relative;
  z-index: 1;
  color: var(--accent-dark);
  font-size: 20px;
  line-height: 1.25;
}

.submit-ritual-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #475467;
  font-size: 13px;
  font-weight: 800;
}

.submit-orbit {
  position: relative;
  z-index: 1;
  width: 74px;
  height: 74px;
  margin: 0 auto 2px;
  border-radius: 50%;
  background: #fff7e6;
  box-shadow: inset 0 0 0 2px #f0c36d;
  animation: ritual-pulse 900ms ease-in-out infinite;
}

.submit-orbit span {
  position: absolute;
  inset: 8px;
  border: 3px solid transparent;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ritual-spin 760ms linear infinite;
}

.submit-orbit span:nth-child(2) {
  inset: 17px;
  border-top-color: #db2777;
  animation-duration: 980ms;
  animation-direction: reverse;
}

.submit-orbit span:nth-child(3) {
  inset: 28px;
  border-top-color: #f59e0b;
  animation-duration: 620ms;
}

@keyframes ritual-card-in {
  0% {
    transform: translateY(18px) scale(0.94);
    opacity: 0;
  }
  24% {
    opacity: 1;
  }
  72% {
    transform: translateY(0) scale(1.02);
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes ritual-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes ritual-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.posted-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  border: 1px solid rgba(240, 195, 109, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 14px;
}

.posted-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.posted-card-head span {
  color: var(--warn);
  font-size: 12px;
  font-weight: 900;
}

.posted-card-head strong {
  display: block;
  color: var(--accent-dark);
  font-size: 20px;
  line-height: 1.25;
}

.posted-card-head small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.posted-score-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.posted-score-grid div {
  display: grid;
  gap: 3px;
  border-radius: 6px;
  background: #f8fcfa;
  padding: 9px;
}

.posted-score-grid span,
.posted-tags span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.posted-score-grid strong {
  color: var(--accent-dark);
  font-size: 14px;
}

.posted-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.posted-tags span {
  border: 1px solid #d7eadf;
  border-radius: 6px;
  background: #f8fcfa;
  color: var(--accent-dark);
  padding: 3px 7px;
}

.posted-card p {
  margin: 0;
  color: #475467;
  font-size: 13px;
}

.review-fields,
.score-button-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.review-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.review-fields span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.quick-review-form {
  border-color: #b8ded8;
  background: #fbfffd;
}

.selected-workspace,
.select-workspace {
  display: grid;
  gap: 4px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #f8fcfa;
  padding: 12px;
}

.selected-workspace span,
.select-workspace span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.selected-workspace strong {
  color: var(--accent-dark);
  font-size: 20px;
  line-height: 1.25;
}

.selected-workspace small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.select-workspace select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  padding: 9px 12px;
}

.score-button-grid fieldset {
  display: grid;
  gap: 8px;
  border: 1px solid #d7eadf;
  border-radius: 8px;
  background: #f8fcfa;
  padding: 10px;
  margin: 0;
  min-width: 0;
}

.score-button-grid legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  padding: 0;
}

.score-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.score-choice label {
  min-width: 0;
}

.score-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.score-choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #344054;
  padding: 5px 7px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  line-height: 1.25;
  cursor: pointer;
}

.score-choice input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.optional-review-fields {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.optional-review-fields summary {
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.optional-review-fields[open] {
  display: grid;
  gap: 12px;
}

.optional-review-fields .review-fields {
  margin-top: 10px;
}

.review-api-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
}

.review-api-body {
  display: grid;
  gap: 10px;
}

.review-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.review-summary div {
  display: grid;
  gap: 2px;
  border-radius: 6px;
  background: var(--soft);
  padding: 10px;
}

.review-summary span,
.review-summary small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.review-summary strong {
  color: var(--accent-dark);
  font-size: 20px;
  line-height: 1.15;
}

.review-list {
  display: grid;
  gap: 8px;
}

.review-item {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.review-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.review-item-head strong {
  color: var(--ink);
  font-size: 14px;
}

.review-item-head span,
.review-scores span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.review-scores {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.review-scores span {
  border: 1px solid #d7eadf;
  border-radius: 6px;
  background: #f8fcfa;
  color: var(--accent-dark);
  padding: 3px 7px;
}

.review-item p,
.review-empty {
  margin: 0;
  color: #475467;
  font-size: 13px;
}

.checks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.table th {
  width: 170px;
  background: var(--soft);
}

.admin-shell {
  max-width: 1240px;
}

.admin-lead {
  display: grid;
  gap: 12px;
}

.admin-lead .panel-title {
  flex-wrap: wrap;
}

.workflow-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.workflow-step {
  display: grid;
  gap: 3px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-left: 5px solid #cfd8e3;
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.workflow-step.active {
  border-left-color: var(--accent);
}

.workflow-step span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.workflow-step strong {
  color: var(--accent-dark);
  font-size: 34px;
  line-height: 1;
}

.workflow-step small {
  color: #475467;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.city-progress-panel {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.city-progress-panel a {
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
  text-decoration: none;
}

.city-progress-panel strong {
  color: var(--accent-dark);
  font-size: 14px;
}

.city-progress-panel span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.inline-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}

.inline-actions select {
  width: 92px;
  min-height: 44px;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  background: #fff;
  padding: 8px;
}

.compact-notice {
  padding: 10px 12px;
}

.warn-notice {
  border-color: #f4c7c7;
  background: #fff6f6;
  color: #9f1239;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.admin-stats a {
  display: grid;
  gap: 2px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 10px;
  text-decoration: none;
}

.admin-stats a.active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.admin-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-stats strong {
  color: var(--accent-dark);
  font-size: 24px;
  line-height: 1.1;
}

.admin-search-row {
  grid-template-columns: minmax(0, 1fr) 190px 104px;
}

.admin-candidate-list {
  display: grid;
  gap: 8px;
}

.candidate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px 86px;
  gap: 12px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-left: 5px solid #cfd8e3;
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.candidate-row.status-approved {
  border-left-color: var(--accent);
}

.candidate-row.status-rejected {
  border-left-color: #b42318;
}

.candidate-row.status-crawled {
  border-left-color: #2563eb;
}

.candidate-main,
.candidate-score,
.candidate-actions {
  min-width: 0;
}

.candidate-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.candidate-title h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-title a {
  text-decoration: none;
}

.candidate-url {
  margin-top: 5px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.candidate-snippet,
.candidate-reason {
  margin: 6px 0 0;
  color: #475467;
  font-size: 13px;
  line-height: 1.45;
}

.candidate-reason {
  border-left: 3px solid #d7eadf;
  padding-left: 8px;
}

.candidate-score {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.candidate-score div {
  display: grid;
  align-content: center;
  min-height: 72px;
  border-radius: 6px;
  background: var(--soft);
  padding: 8px;
}

.candidate-score dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.candidate-score dd {
  margin: 1px 0 0;
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.candidate-score .score-good {
  background: #edfdf3;
  color: #166534;
}

.candidate-score .score-mid {
  background: #fff7e6;
  color: var(--warn);
}

.candidate-score .score-bad {
  background: #fff1f1;
  color: #b42318;
}

.candidate-actions {
  display: grid;
  gap: 6px;
  align-content: center;
}

.candidate-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.candidate-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.warn-inline {
  border-left-color: #f4c7c7;
  background: #fff6f6;
  padding: 7px 8px;
  color: #9f1239;
}

.duplicate-row {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--warn);
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.duplicate-head {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.duplicate-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.duplicate-pair > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  padding: 10px;
}

.duplicate-pair h2 {
  margin: 0 0 4px;
  font-size: 16px;
  overflow-wrap: anywhere;
}

.duplicate-pair p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
}

.duplicate-actions,
.duplicate-actions form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.duplicate-actions button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #344054;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 920px) {
  .home-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-tile {
    border-left: 0;
    border-top: 2px solid var(--accent);
  }

  .stat-tile:first-child {
    border-top: 0;
  }

  .home-search-fields {
    grid-template-columns: 1fr;
  }

  .mode-grid,
  .meter-search,
  .profile-grid,
  .review-fields,
  .score-button-grid,
  .review-summary {
    grid-template-columns: 1fr 1fr;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .ranking-row {
    grid-template-columns: 44px minmax(0, 1fr) 64px;
  }

  .compare {
    grid-column: 2;
  }

  .row-action {
    grid-column: 3;
    grid-row: 1 / span 2;
  }

  .compare {
    border-left: 0;
    padding-left: 0;
  }

  .row-action {
    align-items: center;
  }

  .admin-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .workflow-board,
  .city-progress-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .candidate-row {
    grid-template-columns: 1fr;
  }

  .candidate-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .duplicate-pair {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .app-shell,
  .wrap {
    max-width: none;
    padding: 10px 6px 40px;
  }

  .header,
  .panel-title,
  .result-head {
    align-items: stretch;
    flex-direction: column;
  }

  .home-hero {
    padding: 30px 16px 18px;
  }

  .home-hero h1 {
    font-size: 30px;
  }

  .home-stats {
    grid-template-columns: 1fr 1fr;
  }

  .mode-grid,
  .meter-search,
  .profile-grid,
  .review-fields,
  .score-button-grid,
  .review-summary,
  .mini-meter-row {
    grid-template-columns: 1fr;
  }

  .score-choice {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .meter-search label {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .detail-hero h1 {
    font-size: 28px;
  }

  .review-prompt {
    align-items: stretch;
    flex-direction: column;
  }

  .posted-card-head {
    align-items: stretch;
    flex-direction: column;
  }

  .posted-score-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-tile {
    min-height: 96px;
    padding: 12px;
  }

  .stat-tile strong,
  .stat-large strong {
    font-size: 36px;
  }

  .home-section {
    padding: 14px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .search-row,
  .two {
    grid-template-columns: 1fr;
  }

  .admin-search-row {
    grid-template-columns: 1fr;
  }

  .inline-actions {
    width: 100%;
  }

  .inline-actions select,
  .inline-actions .btn {
    flex: 1 1 0;
  }

  .admin-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .workflow-board,
  .city-progress-panel {
    grid-template-columns: 1fr;
  }

  .search-panel,
  .ranking-row,
  .result-head,
  .link-hub,
  .empty,
  .notice,
  .detail,
  .form {
    padding: 14px;
  }

  .search-panel {
    padding: 12px;
  }

  .search input[type="search"],
  .search select,
  .btn {
    min-height: 38px;
  }

  .seo-lead h1,
  .panel-title h1,
  .result-head h2 {
    font-size: 24px;
    line-height: 1.3;
    overflow-wrap: anywhere;
  }

  .seo-lead p {
    font-size: 15px;
    line-height: 1.65;
  }

  .page-freshness {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-freshness span {
    flex: 0 0 auto;
  }

  .area-tabs,
  .filter-bar,
  .sort-links {
    gap: 6px;
    margin-inline: -2px;
  }

  .area-tabs a,
  .filter-bar a,
  .filter-bar label,
  .sort-links a {
    min-height: 34px;
    padding: 4px 9px;
    font-size: 13px;
  }

  .filter-bar input {
    width: 16px;
    height: 16px;
  }

  .ranking-row {
    grid-template-columns: 42px minmax(0, 1fr) 56px;
    gap: 9px;
    padding: 10px;
  }

  .rank {
    min-height: 50px;
  }

  .rank span {
    font-size: 20px;
  }

  .compare dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare div {
    padding: 6px;
  }

  .compare dd {
    font-size: 12px;
  }

  .workspace-title {
    gap: 6px;
  }

  .workspace-title h2 {
    font-size: 16px;
  }

  .use-label,
  .desc,
  .row-action span {
    display: none;
  }

  .candidate-title .use-label,
  .candidate-url,
  .candidate-snippet,
  .candidate-reason {
    display: block;
  }

  .candidate-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .candidate-title h2 {
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .candidate-score {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .candidate-actions {
    grid-template-columns: 1fr;
  }

  .badges {
    gap: 5px;
  }

  .badge {
    min-height: 22px;
    padding: 1px 6px;
    font-size: 11px;
  }

  .detail-btn {
    width: 100%;
    min-height: 34px;
    padding: 0 9px;
    font-size: 13px;
  }

  .link-hub-grid,
  .area-row {
    grid-template-columns: 1fr;
  }

  .area-row {
    gap: 6px;
  }

  .table th,
  .table td {
    display: block;
    width: 100%;
    overflow-wrap: anywhere;
  }
}
