/* Vaani - kept plain on purpose. Big text, strong contrast, few colours.
   Most of our users are older and on cheap Android phones in daylight. */

:root {
  --paper: #f4efe4;
  --card: #fffdf8;
  --ink: #1f1c17;
  --muted: #5f5a50;
  --line: #d6cdbb;
  --real: #2e6b3b;
  --real-bg: #e4efe2;
  --fake: #a3302a;
  --fake-bg: #f6e1dd;
  --unsure: #7d5f10;
  --unsure-bg: #f5ead0;
  --accent: #1f4e79;
  --radius: 6px;
  --font: "Source Sans 3", "Noto Sans Devanagari", "Noto Sans Gurmukhi", system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.5 var(--font);
  max-width: 560px;
  margin-inline: auto;
  padding: 0 16px 140px;
}

h1 { font-size: 1.55rem; line-height: 1.25; margin: 8px 0 18px; font-weight: 700; }
p { margin: 0 0 8px; }
a { color: var(--accent); }
[hidden] { display: none !important; }

.small { font-size: .9rem; color: var(--muted); }
.hint { color: var(--muted); margin-top: -8px; }

/* header */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 10px;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 18px;
}
.brand { text-decoration: none; color: var(--ink); display: flex; align-items: baseline; gap: 10px; }
.brand-name { font-weight: 700; font-size: 1.6rem; letter-spacing: -.5px; }
.brand-sub { color: var(--muted); font-size: .95rem; }
.lang-btn {
  font: inherit; font-size: .95rem;
  background: none; border: 1.5px solid var(--ink); border-radius: 99px;
  padding: 4px 14px; color: var(--ink); cursor: pointer;
}

/* dialect picker */
.dialects { list-style: none; padding: 0; margin: 0; }
.dialects li {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px; cursor: pointer;
}
.dialects li:active, .dialects li.on { border-color: var(--ink); }
.dialects .d-name { font-size: 1.35rem; font-weight: 600; flex: 1; }
.dialects .d-en { display: block; font-size: .85rem; color: var(--muted); font-weight: 400; }
.play {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1.5px solid var(--ink); background: none; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; flex: none;
}
.play svg { width: 20px; height: 20px; }

