/* Väylä – Satatuote-teema
   Värit: tummansininen #00273E, sininen #005191, punainen #D91D4F
   Fontit: Work Sans (teksti), Roboto (otsikot)
   Ilme: tumma kehys (yläpalkki + sivupalkki), vaalea työtila, punainen korostus säästeliäästi */
:root {
  --navy: #00273e;
  --navy-2: #003657;
  --bg: #eef2f6;
  --bg-2: #ffffff;
  --panel: #ffffff;
  --panel-2: #f3f6f9;
  --line: #dfe5ec;
  --text: #00273e;
  --muted: #5b6f80;
  --accent: #005191;
  --accent-2: #0a62ab;
  --accent-hover: #003f72;
  --accent-soft: rgba(0, 81, 145, 0.08);
  --accent-ink: #ffffff;
  --danger: #d91d4f;
  --punainen: #d91d4f;
  --varjo-pieni: 0 1px 2px rgba(0, 39, 62, 0.06), 0 1px 3px rgba(0, 39, 62, 0.04);
  --varjo: 0 6px 20px rgba(0, 39, 62, 0.08);
  --varjo-iso: 0 18px 44px rgba(0, 39, 62, 0.18);
  --aallot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='260' viewBox='0 0 600 260'%3E%3Cg fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M0 40c50-30 100 30 150 0s100-30 150 0 100 30 150 0 100-30 150 0'/%3E%3Cpath d='M0 80c50-30 100 30 150 0s100-30 150 0 100 30 150 0 100-30 150 0' opacity='.8'/%3E%3Cpath d='M0 120c50-30 100 30 150 0s100-30 150 0 100 30 150 0 100-30 150 0' opacity='.6'/%3E%3Cpath d='M0 160c50-30 100 30 150 0s100-30 150 0 100 30 150 0 100-30 150 0' opacity='.45'/%3E%3Cpath d='M0 200c50-30 100 30 150 0s100-30 150 0 100 30 150 0 100-30 150 0' opacity='.3'/%3E%3Cpath d='M0 240c50-30 100 30 150 0s100-30 150 0 100 30 150 0 100-30 150 0' opacity='.18'/%3E%3C/g%3E%3C/svg%3E");
  color-scheme: light;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: #b9c4cf transparent;
}
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "Work Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
h1, .sivun-nimi, .brand-nimi { font-family: Roboto, "Work Sans", system-ui, sans-serif; }

/* ---------- Brändipalkki ---------- */
.brandbar {
  position: relative;
  z-index: 5;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 24px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy) 55%, var(--navy-2) 100%);
  color: #ffffff;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.07);
}
/* Satatuotteen punainen tunnusviiva palkin alareunassa */
.brandbar::after {
  content: "";
  position: absolute;
  left: 24px;
  bottom: 0;
  width: 56px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--punainen);
}
.brand-logo {
  display: flex;
  align-items: center;
  color: #ffffff;
  text-decoration: none;
}
.brand-logo img { height: 28px; width: auto; display: block; }
.brand-logo .fallback {
  display: none;
  font-family: Roboto, sans-serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
}
.brand-erotin { width: 1px; height: 30px; background: rgba(255, 255, 255, 0.3); }
.brand-tuote {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  text-decoration: none;
}
.brand-tuote svg { display: block; flex-shrink: 0; }
.brand-teksti { display: flex; flex-direction: column; line-height: 1.15; }
.brand-nimi { font-size: 19px; font-weight: 600; letter-spacing: 0.01em; }
.brand-alaotsikko { font-size: 12px; color: rgba(255, 255, 255, 0.72); }

