/* Current place (shown when only one place is open) */
.loc-badge { margin: 0; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 1.05rem; }
.loc-sub { color: var(--muted); }

/* Header actions, language picker, Join / Log in dialog (phone-first) */
.topbar-right { display: flex; align-items: center; gap: 8px; }
.actions { display: flex; align-items: center; gap: 6px; }
.actions[hidden] { display: none; }

.link-btn {
  background: none; border: 0; color: var(--black); font: inherit; font-weight: 700; cursor: pointer;
  text-decoration: underline; min-height: 40px; padding: 4px 4px;
}
.link-btn.dark { color: var(--ink); }
.pill-btn {
  background: var(--black); color: var(--yellow); border: 0; border-radius: 999px;
  min-height: 40px; padding: 6px 14px; font: inherit; font-weight: 800; cursor: pointer;
}
.pill-btn:hover { filter: brightness(1.3); }
.link-btn:focus-visible, .pill-btn:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }

#lang-btn {
  display: flex; align-items: center; gap: 5px; cursor: pointer; min-height: 40px;
  background: rgba(0,0,0,.06); border: 2px solid var(--black);
  border-radius: 10px; padding: 4px 9px; color: var(--black); font: inherit; font-weight: 800; font-size: .9rem;
}
#lang-btn:hover, #lang-btn:focus-visible { background: rgba(0,0,0,.14); outline: none; }
#lang-btn .caret { display: none; font-size: .65rem; opacity: .85; }
@media (min-width: 430px) { #lang-btn .caret { display: inline; } }

/* On a phone the list is a panel across the width of the screen */
#lang-panel {
  position: fixed; left: 10px; right: 10px; top: calc(env(safe-area-inset-top) + 58px); z-index: 50;
  max-height: calc(100vh - 90px); max-height: calc(100dvh - 90px);
  display: flex; flex-direction: column;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(0,0,0,.28);
}
#lang-panel[hidden] { display: none; }
#lang-search {
  margin: 10px; padding: 11px 14px; min-height: var(--tap); font: inherit;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink);
}
#lang-list { list-style: none; margin: 0; padding: 0 6px 10px; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
#lang-list li[hidden] { display: none; }
#lang-list button {
  display: block; width: 100%; min-height: var(--tap);
  background: none; border: 0; color: inherit; font: inherit; text-align: start;
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
}
#lang-list button:hover, #lang-list button:focus-visible, #lang-list button:active { background: var(--bg); outline: none; }
#lang-list button[aria-current="true"] { font-weight: 800; background: var(--yellow); color: var(--black); }

/* Join / Log in dialog */
#auth-dialog {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px;
  width: min(420px, calc(100vw - 24px)); background: var(--card); color: var(--ink);
}
#auth-dialog::backdrop { background: rgba(0,0,0,.55); }
#auth-dialog h2 { margin: 0 0 14px; font-size: 1.3rem; }
#auth-dialog label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .95rem; }
#auth-dialog label[hidden], #auth-dialog .hint[hidden] { display: none; }
#auth-dialog input {
  display: block; width: 100%; min-height: var(--tap); margin-top: 4px; padding: 10px 14px;
  font: inherit; font-weight: 400;   /* 16px keeps iOS from zooming in */
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink);
}
#auth-dialog input:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.hint { margin: -4px 0 12px; color: var(--muted); font-size: .85rem; }
.error { min-height: 1.3em; margin: 0 0 8px; color: #c0392b; font-size: .92rem; }
@media (prefers-color-scheme: dark) { .error { color: #ff8a7a; } }
.dialog-actions { display: flex; gap: 10px; }
.dialog-actions .btn { flex: 1; min-width: 0; cursor: pointer; font: inherit; font-weight: 700; }
.dialog-actions .btn:disabled { opacity: .6; cursor: wait; }
.switch { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: .92rem; }

/* Hide Google's own toolbar and widget UI; we use our own picker */
#google_translate_element { display: none; }
.goog-te-banner-frame, .skiptranslate iframe, iframe.skiptranslate { display: none !important; }
body { top: 0 !important; }
.goog-tooltip, .goog-tooltip:hover { display: none !important; }
.goog-text-highlight { background: none !important; box-shadow: none !important; }
font[style] { background: none !important; box-shadow: none !important; }

/* Desktop: the language list drops down under the button instead of spanning the screen */
@media (min-width: 600px) {
  .topbar-right { position: relative; gap: 12px; }
  #lang-panel {
    position: absolute; left: auto; right: 0; top: calc(100% + 10px);
    width: 300px; max-height: 70vh;
  }
  [dir="rtl"] #lang-panel { right: auto; left: 0; }
  .dialog-actions { justify-content: flex-end; }
  .dialog-actions .btn { flex: 0 0 auto; min-width: 120px; }
}

@media (max-width: 379px) {
  .topbar-right { gap: 4px; }
  .actions { gap: 2px; }
  .pill-btn { padding: 6px 12px; }
  #lang-btn { padding: 4px 7px; gap: 4px; }
}

/* email confirmation messages inside the Join / Log in dialog */
.auth-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; background: var(--bg); border-left: 5px solid var(--yellow); }
.auth-note[hidden], .auth-resend[hidden] { display: none; }
.auth-resend { margin: 0 0 12px; }
.auth-resend button:disabled { opacity: .5; }
