:root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Malgun Gothic', sans-serif;
  color: #191f28;
  background: #fff;
  font-size: 15px;
  line-height: 1.5;
  /* K Beauty Map brand colors, shared with lib/design/tds.dart. */
  --accent: #d72f79;
  --accent-hover: #bd2367;
  --accent-text: #bd2367;
  --accent-soft: #fff0f6;
  --accent-soft-hover: #ffe2ee;
  --accent-border: #f7d5e4;
  /* Keep these layout values aligned with lib/design/tds.dart. */
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-24: 24px;
  --page-gutter: 24px;
  --page-width: 688px;
  --button-height: 56px;
  --icon-button-size: 48px;
  --chip-height: 44px;
  --control-radius: 16px;
  --card-radius: 24px;
}

* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
a:focus-visible,
button:focus-visible,
input:focus-visible,
.photos:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

header, main, footer {
  max-width: var(--page-width);
  margin: auto;
  padding: var(--space-24) var(--page-gutter);
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding-top: var(--space-16);
  padding-bottom: var(--space-16);
}
main { padding-top: var(--space-8); }
main > :first-child { margin-top: 0; }
h1 { font-size: 26px; line-height: 1.35; margin: var(--space-24) 0; }
h2 { font-size: 17px; margin: 0; }
p { margin: var(--space-8) 0; color: #4e5968; }
.brand { font-size: 22px; font-weight: 700; }
.brand-group { display: flex; align-items: center; gap: var(--space-8); }

.action, .secondary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-8);
  min-height: var(--button-height);
  padding: var(--space-16) var(--space-24);
  border-radius: var(--control-radius);
  font-weight: 600;
}
.action { background: var(--accent); color: white; }
.action:hover { background: var(--accent-hover); }
.secondary { background: var(--accent-soft); color: var(--accent-text); }
.secondary:hover { background: var(--accent-soft-hover); }
.icon { display: block; width: 28px; height: 28px; object-fit: contain; flex-shrink: 0; }
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-button-size);
  height: var(--icon-button-size);
  min-height: var(--icon-button-size);
  padding: 0;
  border-radius: var(--control-radius);
  flex-shrink: 0;
}
.icon-button .icon { width: 28px; height: 28px; }
.text-action {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  min-height: var(--icon-button-size);
}
.text-action .icon { width: 24px; height: 24px; }

.categories {
  display: flex;
  gap: var(--space-8);
  overflow-x: auto;
  padding: var(--space-4) 0 var(--space-24);
}
.categories a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  white-space: nowrap;
  border: 1px solid #e5e8eb;
  border-radius: 22px;
  min-height: var(--chip-height);
  padding: var(--space-4) var(--space-16);
}
.categories .icon { width: 32px; height: 32px; }
.categories [aria-current] { color: var(--accent-text); background: var(--accent-soft); border-color: var(--accent-border); }
.search { position: relative; display: block; }
.search > .icon {
  position: absolute;
  left: var(--space-16);
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
.search input {
  border: 0;
  border-radius: var(--control-radius);
  background: #f2f4f6;
  min-height: var(--button-height);
  padding: var(--space-16) var(--space-16) var(--space-16) 56px;
  width: 100%;
}
.stores { list-style: none; padding: 0; margin: 0; }
.card {
  display: flex;
  gap: var(--space-16);
  padding: var(--space-24) 0;
  border-bottom: 1px solid #f2f4f6;
}
.card > img, .empty-photo {
  width: 88px;
  height: 96px;
  border-radius: var(--control-radius);
  object-fit: cover;
  flex-shrink: 0;
  background: #f2f4f6;
}
.card div { min-width: 0; }
.card p { font-size: 13px; }
.card strong, .price strong { color: var(--accent-text); }
.empty-photo { display: flex; align-items: center; justify-content: center; color: #8b95a1; }
.empty-photo .icon { width: 40px; height: 40px; }
.muted { font-size: 13px; color: #6b7684; }

.gallery { position: relative; }
.photos {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border-radius: var(--card-radius);
  scrollbar-width: thin;
}
.photos img {
  flex: 0 0 100%;
  width: 100%;
  height: auto;
  aspect-ratio: 1.45;
  object-fit: cover;
  scroll-snap-align: start;
}
.gallery-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-16);
  margin-top: var(--space-16);
}
.gallery-controls button { border: 0; background: #f2f4f6; cursor: pointer; }
.gallery-controls span { font-size: 13px; }
h1:has(+ .store-tags) { margin-bottom: var(--space-8); }
.store-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-12);
  margin: 0 0 var(--space-24);
}
.store-tags span { color: var(--accent-text); font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.price {
  padding: var(--space-24);
  background: #f9fafb;
  border-radius: var(--card-radius);
  margin: var(--space-24) 0;
}
.price > :first-child { margin-top: 0; }
.price > :last-child { margin-bottom: 0; }
.price strong { font-size: 22px; }
dl {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-16) var(--space-12);
  margin: var(--space-24) 0;
}
dt { display: flex; align-items: center; color: #6b7684; }
dd { margin: 0; overflow-wrap: anywhere; }
dd a { color: var(--accent-text); }
.store-map {
  border: 0;
  width: 100%;
  height: 260px;
  border-radius: var(--card-radius);
  display: block;
  background: #f2f4f6;
}
.actions { display: flex; gap: var(--space-12); margin-top: var(--space-24); }
.actions a { flex: 1; }

footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-8) var(--space-24);
  font-size: 12px;
  color: #6b7684;
  margin-top: 0;
  padding-top: 0;
}
footer .attribution { margin-left: auto; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] { display: none !important; }
@media (min-width: 900px) {
  body:has(.stores) { --page-width: 1000px; }
  .stores { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 var(--space-24); }
}
@media (max-width: 400px) {
  footer .attribution { flex-basis: 100%; margin-left: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .photos { scroll-behavior: smooth; }
}
