:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 720px;
  margin: 10px auto;
  padding: 0 16px 28px;
}

.hero {
  margin-bottom: 14px;
}

.hero-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
}

.hero-top .hero-logo {
  flex: 1;
  display: flex;
  justify-content: center;
}

.hero-top .lang-switcher {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.lang-switcher {
  display: flex;
  gap: 4px;
}

.lang-switcher .lang-btn {
  padding: 0;
  font-size: 13px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.lang-switcher .lang-btn-flag {
  padding: 2px;
  line-height: 0;
  min-width: 0;
  min-height: 0;
  border-radius: 2px;
}

.lang-switcher .lang-btn-flag img {
  display: block;
  width: 28px;
  height: 20px;
  object-fit: cover;
  border-radius: 2px;
}

.lang-switcher .lang-btn[aria-pressed="true"] {
  background: transparent;
  color: inherit;
  border-color: transparent;
}

.lang-switcher .lang-btn-flag[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--accent);
}

.lang-switcher .lang-btn-flag[aria-pressed="false"] {
  opacity: 0.6;
}

.lang-switcher .lang-btn:hover {
  opacity: 0.9;
}

.badge {
  display: inline-block;
  background: #e0e7ff;
  color: #3730a3;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  margin: 0 0 10px;
}

h1 {
  margin: 0;
  font-size: 34px;
}

.hero-logo {
  line-height: 0;
}

.hero-logo img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 80px;
  width: auto;
  object-fit: contain;
}

.subtitle {
  margin-top: 8px;
  color: var(--muted);
  text-align: center;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-top: 12px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.check-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.check-inline input {
  width: 16px;
  height: 16px;
}

.text-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.text-link:hover {
  text-decoration: underline;
}

label {
  font-size: 14px;
  color: var(--muted);
}

select,
button {
  font-size: 15px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  padding: 10px 12px;
}

button {
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  background: var(--accent-dark);
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

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

.category-icon-btn {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: var(--text);
  padding: 8px 6px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
}

.category-icon-btn:hover {
  background: #eff6ff;
  color: #1e40af;
  border-color: #bfdbfe;
}

.category-icon-btn.is-active {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: #93c5fd;
}

.category-emoji {
  font-size: 20px;
  line-height: 1;
}

.category-label {
  font-size: 12px;
  font-weight: 700;
}

.status {
  color: #374151;
}

.location h2 {
  margin: 2px 0 8px;
}

.location p {
  margin: 6px 0;
}

.profile h2 {
  margin: 2px 0 8px;
}

.profile p {
  margin: 6px 0;
}

.swipe-guide {
  margin-top: 0;
  color: var(--muted);
  font-size: 14px;
}

.swipe-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  touch-action: pan-y;
  user-select: none;
  transition: transform 0.18s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.swipe-card.is-dragging {
  transition: none;
}

.swipe-badge {
  position: absolute;
  top: 12px;
  z-index: 2;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.swipe-badge-like {
  right: 12px;
  background: #dcfce7;
  color: #166534;
}

.swipe-badge-skip {
  left: 12px;
  background: #fee2e2;
  color: #991b1b;
}

/* Place card: photo */
.place-card-photo-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: linear-gradient(145deg, #e5e7eb 0%, #f3f4f6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.place-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.place-card-photo.loaded {
  display: block;
}

.place-card-photo-wrap:not(.has-photo) .place-card-photo {
  display: none;
}

.place-card-photo-wrap.has-photo .place-card-photo.loaded {
  display: block;
}

.place-card-body {
  padding: 16px;
}

.place-card-name {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.place-card-meta {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
}

.place-card-rating-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.place-card-stars {
  color: #f59e0b;
  font-size: 1.1rem;
  letter-spacing: 1px;
}

.place-card-rating-value {
  font-weight: 700;
  color: var(--text);
  font-size: 15px;
}

.place-card-review-count {
  font-size: 13px;
  color: var(--muted);
}

.place-card-open-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}

.place-card-open-badge.open-now {
  background: #dcfce7;
  color: #166534;
}

.place-card-open-badge.closed-now {
  background: #fee2e2;
  color: #991b1b;
}

.place-card-address {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--text);
  line-height: 1.45;
}

.place-card-hours {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.place-card-dining {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.place-card-dining-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #f3f4f6;
  color: var(--text);
}

.place-card-dining-tag.place-card-dining-price {
  background: #fef3c7;
  color: #92400e;
}

.place-insights-fallback {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.place-card-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.place-card-menu-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.place-card-menu-link:hover {
  text-decoration: underline;
}

.place-card-actions {
  display: flex;
  gap: 12px;
}

.place-card-actions a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.place-card-actions a:hover {
  text-decoration: underline;
}

.result h2 {
  margin-top: 2px;
  margin-bottom: 8px;
}

.result p {
  margin: 6px 0;
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.actions a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.actions a:hover {
  text-decoration: underline;
}

.result-actions {
  display: flex;
  gap: 14px;
  margin-top: 16px;
}

.result-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 5px 10px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.result-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.result-action-btn:active:not(:disabled) {
  transform: translateY(0);
}

.result-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-action-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
}

.result-action-skip {
  background: linear-gradient(145deg, #ef4444 0%, #dc2626 100%);
}

.result-action-skip:hover:not(:disabled) {
  background: linear-gradient(145deg, #f87171 0%, #ef4444 100%);
}

.result-action-like {
  background: linear-gradient(145deg, #16a34a 0%, #15803d 100%);
}

.result-action-like:hover:not(:disabled) {
  background: linear-gradient(145deg, #22c55e 0%, #16a34a 100%);
}

.hidden {
  display: none;
}

.footer {
  margin-top: 14px;
  color: var(--muted);
  text-align: right;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.footer .footer-link {
  color: var(--muted);
  text-decoration: none;
}

.footer .footer-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.favorites-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.favorites-toolbar p {
  margin: 0;
}

.favorites-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#clearFavoritesBtn {
  background: #ef4444;
}

#clearFavoritesBtn:hover {
  background: #dc2626;
}

#clearFavoritesBtn:disabled {
  background: #9ca3af;
}

.favorites-empty {
  color: var(--muted);
}

.favorites-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.favorite-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: #fcfdff;
}

.favorite-item-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.favorite-item-head h3 {
  margin: 0;
}

.favorite-item p {
  margin: 6px 0;
}

.favorite-remove-btn {
  background: #ef4444;
  font-size: 13px;
  padding: 7px 10px;
}

.favorite-remove-btn:hover {
  background: #dc2626;
}
