:root {
  color-scheme: light;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #f1f5f9;
  --text: #202124;
  --muted: #5f6368;
  --line: #dfe3ea;
  --blue: #1a73e8;
  --blue-strong: #1558b0;
  --green: #188038;
  --yellow: #f9ab00;
  --red: #d93025;
  --shadow: 0 12px 28px rgba(60, 64, 67, 0.12);
  --radius: 8px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101418;
  --surface: #171c21;
  --surface-soft: #20262d;
  --text: #e8eaed;
  --muted: #a8afb8;
  --line: #303841;
  --blue: #8ab4f8;
  --blue-strong: #aecbfa;
  --shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
  min-width: 0;
}

[hidden] {
  display: none !important;
}

html, body {
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--text);
  font-family: "Google Sans", Inter, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
  word-break: break-word;
  overflow-wrap: anywhere;
}

button,
a,
input,
select,
textarea,
.chip,
.suggestion-row,
.avatar-button,
.username-link {
  touch-action: manipulation;
}

button,
.chip,
.suggestion-row,
.avatar-button,
.username-link,
.bottom-nav-button,
.discovery-view-card {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

button:active:not(:disabled),
.chip:active,
.suggestion-row:active,
.avatar-button:active,
.username-link:active {
  transform: scale(0.97);
  filter: brightness(0.94);
  transition: transform 0.04s ease-out, filter 0.04s ease-out;
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body:has(dialog[open]) {
  padding-bottom: 0;
}

img {
  max-width: 100%;
  height: auto;
}

html.capacitor-app body {
  padding-top: env(safe-area-inset-top);
  padding-bottom: calc(78px + env(safe-area-inset-bottom));
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

html.capacitor-app .toast {
  bottom: calc(96px + env(safe-area-inset-bottom));
}

input,
textarea,
select {
  font-size: 16px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 44px;
  max-width: 100%;
  overflow-x: clip;
}

main {
  min-width: 0;
  max-width: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  min-height: 44px;
}

.brand,
.topbar-actions,
.place-actions,
.location-card,
.feed-header,
.dialog-header,
.dialog-actions {
  display: flex;
  align-items: center;
}

.topbar-actions,
.place-actions,
.dialog-actions {
  flex-wrap: wrap;
}

.brand {
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.topbar-actions {
  gap: 10px;
}

.topbar-actions #openSaved,
.topbar-actions #openFollowing,
.topbar-actions #openMyPlaces {
  display: none !important;
}

.icon-button,
.primary-button,
.text-button,
.action-button,
.ghost-button,
.danger-button {
  border: 0;
  border-radius: 999px;
  min-height: 40px;
}

.icon-button {
  display: grid;
  width: 40px;
  place-items: center;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 10px rgba(26, 115, 232, 0.22);
}

.primary-button:hover {
  background: var(--blue-strong);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: min(420px, calc(100% - 28px));
  min-height: 58px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

body:has(dialog[open]) .bottom-nav {
  display: none;
}

/* When a dialog is open, lock the body so scroll inside the dialog content
   doesn't chain through to the underlying page (Android WebView). JS pins
   the body to its current scroll position via top:-<scrollY>px so the page
   doesn't appear to jump to the top while the dialog is open. */
body.body-dialog-lock {
  overflow: hidden !important;
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overscroll-behavior: none;
}

html.body-dialog-lock {
  overflow: hidden !important;
  overscroll-behavior: contain;
}

html.keyboard-open .bottom-nav {
  display: none;
}

.scroll-top-button {
  position: fixed;
  right: 16px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 35;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--surface) 88%, transparent), color-mix(in srgb, var(--surface) 95%, transparent));
  color: var(--text);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(14px);
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px) scale(0.92);
  pointer-events: none;
  transition: opacity 220ms ease-out, transform 220ms ease-out;
}

.scroll-top-button[hidden] {
  display: none !important;
}

.scroll-top-button.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scroll-top-button svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2.4;
  fill: none;
}

.scroll-top-button:active:not(:disabled) {
  transform: translateY(0) scale(0.94);
}

[data-theme="light"] .scroll-top-button {
  background: linear-gradient(135deg, #ffffff, color-mix(in srgb, #ffffff 90%, var(--blue)));
  box-shadow: 0 10px 24px rgba(26, 115, 232, 0.22);
}

/* Inside an open dialog, anchor the scroll-top button to the dialog's
   bottom-right corner so it floats above the dialog scroller instead of
   the (hidden) bottom nav. */
body:has(dialog[open]) .scroll-top-button {
  bottom: calc(20px + env(safe-area-inset-bottom));
}

html.keyboard-open .scroll-top-button {
  display: none;
}

.bottom-nav-button {
  display: grid;
  min-height: 46px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
}

.bottom-nav-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bottom-nav-button.active {
  background: #e8f0fe;
  color: #1967d2;
}

[data-theme="dark"] .bottom-nav-button.active {
  background: #20344d;
  color: var(--blue);
}

.text-button {
  padding: 0 16px;
  background: transparent;
  color: var(--blue);
  font-weight: 600;
}

.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.danger-button {
  border-color: #f4c7c3;
  color: var(--red);
}

.badge {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #e8f0fe;
  color: #1967d2;
  font-size: 0.78rem;
  font-weight: 700;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(320px, 1fr);
  gap: 28px;
  align-items: end;
  padding: 44px 0 28px;
}

.hero-copy h1 {
  max-width: 650px;
  margin: 8px 0 12px;
  font-size: clamp(2.1rem, 5vw, 4.7rem);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero-text {
  max-width: 560px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.eyebrow,
.muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.search-panel,
.side-panel,
.place-card,
.submit-dialog,
.admin-panel,
.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 16px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.search-box input,
.comment-form input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.filter-grid,
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.filter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-grid.single {
  grid-template-columns: 1fr;
}

.venue-name-field {
  display: grid;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  outline-color: var(--blue);
}

textarea {
  min-height: 104px;
  padding-top: 12px;
  resize: vertical;
}

.content-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.side-panel {
  position: sticky;
  top: 18px;
  padding: 16px;
}

.location-card {
  gap: 12px;
}

.location-card h2,
.feed-header h2,
.dialog-header h2 {
  margin: 4px 0 0;
  font-size: 1.25rem;
}

.pin {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  background: #e8f0fe;
  color: #1967d2;
}

[data-theme="dark"] .pin {
  background: #20344d;
  color: var(--blue);
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.stats-grid div {
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.stats-grid strong,
.stats-grid span {
  display: block;
}

.stats-grid strong {
  font-size: 1.45rem;
}

.stats-grid span {
  color: var(--muted);
  font-size: 0.82rem;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.view-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 8px 12px;
  font-weight: 600;
}

.chip.active {
  border-color: transparent;
  background: #e8f0fe;
  color: #1967d2;
}

[data-theme="dark"] .chip.active {
  background: #20344d;
  color: var(--blue);
}

.feed-area {
  min-width: 0;
}

.feed-header {
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 14px;
  overflow: visible;
}

.feed-header > div {
  min-width: 0;
  flex: 1 1 200px;
}

.feed-header select:not(.native-sort-hidden) {
  width: auto;
  min-width: 180px;
  max-width: 100%;
}

.sort-shell {
  position: relative;
  z-index: 5;
  width: min(100%, 210px);
}

.sort-control {
  display: inline-grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--line) 74%, var(--blue));
  border-radius: 999px;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  color: var(--text);
  box-shadow: 0 8px 22px rgba(60, 64, 67, 0.1);
  text-align: left;
}

.sort-control:focus-visible,
.sort-shell.open .sort-control {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 18%, transparent), 0 8px 22px rgba(60, 64, 67, 0.1);
}

.sort-control span {
  margin: 0;
}

.sort-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #e8f0fe;
  color: #1967d2;
  font-size: 1rem;
  font-weight: 700;
}

[data-theme="dark"] .sort-icon {
  background: #20344d;
  color: var(--blue);
}

.sort-copy {
  display: grid;
  gap: 0;
}

.sort-copy > span {
  margin: 0;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 700;
  line-height: 1;
}

.sort-copy strong {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sort-arrow {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1;
  justify-self: center;
  transition: transform 0.16s ease;
}

.sort-shell.open .sort-arrow {
  transform: rotate(180deg);
}

.sort-menu {
  position: absolute;
  top: calc(100% + 2px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-soft));
  box-shadow: 0 18px 42px rgba(60, 64, 67, 0.2);
  z-index: 20;
}

.sort-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  text-align: left;
}

.sort-menu button::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}

.sort-menu button[aria-checked="true"] {
  background: #e8f0fe;
  color: #1967d2;
}

.sort-menu button[aria-checked="true"]::after {
  background: currentColor;
}

[data-theme="dark"] .sort-menu button[aria-checked="true"] {
  background: #20344d;
  color: var(--blue);
}

.native-sort-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.place-card {
  overflow: hidden;
}

.place-image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--surface-soft);
}

.place-body {
  padding: 14px;
}

.place-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.8rem;
}

.place-location {
  min-width: 0;
  overflow-wrap: anywhere;
}

.category-pill {
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--surface-soft);
  color: var(--blue);
  font-weight: 700;
}

.place-card h3 {
  margin: 12px 0 8px;
  font-size: 1.2rem;
}

.recommendation-list {
  display: grid;
  gap: 12px;
}

