:root {
  --bg: #f7f5ef;
  --card: #ffffff;
  --text: #1e2b29;
  --muted: #5f6f6a;
  --primary: #255f55;
  --primary-strong: #19473f;
  --accent: #dcece7;
  --line: #dde6e2;
  --danger: #9a2f2f;
  --warning: #a2620b;
  --shadow: 0 18px 45px rgba(18, 42, 36, 0.08);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background: var(--bg);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select {
  font: inherit;
}
button { cursor: pointer; }
img { max-width: 100%; display: block; }

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 245, 239, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(221, 230, 226, 0.75);
}

.brand-row {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

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

.top-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
}

.top-nav a:hover,
.top-nav a.active-link {
  background: var(--accent);
  color: var(--primary-strong);
}

.auth-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.primary-btn,
.secondary-btn,
.ghost-btn,
.chip-btn,
.tag-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 700;
}

.primary-btn {
  background: var(--primary);
  color: white;
}

.primary-btn:hover { background: var(--primary-strong); }
.secondary-btn {
  background: var(--accent);
  color: var(--primary-strong);
}
.ghost-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text);
}
.chip-btn,
.tag-btn {
  background: white;
  border: 1px solid var(--line);
  color: var(--text);
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.danger-text { color: var(--danger); }
.warning-text { color: var(--warning); }

.page-section {
  padding: 28px 0;
}

.hero-section {
  padding: 42px 0 18px;
}

.hero-card {
  background: linear-gradient(135deg, #fefefe 0%, #eef5f1 100%);
  border: 1px solid var(--line);
  border-radius: 36px;
  box-shadow: var(--shadow);
  padding: 42px;
}

.hero-kicker {
  margin: 0 0 16px;
  color: var(--primary-strong);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-title {
  margin: 0;
  font-size: clamp(2.35rem, 6vw, 4.7rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.hero-subtitle {
  margin: 18px 0 0;
  max-width: 760px;
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--muted);
}

.search-panel {
  margin-top: 28px;
  display: grid;
  gap: 14px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.search-input,
.text-input,
.text-area,
.select-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  color: var(--text);
  padding: 16px 18px;
  outline: none;
}

.search-input {
  font-size: 1.06rem;
  min-height: 60px;
}

.text-area {
  min-height: 140px;
  resize: vertical;
}

.topic-chip-row,
.category-grid,
.card-grid,
.provider-grid,
.related-grid,
.quick-grid {
  display: grid;
  gap: 16px;
}

.topic-chip-row {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.category-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card-grid,
.provider-grid,
.related-grid,
.quick-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.section-heading {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
  letter-spacing: -0.04em;
}

.section-subtext {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.7;
}

.info-card,
.category-card,
.provider-card,
.post-card,
.profile-card,
.admin-card,
.topic-layout-card,
.detail-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 24px;
}

.category-card h3,
.info-card h3,
.provider-card h3,
.post-card h3,
.profile-card h3,
.detail-card h3 {
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}

.soft-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--accent);
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 0.9rem;
}

.mini-list,
.detail-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.75;
}

.two-col,
.three-col {
  display: grid;
  gap: 18px;
}

.two-col { grid-template-columns: 1.15fr 0.85fr; }
.three-col { grid-template-columns: repeat(3, 1fr); }

.topic-hero {
  padding-top: 30px;
}

.topic-title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.topic-title {
  margin: 12px 0 8px;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

.action-row,
.inline-tags,
.provider-meta,
.card-actions,
.flex-row,
.profile-tag-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.detail-copy p,
.detail-copy li,
.post-card p,
.provider-card p,
.profile-card p,
.info-card p,
.category-card p {
  color: var(--muted);
  line-height: 1.7;
}

.split-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.score-pill {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fbfcfb;
}

.score-pill strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1.2rem;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-two-col {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, 1fr);
}

.label-block {
  display: grid;
  gap: 8px;
}

.kicker-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-strong);
}

.empty-state {
  text-align: center;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.65);
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(19, 32, 29, 0.48);
  padding: 20px;
  z-index: 60;
}

.modal-card {
  width: min(540px, 100%);
  background: white;
  border-radius: 28px;
  padding: 28px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  font-size: 1.4rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  margin: 18px 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.form-message {
  min-height: 24px;
  margin-top: 14px;
  color: var(--muted);
}

.stack-xs, .stack-md { display: grid; gap: 8px; }
.stack-md { gap: 14px; }
.split-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wide-btn { width: 100%; }

.footer-note {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 14px;
}

@media (max-width: 980px) {
  .two-col,
  .three-col,
  .split-card,
  .form-two-col,
  .search-row {
    grid-template-columns: 1fr;
  }

  .brand-row {
    flex-wrap: wrap;
    justify-content: center;
    padding: 14px 0;
  }

  .hero-card,
  .info-card,
  .category-card,
  .provider-card,
  .post-card,
  .profile-card,
  .admin-card,
  .topic-layout-card,
  .detail-card {
    padding: 20px;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 18px, 1180px);
  }

  .hero-card {
    border-radius: 26px;
    padding: 24px;
  }

  .hero-title {
    font-size: 2.3rem;
  }

  .topic-title {
    font-size: 2rem;
  }

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