/* Toss Style Design System */
:root {
  /* Primary Colors */
  --color-primary: #3182f6;
  --color-primary-dark: #1b64da;
  --color-primary-light: #4a93f7;
  --color-primary-bg: rgba(49, 130, 246, 0.1);

  /* Success Colors */
  --color-success: #00c471;
  --color-success-bg: rgba(0, 196, 113, 0.1);

  /* Warning Colors */
  --color-warning: #f59f00;
  --color-warning-bg: rgba(245, 159, 0, 0.1);

  /* Error Colors */
  --color-error: #f04452;
  --color-error-bg: rgba(240, 68, 82, 0.1);

  /* Light Mode */
  --bg-primary: #f7f8fa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f2f4f6;
  --bg-elevated: #ffffff;

  --text-primary: #191f28;
  --text-secondary: #4e5968;
  --text-tertiary: #8b95a1;
  --text-disabled: #b0b8c1;

  --border-color: #e5e8eb;
  --border-light: #f2f4f6;
  --divider: #e5e8eb;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.16);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  --transition-slow: 0.3s ease;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #17171c;
  --bg-secondary: #1f2024;
  --bg-tertiary: #26272b;
  --bg-elevated: #2c2d31;

  --text-primary: #ececec;
  --text-secondary: #b0b8c1;
  --text-tertiary: #6b7684;
  --text-disabled: #4e5968;

  --border-color: #333438;
  --border-light: #26272b;
  --divider: #333438;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 8px 32px rgba(0, 0, 0, 0.5);

  --color-primary-bg: rgba(49, 130, 246, 0.15);
  --color-success-bg: rgba(0, 196, 113, 0.15);
  --color-warning-bg: rgba(245, 159, 0, 0.15);
  --color-error-bg: rgba(240, 68, 82, 0.15);
}

/* Base Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Pretendard', 'Noto Sans KR', sans-serif;
  background: var(--bg-primary);
  min-height: 100vh;
  color: var(--text-primary);
  transition: background var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Splash Screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.splash-icon {
  color: var(--color-primary);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

.splash-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 16px;
  min-height: 100vh;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  position: sticky;
  top: 0;
  background: var(--bg-primary);
  z-index: 100;
}

/* Header */
header {
  text-align: center;
  padding: 16px 0 20px;
}

header.hidden {
  display: none;
}

.logo {
  margin-bottom: 12px;
  color: var(--color-primary);
}

.logo svg {
  width: 48px;
  height: 48px;
}

header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--text-tertiary);
  font-size: 14px;
  font-weight: 400;
}

/* Home Button */
.home-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  transition: all var(--transition-normal);
}

.home-btn:hover {
  background: var(--color-primary-bg);
}

.home-btn:active {
  transform: scale(0.95);
}

/* Auth Section */
.auth-section {
  display: flex;
  align-items: center;
}

.auth-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.auth-btn:hover {
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-md);
}

.user-info {
  position: relative;
}

.profile-dropdown {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.profile-dropdown:hover {
  background: var(--bg-tertiary);
  border-color: var(--color-primary);
}

.user-photo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-arrow {
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}

.profile-dropdown:hover .dropdown-arrow {
  color: var(--color-primary);
}

/* Profile Menu */
.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all var(--transition-normal);
  z-index: 1000;
  overflow: hidden;
}

.profile-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.profile-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg-tertiary);
}

.menu-user-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.menu-user-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.menu-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-user-email {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu-divider {
  height: 1px;
  background: var(--divider);
}

.profile-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.profile-menu-item:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.profile-menu-item.logout {
  color: var(--color-error);
}

.profile-menu-item.logout:hover {
  background: var(--color-error-bg);
}

/* Search Section */
.search-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 4px;
  transition: all var(--transition-normal);
  flex: 1;
  box-shadow: var(--shadow-sm);
}

.search-box:hover {
  border-color: var(--text-disabled);
}