.recommendation-item {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.recommendation-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.venue-more-button {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
}

.venue-more-button.open {
  border-color: transparent;
  background: #e8f0fe;
  color: #1967d2;
}

[data-theme="dark"] .venue-more-button.open {
  background: #20344d;
  color: var(--blue);
}

.venue-more-list {
  display: grid;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.recommendation-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.recommendation-author .avatar-button {
  width: 28px;
  height: 28px;
}

.recommendation-author .username-link {
  font-size: 0.86rem;
}

.recommendation-photo {
  display: block;
  width: 100%;
  padding: 0;
  margin: 8px 0 10px;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-soft);
}

.recommendation-photo img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.recommendation-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-bottom: 7px;
}

.recommendation-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.recommendation-title strong {
  font-size: 1rem;
}

.recommendation-title span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.tip {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.place-actions {
  gap: 8px;
  margin-top: 14px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--surface-soft);
  color: var(--text);
}

.like-button.liked {
  background: #fce8e6;
  color: var(--red);
}

[data-theme="dark"] .like-button.liked {
  background: #3d201f;
}

.save-place.liked {
  background: #fef7e0;
  color: #b06000;
}

.save-place.liked span {
  color: #f9ab00;
}

[data-theme="dark"] .save-place.liked {
  background: #3a2a08;
  color: #fdd663;
}

