@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Nunito:wght@400;600;700&display=swap');

:root {
  --bg0: #eef4ff;
  --bg1: #f7eef8;
  --bg2: #e8faf4;
  --ink: #243044;
  --muted: #5d6b82;
  --card: rgba(255, 255, 255, 0.55);
  --stroke: rgba(255, 255, 255, 0.65);
  --accent: #7c8cff;
  --accent-2: #57c5b6;
  --rose: #e8a0bf;
  --danger: #d4546a;
  --shadow: 0 20px 60px rgba(70, 90, 140, 0.14);
  --radius: 22px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Nunito', system-ui, sans-serif;
  --app-vh: 100dvh;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --nav-h: 3.65rem;
  --tap: 44px;
  --shell-pad: max(0.75rem, var(--safe-l));
  --shell-pad-r: max(0.75rem, var(--safe-r));
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
}

html, body { margin: 0; min-height: 100%; }

html.app-noscroll,
body.app-noscroll {
  height: 100%;
  height: var(--app-vh, 100dvh);
  max-height: var(--app-vh, 100dvh);
  overflow: hidden;
  overscroll-behavior: none;
}

body.app-noscroll {
  position: fixed;
  inset: 0;
  width: 100%;
  touch-action: manipulation;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 10% -10%, #dfe7ff 0%, transparent 55%),
    radial-gradient(900px 600px at 100% 0%, #f6d9ea 0%, transparent 50%),
    radial-gradient(800px 500px at 50% 100%, #d8f5ef 0%, transparent 55%),
    linear-gradient(160deg, var(--bg0), var(--bg1) 45%, var(--bg2));
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

@supports not (height: 100dvh) {
  :root { --app-vh: 100vh; }
  html.app-noscroll,
  body.app-noscroll {
    height: 100vh;
    max-height: 100vh;
  }
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.35) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.25) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 80%, rgba(124,140,255,.18) 0 1.5px, transparent 2px);
  background-size: 180px 180px, 140px 140px, 220px 220px;
  animation: drift 40s linear infinite;
  opacity: .7;
  z-index: 0;
}

@media (prefers-reduced-motion: reduce) {
  body::before { animation: none; }
  * { scroll-behavior: auto !important; }
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-80px); }
}

#app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

body.app-noscroll #app {
  height: 100%;
  height: var(--app-vh, 100dvh);
  max-height: var(--app-vh, 100dvh);
  min-height: 0 !important;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.shell {
  width: min(1100px, calc(100% - var(--shell-pad) - var(--shell-pad-r)));
  margin: 0 auto;
  padding-left: 0;
  padding-right: 0;
}

.glass {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* —— Landing —— */
.landing {
  padding: max(1.25rem, var(--safe-t)) 0 max(2.5rem, calc(1.5rem + var(--safe-b)));
}
.hero-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .9rem;
  margin: 0 0 1.2rem;
}
.logo-swiss-chat {
  display: flex;
  align-items: center;
  gap: .9rem;
  text-decoration: none;
  color: inherit;
}
.logo-swiss-chat img {
  width: clamp(64px, 14vw, 96px);
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 12px 28px rgba(70, 90, 140, .18));
}
.logo-swiss-chat .wordmark {
  display: flex;
  flex-direction: column;
  line-height: .95;
}
.logo-swiss-chat .wordmark .swiss {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6.5vw, 3.55rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.logo-swiss-chat .wordmark .chat {
  font-family: var(--font-body);
  font-size: clamp(1.55rem, 5vw, 2.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  margin-top: .05rem;
}
.logo-lindic-byline {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  opacity: .9;
  margin-left: .15rem;
  min-height: var(--tap);
  transition: opacity .2s ease, transform .2s ease;
}
@media (hover: hover) and (pointer: fine) {
  .logo-lindic-byline:hover {
    opacity: 1;
    transform: translateY(-1px);
  }
}
.logo-lindic-byline img {
  display: block;
  height: clamp(30px, 7vw, 48px);
  width: auto;
}
.tagline {
  color: var(--muted);
  font-size: clamp(1rem, 2.6vw, 1.1rem);
  margin: 0 0 1.5rem;
  max-width: 34rem;
  line-height: 1.45;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 1.5rem;
  align-items: stretch;
}
.hero-grid > .hero-info,
.hero-grid > .hero-auth {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
}
.hero-grid > .hero-auth .btn-row {
  margin-top: auto;
  padding-top: 1rem;
}
@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; gap: 1.1rem; }
  .hero-grid > .hero-auth .btn-row {
    margin-top: 1rem;
    padding-top: 0;
  }
}

