/* ── Font yang sama dengan desain ──────────────────────────
   Tanpa ini, browser memakai font bawaan sistem dan seluruh
   halaman langsung terasa berbeda dari Figma.            */
@font-face {
  font-family: 'Tiresias';
  src: url('./fonts/TiresiasLPfont.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Tiresias';
  src: url('./fonts/TiresiasLPfontBold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --navy:  #00205B;
  --bar:   #85ABF1;
  --sky:   #B1CCFF;
  --white: #FFFFFF;
  --ink:   #2B2B2B;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: 'Tiresias', -apple-system, system-ui, sans-serif;
  background: var(--sky);
  color: var(--navy);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  position: relative;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── Bilah atas ──────────────────────────────────────────
   Tinggi 51 dan jarak samping mengikuti nilai dari Figma. */
.bar {
  background: var(--bar);
  display: flex;
  align-items: center;
  gap: 3px;
  height: 51px;
  padding: 10px 19px 10px 15px;
  padding-top: calc(10px + env(safe-area-inset-top));
  height: calc(51px + env(safe-area-inset-top));
  flex-shrink: 0;
  position: relative;
}

.menu-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.6px solid var(--white);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5px;
  flex-shrink: 0;
  padding: 0;
}
.menu-btn span {
  width: 3.4px;
  height: 3.4px;
  border-radius: 50%;
  background: var(--white);
}
.menu-btn:active { background: rgba(255,255,255,.22); }

/* Judul benar-benar di tengah layar, tidak terdorong tombol */
.brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: calc(50% + env(safe-area-inset-top) / 2);
  margin-top: -1px;
  translate: 0 -50%;
  font-family: 'Trebuchet MS', 'Tiresias', sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 22px;
  color: var(--navy);
  white-space: nowrap;
}

.status-dot {
  margin-left: auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(0,32,91,.22);
  flex-shrink: 0;
  transition: background .2s;
}
.status-dot.on { background: #2FB500; }

/* ── Area percakapan ─────────────────────────────────────
   Isi didorong ke bawah, persis seperti di desain.        */
.feed {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  background: var(--sky);
}

.mine {
  align-self: flex-end;
  max-width: 70%;
  background: var(--navy);
  color: var(--white);
  border-radius: 10px;
  padding: 10px;
  font-size: 16px;
  line-height: 20px;
}

.theirs {
  align-self: flex-start;
  max-width: 86%;
  color: var(--navy);
  font-size: 16px;
  line-height: 20px;
  padding: 10px 10px 10px 0;
}

/* ── Panel menu ──────────────────────────────────────────
   Menempel tepat di bawah bar, tanpa menggelapkan sisa
   layar; isi percakapan tetap terlihat normal di bawahnya. */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(51px + env(safe-area-inset-top));
  z-index: 50;
  background: var(--bar);
  border-bottom: 1px solid rgba(255,255,255,.4);
  padding: 12px 0 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sheet[hidden] { display: none; }

.sheet-item {
  align-self: flex-start;
  border: none;
  background: transparent;
  color: var(--navy);
  font-family: inherit;
  font-size: 15px;
  line-height: 19px;
  text-align: left;
  padding: 0;
}
.sheet-item:active { opacity: .6; }

/* ── Kolom ketik ─────────────────────────────────────────
   Tinggi 76 dan jarak mengikuti nilai dari Figma.         */
.composer {
  background: var(--bar);
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 12px 12px 17px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.composer input {
  flex: 1;
  border: none;
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  padding: 14px 10px 14px 15px;
  font-family: inherit;
  font-size: 16px;
  line-height: 20px;
  outline: none;
  min-width: 0;
}
.composer input::placeholder { color: rgba(43,43,43,.42); }

.send {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .08s, filter .08s;
}
.send svg { margin-left: -2px; }
.send:active { transform: scale(.92); filter: brightness(1.3); }