.comments {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.comment {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.comment-author,
.comment-delete {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
}

.comment-author {
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.comment-author:disabled {
  color: var(--muted);
  cursor: default;
}

.comment-delete {
  flex: 0 0 auto;
  color: var(--red);
  font-weight: 800;
  cursor: pointer;
}

.comment-form {
  display: flex;
  gap: 8px;
  min-height: 42px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.comment-form button {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 700;
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 28px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty-state.compact {
  min-height: 220px;
}

.empty-state span {
  font-size: 2.4rem;
  color: var(--muted);
}

.empty-state h3 {
  margin: 10px 0 4px;
}

.empty-state p {
  max-width: 380px;
  margin: 0 0 18px;
  color: var(--muted);
}

.submit-dialog {
  width: min(620px, calc(100% - 28px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  color: var(--text);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.submit-dialog.onboarding-dialog {
  width: min(500px, calc(100% - 28px));
  height: auto;
  max-width: calc(100% - 28px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  border-radius: 14px;
  overflow: hidden;
}

.onboarding-card {
  padding: 0;
}

.onboarding-hero {
  position: relative;
  padding: 24px 24px 18px;
  background:
    linear-gradient(135deg, rgba(26, 115, 232, 0.12), rgba(24, 128, 56, 0.08)),
    var(--surface);
  border-bottom: 1px solid var(--line);
}

.onboarding-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.onboarding-mark {
  display: block;
  width: 58px;
  height: 58px;
  margin-bottom: 14px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.onboarding-hero h2 {
  margin: 4px 44px 0 0;
  font-size: 1.9rem;
  line-height: 1.12;
  letter-spacing: 0;
}

.onboarding-copy {
  margin: 10px 0 0;
  max-width: 390px;
  color: var(--muted);
  line-height: 1.55;
}

.onboarding-points {
  display: grid;
  gap: 10px;
  padding: 16px 18px 0;
}

.onboarding-points div {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.onboarding-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--blue);
  font-weight: 700;
}

.onboarding-points p,
.onboarding-points strong,
.onboarding-points p span {
  display: block;
}

.onboarding-points p {
  margin: 0;
}

.onboarding-points strong {
  margin-bottom: 3px;
}

.onboarding-points p span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.onboarding-dialog .dialog-actions {
  padding: 16px 18px 18px;
  margin: 0;
}

.onboarding-dialog .primary-button {
  width: 100%;
}

.file-field input {
  padding: 10px 12px;
}

.file-field small,
.notice,
.photo-status {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.file-field small {
  display: block;
  margin-top: 6px;
}

.notice {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.venue-suggestions {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.venue-suggestions strong {
  font-size: 0.9rem;
}

.suggestion-row {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: auto;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.suggestion-row span {
  font-weight: 700;
}

.suggestion-row small {
  color: var(--muted);
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  min-height: 44px;
  padding: 8px 0;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}

.check-row input[type="checkbox"] {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  margin: 0;
  accent-color: var(--blue);
  cursor: pointer;
}

.check-row span {
  margin: 0;
  padding-top: 1px;
}

.auth-terms {
  align-items: flex-start;
  line-height: 1.45;
}

.auth-terms a,
.policy-note a {
  color: var(--blue);
  font-weight: 700;
}

.policy-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.submit-dialog::backdrop {
  background: rgba(32, 33, 36, 0.54);
}

.photo-dialog {
  width: min(920px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}

.photo-dialog::backdrop {
  background: rgba(0, 0, 0, 0.78);
}

.photo-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100dvh - 24px);
  object-fit: contain;
}

.photo-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.28);
}

.submit-dialog form {
  padding: 18px;
}

.dialog-header {
  justify-content: space-between;
  gap: 16px;
}

.wide {
  grid-column: 1 / -1;
}

.dialog-actions {
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.admin-panel {
  margin-top: 24px;
  padding: 16px;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-header h2 {
  margin: 4px 0 0;
}

.admin-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-list[data-admin-view="users"] {
  grid-template-columns: 1fr;
}

.admin-card {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  overflow: hidden;
  box-shadow: none;
}

.admin-image {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  background: var(--surface-soft);
}

.admin-body {
  padding: 14px;
}

.admin-body h3 {
  margin: 12px 0 8px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

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

.account-tabs {
  margin-bottom: 14px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.user-results {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.user-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.user-result-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.user-result-row:hover {
  background: var(--surface-soft);
}

.user-result-row strong {
  display: block;
  font-size: 0.95rem;
}

.user-result-row small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.user-name {
  display: block;
  margin-bottom: 4px;
}

.user-meta {
  line-height: 1.45;
}

.user-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 12px;
  align-items: end;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.admin-edit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.admin-edit-grid textarea {
  min-height: 82px;
}

.form-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--red);
  font-weight: 600;
}

.google-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
}

.google-button span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #1a73e8;
  border: 1px solid var(--line);
  font-weight: 700;
}

.place-author {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.avatar-button {
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 50%;
  line-height: 0;
  min-height: auto;
}

.avatar-small,
.avatar-large {
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  background: var(--surface-soft);
  overflow: hidden;
}

.avatar-large {
  width: 96px;
  height: 96px;
  font-size: 36px;
  flex: 0 0 auto;
}

.username-link {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--blue);
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  min-height: auto;
}

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

.follow-button.following {
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: none;
}

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

.list-dialog .admin-tabs {
  margin-bottom: 10px;
}

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

.saved-filter-panel {
  display: grid;
  gap: 12px;
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.saved-filter-panel .search-box,
.saved-filter-panel select {
  background: var(--surface);
}

.saved-filter-panel .filter-grid {
  margin-top: 0;
}

.following-list.people-list,
.people-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.following-name-row,
.people-row {
  display: grid;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.following-name-row {
  grid-template-columns: 36px minmax(0, 1fr);
  color: var(--blue);
  font-weight: 700;
  text-align: left;
}

.following-name-row > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.people-row {
  grid-template-columns: 40px minmax(0, 1fr) auto;
}

.people-row > div {
  min-width: 0;
}

.people-row small {
  display: block;
  margin-top: 3px;
}

.people-row .username-link {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-button {
  position: relative;
}

.notification-button .badge {
  min-width: 20px;
  height: 20px;
  font-size: 0.72rem;
}

.compact-actions {
  justify-content: flex-start;
  margin: 0 0 12px;
}

.notification-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
}

.notification-row.unread {
  border-color: rgba(26, 115, 232, 0.5);
  background: rgba(26, 115, 232, 0.08);
}

.notification-row span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.notification-row .notification-meta {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
}

.recommendation-author .recommendation-time {
  margin-left: auto;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.85;
}

.clickable-stat {
  cursor: pointer;
}

.clickable-stat:hover {
  outline: 1px solid var(--blue);
}

.following-place-card .tip {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.place-detail-dialog {
  width: min(760px, calc(100% - 28px));
}

.detail-image {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-soft);
  margin: 8px 0 14px;
}

.detail-author {
  margin: 4px 0 10px;
}

.detail-tip {
  margin: 12px 0;
  font-size: 1rem;
}

.detail-actions {
  margin: 12px 0 16px;
}

.detail-comments {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.detail-comment-form {
  align-items: center;
  margin-top: 8px;
}

.detail-comment-form input {
  height: 40px;
  min-height: 0;
  padding: 0;
}

.danger-copy {
  margin: 0 0 14px;
  color: var(--red);
  font-weight: 700;
  line-height: 1.45;
}

.policy-back-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  width: 100%;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
}

.policy-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-soft) 92%, transparent);
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.policy-back-link:hover,
.policy-back-link:focus-visible {
  background: color-mix(in srgb, var(--blue) 14%, var(--surface-soft));
  outline: none;
}

.policy-back-link span[aria-hidden="true"] {
  font-size: 1.1rem;
  line-height: 1;
}

.policy-page {
  width: min(820px, calc(100% - 32px));
  margin: 18px auto 72px;
  line-height: 1.65;
}

.policy-page h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 5vw, 3rem);
}

.policy-page h2 {
  margin: 28px 0 8px;
  font-size: 1.2rem;
}

.policy-page p {
  color: var(--muted);
}

.policy-page a {
  color: var(--blue);
  font-weight: 700;
}

.policy-form {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.policy-form textarea {
  min-height: 120px;
}

.policy-status {
  margin: 0;
  color: var(--blue);
  font-weight: 700;
}

.top10-panel {
  width: min(760px, calc(100% - 28px));
  margin: auto;
  padding: 0;
}

.top10-scope {
  margin: 10px 0 14px;
}

.top10-list {
  display: grid;
  gap: 10px;
}

.top10-row {
  display: grid;
  grid-template-columns: 44px 56px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.top10-row.place-row-card {
  grid-template-columns: 44px 80px minmax(0, 1fr) auto;
}

.top10-rank {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--blue);
}

.top10-row.top-rank-1,
.top10-row.top-rank-2,
.top10-row.top-rank-3 {
  border-left-width: 3px;
}

.top10-row.top-rank-1 {
  border-left-color: #a855f7;
  background: color-mix(in srgb, #a855f7 8%, var(--surface));
}
.top10-row.top-rank-1 .top10-rank {
  color: #a855f7;
}

.top10-row.top-rank-2 {
  border-left-color: #f59e0b;
  background: color-mix(in srgb, #f59e0b 8%, var(--surface));
}
.top10-row.top-rank-2 .top10-rank {
  color: #f59e0b;
}

.top10-row.top-rank-3 {
  border-left-color: #94a3b8;
  background: color-mix(in srgb, #94a3b8 8%, var(--surface));
}
.top10-row.top-rank-3 .top10-rank {
  color: #64748b;
}

.top10-info {
  min-width: 0;
  overflow: hidden;
}

.top10-info strong,
.top10-info .username-link {
  display: block;
  font-size: 1rem;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.top10-meta {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.top10-place-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.top10-stats {
  text-align: right;
  min-width: 64px;
}

.top10-stats strong {
  display: block;
  font-size: 1.3rem;
}

.top10-stats span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.top10-image {
  width: 80px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.profile-dialog {
  width: min(720px, calc(100% - 28px));
  padding: 0;
  overflow: hidden;
}

.profile-content {
  padding: 18px;
  max-height: min(90vh, 720px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.place-detail-dialog .profile-content,
.profile-dialog .profile-content {
  overscroll-behavior: contain;
}

.profile-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px;
  margin: 14px 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(26, 115, 232, 0.10), rgba(24, 128, 56, 0.06)),
    var(--surface);
}

.profile-meta p {
  margin: 0;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.profile-stats div {
  padding: 10px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: center;
}

.profile-stats strong {
  display: block;
  font-size: 1.3rem;
}

.profile-stats span {
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-section-title {
  margin: 18px 0 10px;
  font-size: 1rem;
}

.profile-edit-button {
  width: max-content;
}

.profile-edit-dialog .profile-edit {
  margin: 0;
  border: 0;
  box-shadow: none;
}

.profile-place-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-place-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.profile-place-image {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.profile-place-body {
  min-width: 0;
}

.profile-place-name {
  display: block;
  margin: 6px 0 4px;
}

.profile-place-meta {
  margin: 0 0 6px;
}

.profile-place-likes {
  margin-top: 6px;
  font-size: 0.82rem;
}

.profile-edit {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.profile-edit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.avatar-preview {
  width: 96px;
  height: 96px;
}

.profile-edit-fields {
  display: grid;
  gap: 12px;
}

.profile-edit-fields small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.profile-edit-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .top10-row,
  .top10-row.place-row-card {
    grid-template-columns: 44px 56px minmax(0, 1fr);
  }
  .top10-row .top10-stats,
  .top10-row .top10-follow {
    grid-column: 1 / -1;
    text-align: left;
  }
  .profile-place-list,
  .profile-summary,
  .profile-edit-row {
    grid-template-columns: 1fr;
  }
  .profile-place-card {
    grid-template-columns: 80px minmax(0, 1fr);
  }
  .profile-place-image {
    width: 80px;
    height: 80px;
  }
  .people-row {
    grid-template-columns: 40px minmax(0, 1fr);
  }
  .people-row .ghost-button {
    grid-column: 1 / -1;
    justify-self: stretch;
  }
}

.toast {
  position: fixed;
  right: 18px;
  bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 20;
  max-width: min(360px, calc(100% - 36px));
  padding: 13px 16px;
  border-radius: var(--radius);
  background: #202124;
  color: #fff;
  box-shadow: var(--shadow);
  font-weight: 600;
}

@media (max-width: 900px) {
  .hero-band,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: 100%;
    padding: 12px 12px 32px;
  }

  .topbar {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 0;
  }

  .topbar-actions > * {
    flex: 0 1 auto;
  }

  .topbar-actions .ghost-button {
    padding: 0 10px;
    font-size: 0.82rem;
    min-height: 36px;
    line-height: 1;
  }

  .topbar-actions .icon-button {
    min-height: 36px;
    width: 36px;
    height: 36px;
  }

  .topbar-actions .primary-button {
    order: 99;
    flex: 1 0 100%;
    padding: 0 14px;
    font-size: 0.92rem;
    min-height: 40px;
  }

  .topbar-actions .primary-button span {
    font-size: 1.05rem;
  }

  .hero-band {
    padding-top: 18px;
    padding-bottom: 14px;
    gap: 18px;
  }

  .hero-copy h1 {
    font-size: clamp(1.6rem, 7vw, 2.2rem);
  }

  .hero-text {
    font-size: 0.96rem;
  }

  .search-panel {
    padding: 12px;
  }

  .filter-grid,
  .form-grid,
  .cards,
  .admin-list,
  .admin-card,
  .admin-login,
  .admin-edit-grid {
    grid-template-columns: 1fr;
  }

  .admin-image {
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    max-height: 220px;
  }

  .admin-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-row {
    grid-template-columns: 1fr;
  }

  .user-stats {
    justify-content: flex-start;
  }

  .feed-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
  }

  .feed-header > div {
    flex: 0 1 auto;
    width: 100%;
  }

  .feed-header select:not(.native-sort-hidden) {
    width: 100%;
  }

  .sort-shell {
    width: 100%;
  }

  .sort-menu {
    left: 0;
    right: auto;
    width: 100%;
  }

  .place-actions {
    gap: 6px;
  }

  .place-actions .action-button {
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .place-actions .save-place strong,
  .place-actions .report-place {
    display: none;
  }

  .place-card h3,
  .feed-header h2,
  .location-card h2 {
    font-size: 1.1rem;
    word-break: break-word;
  }

  .recommendation-title {
    flex-wrap: wrap;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .category-list {
    gap: 6px;
  }

  .chip {
    padding: 7px 10px;
    font-size: 0.86rem;
  }

  .admin-panel {
    padding: 12px;
  }

  .submit-dialog,
  .profile-dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .submit-dialog.onboarding-dialog {
    width: min(500px, calc(100% - 28px));
    max-width: calc(100% - 28px);
    height: auto;
    max-height: calc(100dvh - 32px);
    margin: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
  }

  .submit-dialog:not(.onboarding-dialog) > form,
  .profile-content {
    padding: 14px;
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .submit-dialog:not(.onboarding-dialog) > form {
    min-height: 100%;
    max-height: none;
  }

  .profile-content {
    height: 100%;
    min-height: 0;
    max-height: 100%;
    overflow-y: auto;
  }

  .submit-dialog .onboarding-card {
    padding: 0;
  }

  .dialog-header {
    position: sticky;
    top: 0;
    background: var(--surface);
    padding-top: 4px;
    padding-bottom: 8px;
    z-index: 2;
    margin-bottom: 4px;
  }

  .profile-dialog .dialog-header {
    position: static;
    background: transparent;
    z-index: auto;
  }

  .dialog-actions {
    justify-content: stretch;
  }

  .dialog-actions .primary-button,
  .dialog-actions .text-button {
    flex: 1 1 auto;
  }

  .profile-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .top10-stats {
    text-align: left;
    min-width: 0;
  }
}

@media (max-width: 380px) {
  .topbar-actions {
    gap: 5px;
  }
  .topbar-actions .ghost-button {
    padding: 0 8px;
    font-size: 0.76rem;
    min-height: 34px;
  }
  .topbar-actions .icon-button {
    min-height: 34px;
    width: 34px;
    height: 34px;
  }
  .chip {
    font-size: 0.8rem;
    padding: 6px 8px;
  }
}

/* MVP discovery home redesign */
.discovery-topbar {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 70px;
  padding: 8px 0 4px;
}

.home-status-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.home-location {
  display: grid;
  gap: 2px;
  justify-self: start;
  min-width: 0;
}

.home-location span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.home-location strong {
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1.15;
}

.home-brand {
  justify-self: center;
  gap: 8px;
  font-size: 1.18rem;
  letter-spacing: 0;
}

.home-brand .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: var(--radius);
}

.home-icon-actions {
  justify-self: end;
  min-width: 88px;
}

.discovery-topbar .account-actions {
  padding-right: 92px;
}

.discovery-topbar .account-actions #openTop10,
.discovery-topbar .account-actions #openSubmit {
  display: none !important;
}

.discovery-topbar #openNotifications,
.discovery-topbar #themeToggle {
  position: absolute;
  top: 8px;
  z-index: 3;
}

.discovery-topbar #openNotifications {
  right: 48px;
}

.discovery-topbar #themeToggle {
  right: 0;
}

.notification-button {
  position: relative;
  overflow: visible;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: width 200ms ease-out, padding 200ms ease-out;
}

.notification-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notification-button .notification-count {
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
  padding: 0 2px;
}

.notification-button.has-unread {
  width: auto;
  min-width: 40px;
  padding: 0 12px 0 12px;
  background: color-mix(in srgb, #a855f7 14%, var(--surface));
  border-color: color-mix(in srgb, #a855f7 38%, var(--line));
}

.notification-button.has-unread .notification-count {
  color: #a855f7;
}

[data-theme="dark"] .notification-button.has-unread .notification-count {
  color: #c084fc;
}

.notification-button .badge {
  display: none;
}

.discovery-hero {
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: stretch;
  padding: 14px 0 20px;
}

.discovery-hero .hero-copy {
  display: none;
}

.discovery-search-panel {
  padding: 12px;
  box-shadow: 0 10px 26px rgba(60, 64, 67, 0.08);
}

.discovery-search-panel .search-box > span,
.filter-toggle span {
  margin: 0;
}

.filter-toggle {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
}

.discovery-search-panel.filters-collapsed .filter-grid {
  display: none;
}

.main-discovery-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
}

.discovery-view-card {
  display: grid;
  align-content: space-between;
  gap: 8px;
  min-height: 102px;
  padding: 14px;
  border-radius: var(--radius);
  text-align: left;
  box-shadow: 0 12px 26px rgba(60, 64, 67, 0.10);
}

.discovery-view-card strong,
.discovery-view-card span {
  display: block;
  margin: 0;
}

.discovery-view-card strong {
  font-size: 1rem;
  line-height: 1.15;
}

.discovery-view-card span {
  color: inherit;
  opacity: 0.78;
  font-size: 0.78rem;
  line-height: 1.25;
}

.discovery-view-card.tone-purple {
  background: #f4efff;
  color: #4d2b8c;
}

.discovery-view-card.tone-blue {
  background: #eaf3ff;
  color: #1558b0;
}

.discovery-view-card.tone-green {
  background: #e9f7ef;
  color: #146c3c;
}

.discovery-view-card.active {
  background: linear-gradient(135deg, #6d35d7, #1a73e8);
  color: #fff;
  box-shadow: 0 16px 34px rgba(77, 43, 140, 0.24);
}

[data-theme="dark"] .discovery-view-card.tone-purple {
  background: #241d34;
  color: #d7c8ff;
}

[data-theme="dark"] .discovery-view-card.tone-blue {
  background: #152235;
  color: #aecbfa;
}

[data-theme="dark"] .discovery-view-card.tone-green {
  background: #14291d;
  color: #a8dab5;
}

.discovery-rail {
  display: flex;
  gap: 12px;
  max-width: 100%;
  padding: 2px 0 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.discovery-rail-card {
  display: grid;
  flex: 0 0 min(290px, 82vw);
  gap: 8px;
  min-height: 128px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(26, 115, 232, 0.12), rgba(249, 171, 0, 0.14)),
    var(--surface);
  color: var(--text);
  text-align: left;
  scroll-snap-align: start;
  box-shadow: 0 10px 24px rgba(60, 64, 67, 0.08);
}

.top10-discovery-card {
  background:
    linear-gradient(135deg, rgba(109, 53, 215, 0.16), rgba(24, 128, 56, 0.12)),
    var(--surface);
}

.cafe-discovery-card {
  background:
    linear-gradient(135deg, rgba(249, 171, 0, 0.18), rgba(217, 48, 37, 0.09)),
    var(--surface);
}

.discovery-rail-card span,
.discovery-rail-card strong,
.discovery-rail-card small {
  display: block;
  margin: 0;
}

.discovery-rail-card span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.discovery-rail-card strong {
  font-size: 1.05rem;
  line-height: 1.25;
}

.discovery-rail-card small {
  align-self: end;
  color: var(--blue);
  font-weight: 800;
}

.content-grid {
  grid-template-columns: minmax(0, 1fr);
}

.home-meta-panel {
  display: none;
}

.feed-header {
  margin-bottom: 16px;
}

.feed-header h2 {
  font-size: 1.35rem;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
}

.place-card {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius);
  background: #111827;
  color: #fff;
  box-shadow: 0 18px 42px rgba(31, 41, 55, 0.18);
}

.place-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.10) 0%, rgba(0, 0, 0, 0.28) 44%, rgba(0, 0, 0, 0.82) 100%),
    linear-gradient(45deg, rgba(109, 53, 215, 0.20), transparent 50%);
}

.place-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  transform: scale(1.01);
}

.place-body {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 430px;
  flex-direction: column;
  justify-content: flex-end;
  padding: 18px;
}

.place-topline {
  align-items: flex-start;
}

.place-card .category-pill {
  max-width: 100%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(10px);
}

.place-card .place-location,
.place-card .recommendation-title span,
.place-card .tip {
  color: rgba(255, 255, 255, 0.78);
}

.place-card h3 {
  margin: 14px 0 10px;
  color: #fff;
  font-size: 1.45rem;
  line-height: 1.14;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.34);
}

.card-description {
  display: -webkit-box;
  margin: 0 0 8px;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.94rem;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta-line {
  margin: 0 0 10px;
  color: rgba(255, 255, 255, 0.70);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.25;
}

.place-card .recommendation-list {
  gap: 8px;
}

.place-card .recommendation-item {
  border-color: rgba(255, 255, 255, 0.22);
}

.place-card .recommendation-title {
  margin-bottom: 0;
}

.place-card .recommendation-title strong {
  color: #fff;
  font-size: 0.96rem;
}

.place-card .place-actions {
  margin-top: 12px;
}

.place-card .action-button,
.place-card .venue-more-button {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.20);
  backdrop-filter: blur(10px);
}

.place-card .action-button.liked {
  background: rgba(255, 255, 255, 0.92);
  color: #4d2b8c;
}

.place-card .report-place {
  display: none;
}

.place-card .comments {
  border-color: rgba(255, 255, 255, 0.22);
}

.place-card .comment {
  color: rgba(255, 255, 255, 0.82);
}

.place-card .comment-author {
  color: #fff;
}

.place-card .comment-form {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px;
}

.place-card .comment-form input {
  color: #fff;
}

.place-card .comment-form input::placeholder {
  color: rgba(255, 255, 255, 0.70);
}

.feed-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(109, 53, 215, 0.10), rgba(26, 115, 232, 0.08)),
    var(--surface);
  box-shadow: 0 10px 24px rgba(60, 64, 67, 0.08);
}

.feed-cta-card strong,
.feed-cta-card p {
  display: block;
  margin: 0;
}

.feed-cta-card p {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.4;
}

.bottom-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: min(520px, calc(100% - 20px));
  min-height: 68px;
  padding: 6px;
}

.bottom-nav-button {
  grid-template-rows: 24px auto;
  gap: 3px;
  min-height: 56px;
  padding: 5px 2px 4px;
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
}

.bottom-nav-button span {
  display: block;
  max-width: 100%;
}

.bottom-nav-button svg {
  justify-self: center;
  width: 23px;
  height: 23px;
}

.bottom-nav-add {
  color: #fff;
}

.bottom-nav-add svg {
  width: 38px;
  height: 38px;
  padding: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6d35d7, #1a73e8);
  color: #fff;
  box-shadow: 0 8px 18px rgba(77, 43, 140, 0.28);
}

.bottom-nav-add span {
  color: var(--text);
}

@media (max-width: 760px) {
  .app-shell {
    padding-top: 8px;
  }

  .discovery-topbar {
    min-height: 68px;
  }

  .discovery-topbar .account-actions {
    padding-right: 0;
  }

  .discovery-topbar .account-actions .ghost-button:not(#openAuth):not(#logoutUser) {
    display: none !important;
  }

  .main-discovery-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
  }

  .discovery-view-card {
    min-width: 0;
    min-height: 116px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .place-card,
  .place-body {
    min-height: 392px;
  }

  .place-card h3 {
    font-size: 1.34rem;
  }

  .feed-cta-card {
    align-items: stretch;
    flex-direction: column;
  }

  .feed-cta-card .primary-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .home-status-row {
    grid-template-columns: minmax(0, 1fr) auto 74px;
  }

  .home-brand span {
    font-size: 1.05rem;
  }

  .home-location strong {
    font-size: 0.98rem;
  }

  .bottom-nav {
    width: min(100%, calc(100% - 12px));
  }

  .bottom-nav-button {
    font-size: 0.58rem;
  }

  .bottom-nav-add span {
    font-size: 0.54rem;
  }
}

/* Clean MVP home correction */
.discovery-topbar {
  min-height: 52px;
  padding: 8px 0 2px;
}

.home-status-row {
  grid-template-columns: minmax(0, 1fr) auto minmax(48px, 1fr);
}

.home-location {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 5px;
  min-height: 38px;
  max-width: 100%;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  box-shadow: none;
}

.home-location strong,
.home-location span {
  margin: 0;
  line-height: 1;
}

.home-location strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.96rem;
  font-weight: 800;
}

.home-location span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: none;
}

.home-brand {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  gap: 0;
  font-size: 1.34rem;
  font-weight: 900;
  letter-spacing: 0;
}

.home-brand .brand-mark {
  display: none;
}

.home-icon-actions {
  min-width: 48px;
}

.discovery-topbar .account-actions {
  position: absolute;
  top: 8px;
  right: 0;
  display: block;
  width: auto;
  padding: 0;
}

.discovery-topbar .account-actions > :not(#openNotifications) {
  display: none !important;
}

.discovery-topbar #openNotifications {
  position: relative;
  top: auto;
  right: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.discovery-topbar #themeToggle {
  display: none !important;
}

.notification-button > span[aria-hidden="true"] {
  font-size: 1rem;
}

.discovery-hero {
  display: block;
  padding: 12px 0 18px;
}

.main-discovery-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 2px 0 10px;
  overflow: visible;
  border: 0;
}

.main-discovery-list::-webkit-scrollbar,
.discovery-rail::-webkit-scrollbar {
  display: none;
}

.discovery-view-card {
  min-width: 0;
  min-height: 116px;
  padding: 12px 10px;
  white-space: normal;
}

.discovery-view-card strong {
  font-size: 0.95rem;
}

.discovery-view-card span {
  font-size: 0.72rem;
  line-height: 1.22;
}

.discovery-view-icon {
  width: 34px;
  height: 34px;
}

.discovery-view-icon svg {
  width: 22px;
  height: 17px;
}

.discovery-view-card.tone-gold {
  background: #fff4d8;
  color: #7a4b00;
}

[data-theme="dark"] .discovery-view-card.tone-gold {
  background: #352811;
  color: #fdd663;
}

.feed-header {
  align-items: flex-start;
  margin-top: 2px;
  margin-bottom: 14px;
}

.feed-header h2 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.15;
}

.feed-header #feedSubtitle {
  margin-top: 5px;
  font-weight: 600;
}

.feed-header .sort-shell {
  display: none;
}

.location-dialog {
  width: min(440px, calc(100% - 28px));
}

.location-dialog form {
  padding: 18px;
}

.location-filter-grid {
  grid-template-columns: 1fr;
}

.location-dialog .dialog-actions {
  margin-top: 16px;
  justify-content: flex-end;
}

@media (max-width: 760px) {
  .discovery-topbar {
    min-height: 50px;
    padding-top: 6px;
  }

  .home-brand {
    top: 10px;
    font-size: 1.22rem;
  }

  .discovery-topbar .account-actions {
    top: 6px;
  }

  .discovery-view-card {
    flex-basis: 174px;
  }
}

@media (max-width: 380px) {
  .home-status-row {
    grid-template-columns: minmax(0, 1fr) auto 44px;
  }

  .home-location {
    padding: 0 8px;
  }

  .home-location strong {
    max-width: 96px;
  }

  .discovery-view-card {
    flex-basis: 162px;
    min-height: 112px;
  }
}

/* Home search, category filters, and bottom nav placement */
body {
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

html.capacitor-app body {
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

.app-shell {
  padding-bottom: 124px;
}

.discovery-hero {
  display: grid;
  gap: 12px;
  padding: 12px 0 16px;
}

.home-search-box {
  min-height: 50px;
  padding: 0 15px;
  background: var(--surface);
  border-color: color-mix(in srgb, var(--line) 78%, transparent);
  box-shadow: 0 8px 22px rgba(60, 64, 67, 0.08);
}

.home-search-box > span {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
}

.home-search-box input::placeholder {
  color: color-mix(in srgb, var(--muted) 82%, transparent);
}

.category-filter-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  max-width: 100%;
  padding: 0 0 8px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}

.category-filter-row::-webkit-scrollbar {
  display: none;
}

.category-filter-chip {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border-color: color-mix(in srgb, var(--line) 82%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, var(--surface-soft));
  color: var(--muted);
  scroll-snap-align: start;
}

.category-filter-chip.active {
  background: linear-gradient(135deg, #6d35d7, #1a73e8);
  color: #fff;
  box-shadow: 0 8px 18px rgba(77, 43, 140, 0.22);
}

.bottom-nav {
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  min-height: calc(72px + env(safe-area-inset-bottom));
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 18px 18px 0 0;
  transform: none;
}

.bottom-nav-button {
  min-height: 54px;
}

html.capacitor-app .toast {
  bottom: calc(86px + env(safe-area-inset-bottom));
}

@media (min-width: 700px) {
  .bottom-nav {
    left: 50%;
    right: auto;
    width: min(560px, 100%);
    border-right: 1px solid var(--line);
    border-left: 1px solid var(--line);
    transform: translateX(-50%);
  }
}

/* Modern app controls */
.native-control-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip-path: inset(50%) !important;
}

.app-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, var(--blue));
  border-radius: 14px;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  color: var(--text);
  text-align: left;
  box-shadow: 0 8px 22px rgba(60, 64, 67, 0.08);
}

.app-select-trigger:focus-visible,
.app-select-trigger:hover {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 16%, transparent), 0 8px 22px rgba(60, 64, 67, 0.08);
}