/* ---------- Profiili ---------- */
.profiili { margin-left: auto; position: relative; display: flex; align-items: center; gap: 6px; }
.profiili-nappi, .brand-ikoni {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.profiili-nappi:hover, .brand-ikoni:hover,
.profiili-nappi[aria-expanded="true"] { background: rgba(255, 255, 255, 0.12); }
.profiili-nimi { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-nuoli, .brand-ikoni svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-ikoni { padding: 8px; }
.brand-ikoni svg { width: 22px; height: 22px; stroke-width: 1.7; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: #2f7fc1;
  color: #ffffff;
  font-family: Roboto, sans-serif;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.iso { width: 56px; height: 56px; font-size: 20px; box-shadow: none; }
.pn-avatar, .pv-avatar, .pd-avatar { display: contents; }

.profiili-valikko {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  width: 260px;
  padding: 8px;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 39, 62, 0.18);
}
.pv-tiedot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 10px 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.pv-teksti { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pv-nimi { font-size: 15px; overflow-wrap: anywhere; }
.pv-titteli { color: var(--muted); font-size: 13px; }
.pv-titteli:empty, .pv-rooli:empty { display: none; }
.pv-rooli {
  align-self: flex-start;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.pv-rooli.yllapitaja { background: var(--accent-soft); color: var(--accent); }
.pv-kohta {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.pv-kohta:hover { background: var(--panel-2); color: var(--accent); }

/* Ikkunat: profiili sekä uusi muistio, nimeäminen ja vahvistukset */
.profiili-dialogi, .dialogi {
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 24px;
  border: none;
  border-radius: 14px;
  color: var(--text);
  box-shadow: 0 24px 60px rgba(0, 39, 62, 0.3);
}
.profiili-dialogi[open], .dialogi[open] { animation: ikkuna 0.18s ease-out; }
.profiili-dialogi::backdrop, .dialogi::backdrop { background: rgba(0, 20, 32, 0.55); }
.profiili-dialogi h2, .dialogi h2 { margin: 0 0 18px; font-family: Roboto, sans-serif; font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.dialogi h2:has(+ .pd-vihje) { margin-bottom: 8px; }
.dialogi .pd-vihje { font-size: 14px; line-height: 1.5; }
.dialogi-ikoni {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.dialogi-ikoni.vaara { background: rgba(217, 29, 79, 0.1); color: var(--danger); }
.dialogi-ikoni svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn.btn-vaarallinen { background: var(--danger); border-color: var(--danger); color: #ffffff; font-weight: 600; }
.btn.btn-vaarallinen:hover { background: #b0163f; border-color: #b0163f; color: #ffffff; }
@keyframes ikkuna { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
.pd-kuva { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.pd-kuvanapit { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-kentta { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 14px; font-weight: 500; }
.pd-vihje { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.pd-tiedot {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--panel-2);
}
.pd-tiedot div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pd-tiedot small { color: var(--muted); font-size: 12px; }
.pd-tiedot b { font-size: 14px; overflow-wrap: anywhere; }
.pd-avaa {
  margin: 0 0 14px;
  padding: 4px 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.pd-avaa:hover { text-decoration: underline; }
.pd-virhe { min-height: 18px; margin: 0 0 10px; color: var(--danger); font-size: 14px; }
.pd-virhe:empty { min-height: 0; margin: 0; }
.pd-napit { display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- Henkilöt-paneeli ---------- */
button.rail-item { border: none; background: none; font: inherit; font-size: 11.5px; font-weight: 500; cursor: pointer; }
.rail-item.auki { background: rgba(255, 255, 255, 0.12); color: #ffffff; }

.henkilot-tausta {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(0, 20, 32, 0);
  transition: background 0.2s;
}
.henkilot-tausta.auki { background: rgba(0, 20, 32, 0.4); }
.henkilot-paneeli {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  box-shadow: -12px 0 40px rgba(0, 39, 62, 0.2);
  transform: translateX(100%);
  transition: transform 0.2s ease-out;
}
.henkilot-tausta.auki .henkilot-paneeli { transform: none; }
.hp-yla {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}
.hp-yla h2 { margin: 0; font-family: Roboto, sans-serif; font-size: 20px; font-weight: 600; }
.hp-maara { color: var(--muted); font-size: 13px; }
.hp-sulje {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}
.hp-sulje:hover { border-color: var(--accent); color: var(--accent); }
.hp-haku { padding: 14px 20px 6px; }
.hp-lista { flex: 1; overflow-y: auto; padding: 4px 12px 24px; }
.hp-ryhma {
  margin: 14px 8px 6px;
  color: var(--muted);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.hp-rivi {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: 10px;
  transition: background 0.15s;
}
.hp-rivi:hover { background: var(--panel-2); }
.henkilo-avatar { width: 44px; height: 44px; font-size: 16px; box-shadow: none; }
.hp-tiedot { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hp-nimi { font-weight: 600; overflow-wrap: anywhere; }
.hp-sina {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  vertical-align: 2px;
}
.hp-ala { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.hp-titteli { color: var(--muted); font-size: 13px; }
.hp-liittyi { color: #8fa0af; font-size: 12px; }
.hp-tyhja { margin: 24px 8px; color: var(--muted); text-align: center; }
.hp-poista {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.hp-poista:hover { border-color: var(--danger); color: var(--danger); background: rgba(217, 29, 79, 0.06); }
.hp-poista svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hp-poista.hp-avain:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.hp-odottaa { color: #8a5300; font-size: 12px; font-weight: 500; }
.syote.vain-luku {
  background: var(--panel-2);
  font-family: Consolas, "SF Mono", monospace;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: center;
}

.rooli-merkki {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.rooli-merkki[data-rooli="omistaja"] { background: var(--navy); color: #ffffff; }
.rooli-merkki[data-rooli="yllapitaja"] { background: var(--accent-soft); color: var(--accent); }
.rooli-merkki[data-rooli="operaattori"] { background: #e6f4ec; color: #1a6e43; }
.rooli-merkki[data-rooli="asentaja"] { background: #fdf1de; color: #8a5300; }

/* ---------- Kehys ---------- */
.app { flex: 1; min-height: 0; display: flex; }
.page { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.rail {
  width: 84px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  background: var(--navy);
}
.rail-item {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 11px 4px 9px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
  font-size: 11.5px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.rail-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rail-item:hover { background: rgba(255, 255, 255, 0.08); color: #ffffff; }
.rail-item.aktiivinen { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.rail-item.aktiivinen::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--punainen);
}
.rail-item:focus-visible { outline: 2px solid #ffffff; outline-offset: -2px; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 60px;
  padding: 0 24px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.topbar .vasen, .topbar .oikea { display: flex; align-items: center; gap: 10px; }
.sivun-nimi { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.005em; }
.tila { color: var(--muted); font-size: 13px; }

/* ---------- Napit ja kentät ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--varjo-pieni);
  transition: border-color 0.15s, background 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ensisijainen {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(0, 81, 145, 0.25);
}
.btn-ensisijainen:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #ffffff; }
.btn-vaara { color: var(--danger); }
.btn-vaara:hover { border-color: var(--danger); color: var(--danger); }

.syote {
  width: 100%;
  padding: 11px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  line-height: 1.6;
}
.syote:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 81, 145, 0.15);
}
.syote::placeholder { color: #8fa0af; }

/* ---------- Keskustelu (Apuri) ---------- */
.rulla { flex: 1; min-height: 0; overflow-y: auto; }
#keskustelu {
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.viesti {
  max-width: 82%;
  padding: 12px 16px;
  border-radius: 14px;
  line-height: 1.6;
  font-size: 15.5px;
  overflow-wrap: anywhere;
  animation: sisaan 0.25s ease-out;
}
.viesti p { margin: 0 0 10px; }
.viesti p:last-child { margin-bottom: 0; }
.viesti ul, .viesti ol { margin: 0 0 10px; padding-left: 22px; }
.viesti pre {
  background: var(--panel-2);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 8px;
  overflow-x: auto;
}
.viesti code { font-family: Consolas, "SF Mono", monospace; font-size: 0.92em; }
.viesti a { color: var(--accent); }
.kayttaja {
  align-self: flex-end;
  background: var(--accent);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.botti {
  align-self: flex-start;
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 39, 62, 0.05);
}
.miettii { color: var(--muted); font-style: italic; animation: sykaha 1.4s ease-in-out infinite; }
.virhe { border-color: var(--danger); color: var(--danger); }

.kirjoitus { flex-shrink: 0; padding: 12px 24px 24px; }
.kirjoitus form {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 39, 62, 0.06);
}
.kirjoitus form:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 81, 145, 0.14);
}
.kirjoitus textarea {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  padding: 11px 12px;
  min-height: 44px;
  max-height: 160px;
}
.kirjoitus textarea::placeholder { color: #8fa0af; }
.laheta {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.laheta:hover { background: var(--accent-hover); }
.laheta:active { transform: scale(0.96); }
.laheta:disabled { opacity: 0.45; cursor: not-allowed; }
.laheta svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vihje {
  max-width: 820px;
  margin: 8px auto 0;
  padding: 0 8px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

/* Netihaun kytkin */
.valinta {
  max-width: 820px;
  margin: 0 auto 8px;
  padding: 0 4px;
  display: flex;
  align-items: center;
}
.kytkin {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  cursor: pointer;
  font-size: 14px;
  color: var(--muted);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.kytkin input { position: absolute; opacity: 0; width: 0; height: 0; }
.kytkin .raide {
  position: relative;
  flex-shrink: 0;
  width: 40px;
  height: 24px;
  border-radius: 12px;
  background: #c5ced8;
  transition: background 0.15s;
}
.kytkin .raide::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 39, 62, 0.3);
  transition: transform 0.15s;
}
.kytkin input:checked + .raide { background: var(--accent); }
.kytkin input:checked + .raide::after { transform: translateX(16px); }
.kytkin input:focus-visible + .raide { outline: 2px solid var(--accent); outline-offset: 2px; }
.kytkin input:checked ~ .kytkin-teksti { color: var(--text); font-weight: 500; }

@keyframes sisaan { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes sykaha { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Puhelin ---------- */
@media (max-width: 800px) {
  .brandbar { height: 52px; padding: 0 14px; gap: 12px; }
  .brand-logo img { height: 22px; }
  .brand-erotin { height: 24px; }
  .brand-tuote svg { width: 26px; height: 26px; }
  .brand-nimi { font-size: 17px; }
  .brand-alaotsikko { display: none; }
  .profiili-nimi, .pn-nuoli, .brand-ikoni { display: none; }
  .profiili-nappi { padding: 4px; }
  .avatar { width: 32px; height: 32px; }

  .brandbar::after { left: 14px; width: 40px; }
  .app { flex-direction: column; }
  .rail {
    order: 2;
    width: 100%;
    flex-direction: row;
    justify-content: space-around;
    gap: 4px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .rail-item { flex: 1; padding: 8px 4px; }
  .rail-item.aktiivinen::before { left: 26%; right: 26%; top: -6px; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .topbar { height: 54px; padding: 0 14px; }
  #keskustelu { padding: 18px 14px; }
  .kirjoitus { padding: 8px 12px 14px; }
  .vihje { margin-top: 6px; }
  .viesti { max-width: 92%; }
}