/* input box */
.box {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 18px;
}
.label { display: block; font-weight: 600; margin-bottom: 6px; }
textarea, input[type=text] {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
textarea { resize: vertical; min-height: 120px; }
textarea:focus, input[type=text]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.preview { display: block; max-height: 140px; margin-top: 10px; border: 1px solid var(--line); border-radius: 4px; }
.sender { margin-top: 12px; }
.sender summary { cursor: pointer; color: var(--muted); font-size: .95rem; margin-bottom: 8px; }

/* buttons */
.btn {
  font: inherit; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius);
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid var(--ink);
}
.btn svg { width: 20px; height: 20px; }
.btn-plain { background: none; color: var(--ink); }
.btn-go { width: 100%; background: var(--ink); color: var(--paper); font-size: 1.2rem; padding: 14px; margin: 6px 0 20px; }
.btn-go:disabled { opacity: .6; }
.btn-alarm { width: 100%; background: var(--card); color: var(--fake); border-color: var(--fake); }
.btn-small { font-size: .95rem; padding: 8px 12px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* mic */
.ask { display: flex; align-items: center; gap: 16px; margin: 0 0 16px; }
.mic {
  width: 78px; height: 78px; border-radius: 50%; flex: none;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--ink);
  display: grid; place-items: center; cursor: pointer;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.mic svg { width: 34px; height: 34px; }
.mic.on { background: var(--fake); color: #fff; border-color: var(--fake); }
.ask-label { font-weight: 600; margin: 0; }

/* result */
#result { border-top: 2px solid var(--ink); padding-top: 18px; }
.verdict {
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  border: 2px solid currentColor;
}
.verdict.real { color: var(--real); background: var(--real-bg); }
.verdict.fake { color: var(--fake); background: var(--fake-bg); }
.verdict.not_sure { color: var(--unsure); background: var(--unsure-bg); }
.verdict .word { font-size: 2.1rem; font-weight: 700; line-height: 1.1; margin: 0 0 6px; }
.verdict .say { color: var(--ink); margin: 0 0 10px; }
.verdict .btn { color: var(--ink); border-color: var(--ink); background: var(--card); }

.reasons { list-style: none; padding: 0; margin: 0 0 18px; }
.reasons li { padding: 8px 0 8px 30px; position: relative; border-bottom: 1px dashed var(--line); }
.reasons li::before {
  content: ""; position: absolute; left: 4px; top: 15px;
  width: 12px; height: 12px; border-radius: 2px;
}
.reasons li.hard::before { background: var(--fake); }
.reasons li.medium::before { background: #c28a1d; border-radius: 50%; }
.reasons li.good::before { background: var(--real); border-radius: 50%; }
.reasons li.info::before { border: 2px solid var(--muted); border-radius: 50%; }

h2 { font-size: 1.15rem; margin: 18px 0 8px; }
.steps { padding-left: 1.3em; margin: 0 0 14px; }
.steps li { margin-bottom: 8px; overflow-wrap: anywhere; }
.reasons li { overflow-wrap: anywhere; }

.actions { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 18px; }
.actions .btn { width: 100%; background: var(--card); color: var(--ink); }
.actions .btn.primary { background: var(--real); color: #fff; border-color: var(--real); }
.cif { display: flex; flex-direction: column; gap: 6px; }
.note { font-size: .9rem; color: var(--unsure); border-left: 3px solid var(--unsure); padding-left: 10px; margin: 6px 0 12px; }

.trace { border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 10px 14px; margin: 10px 0 14px; }
.trace summary { cursor: pointer; font-weight: 600; }
.trace ol { padding-left: 1.2em; margin: 10px 0 0; font-size: .92rem; }
.trace li { margin-bottom: 8px; }
.trace code { font-size: .85rem; background: #f1ece0; padding: 1px 4px; border-radius: 3px; word-break: break-all; }
.trace .lvl { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-right: 4px; }
.trace .lvl.hard { color: var(--fake); }
.trace .lvl.medium { color: #9a6c0c; }
.trace .lvl.good { color: var(--real); }
.trace .lvl.info { color: var(--muted); }

.after { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.link-btn { background: none; border: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; padding: 0; }

/* already clicked panel */
.clicked {
  background: var(--fake-bg);
  border: 2px solid var(--fake);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 20px;
}
.clicked h2 { color: var(--fake); margin-top: 0; font-size: 1.3rem; }
.clicked .steps li { margin-bottom: 10px; }
.clicked .btn { width: 100%; margin-bottom: 8px; background: var(--card); color: var(--ink); }
.clicked .btn.primary { background: var(--fake); color: #fff; border-color: var(--fake); }

/* footer sticks to the bottom so the emergency button is always there */
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: var(--paper);
  border-top: 1.5px solid var(--line);
  padding: 10px 16px 12px;
}
.bottom > * { max-width: 528px; margin-inline: auto; }
.fine { font-size: .75rem; color: var(--muted); margin: 6px auto 0; text-align: center; }

.busy { opacity: .6; pointer-events: none; }

@media (min-width: 700px) {
  body { padding-top: 10px; }
}

/* follow-up questions */
.ask-more { border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 12px 14px; margin: 4px 0 14px; }
.ask-row { display: flex; gap: 8px; }
.ask-row input { flex: 1; }
.answer { margin-top: 12px; border-left: 3px solid var(--accent); padding-left: 10px; }
.answer .q { color: var(--muted); font-size: .9rem; margin-bottom: 4px; }
.eng { font-size: .78rem; color: var(--accent); background: #e8eef5; padding: 1px 6px; border-radius: 3px; display: inline-block; overflow-wrap: anywhere; }
