/* Visueller Sprachführer in the Reise-Check app. Arial, sage/petrol/gold, light/dark.
   Generous space between text and frames — do not tighten. */
:root {
  --pg-hole: #f5f7f7;
  --pg-sage: #366f6c;
}
html[data-theme="dark"] {
  --pg-hole: #0c1a1a;
  --pg-sage: #b5cec5;
}

/* Five nav items: wrapping allowed, generous inset between label and pill / neighbors. */
.bottom-nav { gap: 6px; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
.bottom-nav button {
  font-size: 12px;
  line-height: 1.25;
  padding: 8px 6px;
  white-space: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  -webkit-hyphens: auto;
  min-height: 48px;
}
body { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }

@media (max-width: 400px) {
  .bottom-nav { gap: 4px; padding: 8px 5px calc(8px + env(safe-area-inset-bottom)); }
  .bottom-nav button { font-size: 11px; padding: 8px 5px; line-height: 1.25; }
}
@media (max-width: 340px) {
  .bottom-nav { gap: 3px; padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); }
  .bottom-nav button { font-size: 10.5px; padding: 8px 4px; }
}

body.pg-open .install,
body.pg-open footer { display: none; }

.phrase-guide { padding: 4px 0 28px; color: #132e2d; }
.phrase-guide a { color: #24504e; }

.pg-hero {
  background: linear-gradient(160deg, #0c1a1a 0%, #132e2d 55%, #1d4644 100%);
  color: #fff;
  border-radius: 18px;
  padding: 28px 24px 26px;
  text-align: center;
  margin: 0 0 28px;
}
.pg-hero .eyebrow { color: #c8a24a; margin: 0 0 16px; }
.pg-hero h1 {
  color: #fff;
  font-size: clamp(1.7rem, 5.4vw, 2.15rem);
  line-height: 1.15;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.pg-hero .pg-title-en {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #c8a24a;
  margin: 0 0 20px;
  text-transform: uppercase;
}
.pg-art {
  width: min(220px, 58%);
  height: 120px;
  margin: 0 auto 22px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-art svg { width: 100%; height: 100%; display: block; }
.pg-instruction {
  margin: 0 auto;
  max-width: 28rem;
  padding: 20px 22px;
  border: 2px solid #c8a24a;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  text-align: center;
}
.pg-instruction b {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin: 0 0 10px;
}
.pg-instruction span {
  display: block;
  color: #d6e4e2;
  font-size: 1rem;
  line-height: 1.4;
}
.pg-tagline {
  margin: 22px 0 0;
  color: #cfe0de;
  font-size: 0.95rem;
  line-height: 1.45;
}
.pg-tagline i { font-style: normal; display: block; margin-top: 8px; color: #b5c9c3; }

.pg-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 32px;
}
.pg-toc a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #d4dfdd;
  border-radius: 999px;
  background: #fff;
  text-decoration: none;
  color: #132e2d;
  font-size: 0.92rem;
  line-height: 1.3;
}
.pg-toc a:hover, .pg-toc a:focus-visible { border-color: #366f6c; }

.pg-section { margin: 0 0 40px; scroll-margin-top: 16px; }
.pg-section > h2 {
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0 0 8px;
  color: #132e2d;
}
.pg-sec-en {
  margin: 0 0 20px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c8a24a;
  line-height: 1.35;
}

.pg-sub {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #24504e;
  margin: 28px 0 16px;
  line-height: 1.35;
}
.pg-section > .pg-sub:first-of-type { margin-top: 0; }
.pg-sub i {
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
  color: #5b6b6b;
}

.pg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.pg-tile {
  background: #fff;
  border: 1px solid #dde5e4;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 20px 16px 16px;
  min-width: 0;
  color: #132e2d;
}
.pg-pic {
  width: 100%;
  min-height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 16px;
}
.pg-pic svg { width: auto; height: 72px; max-width: 100%; display: block; }
.pg-lb { text-align: center; line-height: 1.25; width: 100%; padding: 0 2px; }
.pg-lb b { display: block; font-size: 1rem; font-weight: 700; color: #132e2d; }
.pg-lb i { display: block; font-size: 0.88rem; font-style: normal; font-weight: 400; color: #5b6b6b; margin-top: 6px; }

.pg-hint {
  text-align: center;
  margin: 8px 0 20px;
  padding: 18px 20px;
  border: 2px solid #c8a24a;
  border-radius: 16px;
  background: #fff;
  line-height: 1.4;
}
.pg-hint b { display: block; color: #132e2d; font-size: 1.05rem; margin: 0 0 8px; }
.pg-hint span { color: #5b6b6b; }

.pg-body {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.pg-figure {
  background: #fff;
  border: 1px solid #dde5e4;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 18px 16px;
  color: #132e2d;
  min-width: 0;
}
.pg-figure .pg-pic { min-height: 260px; margin-bottom: 18px; }
.pg-figure .pg-pic svg { width: 100%; height: 260px; max-height: none; }
.pg-side { display: grid; grid-template-rows: repeat(3, 1fr); gap: 16px; min-width: 0; }
.pg-side .pg-pic { min-height: 72px; }
.pg-side .pg-pic svg { height: 64px; }

.pg-nums {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
}
.pg-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  padding: 16px 8px;
  background: #fff;
  border: 1px solid #dde5e4;
  border-radius: 14px;
  font-size: 1.6rem;
  font-weight: 700;
  color: #132e2d;
}

.pg-clock {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) 1.3fr;
  gap: 16px;
  margin: 0 0 24px;
  align-items: stretch;
}
.pg-clock-tile { margin: 0; }
.pg-clock-tile .pg-pic { min-height: 96px; }
.pg-clock-tile .pg-pic svg { height: 88px; }
.pg-clock-note {
  background: #fff;
  border: 2px solid #c8a24a;
  border-radius: 16px;
  padding: 20px 22px;
  line-height: 1.45;
  color: #132e2d;
}
.pg-clock-note b { display: block; font-size: 1.05rem; margin: 0 0 12px; }
.pg-clock-note p { margin: 0 0 12px; }
.pg-clock-note p:last-child { margin: 0; color: #5b6b6b; }

.pg-scale {
  background: #fff;
  border: 1px solid #dde5e4;
  border-radius: 16px;
  padding: 22px 18px 20px;
}
.pg-scale-h {
  font-size: 1.05rem;
  font-weight: 700;
  color: #132e2d;
  margin: 0 0 18px;
  line-height: 1.35;
}
.pg-scale-h i {
  font-style: normal;
  font-weight: 400;
  color: #5b6b6b;
  letter-spacing: 0;
}
.pg-faces {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
.pg-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 6px 10px;
  border-radius: 12px;
  color: #132e2d;
}
.pg-face .pg-pic { min-height: 56px; margin: 0 0 10px; }
.pg-face .pg-pic svg { height: 52px; }
.pg-face .n { font-weight: 700; font-size: 0.95rem; }
.pg-cap {
  margin: 0;
  text-align: center;
  color: #24504e;
  font-size: 0.92rem;
  line-height: 1.45;
  padding: 8px 8px 0;
}

.pg-credit {
  margin: 36px 0 8px;
  padding: 22px 20px;
  border-top: 1px solid #dde5e4;
  color: #5b6b6b;
  font-size: 0.88rem;
  line-height: 1.55;
}
.pg-credit p { margin: 0 0 12px; }
.pg-credit p:last-of-type { margin-bottom: 16px; }
.pg-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.14em;
  overflow-wrap: anywhere;
}
.pg-brand { margin: 0; font-weight: 600; color: #132e2d; }

.pg-tile-icon { background: #e8f1f0; color: #366f6c; }
.pg-tile-icon svg { width: 22px; height: 22px; display: block; }

@media (min-width: 600px) {
  .pg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pg-pic { min-height: 100px; }
  .pg-pic svg { height: 88px; }
  .pg-figure .pg-pic, .pg-figure .pg-pic svg { min-height: 300px; height: 300px; }
}

@media (orientation: landscape) {
  .pg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .pg-pic { min-height: 100px; margin-bottom: 14px; }
  .pg-pic svg { height: 88px; }
  .pg-hero { padding: 20px 22px 18px; margin-bottom: 20px; }
  .pg-art { height: 88px; margin-bottom: 16px; }
  .pg-instruction { padding: 16px 20px; }
  .pg-body { grid-template-columns: 1.1fr 1.2fr; }
  .pg-figure .pg-pic, .pg-figure .pg-pic svg { min-height: 200px; height: 200px; }
  .pg-faces { gap: 10px; }
  .pg-toc { position: sticky; top: 0; z-index: 2; background: #f5f7f7; padding: 10px 0 12px; margin-bottom: 20px; }
}

@media (orientation: landscape) and (max-height: 560px) {
  body.pg-open { padding-bottom: calc(52px + env(safe-area-inset-bottom)); }
  body.pg-open .app-header { padding: 4px 12px; gap: 8px; }
  body.pg-open .app-header img { height: 24px; width: 24px; }
  body.pg-open .app-header a { font-size: 15px; gap: 8px; }
  body.pg-open .app-header small,
  body.pg-open #network { display: none; }
  body.pg-open .bottom-nav { padding: 4px 8px calc(4px + env(safe-area-inset-bottom)); gap: 6px; }
  body.pg-open .bottom-nav button { min-height: 40px; font-size: 11px; padding: 6px 6px; white-space: normal; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto; }
  body.pg-open main { padding: 6px 16px 4px; }
  .pg-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
  .pg-pic { min-height: 80px; margin-bottom: 10px; }
  .pg-pic svg { height: 76px; }
  .pg-hero {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    text-align: left;
    padding: 6px 12px;
    margin-bottom: 6px;
  }
  .pg-hero .eyebrow,
  .pg-art,
  .pg-tagline { display: none; }
  .pg-hero h1 { font-size: 1.05rem; margin: 0 8px 0 0; display: inline; }
  .pg-hero .pg-title-en { display: inline; margin: 0; font-size: 0.68rem; }
  .pg-instruction { margin: 0; flex: 1 1 auto; padding: 6px 12px; text-align: left; }
  .pg-instruction b { display: inline; margin: 0 8px 0 0; font-size: 0.95rem; }
  .pg-instruction span { display: inline; font-size: 0.9rem; }
  .pg-toc {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 4px;
    padding: 0 0 4px;
    gap: 8px;
  }
  .pg-toc a { flex: 0 0 auto; white-space: nowrap; min-height: 32px; padding: 4px 12px; font-size: 0.88rem; }
  .pg-section { margin-bottom: 16px; }
  .pg-section > h2 { font-size: 1.05rem; margin: 0 0 8px; }
  .pg-sec-en { display: none; }
  .pg-tile { padding: 12px 8px 10px; }
  .pg-lb b { font-size: 0.92rem; }
  .pg-lb i { font-size: 0.8rem; margin-top: 3px; }
}


html[data-theme="dark"] .phrase-guide { color: var(--dm-text); }
html[data-theme="dark"] .phrase-guide a { color: var(--dm-sage); }
html[data-theme="dark"] .pg-toc { background: transparent; }
html[data-theme="dark"] .pg-toc a,
html[data-theme="dark"] .pg-tile,
html[data-theme="dark"] .pg-hint,
html[data-theme="dark"] .pg-figure,
html[data-theme="dark"] .pg-num,
html[data-theme="dark"] .pg-clock-note,
html[data-theme="dark"] .pg-scale,
html[data-theme="dark"] .pg-face {
  background: var(--dm-surface);
  color: var(--dm-text);
  border-color: var(--dm-line);
}
html[data-theme="dark"] .pg-section > h2,
html[data-theme="dark"] .pg-lb b,
html[data-theme="dark"] .pg-hint b,
html[data-theme="dark"] .pg-clock-note,
html[data-theme="dark"] .pg-clock-note b,
html[data-theme="dark"] .pg-scale-h,
html[data-theme="dark"] .pg-num,
html[data-theme="dark"] .pg-face .n,
html[data-theme="dark"] .pg-brand { color: var(--dm-text); }
html[data-theme="dark"] .pg-lb i,
html[data-theme="dark"] .pg-hint span,
html[data-theme="dark"] .pg-sub i,
html[data-theme="dark"] .pg-clock-note p:last-child,
html[data-theme="dark"] .pg-scale-h i,
html[data-theme="dark"] .pg-credit { color: var(--dm-muted); border-color: var(--dm-line); }
html[data-theme="dark"] .pg-sub,
html[data-theme="dark"] .pg-cap { color: var(--dm-sage); }
html[data-theme="dark"] .pg-sec-en,
html[data-theme="dark"] .pg-hero .eyebrow { color: var(--dm-gold); }
html[data-theme="dark"] .pg-toc a:hover,
html[data-theme="dark"] .pg-toc a:focus-visible { border-color: var(--dm-sage); }
html[data-theme="dark"] .pg-instruction,
html[data-theme="dark"] .pg-hint,
html[data-theme="dark"] .pg-clock-note { border-color: var(--dm-gold); }
html[data-theme="dark"] .pg-tile-icon { background: var(--dm-raised); color: var(--dm-sage); }
html[data-theme="dark"] .pg-toc { background: var(--dm-bg); }

.tiles button[data-page="phrase"] .tile-icon { background: #e8f1f0; color: #366f6c; }
