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

.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.5rem 1rem;
  background-color: #fff;
  color: #0a0a0a;
  font-size: 0.9rem;
  z-index: 100;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
}

*:focus {
  outline: 2px solid #5a9fd4;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid #5a9fd4;
  outline-offset: 2px;
}

body {
  min-height: 100vh;
  background-color: #0a0a0a;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
}

/* ----- Layout ----- */

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.site-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo {
  font-size: 2.6rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: #ffffff;
}

.logo a {
  color: inherit;
  text-decoration: none;
}

.tagline {
  font-size: 0.95rem;
  color: #888;
  margin-top: 0.6rem;
}

.divider {
  width: 60px;
  height: 2px;
  background-color: #333;
  margin: 1.5rem auto;
}

/* ----- User bar ----- */

.user-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.user-bar-row,
.user-bar-auth {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.user-bar label {
  font-size: 0.85rem;
  color: #888;
}

select,
input[type="text"],
input[type="search"],
textarea {
  background-color: #121212;
  color: #e0e0e0;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font-family: inherit;
  font-size: 0.9rem;
}

select:hover,
input:hover,
textarea:hover {
  border-color: #3a3a3a;
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}

.btn {
  background-color: #1a1a1a;
  color: #e0e0e0;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.55rem 0.9rem;
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  background-color: #232323;
  border-color: #3a3a3a;
}

.btn-primary {
  background-color: #2d4a63;
  border-color: #355875;
  color: #fff;
}

.btn-primary:hover {
  background-color: #355875;
}

.btn-ghost {
  background: none;
  border-color: transparent;
  color: #888;
}

.btn-ghost:hover {
  color: #fff;
  background-color: #1a1a1a;
}

/* ----- Controls ----- */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.controls .search {
  flex: 1 1 240px;
  max-width: 320px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.control-group span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #767676;
}

.checkbox-control {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #aaa;
  cursor: pointer;
}

.checkbox-control input {
  width: 1rem;
  height: 1rem;
  accent-color: #5a9fd4;
  cursor: pointer;
}

.results-count {
  text-align: center;
  font-size: 0.85rem;
  color: #767676;
  margin-bottom: 1.25rem;
}

/* ----- Filter groups (collapsible) ----- */

.filter-panel {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-group {
  border: 1px solid #1f1f1f;
  border-radius: 8px;
  background-color: #111;
  overflow: hidden;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #aaa;
  cursor: pointer;
  user-select: none;
  list-style: none; /* removes default triangle in Firefox */
}

/* Remove default marker in all browsers */
.filter-toggle::-webkit-details-marker { display: none; }
.filter-toggle::marker { display: none; }

.filter-toggle:hover {
  color: #ddd;
}

.filter-arrow {
  margin-left: auto;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid #555;
  border-bottom: 2px solid #555;
  transform: rotate(45deg);
  transition: transform 0.18s;
  flex-shrink: 0;
}

.filter-group[open] .filter-arrow {
  transform: rotate(-135deg);
}

.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.3rem;
  border-radius: 10px;
  background-color: #2d4a63;
  color: #aee0ff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0;
}

.filter-badge[hidden] { display: none; }

.filter-group .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 0.9rem 0.75rem;
}

/* On desktop keep all groups open by default (handled by the `open` attr in HTML).
   On mobile they start closed — JS removes `open` below 640px on load. */

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: #bbb;
  background-color: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.chip:hover {
  border-color: #3a3a3a;
  color: #ddd;
}

.chip input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.chip .check {
  font-size: 0.7rem;
  color: transparent;
  width: 0;
  overflow: hidden;
  transition: width 0.1s;
}

.chip.on {
  background-color: #2d4a63;
  border-color: #4a7396;
  color: #fff;
}

.chip.on .check {
  color: #aee0ff;
  width: 0.8rem;
}

.chip input:focus-visible + .check,
.chip:focus-within {
  outline: 2px solid #5a9fd4;
  outline-offset: 2px;
}