.search-box:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-bg);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}

.search-icon svg {
  width: 18px;
  height: 18px;
}

.search-box input {
  flex: 1;
  padding: 12px 12px 12px 40px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  cursor: pointer;
  outline: none;
  min-width: 0;
}

.search-box input::placeholder {
  color: var(--text-disabled);
}

.btn-search-inline {
  padding: 12px 18px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.btn-search-inline:hover:not(:disabled) {
  background: var(--color-primary-dark);
}

.btn-search-inline:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-search-inline:disabled {
  background: var(--text-disabled);
  cursor: not-allowed;
}

.btn-history-small {
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.btn-history-small:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
}

.btn-history-small svg {
  stroke: var(--text-tertiary);
  width: 18px;
  height: 18px;
}

.btn-history-small:hover svg {
  stroke: var(--color-primary);
}

/* Loading */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.loading span {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

/* Result Container */
.result-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-container:empty {
  display: none;
}

/* Building Count Header */
.building-count-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.count-icon {
  width: 36px;
  height: 36px;
  background: var(--color-primary-bg);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.count-icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-primary);
}

.building-count-header span {
  font-size: 14px;
  color: var(--text-secondary);
}

.building-count-header strong {
  color: var(--color-primary);
  font-weight: 700;
}

/* Building Selector */
.building-selector-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.scroll-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.scroll-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--color-primary);
}

.scroll-btn:active {
  transform: scale(0.95);
}

/* 모바일에서 스크롤 버튼 숨김 */
@media (max-width: 768px) {
  .scroll-btn {
    display: none;
  }
}

.building-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 10px 2px 6px;
  margin: -10px 0 0;
  flex: 1;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.building-selector::-webkit-scrollbar {
  display: none;
}

.building-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  min-width: 90px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.building-tab:hover {
  background: var(--bg-tertiary);
  border-color: var(--color-primary);
}

.building-tab.active {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
}

.tab-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.building-tab.active .tab-name {
  color: var(--color-primary);
}

.tab-area {
  font-size: 11px;
  color: var(--text-tertiary);
}

.building-tab.active .tab-area {
  color: var(--color-primary);
}

.tab-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

/* Summary Card */
.summary-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.summary-card:hover {
  box-shadow: var(--shadow-md);
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
}

.summary-building-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.summary-purpose {
  background: var(--color-primary);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

.summary-body {
  padding: 12px 16px;
}

/* Summary Grid Layout */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
}

.summary-grid-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-grid-item.full-width {
  grid-column: 1 / -1;
}

.summary-grid-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.summary-grid-value {
  font-size: 16px;
  color: var(--text-primary);
  font-weight: 700;
}

.summary-purpose-badge {
  background: var(--color-primary);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

/* Legacy list style (for backwards compatibility) */
.summary-body-list {
  padding: 12px 16px;
}

.summary-list-item {
  display: flex;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.5;
}

.summary-list-item .summary-label {
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  margin-right: 4px;
}

.summary-list-item .summary-value {
  color: var(--text-primary);
  font-weight: 400;
  word-break: break-word;
}

.summary-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.summary-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.summary-row.single {
  justify-content: flex-start;
}

.summary-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.summary-item.full {
  flex: none;
}

.summary-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.summary-value {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: center;
  gap: 8px;
}

.btn-detail-sm {
  flex: 1;
  padding: 10px 12px;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-normal);
}

.btn-detail-sm:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-detail-sm:active {
  transform: scale(0.98);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.modal-content {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 400px;
  max-height: 80vh;
  overflow: hidden;
  animation: modalSlideIn 0.25s ease;
  box-shadow: var(--shadow-xl);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--divider);
}

.modal-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: 16px;
  max-height: 60vh;
  overflow-y: auto;
}

/* Auth Modal */
.auth-modal-content {
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  width: 100%;
  max-width: 340px;
  text-align: center;
  position: relative;
  animation: modalSlideIn 0.25s ease;
  box-shadow: var(--shadow-xl);
}