.panel { padding: clamp(1rem, 2.5vw, 1.35rem); }
.panel h2, .panel h3 {
  font-family: var(--font-display);
  margin: 0 0 .75rem;
  letter-spacing: -0.02em;
}
label {
  display: block;
  font-size: .85rem;
  color: var(--muted);
  margin: .65rem 0 .25rem;
}
input, select, textarea, button {
  font: inherit;
  color: inherit;
}
input, select, textarea {
  width: 100%;
  border: 1px solid rgba(90, 110, 150, .22);
  background: rgba(255,255,255,.8);
  border-radius: 14px;
  padding: .75rem .9rem;
  min-height: var(--tap);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 3px), calc(100% - 12px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}
.reg-blocked {
  padding: .25rem 0 .5rem;
}
.tabs button:disabled {
  opacity: .45;
  cursor: not-allowed;
}
textarea { min-height: 90px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border: 0;
  border-radius: 999px;
  padding: .75rem 1.2rem;
  min-height: var(--tap);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #9aa6ff);
  color: #fff;
  box-shadow: 0 10px 24px rgba(124, 140, 255, .35);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(1.05); }
}
.btn:active { transform: scale(0.98); }
.btn.secondary {
  background: rgba(255,255,255,.7);
  color: var(--ink);
  box-shadow: none;
  border: 1px solid rgba(90,110,150,.18);
}
.btn.danger {
  background: linear-gradient(135deg, #e06b7e, var(--danger));
  box-shadow: 0 10px 24px rgba(212,84,106,.28);
}
.btn.ghost {
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  margin-top: 1rem;
}
.err { color: var(--danger); font-size: .9rem; margin: .5rem 0 0; }
.ok { color: #2a9b7a; font-size: .9rem; margin: .5rem 0 0; }
.hint { color: var(--muted); font-size: .85rem; margin: .4rem 0 0; }

.place-results {
  list-style: none;
  margin: .4rem 0 0;
  padding: 0;
  max-height: min(40dvh, 220px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border-radius: 14px;
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(90,110,150,.15);
}
.place-results li {
  padding: .7rem .85rem;
  min-height: var(--tap);
  cursor: pointer;
  border-bottom: 1px solid rgba(90,110,150,.08);
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  .place-results li:hover, .place-results li.active { background: rgba(124,140,255,.12); }
}
.place-results li:active, .place-results li.active { background: rgba(124,140,255,.12); }
.place-results .meta { color: var(--muted); font-size: .8rem; }

.scope-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .5rem 0 0;
}
.scope-pills button {
  border: 1px solid rgba(90,110,150,.2);
  background: rgba(255,255,255,.65);
  border-radius: 999px;
  padding: .55rem 1rem;
  min-height: var(--tap);
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  touch-action: manipulation;
  flex: 1 1 auto;
  text-align: center;
}
.scope-pills button.active {
  background: rgba(124,140,255,.2);
  border-color: var(--accent);
  font-weight: 700;
}

.tabs { display: flex; gap: .4rem; margin-bottom: 1rem; }
.tabs button {
  flex: 1;
  border: 0;
  background: rgba(255,255,255,.5);
  border-radius: 999px;
  padding: .6rem .9rem;
  min-height: var(--tap);
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
.tabs button.active { background: rgba(124,140,255,.2); font-weight: 700; }
.tabs.tabs-3 button { font-size: .92rem; padding: .55rem .45rem; }

.guest-badge {
  display: inline-block;
  margin-left: .35rem;
  padding: .12rem .45rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
  vertical-align: middle;
  color: #5a3d12;
  background: #f5d27a;
  border: 1px solid rgba(180, 130, 40, .35);
}
.user-chip .guest-badge { display: block; margin: .25rem 0 0; width: fit-content; }
.msg .guest-badge { margin-left: .4rem; font-size: .68rem; }
.guest-geo {
  margin: .65rem 0;
  padding: .65rem .75rem;
  border-radius: 12px;
  background: rgba(90, 140, 90, .08);
  border: 1px solid rgba(90, 140, 90, .2);
  font-size: .92rem;
}
.guest-geo.warn {
  background: rgba(190, 90, 60, .08);
  border-color: rgba(190, 90, 60, .28);
}
.guest-geo p { margin: .2rem 0; }

.msg-report {
  margin-left: .45rem;
  border: 0;
  background: transparent;
  color: var(--muted, #667089);
  font: inherit;
  font-size: .75rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}
.msg.mine .msg-report { display: none; }
@media (hover: hover) and (pointer: fine) {
  .msg-report:hover { color: #b04545; }
}

.moderation-gate h2 { margin-top: .35rem; }
.moderation-gate .mod-lead { font-weight: 600; }
.mod-strike-pill {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  background: rgba(190, 90, 60, .15);
  color: #8a3a22;
  margin: 0 0 .5rem;
}
.mod-accusations {
  margin: .75rem 0 1.25rem;
  padding-left: 1.2rem;
}
.mod-accusations li { margin: .55rem 0; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(20, 28, 45, .45);
  backdrop-filter: blur(2px);
}
.modal-card {
  width: min(420px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
}

.nick-suggestions {
  margin: .35rem 0 .85rem;
  padding: .65rem .75rem;
  border-radius: 12px;
  background: rgba(190, 140, 60, .08);
  border: 1px solid rgba(190, 140, 60, .25);
}
.nick-suggestions .hint { margin: 0 0 .45rem; }
.nick-suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.nick-chip {
  border: 1px solid rgba(90, 110, 150, .28);
  background: rgba(255, 255, 255, .75);
  border-radius: 999px;
  padding: .35rem .75rem;
  font: inherit;
  font-size: .9rem;
  cursor: pointer;
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  .nick-chip:hover {
    border-color: var(--accent, #5a6bb8);
    background: rgba(124, 140, 255, .12);
  }
}
.soft-rule {
  border: 0;
  border-top: 1px solid rgba(90,110,150,.12);
  margin: 1.25rem 0;
}
.empty { color: var(--muted); padding: 1rem 0; }

/* —— App shell (logged in) —— */
.app-root {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding:
    max(0.5rem, var(--safe-t))
    var(--shell-pad-r)
    0
    var(--shell-pad);
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 0.85rem;
  flex: 1;
  min-height: 0;
  padding-bottom: 0.75rem;
}

.app-shell > main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.side {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  align-self: start;
  max-height: 100%;
}
.side .nav {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.side .nav button {
  text-align: left;
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: .7rem .85rem;
  min-height: var(--tap);
  font: inherit;
  cursor: pointer;
  color: var(--ink);
  touch-action: manipulation;
}
.side .nav button.active { background: rgba(124,140,255,.15); font-weight: 700; }
@media (hover: hover) and (pointer: fine) {
  .side .nav button:hover { background: rgba(124,140,255,.15); }
}

.user-chip {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-bottom: .85rem;
}
.avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

/* Bottom tab bar — phones & narrow tablets */
.bottom-nav {
  display: none;
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin: 0 calc(-1 * var(--shell-pad)) 0 calc(-1 * var(--shell-pad-r));
  padding:
    0.35rem max(0.5rem, var(--safe-l))
    max(0.35rem, var(--safe-b))
    max(0.5rem, var(--safe-r));
  background: rgba(255, 255, 255, 0.82);
  border-top: 1px solid rgba(90, 110, 150, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -8px 28px rgba(70, 90, 140, 0.08);
}
.bottom-nav .nav-inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.15rem;
  max-width: 560px;
  margin: 0 auto;
}
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: var(--nav-h);
  border: 0;
  background: transparent;
  border-radius: 14px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
  padding: 0.35rem 0.25rem;
}
.bottom-nav button .nav-ico {
  font-size: 1.2rem;
  line-height: 1;
}
.bottom-nav button.active {
  color: var(--accent);
  background: rgba(124, 140, 255, 0.12);
}
.bottom-nav .logout-inline {
  display: none;
}

/* —— Chat —— */
.chat-frame {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}
.chat-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  padding: .75rem .9rem;
  border-bottom: 1px solid rgba(90,110,150,.12);
  flex-shrink: 0;
}
.chat-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 3.2vw, 1.25rem);
  line-height: 1.2;
}
.chat-status { font-size: .82rem; color: var(--muted); }
.chat-status.online { color: #2a9b7a; }
.chat-head .scope-pills {
  margin: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}
.chat-head .scope-pills button {
  flex: 0 1 auto;
  min-height: 2.5rem;
  padding: .4rem .75rem;
  font-size: .9rem;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: .85rem .9rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.msg {
  max-width: min(88%, 520px);
  padding: .65rem .85rem;
  border-radius: 16px;
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(90,110,150,.1);
  align-self: flex-start;
}
.msg.mine {
  align-self: flex-end;
  background: rgba(124,140,255,.18);
}
.msg .who { font-weight: 700; font-size: .85rem; margin-bottom: .15rem; }
.msg .when { color: var(--muted); font-size: .75rem; margin-left: .4rem; font-weight: 400; }
.msg .body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: .5rem;
  padding: .65rem .75rem max(.65rem, calc(.25rem + var(--safe-b)));
  border-top: 1px solid rgba(90,110,150,.12);
  flex-shrink: 0;
  background: rgba(255,255,255,.35);
}
.composer textarea,
.composer input {
  flex: 1;
  min-width: 0;
  min-height: var(--tap);
  max-height: 8rem;
  resize: none;
  line-height: 1.35;
  padding: .7rem .85rem;
  field-sizing: content;
}
.composer .btn {
  flex-shrink: 0;
  min-width: var(--tap);
  padding-left: 1rem;
  padding-right: 1rem;
}

.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.list-people { list-style: none; margin: 0; padding: 0; }
.list-people li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid rgba(90,110,150,.1);
  flex-wrap: wrap;
}
.list-people .info { display: flex; align-items: center; gap: .6rem; min-width: 0; flex: 1 1 12rem; }
.list-people .actions { display: flex; flex-wrap: wrap; gap: .35rem; }
.footer-mini {
  text-align: center;
  color: var(--muted);
  font-size: .8rem;
  padding: 1rem 0 max(1.5rem, var(--safe-b));
}
.footer-mini a { color: var(--accent, #5a6bb8); text-decoration: underline; text-underline-offset: 2px; }
.auth-subhead {
  margin: 0 0 .85rem;
  font-size: 1.1rem;
}
.verify-gate h2 { margin: 0 0 .5rem; }
.verify-gate p { margin: .55rem 0; line-height: 1.45; }

.profile-notice {
  margin: 0 0 1.1rem;
  padding: .85rem 1rem;
  border-radius: 14px;
  background: rgba(124, 140, 255, 0.1);
  border: 1px solid rgba(124, 140, 255, 0.22);
  font-size: .92rem;
  line-height: 1.45;
}
.profile-notice p { margin: .35rem 0; }
.profile-notice a { color: var(--accent, #5a6bb8); }
.profile-section-title {
  margin: 1.25rem 0 .65rem;
  font-size: 1.05rem;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .75rem;
}
.profile-form label .opt,
.profile-form label .req {
  font-weight: 500;
  font-size: .78rem;
  margin-left: .25rem;
}
.profile-form label .opt { color: var(--muted, #667089); }
.profile-form label .req { color: #c04545; }
.avatar-preview {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin: .35rem 0 1rem;
}
.auth-links {
  margin: .65rem 0 0;
  text-align: center;
}
button.linkish {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--accent, #5a6bb8);
  font: inherit;
  font-size: .9rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
button.linkish:hover { opacity: .85; }
.check-legal {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  margin: .85rem 0 .35rem;
  font-size: .88rem;
  line-height: 1.45;
  color: var(--ink);
  cursor: pointer;
}
.check-legal input {
  margin-top: .2rem;
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
}
.check-legal a { color: var(--accent, #5a6bb8); }
.legal-inline { margin: 1rem 0 0; }
.legal-inline a { color: var(--accent, #5a6bb8); }

/* AGB / legal document page */
body.legal-page {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124,140,255,.22), transparent 55%),
    radial-gradient(900px 500px at 90% 0%, rgba(87,197,182,.18), transparent 50%),
    linear-gradient(180deg, #eef1fb 0%, #f7f8fc 40%, #eef2f8 100%);
  color: var(--ink, #1c2438);
}
.legal-shell {
  width: min(820px, calc(100% - 1.5rem));
  margin: 0 auto;
  padding: 1.25rem 0 max(2.5rem, env(safe-area-inset-bottom));
}
.legal-nav { margin: 0 0 1rem; font-size: .95rem; }
.legal-nav a { color: var(--accent, #5a6bb8); font-weight: 600; text-decoration: none; }
.legal-doc {
  background: rgba(255,255,255,.72);
  border: 1px solid rgba(90,110,150,.14);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(60,75,120,.1);
  backdrop-filter: blur(12px);
  padding: 1.5rem 1.35rem 2rem;
}
.legal-header { margin-bottom: 1.25rem; }
.legal-kicker {
  margin: 0 0 .35rem;
  font-size: .8rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted, #667089);
}
.legal-doc h1 {
  margin: 0 0 .5rem;
  font-size: clamp(1.55rem, 4vw, 2rem);
  line-height: 1.2;
}
.legal-meta { margin: 0; color: var(--muted, #667089); font-size: .88rem; }
.legal-lead {
  margin: 1rem 0 1.25rem;
  padding: .9rem 1rem;
  border-radius: 14px;
  background: rgba(124,140,255,.1);
  border: 1px solid rgba(124,140,255,.22);
  line-height: 1.5;
}
.legal-toc {
  margin: 0 0 1.5rem;
  padding: 1rem 1rem 1rem 1.25rem;
  border-radius: 14px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(90,110,150,.12);
}
.legal-toc ol { margin: 0; padding-left: 1.1rem; }
.legal-toc li { margin: .35rem 0; }
.legal-toc a { color: var(--accent, #5a6bb8); text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }
.legal-section { margin: 1.5rem 0 0; scroll-margin-top: 1rem; }
.legal-section h2 {
  margin: 0 0 .65rem;
  font-size: 1.15rem;
  line-height: 1.3;
}
.legal-section p,
.legal-section li {
  line-height: 1.55;
  font-size: .95rem;
}
.legal-section ul { padding-left: 1.2rem; margin: .5rem 0 1rem; }
.legal-section li { margin: .35rem 0; }
@media (min-width: 720px) {
  .legal-doc { padding: 2rem 2.25rem 2.5rem; }
}

.install-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin: 0 0 1rem;
  padding: .75rem 1rem;
  border-radius: 16px;
  background: rgba(124, 140, 255, 0.14);
  border: 1px solid rgba(124, 140, 255, 0.28);
}
.install-banner.show { display: flex; flex-wrap: wrap; }
.install-banner p { margin: 0; flex: 1 1 12rem; font-size: .92rem; color: var(--ink); }
.install-banner .btn-row { margin: 0; }

/* SEO landings */
.seo-land {
  width: min(1100px, calc(100% - var(--shell-pad) - var(--shell-pad-r)));
  margin: 0 auto max(2rem, var(--safe-b));
  padding: 1.5rem 1.25rem 2rem;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(90,110,150,.12);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}
.seo-land h1 {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 3.5vw, 1.9rem);
  letter-spacing: -0.02em;
  margin: .35rem 0 .75rem;
}
.seo-land h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 1.35rem 0 .55rem;
}
.seo-land p, .seo-intro {
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 .75rem;
}
.seo-crumb {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .35rem;
}
.seo-crumb a { color: var(--accent); text-decoration: none; font-weight: 700; }
@media (hover: hover) and (pointer: fine) {
  .seo-crumb a:hover { text-decoration: underline; }
}
.seo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .55rem;
}
.seo-list li a {
  display: inline-block;
  padding: .45rem .75rem;
  min-height: 2.4rem;
  border-radius: 999px;
  background: rgba(124,140,255,.12);
  border: 1px solid rgba(124,140,255,.22);
  color: var(--ink);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  touch-action: manipulation;
}
body.app-noscroll .seo-land { display: none; }
.seo-steps {
  margin: .4rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
  line-height: 1.5;
}

/* —— Responsive: phone / tablet portrait —— */
@media (max-width: 860px) {
  .app-root {
    padding-bottom: 0;
  }
  .app-shell {
    grid-template-columns: 1fr;
    padding-bottom: 0;
    gap: 0;
  }
  .app-shell > .side {
    display: none;
  }
  .bottom-nav {
    display: block;
  }
  .chat-frame,
  .panel-scroll.glass,
  main > .glass {
    border-radius: 18px;
  }
  .chat-head {
    padding: .65rem .75rem;
  }
  .chat-head .scope-pills {
    width: 100%;
    justify-content: stretch;
  }
  .chat-head .scope-pills button {
    flex: 1 1 0;
  }
  .composer {
    /* Bottom nav already has safe-area; avoid double padding when bar visible */
    padding-bottom: .55rem;
  }
  .list-people li {
    align-items: flex-start;
  }
  .list-people .actions {
    width: 100%;
  }
  .list-people .actions .btn {
    flex: 1 1 auto;
  }
}

/* Narrow phones */
@media (max-width: 420px) {
  :root {
    --radius: 18px;
    --shell-pad: max(0.55rem, var(--safe-l));
    --shell-pad-r: max(0.55rem, var(--safe-r));
  }
  .logo-swiss-chat { gap: .65rem; }
  .panel { padding: .9rem; }
  .msg { max-width: 92%; }
  .bottom-nav button { font-size: 0.68rem; }
}

/* Tablet landscape / mid desktop: keep side nav */
@media (min-width: 861px) and (max-width: 1100px) {
  .app-shell { grid-template-columns: 210px minmax(0, 1fr); }
}

/* Landscape phones — compact chrome, max chat space */
@media (max-height: 520px) and (orientation: landscape) {
  .landing { padding-top: max(0.5rem, var(--safe-t)); }
  .hero-brand { margin-bottom: .6rem; gap: .45rem; }
  .logo-swiss-chat img { width: 52px; }
  .logo-swiss-chat .wordmark .swiss { font-size: 1.6rem; }
  .logo-swiss-chat .wordmark .chat { font-size: 1.25rem; }
  .tagline { margin-bottom: .75rem; font-size: .95rem; }

  .chat-head {
    padding: .4rem .65rem;
    gap: .35rem;
  }
  .chat-head h2 { font-size: 1rem; }
  .chat-head .scope-pills button {
    min-height: 2.15rem;
    padding: .3rem .55rem;
    font-size: .82rem;
  }
  .messages { padding: .55rem .65rem; gap: .45rem; }
  .msg { padding: .45rem .65rem; }
  .composer {
    padding: .4rem .55rem;
  }
  .composer textarea,
  .composer input {
    min-height: 2.35rem;
    max-height: 4.5rem;
    padding: .45rem .7rem;
  }
  .bottom-nav {
    padding-top: 0.15rem;
    padding-bottom: max(0.15rem, var(--safe-b));
  }
  .bottom-nav button {
    min-height: 2.75rem;
    flex-direction: row;
    gap: .35rem;
    font-size: .75rem;
  }
  .bottom-nav button .nav-ico { font-size: 1rem; }
  :root { --nav-h: 2.75rem; }
}

/* Short portrait (small phones) */
@media (max-height: 700px) and (orientation: portrait) and (max-width: 860px) {
  .chat-head h2 { font-size: 1.05rem; }
  .messages { padding: .7rem .75rem; }
}

/* PWA standalone: slightly tighter top chrome */
@media (display-mode: standalone), (display-mode: fullscreen) {
  .app-root {
    padding-top: max(0.35rem, var(--safe-t));
  }
  .landing {
    padding-top: max(1rem, var(--safe-t));
  }
}

/* Hover-capable: no sticky bottom nav feel needed changes */
@media (hover: hover) and (pointer: fine) and (min-width: 861px) {
  .bottom-nav { display: none !important; }
}

/* —— Smileys / Composer —— */
.composer-wrap { display: flex; flex-direction: column; flex-shrink: 0; }
.composer-tools { display: flex; gap: .35rem; align-items: center; }
.composer-icon {
  flex-shrink: 0;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: 12px;
  background: rgba(255,255,255,.55);
  font-size: 1.25rem;
  cursor: pointer;
  touch-action: manipulation;
}
.smiley-picker {
  border-top: 1px solid rgba(90,110,150,.12);
  background: rgba(255,255,255,.55);
  max-height: 220px;
  display: flex;
  flex-direction: column;
}
.smiley-picker[hidden] { display: none !important; }
.smiley-tabs {
  display: flex;
  gap: .25rem;
  overflow-x: auto;
  padding: .4rem .5rem 0;
  flex-shrink: 0;
}
.smiley-tab {
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: .3rem .65rem;
  font: inherit;
  font-size: .78rem;
  white-space: nowrap;
  cursor: pointer;
  color: var(--muted);
}
.smiley-tab.active { background: rgba(124,140,255,.18); color: var(--ink); font-weight: 700; }
.smiley-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(2.4rem, 1fr));
  gap: .2rem;
  padding: .45rem .5rem .65rem;
  overflow: auto;
  flex: 1;
}
.smiley-item {
  border: 0;
  background: transparent;
  border-radius: 10px;
  font-size: 1.45rem;
  line-height: 1;
  padding: .25rem;
  cursor: pointer;
  touch-action: manipulation;
}
@media (hover: hover) and (pointer: fine) {
  .smiley-item:hover { background: rgba(124,140,255,.12); }
}
.sticker-face { display: inline-block; }
.anim-bounce .sticker-face { animation: sm-bounce 1.1s ease-in-out infinite; }
.anim-spin .sticker-face { animation: sm-spin 2.2s linear infinite; }
.anim-pulse .sticker-face { animation: sm-pulse 1.2s ease-in-out infinite; }
.anim-shake .sticker-face { animation: sm-shake .55s ease-in-out infinite; }
.anim-wiggle .sticker-face { animation: sm-wiggle .8s ease-in-out infinite; }
.anim-float .sticker-face { animation: sm-float 1.6s ease-in-out infinite; }
.anim-pop .sticker-face { animation: sm-pop 1.1s ease-in-out infinite; }
.anim-blink .sticker-face { animation: sm-blink 1.8s step-end infinite; }
@keyframes sm-bounce { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-6px)} }
@keyframes sm-spin { to { transform: rotate(360deg); } }
@keyframes sm-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.18)} }
@keyframes sm-shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-3px)} 75%{transform:translateX(3px)} }
@keyframes sm-wiggle { 0%,100%{transform:rotate(0)} 25%{transform:rotate(-8deg)} 75%{transform:rotate(8deg)} }
@keyframes sm-float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-5px) scale(1.05)} }
@keyframes sm-pop { 0%,100%{transform:scale(1)} 40%{transform:scale(1.25)} 60%{transform:scale(.95)} }
@keyframes sm-blink { 0%,90%,100%{opacity:1} 95%{opacity:.15} }
.msg-sticker {
  display: inline-flex;
  font-size: 2.4rem;
  line-height: 1;
  padding: .2rem 0;
}
.msg-sticker.anim-bounce { animation: sm-bounce 1.1s ease-in-out infinite; }
.msg-sticker.anim-spin { animation: sm-spin 2.2s linear infinite; }
.msg-sticker.anim-pulse { animation: sm-pulse 1.2s ease-in-out infinite; }
.msg-sticker.anim-shake { animation: sm-shake .55s ease-in-out infinite; }
.msg-sticker.anim-wiggle { animation: sm-wiggle .8s ease-in-out infinite; }
.msg-sticker.anim-float { animation: sm-float 1.6s ease-in-out infinite; }
.msg-sticker.anim-pop { animation: sm-pop 1.1s ease-in-out infinite; }
.msg-sticker.anim-blink { animation: sm-blink 1.8s step-end infinite; }

.msg-nick-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: transparent;
}
@media (hover: hover) and (pointer: fine) {
  .msg-nick-btn:hover { text-decoration-color: currentColor; }
}

/* Person sheet / report */
.person-sheet .actions { display: flex; flex-direction: column; gap: .45rem; margin-top: .75rem; }
.person-sheet .actions .btn { width: 100%; }

/* File offer / blur */
.file-offer-card, .media-pending {
  margin-top: .35rem;
  padding: .65rem;
  border-radius: 12px;
  background: rgba(90,110,150,.08);
  border: 1px solid rgba(90,110,150,.18);
}
.media-blur {
  filter: blur(14px);
  transform: scale(1.05);
  pointer-events: none;
  user-select: none;
  max-width: 220px;
  max-height: 160px;
  border-radius: 10px;
  display: block;
}
.media-clear {
  max-width: 240px;
  max-height: 220px;
  border-radius: 10px;
  display: block;
}
.file-offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin-top: .55rem;
}

/* DM */
.dm-head-back { margin-right: .5rem; }
.file-policy-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  padding: .35rem .75rem;
  font-size: .85rem;
  color: var(--muted);
  border-bottom: 1px solid rgba(90,110,150,.1);
}
