/* Same look as the Android app: light background, navy bars, vivid buttons, grey cards */
:root {
  --header: #0b2545;
  --blue: #2f80ff;
  --yellow: #ffb703;
  --orange: #ff8a00;
  --red: #e53935;
  --green: #22c55e;
  --amber: #b45309;
  --bg: #f3f5f9;
  --card: #d9dee6;
  --text: #14213d;
  --muted: #5c677d;
  --line: #c5ccd6;
  --soft-amber: #fff0c7;
  --soft-red: #fde2e2;
  --soft-green: #ddf4ec;
  --soft-blue: #dce8fb;
  --viber: #7b61ff;
  --whatsapp: #25d366;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
body { overscroll-behavior-y: none; }
#app { display: flex; flex-direction: column; height: 100%; max-width: 640px; margin: 0 auto; background: var(--bg); }
#screen { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-top: var(--safe-t); }
.page { padding: 16px 16px 32px; }
h1.title { font-size: 22px; margin: 0 0 4px; }
.subtitle { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.section { color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin: 18px 2px 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.bold { font-weight: 700; }
pre.text, .pre { white-space: pre-wrap;  font-family: inherit; margin: 0; }

/* bottom navigation */
#tabs { display: flex; background: var(--header); padding: 6px 0 calc(6px + var(--safe-b)); }
#tabs button { flex: 1; background: none; border: 0; color: #b8c4d9; font-weight: 700; font-size: 12px; line-height: 1.3; font-family: inherit; padding: 4px 0; border-radius: 12px; }
#tabs button span { display: block; font-size: 20px; }
#tabs button.on { color: var(--yellow); }

/* header */
.header { background: var(--header); color: #fff; padding: 18px 20px 26px; }
.header .row { display: flex; align-items: center; gap: 14px; }
.header img { width: 64px; height: 64px; border-radius: 14px; background: #041630; object-fit: cover; }
.header .name { font-size: 20px; font-weight: 700; }
.header .trade { color: #b8c4d9; font-size: 14px; }
.header .apptitle { color: var(--yellow); font-weight: 700; font-size: 15px; margin: 14px 0 10px; }
.pill { display: inline-block; border-radius: 30px; padding: 5px 12px; font-size: 13px; font-weight: 700; }
.header .pill { background: rgba(34, 197, 94, .15); color: #b7f5c8; }

/* cards */
.card { background: var(--card); border-radius: 18px; padding: 16px; box-shadow: 0 1px 2px rgba(11, 37, 69, .08); }
.card + .card, .mt { margin-top: 14px; }
.mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt16 { margin-top: 16px; }
.card h3 { margin: 0 0 4px; font-size: 16px; }
.soft-amber { background: var(--soft-amber); }
.soft-red { background: var(--soft-red); }
.soft-green { background: var(--soft-green); }
.soft-blue { background: var(--soft-blue); border: 1px solid var(--blue); }
.body { padding: 0 16px; }

/* buttons */
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 14px; font-weight: 700; font-size: 16px; line-height: 1.25; font-family: inherit; color: #fff;
  background: var(--blue); text-align: center; text-decoration: none; cursor: pointer; }
.btn:active { filter: brightness(.92); }
.btn.orange { background: var(--orange); } .btn.red { background: var(--red); } .btn.green { background: var(--green); }
.btn.viber { background: var(--viber); } .btn.whatsapp { background: var(--whatsapp); } .btn.navy { background: var(--header); }
.btn.yellow { background: var(--yellow); color: #15171a; } .btn.white { background: #fff; color: var(--orange); }
.btn.ghost { background: var(--card); color: var(--blue); border: 1px solid var(--line); font-size: 15px; padding: 12px; }
.card .btn.ghost { background: #eef1f5; }
.row2, .row3 { display: flex; gap: 8px; }
.row2 > *, .row3 > * { flex: 1; min-width: 0; }

.sos { display: block; width: 100%; border: 0; margin-top: -14px; border-radius: 22px; background: var(--orange); color: #fff; padding: 20px 16px;
  box-shadow: 0 6px 16px rgba(255, 138, 0, .35); text-align: center; cursor: pointer; }
.sos b { display: block; font-size: 24px; }
.sos small { color: #fff3e0; font-size: 14px; }

/* grid tiles */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; min-height: 120px; text-align: left;
   font-family: inherit; color: var(--text); cursor: pointer; }
.tile .ic { font-size: 28px; }
.tile b { display: block; margin: 6px 0 2px; font-size: 15px; }
.tile small { color: var(--muted); font-size: 12px; }

/* list rows */
.rowlink { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin-top: 10px;  font-family: inherit; color: var(--text); text-align: left; cursor: pointer; }
.rowlink .ic { font-size: 26px; width: 40px; }
.rowlink .tx { flex: 1; } .rowlink .tx small { display: block; color: var(--muted); font-size: 13px; }
.rowlink .chev { color: var(--muted); font-size: 24px; }

/* forms */
label.l { display: block; color: var(--muted); font-size: 13px; font-weight: 700; margin: 12px 0 4px; }
input.f, select.f, textarea.f { width: 100%; font-size: 16px; font-family: inherit; color: var(--text); background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 12px; -webkit-appearance: none; appearance: none; }
textarea.f { min-height: 90px; resize: vertical; }
select.f { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235c677d' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 14px; }
.check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--header); }
.check.red { color: var(--red); font-weight: 700; font-size: 15px; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; margin-top: 8px; }
.thumbs img { width: 80px; height: 80px; object-fit: cover; border-radius: 10px; flex: none; }
.err { border-color: var(--red) !important; }

/* radio list */
.radio { display: flex; gap: 10px; align-items: center; padding: 8px 2px; font-size: 15px; }
.radio input { width: 20px; height: 20px; accent-color: var(--orange); }
.advice { background: var(--soft-amber); border-radius: 12px; padding: 12px; margin-top: 10px; white-space: pre-wrap; }

/* outages */
.out { border-radius: 14px; padding: 12px; background: #eef1f5; border: 1px solid var(--line); }
.out + .out { margin-top: 10px; }
.out.mine { background: var(--soft-red); border-color: var(--red); }
.out.now { background: var(--soft-amber); }
.out .when { font-weight: 700; color: var(--header); }
.out.now .when { color: var(--amber); }
.out .mun { font-size: 13px; font-weight: 700; color: var(--muted); margin: 2px 0 4px; }
.out.mine .mun { color: var(--red); }
.out .area { font-size: 14px; }
.out .area.clip { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.live { font-size: 11px; padding: 3px 9px; }
.live.on { background: rgba(34, 197, 94, .2); color: #15803d; }
.live.off { background: rgba(0, 0, 0, .08); color: var(--muted); }
.flex { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; }

/* tips */
details.tip { background: var(--card); border-radius: 18px; padding: 16px; margin-top: 10px; }
details.tip summary { font-weight: 700; cursor: pointer; list-style: none; }
details.tip summary::-webkit-details-marker { display: none; }
details.tip summary::after { content: "  ▾"; } details.tip[open] summary::after { content: "  ▴"; }
details.tip p { margin: 8px 0 0; font-size: 14px; }

/* contact */
.bizcard { background: var(--header); color: #fff; border-radius: 22px; padding: 16px; text-align: center; }
.bizcard img { width: 100%; border-radius: 16px; display: block; }
.bizcard .n { font-size: 24px; font-weight: 700; margin-top: 12px; }
.bizcard .t { color: #b8c4d9; font-size: 15px; }
.bizcard .p { color: var(--yellow); font-size: 22px; font-weight: 700; margin-top: 12px; }

/* assistant */
.chatwrap { display: flex; flex-direction: column; height: 100%; }
.chathead { background: var(--header); color: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px; }
.chathead img { width: 40px; height: 40px; border-radius: 10px; }
.chathead .st { font-size: 12px; color: #b8c4d9; }
.chat { flex: 1; overflow-y: auto; padding: 14px 12px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; margin: 6px 0; white-space: pre-wrap; font-size: 15px; }
.msg.bot { background: var(--card); border-bottom-left-radius: 4px; }
.msg.me { background: var(--blue); color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.msg.danger { background: var(--soft-red); border: 1px solid var(--red); }
.msg .src { display: block; font-size: 11px; color: var(--muted); margin-top: 6px; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.acts button { border: 0; border-radius: 20px; padding: 8px 12px; font-weight: 700; font-size: 13px; font-family: inherit; color: #fff; background: var(--blue); cursor: pointer; }
.acts button.red { background: var(--red); } .acts button.orange { background: var(--orange); } .acts button.green { background: var(--green); }
.acts button.ghost { background: #fff; color: var(--blue); border: 1px solid var(--line); }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 8px; }
.chips button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 8px 12px; font-size: 14px; font-family: inherit; color: var(--text); }
.composer { display: flex; gap: 8px; padding: 8px 12px calc(8px); background: var(--bg); border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; height: 46px; max-height: 120px; font-size: 16px; font-family: inherit; border: 1px solid var(--line); border-radius: 22px; padding: 11px 14px; }
.composer button { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 20px; }
.typing { color: var(--muted); font-size: 13px; padding: 4px 6px; }
.askbox { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;  font-family: inherit; color: var(--text); cursor: pointer; }
.askbox .bubble { flex: 1; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 11px 14px; color: var(--muted); }

/* misc */
#white { position: fixed; inset: 0; background: #fff; z-index: 50; display: none; align-items: flex-end; justify-content: center; padding-bottom: 40px; color: #999; }
#toast { position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); background: rgba(20, 33, 61, .92); color: #fff;
  padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90%; z-index: 60; opacity: 0; transition: opacity .2s; pointer-events: none; text-align: center; }
#toast.show { opacity: 1; }
.install { background: var(--soft-blue); border-radius: 14px; padding: 12px; margin-top: 14px; font-size: 14px; }
.hist { padding: 10px 0; border-top: 1px solid var(--line); } .hist:first-child { border-top: 0; padding-top: 0; }
.danger-link { color: var(--red); font-size: 13px; background: none; border: 0; padding: 20px 0 0; font-size: 13px; font-family: inherit; }