.clear-filters {
  align-self: flex-start;
  font-size: 0.78rem;
  color: #767676;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.2rem 0;
  margin-top: 0.25rem;
}

.btn-locate {
  background-color: #1a2a1a;
  border-color: #2a3a2a;
  color: #7fae6f;
}

.btn-locate:hover {
  background-color: #223222;
  border-color: #3a4a3a;
}

.btn-locate.active {
  background-color: #1e3a1e;
  border-color: #34A853;
  color: #34A853;
}

.distance-tag {
  display: inline-block;
  background-color: #1e3a1e;
  color: #7fae6f;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.1rem 0.5rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ----- Restaurant grid ----- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.card {
  background-color: #111;
  border: 1px solid #1f1f1f;
  border-radius: 10px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.15s;
}

.card.visited {
  border-color: #355875;
}

.card.want {
  border-color: #5a4a7a;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.card-name {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
}

.price {
  font-size: 0.95rem;
  color: #7fae6f;
  font-weight: 600;
  white-space: nowrap;
}

.price .dim {
  color: #3a3a3a;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.badge {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: #bbb;
  background-color: #1c1c1c;
  border: 1px solid #2a2a2a;
  border-radius: 20px;
  padding: 0.2rem 0.65rem;
}

.badge.cuisine {
  color: #d9c08a;
  border-color: #3a3320;
}

.desc {
  font-size: 0.88rem;
  color: #999;
}

.meta {
  font-size: 0.8rem;
  color: #767676;
}

.meta strong {
  color: #aaa;
  font-weight: 600;
}

/* ----- Card links row ----- */

.card-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #ccc;
  text-decoration: none;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  transition: border-color 0.15s, background-color 0.15s;
  white-space: nowrap;
}

.card-link:hover {
  border-color: #3a3a3a;
  background-color: #161616;
}

