:root {
  --bg: #f4f6fa;
  --surface: #fff;
  --text: #111827;
  --muted: #667085;
  --blue: #1e408f;
  --blue-soft: #eef3ff;
  --cyan: #258aa0;
  --pink: #a83979;
  --pink-soft: #fff3f9;
  --border: #dfe5ef;
  --border-soft: #edf1f6;
  --shadow: 0 12px 34px rgba(15, 23, 42, .055);
  --shadow-hover: 0 16px 34px rgba(15, 23, 42, .095);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: linear-gradient(180deg, #fbfcff 0%, var(--bg) 440px); }
a { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(223, 229, 239, .9);
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 5px 22px rgba(15, 23, 42, .025);
  backdrop-filter: blur(18px) saturate(145%);
  -webkit-backdrop-filter: blur(18px) saturate(145%);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1260px, calc(100% - 36px));
  min-height: 68px;
  margin: 0 auto;
}

.brand { display: flex; align-items: center; min-width: 0; }
.brand strong { padding-right: 14px; border-right: 1px solid var(--border); font-size: 25px; font-weight: 850; line-height: 1; letter-spacing: -.05em; }
.brand span { margin-left: 14px; font-size: 20px; font-weight: 680; line-height: 1.15; letter-spacing: -.025em; }
.test-chip { flex: 0 0 auto; padding: 7px 11px; border: 1px solid #f2c36b; border-radius: 999px; background: #fff8e8; color: #7a4b00; font-size: 11px; font-weight: 820; }

.hub { width: min(1260px, calc(100% - 36px)); margin: 0 auto; padding: 26px 0 48px; }
.welcome { margin-bottom: 20px; padding: 0 2px; }
.kicker { color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
h1 { margin: 5px 0 7px; font-size: clamp(34px, 4.2vw, 48px); font-weight: 680; line-height: 1; letter-spacing: -.045em; }

.sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tool-section { --accent: var(--blue); --accent-soft: var(--blue-soft); min-width: 0; padding: 16px; border: 1px solid var(--border); border-radius: 20px; background: rgba(255, 255, 255, .94); box-shadow: var(--shadow); }
.tool-section.pk { --accent: var(--pink); --accent-soft: var(--pink-soft); }
.tool-section.wide { grid-column: 1 / -1; --accent: var(--cyan); --accent-soft: #effafd; }
.section-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 13px; padding-bottom: 12px; border-bottom: 1px solid var(--border-soft); }
.section-mark { flex: 0 0 10px; width: 10px; height: 10px; margin-top: 5px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.section-head h2 { margin: 0; font-size: 17px; font-weight: 750; line-height: 1.2; letter-spacing: -.02em; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-weight: 560; line-height: 1.4; }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.tool-section.wide .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tool-card { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 128px; padding: 13px; overflow: hidden; border: 1px solid #e5eaf2; border-radius: 14px; background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%); text-decoration: none; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.tool-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: transparent; }
.tool-card.primary::before { background: var(--accent); }
.tool-card.pk { border-color: #f1cce0; background: linear-gradient(180deg, #fff 0%, var(--pink-soft) 100%); }
.tool-card.pk::before { background: var(--pink); }
.tool-card:hover, .tool-card:focus-visible { z-index: 1; transform: translateY(-2px); border-color: #cbd5e3; box-shadow: var(--shadow-hover); outline: none; }
.card-title { padding-bottom: 8px; border-bottom: 1px solid var(--border-soft); color: #172033; font-size: 14px; font-weight: 760; line-height: 1.2; }
.tool-card.primary .card-title { color: var(--accent); }
.card-description { margin-top: 8px; color: var(--muted); font-size: 11px; font-weight: 530; line-height: 1.4; }
.open-label { display: inline-flex; align-items: center; gap: 5px; margin-top: auto; padding-top: 10px; color: var(--accent); font-size: 11px; font-weight: 780; }

.loading, .load-error { grid-column: 1 / -1; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: #fff; color: var(--muted); text-align: center; }

@media (max-width: 980px) {
  .sections { grid-template-columns: 1fr; }
  .tool-section.wide { grid-column: auto; }
  .tool-section.wide .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  .header-inner, .hub { width: min(100% - 22px, 1260px); }
  .header-inner { min-height: 60px; }
  .brand strong { font-size: 22px; }
  .brand span { font-size: 16px; }
  .test-chip { padding: 6px 8px; font-size: 9px; }
  .hub { padding-top: 20px; }
  .card-grid, .tool-section.wide .card-grid { grid-template-columns: 1fr; }
  .tool-card { min-height: 112px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