.app-select-trigger strong {
  overflow: hidden;
  font-size: 0.98rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-select-trigger span {
  color: var(--blue);
  font-size: 0.86rem;
}

.select-sheet {
  position: fixed;
  inset: auto 0 0;
  width: min(520px, 100%);
  height: clamp(360px, 55dvh, 560px);
  max-height: calc(100dvh - 24px);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 24px 24px 0 0;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  box-shadow: 0 -20px 44px rgba(0, 0, 0, 0.28);
}

.select-sheet-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  min-height: 0;
  padding: 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

.select-sheet .dialog-header {
  position: static;
  margin: 0;
  padding: 0;
  background: transparent;
}

.select-sheet-options {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.select-sheet::backdrop {
  background: rgba(0, 0, 0, 0.62);
}

.select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: var(--text);
  text-align: left;
}

.select-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.select-option strong {
  width: 22px;
  color: var(--blue);
  font-size: 1rem;
  text-align: right;
}

.select-option.selected {
  border-color: color-mix(in srgb, var(--blue) 72%, var(--line));
  background: color-mix(in srgb, var(--blue) 16%, var(--surface));
  color: var(--text);
}

.upload-card {
  margin-top: 4px;
}

.upload-empty,
.upload-preview {
  width: 100%;
  min-height: 112px;
  border: 1px dashed color-mix(in srgb, var(--line) 70%, var(--blue));
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-soft) 78%, var(--surface));
  color: var(--text);
}