.card-link--maps .g { font-weight: 700; letter-spacing: -0.02em; }
.card-link--maps .g .b  { color: #4285F4; }
.card-link--maps .g .r  { color: #EA4335; }
.card-link--maps .g .y  { color: #FBBC05; }
.card-link--maps .g .g2 { color: #34A853; }
.card-link--maps .stars       { color: #FBBC05; letter-spacing: 0.05em; }
.card-link--maps .rating-num  { color: #fff; font-weight: 600; }
.card-link--maps .review-count { color: #767676; }
.card-link--maps .ext         { color: #5a9fd4; font-size: 0.75rem; }

/* ----- Dishes section ----- */

.dishes-group {
  border: 1px solid #1f1f1f;
  border-radius: 8px;
  background-color: #0e0e0e;
  overflow: hidden;
}

.dishes-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.dishes-toggle::-webkit-details-marker { display: none; }
.dishes-toggle::marker { display: none; }

.dishes-toggle:hover { color: #ccc; }

.dishes-toggle .filter-arrow {
  margin-left: auto;
}

.dishes-body {
  padding: 0 0.85rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dish-course {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dish-course-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #555;
  font-weight: 700;
}

.dish-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.dish-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.85rem;
  color: #ccc;
  text-decoration: none;
  border-radius: 4px;
  padding: 0.25rem 0.3rem;
  transition: background-color 0.12s;
}

a.dish-item:hover {
  background-color: #1a1a1a;
  color: #fff;
}

.dish-name {
  font-weight: 600;
  color: #e0e0e0;
}

.dish-note {
  font-size: 0.78rem;
  color: #767676;
}


/* ----- User section in card ----- */

.user-block {
  border-top: 1px solid #1f1f1f;
  padding-top: 0.85rem;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.visited-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.visited-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: #aaa;
  cursor: pointer;
  user-select: none;
}

.visited-toggle input {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: #34A853;
  cursor: pointer;
}

.want-toggle input {
  accent-color: #9b7fc8;
}

.rate-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rate-label {
  font-size: 0.8rem;
  color: #888;
}

.my-stars {
  display: inline-flex;
  gap: 0.1rem;
}

.my-stars button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: #3a3a3a;
  padding: 0 0.05rem;
  transition: color 0.1s;
}

.my-stars button.on {
  color: #FBBC05;
}

/* Hover preview fill is handled in JS via the .on class for accuracy. */

.clear-rating {
  font-size: 0.72rem;
  color: #767676;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 0.25rem;
}

.clear-rating:hover {
  color: #aaa;
}

.remarks-field {
  font-size: 0.85rem;
}

.remarks-saved {
  font-size: 0.72rem;
  color: #34A853;
  opacity: 0;
  transition: opacity 0.2s;
}

.remarks-saved.show {
  opacity: 1;
}

.empty {
  text-align: center;
  color: #767676;
  padding: 3rem 1rem;
  font-size: 0.95rem;
}

/* ----- Footer ----- */

.site-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #1a1a1a;
  text-align: center;
  font-size: 0.8rem;
  color: #7e7268;
}

.site-footer a {
  color: #999;
  text-decoration: none;
  border-bottom: 1px solid #595959;
}

.site-footer a:hover {
  color: #fff;
}

.disclaimer {
  font-size: 0.75rem;
  color: #5a5a5a;
  margin-top: 0.6rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

/* ----- Modal ----- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 200;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  background-color: #121212;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 1.5rem;
  width: 100%;
  max-width: 380px;
}

.modal h2 {
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 1rem;
}

.modal label {
  display: block;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.4rem;
}

.modal input {
  width: 100%;
  margin-bottom: 1rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.user-list {
  list-style: none;
  margin: 0 0 1rem;
}

.user-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #1f1f1f;
  font-size: 0.9rem;
  color: #ccc;
}

.user-list .active-tag {
  font-size: 0.7rem;
  color: #34A853;
  margin-left: 0.5rem;
}

@media (max-width: 640px) {
  .logo { font-size: 2rem; letter-spacing: 0.2em; }
  .controls .search { max-width: none; }
  /* Cards must fit a phone screen — allow single column down to 280px */
  .grid { grid-template-columns: 1fr; }
  /* Stack the two checkboxes vertically on small screens */
  .visited-row { flex-direction: column; align-items: flex-start; }
  /* Recommendations and user block are full width — prevent any horizontal overflow */
  .card { word-break: break-word; }
}

.btn-locate {
  background-color: #1a2a1a;
  border-color: #2a3a2a;
  color: #7fae6f;
}

.btn-locate:hover {
  background-color: #223222;
  border-color: #3a4a3a;
}

.btn-locate.active {
  background-color: #1e3a1e;
  border-color: #34A853;
  color: #34A853;
}

.distance-tag {
  display: inline-block;
  background-color: #1e3a1e;
  color: #7fae6f;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.1rem 0.5rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

/* ----- Google auth ----- */

.btn-auth {
  background-color: #1a2436;
  border-color: #2a3a55;
  color: #aecbf0;
}

.btn-auth:hover {
  background-color: #223150;
  border-color: #3a5076;
  color: #fff;
}

.auth-status {
  font-size: 0.8rem;
  color: #7fae6f;
}

.auth-status[hidden] { display: none; }

.sync-status {
  font-size: 0.78rem;
  padding: 0.2rem 0.55rem;
  border-radius: 10px;
}

.sync-status[hidden] { display: none; }

.sync-status[data-type="saving"] { color: #d9c08a; }
.sync-status[data-type="ok"]     { color: #7fae6f; }
.sync-status[data-type="error"]  { color: #e08a8a; background-color: #2a1818; }

/* ----- Legal / long-form pages ----- */

body.legal-page {
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  padding: 2rem 1.5rem;
}

body.legal-page .container {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

body.legal-page .logo {
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

body.legal-page .logo a {
  color: #ffffff;
  text-decoration: none;
}

body.legal-page .logo a:hover { color: #aaa; }

.page-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.page-meta {
  font-size: 0.85rem;
  color: #767676;
  margin-bottom: 2rem;
}

body.legal-page .divider { margin: 0 0 2rem; }

body.legal-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin: 2.5rem 0 1rem;
  letter-spacing: 0.02em;
}

body.legal-page h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #ccc;
  margin: 1.8rem 0 0.8rem;
}

body.legal-page p {
  font-size: 0.95rem;
  color: #aaa;
  line-height: 1.7;
  margin-bottom: 1rem;
}

body.legal-page a {
  color: #aaa;
  text-decoration: none;
  border-bottom: 1px solid #595959;
  transition: color 0.2s;
}

body.legal-page a:hover { color: #fff; }

body.legal-page ul,
body.legal-page ol {
  font-size: 0.95rem;
  color: #aaa;
  line-height: 1.7;
  margin: 0 0 1rem 1.5rem;
}

body.legal-page li { margin-bottom: 0.4rem; }

body.legal-page strong {
  color: #ccc;
  font-weight: 600;
}

body.legal-page code {
  background-color: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 3px;
  padding: 0.1rem 0.4rem;
  font-size: 0.85rem;
  color: #c0c0c0;
}

body.legal-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.85rem;
}

body.legal-page th {
  text-align: left;
  color: #ccc;
  font-weight: 600;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #333;
}

body.legal-page td {
  color: #aaa;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #1a1a1a;
  vertical-align: top;
}

body.legal-page tr:last-child td { border-bottom: none; }

.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: #767676;
  text-decoration: none;
  border-bottom: none;
  margin-bottom: 1.5rem;
}

.back-link:hover { color: #aaa; }

.legal-nav {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #1a1a1a;
}

.legal-nav p {
  font-size: 0.85rem;
  color: #767676;
  margin-bottom: 0.5rem;
}

.legal-nav a { font-size: 0.85rem; line-height: 2; }

body.legal-page .site-footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #1a1a1a;
  text-align: left;
}

/* ----- Hamburger button ----- */

.btn-hamburger {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0.4rem;
  background: none;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
}

.btn-hamburger:hover {
  border-color: #444;
  background-color: #161616;
}

.btn-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #888;
  border-radius: 2px;
  transition: background-color 0.15s;
}

.btn-hamburger:hover span { background-color: #ccc; }

/* Make the header relative so the hamburger can position against it */
.site-header { position: relative; }

/* ----- Settings panel (left slide-in) ----- */

.settings-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0,0,0,0.55);
  z-index: 300;
  transition: opacity 0.2s;
}

.settings-backdrop[hidden] { display: none; }

.settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: min(300px, 88vw);
  background-color: #111;
  border-right: 1px solid #1f1f1f;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 301;
  padding: 0 0 2rem;
  box-shadow: 4px 0 24px rgba(0,0,0,0.5);
}

.settings-panel[hidden] { display: none; }

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.85rem;
  border-bottom: 1px solid #1f1f1f;
  position: sticky;
  top: 0;
  background-color: #111;
  z-index: 1;
}

.settings-header h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #bbb;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.settings-close {
  font-size: 1rem;
  color: #555;
  padding: 0.2rem 0.5rem;
  line-height: 1;
}

.settings-close:hover { color: #ccc; }

.settings-section {
  padding: 1rem 1rem 0;
  border-bottom: 1px solid #1a1a1a;
  padding-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.settings-section:last-child { border-bottom: none; }

.settings-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #444;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.settings-row label {
  font-size: 0.88rem;
  color: #aaa;
  flex-shrink: 0;
}

.settings-row select {
  flex: 1;
  max-width: 150px;
  font-size: 0.85rem;
}

.settings-auth-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 1rem;
}

.settings-note {
  font-size: 0.78rem;
  color: #484848;
  line-height: 1.5;
  margin: 0;
}

.settings-note a {
  color: #666;
  text-decoration: none;
  border-bottom: 1px solid #3a3a3a;
}

.settings-note a:hover { color: #aaa; }

/* ----- RTL support ----- */

[dir="rtl"] .btn-hamburger {
  left: auto;
  right: 1.25rem;
}

[dir="rtl"] .settings-panel {
  left: auto;
  right: 0;
  border-right: none;
  border-left: 1px solid #1f1f1f;
  box-shadow: -4px 0 24px rgba(0,0,0,0.5);
}

[dir="rtl"] .filter-arrow {
  margin-left: 0;
  margin-right: auto;
}

[dir="rtl"] .card-head {
  flex-direction: row-reverse;
}

[dir="rtl"] .card-links {
  flex-direction: row-reverse;
}

[dir="rtl"] .visited-row {
  flex-direction: row-reverse;
  justify-content: flex-end;
}

[dir="rtl"] .rate-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .filter-toggle {
  direction: rtl;
  text-align: right;
}

[dir="rtl"] .filter-group .chips {
  direction: rtl;
}

[dir="rtl"] .filter-badge {
  margin-right: 0;
  margin-left: 0.25rem;
}

[dir="rtl"] .settings-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .user-bar-row,
[dir="rtl"] .user-bar-auth {
  flex-direction: row-reverse;
}

[dir="rtl"] .chip {
  flex-direction: row-reverse;
}

[dir="rtl"] .dish-item {
  text-align: right;
}

[dir="rtl"] .card-link--maps {
  flex-direction: row-reverse;
}

[dir="rtl"] .my-stars {
  flex-direction: row-reverse;
}

[dir="rtl"] .clear-rating {
  margin-left: 0;
  margin-right: 0.25rem;
}

[dir="rtl"] textarea {
  text-align: right;
}

/* ----- Map view ----- */

.btn-map {
  background-color: #1a1a2e;
  border-color: #2a2a4a;
  color: #8a8ac8;
}

.btn-map:hover {
  background-color: #222240;
  border-color: #3a3a6a;
  color: #b0b0e0;
}

.btn-map.active {
  background-color: #2d2d63;
  border-color: #4a4a9a;
  color: #c0c0ff;
}

.map-container {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1f1f1f;
  margin-bottom: 1.25rem;
}

.map-canvas {
  width: 100%;
  height: 480px;
  background-color: #111;
}

@media (max-width: 640px) {
  .map-canvas { height: 340px; }
}

/* Leaflet popup custom styling to match the dark theme */
.map-popup-wrapper .leaflet-popup-content-wrapper {
  background-color: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  color: #e0e0e0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.6);
  padding: 0;
}

.map-popup-wrapper .leaflet-popup-content {
  margin: 0;
  padding: 0;
  /* Allow scrolling for hotels with many restaurants */
  max-height: 300px;
  overflow-y: auto;
}

.map-popup-wrapper .leaflet-popup-tip {
  background-color: #161616;
}

.map-popup-wrapper .leaflet-popup-close-button {
  color: #666;
  font-size: 1rem;
  padding: 4px 6px;
  top: 4px;
  right: 4px;
}

.map-popup-wrapper .leaflet-popup-close-button:hover {
  color: #ccc;
  background: none;
}

.map-popup {
  padding: 0.5rem 0;
  min-width: 200px;
}

.map-popup-hotel {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  padding: 0 0.9rem 0.4rem;
  border-bottom: 1px solid #1f1f1f;
  margin-bottom: 0.3rem;
}

.map-popup-row {
  padding: 0.4rem 0.9rem;
  border-bottom: 1px solid #1a1a1a;
}

.map-popup-row:last-child {
  border-bottom: none;
}

.map-popup-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #e0e0e0;
  text-decoration: none;
  margin-bottom: 0.15rem;
  transition: color 0.12s;
}

.map-popup-name:hover {
  color: #5a9fd4;
}

.map-popup-meta {
  font-size: 0.72rem;
  color: #666;
}

/* Leaflet attribution text */
.leaflet-control-attribution {
  background: rgba(0,0,0,0.55) !important;
  color: #888 !important;
  font-size: 0.65rem !important;
}

.leaflet-control-attribution a {
  color: #aaa !important;
}
