:root {
  --fdc-line-tab-height: 38px;
  --fdc-line-tab-padding-x: 10px;
  --fdc-line-tab-border: var(--fdc-border-divider, var(--fdc-color-border, #d6e3f2));
  --fdc-line-tab-text: var(--fdc-color-text-sub, #61758c);
  --fdc-line-tab-hover-text: var(--fdc-shell-primary, var(--fdc-color-accent, #3b82f6));
  --fdc-line-tab-active-text: var(--fdc-shell-primary, var(--fdc-color-accent, #3b82f6));
  --fdc-line-tab-active-rule: var(--fdc-shell-primary, var(--fdc-color-accent, #3b82f6));

  --fdc-switcher-radius: 999px;
  --fdc-switcher-height: 40px;
  --fdc-switcher-padding-x: 14px;
  --fdc-switcher-border: var(--fdc-border-control, var(--fdc-color-border-strong, #c3d4e8));
  --fdc-switcher-bg: rgba(248, 250, 252, 0.94);
  --fdc-switcher-text: var(--fdc-color-text-sub, #64748b);
  --fdc-switcher-hover-border: rgba(59, 130, 246, 0.42);
  --fdc-switcher-hover-bg: rgba(59, 130, 246, 0.08);
  --fdc-switcher-hover-text: var(--fdc-shell-primary, var(--fdc-color-accent, #3b82f6));
  --fdc-switcher-active-border: rgba(59, 130, 246, 0.45);
  --fdc-switcher-active-bg: rgba(59, 130, 246, 0.14);
  --fdc-switcher-active-text: var(--fdc-shell-primary, var(--fdc-color-accent, #3b82f6));
  --fdc-switcher-active-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
  --fdc-rounded-tab-radius: 16px;
  --fdc-rounded-tab-height: 42px;
  --fdc-rounded-tab-padding-x: 14px;
  --fdc-rounded-tab-border: var(--fdc-border-control, var(--fdc-color-border-strong, #c3d4e8));
  --fdc-rounded-tab-bg: rgba(255, 255, 255, 0.76);
  --fdc-rounded-tab-text: var(--fdc-color-text-sub, #64748b);
  --fdc-rounded-tab-hover-border: rgba(59, 130, 246, 0.34);
  --fdc-rounded-tab-hover-bg: rgba(59, 130, 246, 0.08);
  --fdc-rounded-tab-hover-text: var(--fdc-shell-primary, var(--fdc-color-accent, #3b82f6));
  --fdc-rounded-tab-active-border: rgba(59, 130, 246, 0.42);
  --fdc-rounded-tab-active-bg: rgba(59, 130, 246, 0.14);
  --fdc-rounded-tab-active-text: var(--fdc-shell-primary, var(--fdc-color-accent, #3b82f6));
  --fdc-rounded-tab-active-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.08);
}

:root[data-theme='dark'] {
  --fdc-line-tab-border: var(--fdc-border-divider, var(--fdc-color-border, #3b4d68));
  --fdc-line-tab-text: #97abc4;
  --fdc-line-tab-hover-text: #93c5fd;
  --fdc-line-tab-active-text: #93c5fd;
  --fdc-line-tab-active-rule: #93c5fd;

  --fdc-switcher-border: var(--fdc-border-control, var(--fdc-color-border-strong, #4b6282));
  --fdc-switcher-bg: rgba(15, 23, 42, 0.74);
  --fdc-switcher-text: #c4d2e3;
  --fdc-switcher-hover-border: rgba(59, 130, 246, 0.44);
  --fdc-switcher-hover-bg: rgba(59, 130, 246, 0.16);
  --fdc-switcher-hover-text: var(--fdc-shell-primary, var(--fdc-color-accent, #3b82f6));
  --fdc-switcher-active-border: rgba(59, 130, 246, 0.52);
  --fdc-switcher-active-bg: rgba(59, 130, 246, 0.2);
  --fdc-switcher-active-text: var(--fdc-shell-primary, var(--fdc-color-accent, #3b82f6));
  --fdc-switcher-active-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
  --fdc-rounded-tab-border: var(--fdc-border-control, var(--fdc-color-border-strong, #4b6282));
  --fdc-rounded-tab-bg: rgba(15, 23, 42, 0.74);
  --fdc-rounded-tab-text: #c4d2e3;
  --fdc-rounded-tab-hover-border: rgba(59, 130, 246, 0.42);
  --fdc-rounded-tab-hover-bg: rgba(59, 130, 246, 0.16);
  --fdc-rounded-tab-hover-text: var(--fdc-shell-primary, var(--fdc-color-accent, #3b82f6));
  --fdc-rounded-tab-active-border: rgba(59, 130, 246, 0.52);
  --fdc-rounded-tab-active-bg: rgba(59, 130, 246, 0.2);
  --fdc-rounded-tab-active-text: var(--fdc-shell-primary, var(--fdc-color-accent, #3b82f6));
  --fdc-rounded-tab-active-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.legal-nav,
.modal-tabbar,
.map-detail-tabs {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  flex-wrap: nowrap;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--fdc-line-tab-border);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-tabbar {
  padding-top: 4px;
}

.legal-nav::-webkit-scrollbar,
.modal-tabbar::-webkit-scrollbar,
.map-detail-tabs::-webkit-scrollbar {
  display: none;
}

:where(.legal-nav-link, .modal-tab-btn, .map-detail-tab-btn) {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--fdc-line-tab-text);
  min-height: var(--fdc-line-tab-height);
  padding: 8px var(--fdc-line-tab-padding-x);
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    color 0.18s ease,
    background-color 0.18s ease;
}

.modal-tabbar .modal-tab-btn {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

:where(.legal-nav-link, .modal-tab-btn, .map-detail-tab-btn):hover {
  color: var(--fdc-line-tab-hover-text);
}

:where(.legal-nav-link, .modal-tab-btn, .map-detail-tab-btn):focus-visible {
  outline: 3px solid var(--fdc-focus-ring-color);
  outline-offset: 1px;
  border-radius: 8px;
}

.modal-tab-btn:focus-visible {
  outline-offset: 0;
}

.legal-nav-link.is-active,
body.legal-page[data-legal-doc-type='privacy_policy'] .legal-nav-link[data-legal-nav='privacy_policy'],
body.legal-page[data-legal-doc-type='terms_of_service'] .legal-nav-link[data-legal-nav='terms_of_service'],
body.legal-page[data-legal-doc-type='location_based_service_terms'] .legal-nav-link[data-legal-nav='location_based_service_terms'],
body.legal-page[data-legal-doc-type='personal_location_privacy'] .legal-nav-link[data-legal-nav='personal_location_privacy'],
body.legal-page[data-legal-doc-type='open_source_licenses'] .legal-nav-link[data-legal-nav='open_source_licenses'],
body.legal-page[data-legal-doc-type='business_info'] .legal-nav-link[data-legal-nav='business_info'],
.modal-tab-btn.active,
.map-detail-tab-btn.is-active {
  border-bottom-color: var(--fdc-line-tab-active-rule);
  color: var(--fdc-line-tab-active-text);
}

.feed-toolbar-tabs {
  gap: 8px;
}

.feed-filter-btn {
  min-height: var(--fdc-switcher-height);
  padding: 0 var(--fdc-switcher-padding-x);
  border: 1px solid var(--fdc-switcher-border);
  border-radius: var(--fdc-switcher-radius);
  background: var(--fdc-switcher-bg);
  color: var(--fdc-switcher-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.feed-filter-btn:focus-visible {
  outline: 3px solid var(--fdc-focus-ring-color);
  outline-offset: 2px;
}

.feed-filter-btn.is-active {
  border-color: var(--fdc-switcher-active-border);
  background: var(--fdc-switcher-active-bg);
  color: var(--fdc-switcher-active-text);
  box-shadow: var(--fdc-switcher-active-shadow);
}

.feed-filter-btn.is-active .feed-filter-count {
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(255, 255, 255, 0.76);
  color: var(--fdc-switcher-active-text);
}

:root[data-theme='dark'] .feed-filter-btn.is-active .feed-filter-count {
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(15, 23, 42, 0.5);
}

.fdc-rounded-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fdc-rounded-tab {
  min-height: var(--fdc-rounded-tab-height);
  padding: 0 var(--fdc-rounded-tab-padding-x);
  border: 1px solid var(--fdc-rounded-tab-border);
  border-radius: var(--fdc-rounded-tab-radius);
  background: var(--fdc-rounded-tab-bg);
  color: var(--fdc-rounded-tab-text);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background-color 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.fdc-rounded-tab:focus-visible {
  outline: 3px solid var(--fdc-focus-ring-color);
  outline-offset: 2px;
}

.fdc-rounded-tab.is-active,
.fdc-rounded-tab[aria-selected='true'] {
  border-color: var(--fdc-rounded-tab-active-border);
  background: var(--fdc-rounded-tab-active-bg);
  color: var(--fdc-rounded-tab-active-text);
  box-shadow: var(--fdc-rounded-tab-active-shadow);
}