.auth-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background: var(--bg-tertiary);
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.auth-modal-close:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.auth-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
}

.auth-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.auth-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.auth-modal-btn.login-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.auth-modal-btn.login-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--text-disabled);
}

.auth-modal-btn.signup-btn {
  background: var(--color-primary);
  border: none;
  color: #fff;
}

.auth-modal-btn.signup-btn:hover {
  background: var(--color-primary-dark);
}

.auth-modal-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  margin: 0;
  line-height: 1.5;
}

/* History Tabs */
.history-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.history-tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.history-tab-btn:hover {
  background: var(--bg-primary);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.history-tab-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.history-tab-btn svg {
  flex-shrink: 0;
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.history-item:hover {
  background: var(--color-primary-bg);
}

.history-favorite {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--text-disabled);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-favorite:hover {
  color: var(--color-warning);
}

.history-favorite.active {
  color: var(--color-warning);
}

.history-content {
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.history-address {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-date {
  font-size: 12px;
  color: var(--text-tertiary);
}

.history-delete {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--text-disabled);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-delete:hover {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.no-history,
.loading-small,
.error-small {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.error-small {
  color: var(--color-error);
}

.no-result {
  text-align: center;
  color: var(--text-tertiary);
  padding: 40px 20px;
  font-size: 14px;
}

.error-message {
  background: var(--color-error-bg);
  border: 1px solid var(--color-error);
  color: var(--color-error);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 14px;
}

/* Detail Modal */
.detail-modal-content {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
}

.detail-modal-content .modal-body {
  max-height: 80vh;
  padding: 16px;
}

.detail-section {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  overflow: hidden;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section-header {
  padding: 12px 14px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}

.detail-section-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

/* Detail Cards */
.detail-cards {
  padding: 10px;
}

.detail-card-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
}

.detail-card-item:last-child {
  margin-bottom: 0;
}

.detail-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.detail-card-grid {
  padding: 10px 12px;
}

.detail-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-card-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-card-label {
  font-size: 13px;
  color: var(--text-tertiary);
}

.detail-card-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
}

/* Floor List */
.detail-floor-list {
  padding: 8px;
  max-height: 200px;
  overflow-y: auto;
}

.detail-floor-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}

.detail-floor-item:last-child {
  margin-bottom: 0;
}

.floor-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 35px;
}

.floor-use {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floor-etc {
  font-size: 12px;
  color: var(--text-tertiary);
  max-width: 120px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.floor-area {
  font-size: 13px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* Law Section */
.law-section {
  border: 1px solid var(--color-success);
  background: var(--color-success-bg);
}

.law-header {
  background: var(--color-success-bg);
}

.law-header h4 {
  color: var(--color-success);
}

.law-content {
  padding: 12px;
}

.law-name-compact {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-success);
  margin-bottom: 4px;
}

.law-period-compact {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 10px;
}

.law-points-compact {
  list-style: none;
  padding: 0;
  margin: 0;
}

.law-points-compact li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0 4px 14px;
  position: relative;
}

.law-points-compact li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 5px;
  background: var(--color-success);
  border-radius: 50%;
}

/* 용도별 합계 */
.usage-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 16px;
}

.usage-chip {
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

/* 지상/지하 그룹 헤더 */
.floor-group-header {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  margin-top: 12px;
  background: var(--bg-secondary);
}

.floor-group-header:first-child {
  margin-top: 0;
}

/* 층별 정렬 바 */
.floor-sort-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 12px;
}

.floor-sort-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.floor-sort-buttons {
  display: flex;
  gap: 6px;
  flex: 1;
}

.floor-sort-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.floor-sort-btn:hover {
  background: var(--bg-primary);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.floor-sort-btn.active {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.floor-sort-btn svg {
  flex-shrink: 0;
}

/* 층별 섹션 확대 */
.floor-section-large .detail-floor-list {
  max-height: 400px;
  padding: 10px;
}

/* 주요 정보 요약 칩 */
.info-summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-bottom: 12px;
}

.info-chip {
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.info-chip.primary {
  background: var(--color-primary);
  color: #fff;
}

/* 상세 정보 리스트 */
.detail-info-list {
  padding: 8px 12px;
}

.detail-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.detail-info-item:last-child {
  border-bottom: none;
}

.detail-info-label {
  font-size: 13px;
  color: var(--text-tertiary);
}

.detail-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-info-value.highlight {
  color: var(--color-primary);
}

/* 동 선택 탭 */
.building-tabs-wrapper {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 12px;
}

.building-tabs-wrapper .scroll-btn {
  flex-shrink: 0;
}

.building-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.building-tabs::-webkit-scrollbar {
  display: none;
}

.building-tab-btn {
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.building-tab-btn:hover {
  background: var(--bg-primary);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.building-tab-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* 내 정보 모달 */
.my-info-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
}

.my-info-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--color-primary);
}

.my-info-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.my-info-details {
  width: 100%;
}

.my-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.my-info-row:last-child {
  border-bottom: none;
}

.my-info-label {
  font-size: 14px;
  color: var(--text-tertiary);
}

.my-info-value {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

/* 설정 모달 */
.settings-section {
  padding: 8px 0;
}

.settings-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.theme-options {
  display: flex;
  gap: 12px;
}

.theme-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.theme-option:hover {
  background: var(--bg-primary);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.theme-option.active {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.theme-option span {
  font-size: 13px;
  font-weight: 500;
}

/* Footer */
footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-disabled);
  font-size: 12px;
}

/* Responsive */
@media (max-width: 480px) {
  .container {
    padding: 0 12px 12px;
  }

  .top-bar {
    padding: 8px 0;
  }

  header {
    padding: 12px 0 16px;
  }

  header h1 {
    font-size: 20px;
  }

  .subtitle {
    font-size: 13px;
  }

  .search-box input {
    padding: 10px 10px 10px 36px;
    font-size: 14px;
  }

  .btn-search-inline {
    padding: 10px 14px;
    font-size: 13px;
  }

  .btn-history-small {
    width: 44px;
    height: 44px;
  }

  .summary-building-name {
    font-size: 15px;
  }

  .summary-value {
    font-size: 14px;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--text-disabled);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-tertiary);
}

/* ==================== 지도 모달 ==================== */
.map-modal-content {
  max-width: 500px;
  width: 100%;
}

.map-modal-body {
  padding: 0;
}

.map-container {
  width: 100%;
  height: 350px;
  background: var(--bg-tertiary);
  border-radius: 0;
}

.map-address {
  padding: 12px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-light);
}

.map-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  line-height: 1.6;
  padding: 20px;
}

/* ==================== 요약 카드 액션 버튼 ==================== */
.summary-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.action-btn:active {
  transform: scale(0.95);
}

/* ==================== 메모 스타일 ==================== */
.history-memo {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.memo-preview {
  font-size: 12px;
  color: var(--text-tertiary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}

.memo-placeholder {
  font-size: 12px;
  color: var(--text-disabled);
  font-style: italic;
}

.memo-btn {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--text-disabled);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.memo-btn:hover {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

/* 검색기록 지도 버튼 */
.history-map {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  color: var(--text-disabled);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.history-map:hover {
  background: var(--color-primary-bg);
  color: var(--color-primary);
}

/* ==================== 토스트 메시지 ==================== */
.toast-message {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 500;
  z-index: 2000;
  animation: toastSlideIn 0.3s ease;
}

.toast-message.fade-out {
  animation: toastFadeOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes toastFadeOut {
  from {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px);
  }
}

/* ==================== 소방시설 카드 ==================== */
.fire-facilities-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}

.fire-facilities-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, #f04452 0%, #ff6b6b 100%);
  color: #fff;
}

.classification-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.classification-class {
  font-size: 15px;
  font-weight: 700;
}

.classification-category {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: 10px;
}

.law-period-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 10px;
  border-radius: 12px;
}

.approval-date-warning {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff8e5 0%, #fff3cd 100%);
  border-left: 3px solid #ff9800;
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #856404;
}

.approval-date-warning svg {
  flex-shrink: 0;
  stroke: #ff9800;
  margin-top: 1px;
}

.approval-date-warning strong {
  color: #e65100;
  font-weight: 600;
}

.facilities-section {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}

.facilities-section:last-of-type {
  border-bottom: none;
}

.facilities-section.collapsed .optional-list {
  display: none;
}

.facilities-section.collapsed .toggle-icon {
  transform: rotate(0deg);
}

.facilities-section:not(.collapsed) .toggle-icon {
  transform: rotate(180deg);
}

.facilities-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

.facilities-title.required {
  color: var(--color-error);
}

.facilities-title.optional {
  color: var(--text-tertiary);
  cursor: pointer;
  margin-bottom: 0;
  padding: 8px 0;
}

.facilities-title.optional:hover {
  color: var(--text-secondary);
}

.facilities-count {
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: 10px;
  color: var(--text-secondary);
}

.facilities-title.required .facilities-count {
  background: var(--color-error-bg);
  color: var(--color-error);
}

.toggle-icon {
  margin-left: auto;
  transition: transform var(--transition-fast);
}

.facilities-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.optional-list {
  margin-top: 10px;
}

.facility-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
}

.facility-item.required {
  background: var(--color-error-bg);
  border: 1px solid rgba(240, 68, 82, 0.2);
}

.facility-item.optional {
  background: var(--bg-tertiary);
  opacity: 0.7;
}

.facility-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.facility-info {
  flex: 1;
  min-width: 0;
}

.facility-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.facility-item.required .facility-name {
  color: var(--color-error);
}

.facility-reason {
  display: block;
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.facility-status {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 12px;
  flex-shrink: 0;
}

.facility-status.required {
  background: var(--color-error);
  color: #fff;
}

.facility-status.optional {
  background: var(--bg-secondary);
  color: var(--text-disabled);
  border: 1px solid var(--border-color);
}

.facilities-note {
  padding: 10px 16px;
  font-size: 11px;
  color: var(--text-tertiary);
  background: var(--bg-tertiary);
  line-height: 1.5;
}

/* 법령 링크 */
.law-links {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
}

.law-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.law-link:hover {
  background: var(--color-primary-bg);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.law-link svg {
  flex-shrink: 0;
}

.law-date-info {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}

/* 법령 링크 wrap */
.law-links {
  flex-wrap: wrap;
}

/* ==================== 인앱 브라우저 안내 화면 ==================== */
.inapp-guide {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.inapp-guide-content {
  text-align: center;
  max-width: 320px;
}

.inapp-guide-icon {
  color: var(--color-primary);
  margin-bottom: 24px;
}

.inapp-guide-content h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.inapp-guide-content > p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 28px;
}

.inapp-platform-guide {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.inapp-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  text-align: left;
  font-size: 14px;
  color: var(--text-primary);
}

.inapp-step:first-child {
  border-bottom: 1px solid var(--border-light);
}

.step-icon {
  width: 32px;
  height: 32px;
  background: var(--color-primary-bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
}

.inapp-copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.inapp-copy-btn:hover {
  background: var(--color-primary-dark);
}

.inapp-copy-btn:active {
  transform: scale(0.98);
}

.inapp-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 12px;
}

/* 인앱 토스트 메시지 */
.inapp-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 500;
  z-index: 10001;
  animation: toastSlideIn 0.3s ease;
}

.inapp-toast.success {
  background: var(--color-success);
  color: #fff;
  border-color: var(--color-success);
}

/* ==================== 소방기준 보기 버튼 ==================== */
.fire-standards-btn-wrapper {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
}

.btn-fire-standards {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--color-primary-bg);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.btn-fire-standards:hover {
  background: var(--color-primary);
  color: #fff;
}

.btn-fire-standards:active {
  transform: scale(0.98);
}

/* ==================== 소방기준 모달 ==================== */
.fire-standards-modal-content {
  max-width: 500px;
  max-height: 90vh;
}

.fire-standards-modal-content .modal-body {
  max-height: 80vh;
  padding: 0;
}

.fire-standards-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.purpose-badge {
  background: linear-gradient(135deg, #f04452 0%, #ff6b6b 100%);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.permit-date-badge {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

/* 카테고리별 스타일 */
.standards-category {
  border-bottom: 1px solid var(--border-light);
}

.standards-category:last-of-type {
  border-bottom: none;
}

.standards-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--bg-secondary);
  border-left: 4px solid var(--category-color, var(--color-primary));
}

.category-icon {
  font-size: 18px;
}

.standards-category-header h3 {
  flex: 1;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.category-count {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* 시설 목록 */
.standards-facility-list {
  padding: 8px 16px 16px;
}

.standards-facility-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 8px;
}

.standards-facility-item:last-child {
  margin-bottom: 0;
}

.standards-facility-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.standards-facility-criteria {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.criteria-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.criteria-item::before {
  content: '•';
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.criteria-text {
  flex: 1;
}

.applicable-badge {
  font-size: 10px;
  padding: 2px 6px;
  background: var(--bg-secondary);
  border-radius: 4px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* 참고사항 */
.fire-standards-note {
  padding: 16px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-light);
}

.fire-standards-note p {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.6;
  margin: 0 0 4px;
}

.fire-standards-note p:last-child {
  margin-bottom: 0;
}

/* ==================== 클릭 가능한 시설 항목 ==================== */
.facility-item.clickable {
  cursor: pointer;
  transition: all var(--transition-fast);
}

.facility-item.clickable:hover {
  transform: translateX(4px);
  background: var(--color-primary-bg);
}

.facility-item.clickable.required:hover {
  background: rgba(240, 68, 82, 0.15);
}

.facility-arrow {
  color: var(--text-disabled);
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.facility-item.clickable:hover .facility-arrow {
  color: var(--color-primary);
  transform: translateX(2px);
}

/* ==================== 시설 상세 모달 ==================== */
.facility-detail-modal-content {
  max-width: 480px;
  max-height: 85vh;
}

.facility-detail-modal-content .modal-body {
  padding: 0;
  max-height: 75vh;
}

.facility-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-light);
}

.facility-detail-icon {
  font-size: 32px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.facility-detail-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.facility-detail-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.facility-detail-category {
  font-size: 12px;
  color: var(--text-tertiary);
}

.facility-detail-status {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.facility-detail-status.required {
  background: var(--color-error);
  color: #fff;
}

.facility-detail-status.optional {
  background: var(--bg-secondary);
  color: var(--text-disabled);
  border: 1px solid var(--border-color);
}

.facility-detail-section {
  padding: 16px;
}

.facility-detail-section h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.regulations-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.regulation-item {
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  padding: 12px;
  border-left: 4px solid var(--border-color);
}

.regulation-item.applicable {
  border-left-color: var(--color-error);
  background: var(--color-error-bg);
}

.regulation-item.not-applicable {
  opacity: 0.6;
}

.regulation-period {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.regulation-period svg {
  flex-shrink: 0;
}

.applicable-tag {
  background: var(--color-error);
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  margin-left: auto;
}

.regulation-criteria {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 6px;
}

.regulation-target {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.regulation-note {
  font-size: 11px;
  color: var(--text-tertiary);
  font-style: italic;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-light);
}

.facility-detail-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-tertiary);
}

.facility-detail-footer {
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-light);
  text-align: center;
}

.facility-detail-footer p {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
}