.upload-empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  text-align: left;
}

.upload-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #6d35d7, #1a73e8);
  color: #fff;
  font-size: 1.25rem;
}

.upload-copy {
  display: grid;
  gap: 4px;
}

.upload-copy strong,
.upload-preview-info strong {
  overflow: hidden;
  color: var(--text);
  font-size: 0.98rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-copy small {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
}

.upload-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--blue) 16%, var(--surface));
  color: var(--blue);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.upload-preview {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-style: solid;
}

.upload-preview img {
  width: 82px;
  height: 82px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface);
}

.upload-preview-info {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.upload-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.danger-text-button {
  color: var(--red);
}

.danger-outline-button {
  border-color: color-mix(in srgb, var(--red) 45%, var(--line));
  color: var(--red);
}

.danger-outline-button:hover,
.danger-outline-button:focus-visible {
  background: color-mix(in srgb, var(--red) 12%, var(--surface-soft));
}

.confirm-dialog {
  width: min(420px, calc(100% - 28px));
  height: auto;
  min-height: 0;
  max-height: calc(100dvh - 32px);
  margin: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
}

.confirm-dialog form {
  min-height: 0;
  padding: 20px;
}

.confirm-dialog .dialog-header {
  position: static;
  margin: 0 0 8px;
  padding: 0;
  background: transparent;
}

.confirm-dialog .danger-button {
  border-color: transparent;
  background: var(--red);
  color: #fff;
}

@media (max-width: 460px) {
  .upload-empty {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .upload-action {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (min-width: 700px) {
  .select-sheet {
    inset: 50% auto auto 50%;
    width: min(520px, calc(100% - 32px));
    height: auto;
    min-height: 360px;
    max-height: min(72dvh, 620px);
    border: 1px solid var(--line);
    border-radius: 24px;
    transform: translate(-50%, -50%);
  }

  .select-sheet-content {
    max-height: inherit;
  }

  .select-sheet-options {
    max-height: calc(min(72dvh, 620px) - 112px);
  }
}

/* Full-screen first-launch onboarding */
.onboarding-dialog {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 8%, rgba(109, 53, 215, 0.28), transparent 34%),
    linear-gradient(180deg, #12151d 0%, #101418 100%);
  color: var(--text);
  overflow: hidden;
}

.onboarding-dialog::backdrop {
  background: #101418;
}

.onboarding-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100%;
  padding: calc(22px + env(safe-area-inset-top)) 22px calc(20px + env(safe-area-inset-bottom));
}

.onboarding-brand {
  display: inline-flex;
  align-items: center;
  justify-self: center;
  gap: 10px;
  color: #fff;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0;
}

.onboarding-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.onboarding-pages {
  display: grid;
  align-items: center;
  min-height: 0;
}

.onboarding-page {
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(100%, 440px);
  margin: 0 auto;
  text-align: center;
}

.onboarding-visual {
  display: grid;
  width: min(42vw, 168px);
  aspect-ratio: 1;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(109, 53, 215, 0.96), rgba(26, 115, 232, 0.82)),
    var(--surface-soft);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

.onboarding-glyph {
  color: #fff;
  font-size: clamp(3.2rem, 13vw, 5.2rem);
  font-weight: 800;
  line-height: 1;
}

.onboarding-page .muted {
  color: #b7bfd0;
  text-transform: uppercase;
  letter-spacing: 0;
}

.onboarding-page h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 7vw, 3.05rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.onboarding-page p {
  max-width: 360px;
  margin: 0;
  color: #c6ccd8;
  font-size: 1.02rem;
  line-height: 1.55;
}

.onboarding-footer {
  display: grid;
  gap: 16px;
  width: min(100%, 440px);
  margin: 0 auto;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.onboarding-dots button {
  width: 8px;
  min-height: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
  transition: width 0.2s ease, background 0.2s ease;
}

.onboarding-dots button.active {
  width: 24px;
  background: #9f7aea;
}

.onboarding-next,
.onboarding-google,
.onboarding-skip {
  width: 100%;
}

.onboarding-next {
  min-height: 54px;
  background: linear-gradient(135deg, #8b5cf6 0%, #4f46e5 50%, #2563eb 100%);
  box-shadow:
    0 18px 40px rgba(99, 102, 241, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.onboarding-next:hover {
  background: linear-gradient(135deg, #9b6cff 0%, #5b53f0 50%, #2f73f5 100%);
}

.onboarding-final-actions {
  display: grid;
  gap: 10px;
}

.onboarding-consent {
  min-height: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  color: #dce2ee;
  font-size: 0.9rem;
}

.check-row input[type="checkbox"] {
  position: relative;
  display: inline-block;
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--line) 70%, var(--blue));
  border-radius: 8px;
  background: var(--surface-soft);
}

.check-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><polyline points='5,12.5 10,17.5 19,7.5'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 70% 70%;
  opacity: 0;
  pointer-events: none;
}

.check-row input[type="checkbox"]:checked {
  border-color: transparent;
  background: linear-gradient(135deg, #6d35d7, #1a73e8);
}

.check-row input[type="checkbox"]:checked::after {
  opacity: 1;
}

.onboarding-consent a {
  color: #bfa7ff;
}

.onboarding-error {
  color: #ffb4ab;
  font-size: 0.88rem;
  text-align: center;
}

.onboarding-google {
  min-height: 52px;
  border-color: rgba(255, 255, 255, 0.12);
  background: #fff;
  color: #202124;
}

.onboarding-google:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.onboarding-skip {
  min-height: 42px;
  color: #c6ccd8;
}

@media (min-width: 760px) {
  .onboarding-card {
    padding-left: 32px;
    padding-right: 32px;
  }
}

@media (max-height: 680px) {
  .onboarding-card {
    padding-top: calc(14px + env(safe-area-inset-top));
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  .onboarding-visual {
    width: min(34vw, 128px);
    border-radius: 26px;
  }

  .onboarding-page h2 {
    font-size: clamp(1.75rem, 6vw, 2.4rem);
  }

  .onboarding-page p {
    font-size: 0.95rem;
  }
}

/* Final MVP refinements */
.dialog-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.field-helper {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.place-card {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(60, 64, 67, 0.10);
}

[data-theme="dark"] .place-card {
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
}

.place-card::after {
  content: none;
}

.place-image {
  position: static;
  display: block;
  width: 100%;
  height: clamp(180px, 32vw, 220px);
  max-height: 220px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transform: none;
}

.place-body {
  position: static;
  z-index: auto;
  display: block;
  min-height: 0;
  padding: 14px;
}

.place-card .category-pill {
  max-width: 100%;
  background: color-mix(in srgb, var(--blue) 14%, var(--surface-soft));
  color: var(--blue);
  box-shadow: none;
  backdrop-filter: none;
}

.place-card h3 {
  margin: 12px 0 8px;
  color: var(--text);
  font-size: 1.28rem;
  line-height: 1.16;
  text-shadow: none;
}

.place-card .place-location,
.place-card .recommendation-title span,
.place-card .tip,
.card-description {
  color: var(--muted);
}

.card-description {
  margin: 0 0 10px;
  font-size: 0.94rem;
  line-height: 1.45;
}

.card-meta-line {
  display: none;
}

.place-card .recommendation-item {
  border-color: var(--line);
}

.place-card .recommendation-title strong {
  color: var(--text);
}

.place-card .action-button,
.place-card .venue-more-button {
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: none;
  backdrop-filter: none;
}

.place-card .action-button.liked {
  background: color-mix(in srgb, var(--blue) 16%, var(--surface));
  color: var(--blue);
}

.place-card .comments {
  border-color: var(--line);
}

.place-card .comment {
  color: var(--muted);
}

.place-card .comment-author {
  color: var(--blue);
}

.place-card .comment-form {
  background: var(--surface-soft);
}

.place-card .comment-form input {
  color: var(--text);
}

.place-card .comment-form input::placeholder {
  color: var(--muted);
}

.skeleton-card {
  pointer-events: none;
  overflow: hidden;
}

.skeleton-image,
.skeleton-author .skeleton-avatar,
.skeleton-author .skeleton-name,
.skeleton-author .skeleton-time,
.skeleton-body strong,
.skeleton-body p,
.skeleton-actions .skeleton-pill {
  display: block;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--surface-soft), color-mix(in srgb, var(--surface-soft) 70%, var(--line)), var(--surface-soft));
  background-size: 200% 100%;
  animation: skeleton-pulse 1.2s ease-in-out infinite;
}

.skeleton-author {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 8px;
}

.skeleton-author .skeleton-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

.skeleton-author .skeleton-name {
  flex: 0 1 38%;
  height: 14px;
  border-radius: 999px;
}

.skeleton-author .skeleton-time {
  margin-left: auto;
  width: 48px;
  height: 10px;
  border-radius: 999px;
  opacity: 0.75;
}

.skeleton-image {
  height: clamp(180px, 32vw, 220px);
  margin: 0 14px;
  border-radius: 14px;
}

.skeleton-body {
  display: grid;
  gap: 8px;
  padding: 12px 14px 4px;
}

.skeleton-body strong {
  width: 74%;
  height: 20px;
  border-radius: 8px;
}

.skeleton-body p {
  width: 92%;
  height: 12px;
  border-radius: 6px;
}

.skeleton-body p.skeleton-line-short {
  width: 60%;
}

.skeleton-actions {
  display: flex;
  gap: 8px;
  padding: 8px 14px 14px;
}

.skeleton-actions .skeleton-pill {
  flex: 1 1 0;
  height: 32px;
  border-radius: 999px;
  max-width: 88px;
}

@keyframes skeleton-pulse {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.upload-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.upload-preview.upload-busy {
  border-style: dashed;
}

.upload-preview.upload-error {
  border-color: color-mix(in srgb, var(--red) 72%, var(--line));
  background: color-mix(in srgb, var(--red) 9%, var(--surface));
}

.upload-preview.upload-error .upload-status {
  color: var(--red);
}

.bottom-nav-add svg {
  background: linear-gradient(135deg, #6d35d7, #1a73e8);
  color: #fff;
  box-shadow: 0 10px 22px rgba(77, 43, 140, 0.34);
}

.home-brand span {
  font-family: "Google Sans", Inter, system-ui, sans-serif;
  font-size: clamp(1.22rem, 4vw, 1.48rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  background: linear-gradient(90deg, #ffffff 0%, #c8f1ff 42%, #b9a7ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 10px 28px rgba(26, 115, 232, 0.18);
}

[data-theme="light"] .home-brand span {
  background: linear-gradient(90deg, #101418 0%, #1a73e8 46%, #6d35d7 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

.discovery-view-card {
  position: relative;
  overflow: hidden;
}

.discovery-view-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: 1rem;
  font-weight: 900;
}

.category-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 12px 4px 6px;
  border-radius: 999px;
}

.category-filter-chip strong {
  color: inherit;
  font-size: 0.88rem;
  line-height: 1;
}

.category-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-soft) 78%, transparent);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 900;
}

.category-icon svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
}

.place-card-clickable {
  cursor: pointer;
}

.place-card-clickable:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.place-card-clickable button,
.place-card-clickable a,
.place-card-clickable input,
.place-card-clickable textarea,
.place-card-clickable form,
.place-card-clickable label,
.place-card-clickable .comments {
  cursor: auto;
}

.place-card-clickable .action-button,
.place-card-clickable .venue-more-button,
.place-card-clickable .username-link,
.place-card-clickable .avatar-button,
.place-card-clickable .recommendation-photo {
  cursor: pointer;
}

.category-tone-food .category-icon {
  background: #ffe8c7;
  color: #7c2d12;
}

.category-tone-cafe .category-icon {
  background: #dff6ea;
  color: #14532d;
}

.category-tone-view .category-icon {
  background: #dbeafe;
  color: #1d4ed8;
}

.category-tone-activity .category-icon {
  background: #fde2e2;
  color: #991b1b;
}

.category-tone-fun .category-icon {
  background: #f1ddff;
  color: #6b21a8;
}

.category-filter-chip.active .category-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.top10-filter-bar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.top10-filter-button {
  display: grid;
  gap: 4px;
  min-width: 0;
  min-height: 52px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-soft) 88%, transparent);
  color: var(--text);
  text-align: left;
}

.top10-filter-button span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.top10-filter-button strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.96rem;
}

.top10-panel .admin-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.top10-panel .admin-tabs .chip {
  justify-content: center;
  min-width: 0;
  min-height: 42px;
  padding: 7px 9px;
  white-space: normal;
  line-height: 1.12;
}

.top10-row {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(26, 115, 232, 0.06)),
    var(--surface);
}

.top10-rank {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--blue) 14%, transparent);
  font-variant-numeric: tabular-nums;
}

.top10-stats strong,
.place-actions .like-button strong,
.place-actions .comment-toggle strong {
  font-variant-numeric: tabular-nums;
}

/* Dashboard layout refinements */
.main-discovery-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 2.2vw, 12px);
  padding: 8px 2px 14px;
  overflow: visible;
}

.discovery-view-card {
  min-width: 0;
  min-height: 116px;
  padding: 12px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}

.discovery-view-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.discovery-view-card::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 140%;
  height: 180%;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 75% 25%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 70%),
    linear-gradient(125deg, transparent 35%, rgba(255, 255, 255, 0.22) 48%, transparent 62%);
  mix-blend-mode: screen;
  opacity: 0.85;
  z-index: 0;
}

.discovery-view-card > * {
  position: relative;
  z-index: 1;
}

.discovery-view-card.tone-purple {
  background: linear-gradient(135deg, #4b3bff 0%, #6d35d7 55%, #9333ea 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 28px rgba(77, 43, 140, 0.32);
}

.discovery-view-card.tone-purple span {
  color: rgba(255, 255, 255, 0.82);
}

.discovery-view-card.tone-blue {
  background: linear-gradient(135deg, #eef3ff 0%, #dce8ff 100%);
  color: #0f3a86;
  border-color: color-mix(in srgb, #1a73e8 22%, transparent);
  box-shadow: 0 12px 24px rgba(15, 58, 134, 0.10);
}

.discovery-view-card.tone-blue span {
  color: color-mix(in srgb, #0f3a86 70%, transparent);
}

.discovery-view-card.tone-gold {
  background: linear-gradient(135deg, #ffe79a 0%, #f4c94a 55%, #d99a1c 100%);
  color: #5a3700;
  border-color: rgba(122, 75, 0, 0.18);
  box-shadow: 0 14px 28px rgba(217, 154, 28, 0.28);
}

.discovery-view-card.tone-gold span {
  color: color-mix(in srgb, #5a3700 72%, transparent);
}

html:not(.capacitor-app) .main-discovery-list {
  width: min(680px, 100%);
  margin: 0 auto;
  gap: 12px;
  align-items: stretch;
}

html:not(.capacitor-app) .category-filter-row {
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0 14px;
  overflow: visible;
  scroll-snap-type: none;
}

html:not(.capacitor-app) .category-filter-chip {
  min-height: 44px;
  padding: 5px 13px 5px 7px;
  border: 1px solid color-mix(in srgb, var(--line) 76%, transparent);
  border-radius: 16px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 96%, #ffffff), color-mix(in srgb, var(--surface-soft) 78%, var(--surface))),
    var(--surface);
  color: color-mix(in srgb, var(--text) 82%, var(--muted));
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

html:not(.capacitor-app) .category-filter-chip strong {
  font-size: 0.88rem;
  font-weight: 850;
}

html:not(.capacitor-app) .category-filter-chip .category-icon {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 6px 14px rgba(15, 23, 42, 0.10);
}

html:not(.capacitor-app) .category-filter-chip.active {
  border-color: color-mix(in srgb, var(--blue) 42%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 28%, var(--surface)) 0%, color-mix(in srgb, #6d35d7 22%, var(--surface)) 100%),
    var(--surface);
  color: var(--text);
  box-shadow:
    0 14px 30px rgba(26, 115, 232, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

html:not(.capacitor-app)[data-theme="dark"] .category-filter-chip {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, #243041), color-mix(in srgb, var(--surface-soft) 74%, var(--surface))),
    var(--surface);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.24);
}

html:not(.capacitor-app)[data-theme="dark"] .category-filter-chip.active {
  color: #ffffff;
}

html:not(.capacitor-app) .cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

html:not(.capacitor-app) .place-card {
  min-height: 126px;
  border-radius: 14px;
}

html:not(.capacitor-app) .place-image {
  width: 112px;
  min-height: 126px;
}

html:not(.capacitor-app) .place-body {
  gap: 6px;
  padding: 10px 12px;
}

html:not(.capacitor-app) .place-author {
  margin-bottom: 4px;
}

html:not(.capacitor-app) .place-card .place-actions {
  gap: 6px;
  margin-top: 6px;
}

html:not(.capacitor-app) .place-card .action-button {
  min-height: 28px;
  padding: 0 8px;
}

@media (max-width: 760px) {
  html:not(.capacitor-app) .main-discovery-list {
    width: 100%;
    gap: 8px;
  }

  html:not(.capacitor-app) .category-filter-row {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  html:not(.capacitor-app) .cards {
    grid-template-columns: 1fr;
  }

  html:not(.capacitor-app) .place-image {
    width: 84px;
    min-height: 108px;
  }

}

[data-theme="dark"] .discovery-view-card.tone-purple {
  background: linear-gradient(135deg, #3a2bb0 0%, #5b2db8 55%, #7a23a8 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.10);
}

[data-theme="dark"] .discovery-view-card.tone-purple span {
  color: rgba(255, 255, 255, 0.78);
}

[data-theme="dark"] .discovery-view-card.tone-blue {
  background: linear-gradient(135deg, #15243e 0%, #1c3358 100%);
  color: #cfdcff;
  border-color: color-mix(in srgb, #6896f5 28%, transparent);
}

[data-theme="dark"] .discovery-view-card.tone-blue span {
  color: color-mix(in srgb, #cfdcff 78%, transparent);
}

[data-theme="dark"] .discovery-view-card.tone-gold {
  background: linear-gradient(135deg, #3d2807 0%, #6b4310 55%, #8a5d10 100%);
  color: #ffdf85;
  border-color: rgba(250, 204, 21, 0.22);
}

[data-theme="dark"] .discovery-view-card.tone-gold span {
  color: color-mix(in srgb, #ffdf85 72%, transparent);
}

.discovery-view-card.active {
  filter: brightness(1.04);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.discovery-view-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.20);
  box-shadow:
    0 6px 14px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 0, 0, 0.10);
}

.discovery-view-icon svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.discovery-view-card.tone-purple .discovery-view-icon {
  background: linear-gradient(135deg, #7c5cff 0%, #5836c9 100%);
  color: #ffffff;
}

.discovery-view-card.tone-blue .discovery-view-icon {
  background: linear-gradient(135deg, #e8eeff 0%, #c9d6f5 100%);
  color: #1d4ed8;
}

.discovery-view-card.tone-gold .discovery-view-icon {
  background: linear-gradient(135deg, #ffd158 0%, #d99a1c 100%);
  color: #5a3700;
}

[data-theme="dark"] .discovery-view-card.tone-purple .discovery-view-icon {
  background: linear-gradient(135deg, #6147d7 0%, #3a2497 100%);
  color: #ffffff;
}

[data-theme="dark"] .discovery-view-card.tone-blue .discovery-view-icon {
  background: linear-gradient(135deg, #2a3a64 0%, #1b274a 100%);
  color: #cfdcff;
}

[data-theme="dark"] .discovery-view-card.tone-gold .discovery-view-icon {
  background: linear-gradient(135deg, #d4a934 0%, #8a5d10 100%);
  color: #fff3b0;
}

.feed-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.feed-view-all {
  align-self: center;
  white-space: nowrap;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.place-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  min-height: 108px;
  border-radius: 10px;
}

.place-image {
  width: 84px;
  height: 100%;
  min-height: 108px;
  max-height: none;
  aspect-ratio: auto;
}

.place-body {
  display: grid;
  gap: 4px;
  padding: 8px 10px;
}

.place-card h3 {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.16;
}

.card-description,
.place-card .tip {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 0.74rem;
  line-height: 1.25;
}

.place-card .category-pill {
  padding: 3px 7px;
  font-size: 0.68rem;
}

.place-card .recommendation-item {
  padding: 0;
  border: 0;
}

.place-card .place-actions {
  display: flex;
  gap: 5px;
  margin-top: 4px;
}

.place-card .action-button {
  min-height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.place-card .save-place strong,
.place-card .detail-place strong,
.place-card .report-place {
  display: none;
}

.top10-panel {
  width: min(840px, 100%);
  max-width: 100%;
}

@media (max-width: 760px) {
  .top10-panel {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    height: 100dvh;
    max-height: 100dvh;
    inset: 0;
  }
}

.top10-row {
  grid-template-columns: 38px 48px minmax(0, 1fr) auto auto;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
}

.top10-row.place-row-card {
  grid-template-columns: 38px 52px minmax(0, 1fr) auto;
}

.top10-rank {
  width: 34px;
  height: 34px;
  font-size: 0.95rem;
}

.top10-image {
  width: 52px;
  height: 44px;
  border-radius: 8px;
}

.top10-info strong,
.top10-info .username-link {
  font-size: 0.95rem;
}

.top10-meta {
  margin: 0;
  font-size: 0.76rem;
  line-height: 1.25;
}

.top10-stats strong {
  font-size: 1rem;
}

.top10-stats span {
  font-size: 0.7rem;
}

@media (max-width: 620px) {
  .top10-panel .admin-tabs,
  .top10-filter-bar {
    grid-template-columns: 1fr;
  }

  .feed-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .feed-header .sort-shell {
    grid-column: 1 / -1;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .skeleton-image {
    height: 108px;
  }

  .place-image {
    width: 84px;
    height: 100%;
    min-height: 108px;
    max-height: none;
  }

  .place-card,
  .place-body {
    min-height: 0;
  }
}

/* Recommendation card body — definitive left-alignment (2026-05-23).
   Earlier rules layered display: grid, display: flex, display: block on
   .place-body inconsistently; that drift made newer recommendations with
   an author block show a visible right-shift on the description line.
   Force a single deterministic flex column and zero out any logical
   inset on each direct child. */
.place-card .place-body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.place-card .place-body > * {
  min-width: 0;
  max-width: 100%;
  width: auto;
  margin-inline: 0;
  padding-inline: 0;
  text-indent: 0;
}

.place-card .place-body .place-topline,
.place-card .place-body .place-author {
  align-self: flex-start;
}

.place-card .place-body h3,
.place-card .place-body .card-description,
.place-card .place-body .recommendation-list {
  align-self: stretch;
  text-align: start;
  width: 100%;
}

.place-card .recommendation-item {
  padding-top: 0;
  border-top: 0;
  width: 100%;
  margin-inline: 0;
}

.place-card .place-actions {
  width: 100%;
  margin-inline: 0;
}

/* Discovery cards — simplified visual treatment (2026-05-23). */
.main-discovery-list .discovery-view-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 144px;
  padding: 16px 12px;
  border: 0;
  border-radius: 18px;
  text-align: center;
  overflow: visible;
  isolation: isolate;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.main-discovery-list .discovery-view-card::before,
.main-discovery-list .discovery-view-card::after {
  content: none;
}

.main-discovery-list .discovery-view-card > * {
  position: relative;
  z-index: 1;
}

.main-discovery-list .discovery-view-card .discovery-view-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
  color: #ffffff;
  padding: 0;
  margin: 0;
}

.main-discovery-list .discovery-view-card .discovery-view-icon svg {
  display: block;
  width: 30px;
  height: 30px;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: #ffffff;
  shape-rendering: geometricPrecision;
  overflow: visible;
}

.main-discovery-list .discovery-view-card strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.main-discovery-list .discovery-view-card span {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.3;
  color: rgba(255, 255, 255, 0.78);
  opacity: 1;
}

.main-discovery-list .discovery-view-card.tone-purple {
  background: linear-gradient(140deg, #7c3aed 0%, #4f46e5 100%);
  box-shadow:
    0 10px 22px rgba(79, 70, 229, 0.32),
    0 0 28px rgba(124, 58, 237, 0.40);
}

.main-discovery-list .discovery-view-card.tone-blue {
  background: linear-gradient(140deg, #0ea5e9 0%, #2563eb 100%);
  box-shadow:
    0 10px 22px rgba(37, 99, 235, 0.32),
    0 0 28px rgba(56, 189, 248, 0.40);
}

.main-discovery-list .discovery-view-card.tone-gold {
  background: linear-gradient(140deg, #f59e0b 0%, #d97706 100%);
  box-shadow:
    0 10px 22px rgba(217, 119, 6, 0.32),
    0 0 28px rgba(251, 191, 36, 0.45);
}

.main-discovery-list .discovery-view-card:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.main-discovery-list .discovery-view-card:active {
  transform: translateY(0);
  filter: brightness(0.98);
}

.main-discovery-list .discovery-view-card.active {
  outline: 2px solid rgba(255, 255, 255, 0.86);
  outline-offset: -2px;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
  filter: none;
}

[data-theme="dark"] .main-discovery-list .discovery-view-card.tone-purple {
  background: linear-gradient(140deg, #6d28d9 0%, #4338ca 100%);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.40),
    0 0 32px rgba(139, 92, 246, 0.45);
}

[data-theme="dark"] .main-discovery-list .discovery-view-card.tone-blue {
  background: linear-gradient(140deg, #0284c7 0%, #1d4ed8 100%);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.40),
    0 0 32px rgba(56, 189, 248, 0.42);
}

[data-theme="dark"] .main-discovery-list .discovery-view-card.tone-gold {
  background: linear-gradient(140deg, #d97706 0%, #b45309 100%);
  box-shadow:
    0 12px 26px rgba(0, 0, 0, 0.40),
    0 0 32px rgba(251, 191, 36, 0.45);
}

html:not(.capacitor-app) .main-discovery-list .discovery-view-card {
  min-height: 132px;
  border-radius: 16px;
}

html:not(.capacitor-app) .main-discovery-list .discovery-view-card .discovery-view-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
}

html:not(.capacitor-app) .main-discovery-list .discovery-view-card .discovery-view-icon svg {
  width: 26px;
  height: 26px;
}

@media (max-width: 760px) {
  .main-discovery-list .discovery-view-card {
    min-height: 150px;
    padding: 14px 10px;
    gap: 8px;
  }

  .main-discovery-list .discovery-view-card .discovery-view-icon {
    width: 48px;
    height: 48px;
  }

  .main-discovery-list .discovery-view-card .discovery-view-icon svg {
    width: 28px;
    height: 28px;
  }

  .main-discovery-list .discovery-view-card strong {
    font-size: 0.95rem;
  }

  .main-discovery-list .discovery-view-card span {
    font-size: 0.72rem;
  }
}

/* --- Wave 1.5 / P1.10 native polish: dialog transitions, pull-to-refresh,
   platform-aware CSS, reduced-motion override. --- */

dialog {
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition:
    opacity 180ms ease-out,
    transform 180ms ease-out,
    overlay 180ms ease-out allow-discrete,
    display 180ms ease-out allow-discrete;
}

dialog[open] {
  opacity: 1;
  transform: translateY(0) scale(1);
}

@starting-style {
  dialog[open] {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}

dialog::backdrop {
  opacity: 0;
  transition:
    opacity 180ms ease-out,
    overlay 180ms ease-out allow-discrete,
    display 180ms ease-out allow-discrete;
}

dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog[open]::backdrop {
    opacity: 0;
  }
}

.ptr-indicator {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top) + 6px);
  z-index: 60;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translate(-50%, -60px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease-out;
  backdrop-filter: blur(10px);
}

.ptr-indicator.active {
  opacity: 1;
}

.ptr-indicator .ptr-spinner {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid color-mix(in srgb, var(--text) 24%, transparent);
  border-top-color: var(--blue);
}

.ptr-indicator.ready .ptr-spinner {
  border-top-color: var(--green);
}

.ptr-indicator.refreshing .ptr-spinner {
  animation: ptr-spin 720ms linear infinite;
}

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

html.platform-ios body {
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
}

html.platform-android body {
  font-family: "Google Sans", Roboto, system-ui, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .ptr-indicator.refreshing .ptr-spinner {
    animation: none !important;
  }
}

/* --- Wave 1.6 / P1.11 Android Material ripple emulation.
   Activates only on Android via html.platform-android.
   ::after pseudo paints a radial wash that expands on press. --- */

html.platform-android .primary-button,
html.platform-android .ghost-button,
html.platform-android .danger-button,
html.platform-android .icon-button,
html.platform-android .text-button,
html.platform-android .action-button,
html.platform-android .bottom-nav-button,
html.platform-android .chip {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

/* Bottom-nav-add (FAB-style "Öneri ekle") needs to overflow its container
   because its inner purple circle (54x54) is larger than the surrounding
   nav cell. Exclude it from the generic ripple overflow clip and hide the
   rectangular ripple — the gradient circle itself provides press feedback. */
html.platform-android .bottom-nav-add {
  overflow: visible;
}

html.platform-android .bottom-nav-add::after {
  display: none;
}

html.platform-android .primary-button::after,
html.platform-android .ghost-button::after,
html.platform-android .danger-button::after,
html.platform-android .icon-button::after,
html.platform-android .text-button::after,
html.platform-android .action-button::after,
html.platform-android .bottom-nav-button::after,
html.platform-android .chip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.22) 40%,
    rgba(255, 255, 255, 0) 75%
  );
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
  z-index: 0;
}

html.platform-android .primary-button > *,
html.platform-android .ghost-button > *,
html.platform-android .danger-button > *,
html.platform-android .icon-button > *,
html.platform-android .text-button > *,
html.platform-android .action-button > *,
html.platform-android .bottom-nav-button > *,
html.platform-android .chip > * {
  position: relative;
  z-index: 1;
}

html.platform-android .primary-button:active::after,
html.platform-android .ghost-button:active::after,
html.platform-android .danger-button:active::after,
html.platform-android .icon-button:active::after,
html.platform-android .text-button:active::after,
html.platform-android .action-button:active::after,
html.platform-android .bottom-nav-button:active::after,
html.platform-android .chip:active::after {
  animation: viralist-ripple 420ms ease-out;
}

@keyframes viralist-ripple {
  0% { opacity: 0; transform: scale(0.35); }
  35% { opacity: 1; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.7); }
}

/* Like/save tap pop animation — fires on toggle-ON via .pop-once class. */
.action-button.pop-once span,
#detailLike.pop-once span,
#detailSave.pop-once span {
  display: inline-block;
  animation: viralist-pop 360ms cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center;
}

@keyframes viralist-pop {
  0%   { transform: scale(1); }
  18%  { transform: scale(0.78); }
  44%  { transform: scale(1.35); }
  72%  { transform: scale(0.94); }
  100% { transform: scale(1); }
}

[data-theme="light"].platform-android .primary-button::after,
[data-theme="light"].platform-android .ghost-button::after,
[data-theme="light"].platform-android .danger-button::after,
[data-theme="light"].platform-android .icon-button::after,
[data-theme="light"].platform-android .text-button::after,
[data-theme="light"].platform-android .action-button::after,
[data-theme="light"].platform-android .bottom-nav-button::after,
[data-theme="light"].platform-android .chip::after {
  background: radial-gradient(
    circle at center,
    rgba(26, 115, 232, 0.28) 0%,
    rgba(26, 115, 232, 0.14) 40%,
    rgba(26, 115, 232, 0) 75%
  );
}
