/* ============================================================
   पटेल मंडी खबर — design system
   Deep green #14632e + wheat gold #e8a020, mobile-first.
   System fonts only. No external assets.
   ============================================================ */
:root{
  --green:#14632e;
  --green-dark:#0d4a21;
  --green-light:#e7f2ea;
  --gold:#e8a020;
  --gold-dark:#c9850f;
  --ink:#1c2b21;
  --muted:#68756c;
  --bg:#f3f5f1;
  --card:#ffffff;
  --line:#e3e8e1;
  --radius:14px;
  --shadow:0 2px 10px rgba(20,99,46,.08);
  --nav-h:64px;
}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{
  font-family:"Noto Sans Devanagari","Mangal",system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  background:var(--bg);color:var(--ink);
  font-size:16px;line-height:1.55;
  padding-bottom:calc(var(--nav-h) + env(safe-area-inset-bottom,0px) + 12px);
}
.wrap{max-width:680px;margin:0 auto;padding:0 14px}
a{color:var(--green);text-decoration:none}

/* ---------- header ---------- */
.app-header{
  background:linear-gradient(135deg,var(--green-dark),var(--green));
  color:#fff;position:sticky;top:0;z-index:50;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
}
.header-in{padding:12px 14px}
.brand{font-size:1.45rem;font-weight:700;letter-spacing:.2px}
.tagline{font-size:.78rem;color:#ffe9bd;opacity:.95;margin-top:2px}

/* ---------- layout / cards ---------- */
#app{padding:14px 0 8px;min-height:60vh}
.card{
  background:var(--card);border:1px solid var(--line);
  border-radius:var(--radius);box-shadow:var(--shadow);
  padding:14px;margin-bottom:12px;
}
.card h2{font-size:1.12rem;color:var(--green-dark);margin-bottom:8px}
.card h3{font-size:1rem;margin-bottom:6px}
.sec-title{font-size:1.05rem;font-weight:700;color:var(--green-dark);margin:14px 2px 8px}
.muted{color:var(--muted);font-size:.85rem}
.small{font-size:.8rem}

/* ---------- price display ---------- */
.price-hero{text-align:center;padding:6px 0 2px}
.price-hero .p-label{font-size:.85rem;color:var(--muted)}
.price-hero .p-val{font-size:2.1rem;font-weight:800;color:var(--green-dark);line-height:1.2}
.price-hero .p-unit{font-size:.85rem;color:var(--muted)}
.price-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:10px}
.price-cell{background:var(--green-light);border-radius:10px;padding:8px 6px;text-align:center}
.price-cell .k{font-size:.72rem;color:var(--muted)}
.price-cell .v{font-size:1.05rem;font-weight:700;color:var(--ink)}
.delta-up{color:#0d7a2f;font-weight:700}
.delta-dn{color:#c0392b;font-weight:700}

/* ---------- freshness badges (spec §43) ---------- */
.badge{display:inline-block;font-size:.75rem;font-weight:700;border-radius:999px;padding:3px 10px;margin:2px 4px 2px 0}
.f-fresh{background:#dff5e3;color:#0d6b2a;border:1px solid #a9dfb6}
.f-warn{background:#fff4d6;color:#8a5f00;border:1px solid #f0d47e}
.f-old{background:#ffe8d6;color:#a34a00;border:1px solid #f5b97e}
.f-stale{background:#fde2e2;color:#a02020;border:1px solid #f2a3a3}

/* ---------- buttons / inputs ---------- */
.btn{
  display:inline-block;border:none;border-radius:10px;cursor:pointer;
  font-size:.95rem;font-weight:700;padding:11px 18px;font-family:inherit;
}
.btn-primary{background:var(--gold);color:#3d2b00}
.btn-primary:active{background:var(--gold-dark)}
.btn-green{background:var(--green);color:#fff}
.btn-ghost{background:#fff;color:var(--green);border:1.5px solid var(--green)}
.btn-block{width:100%;text-align:center}
.field{margin-bottom:10px}
.field label{display:block;font-size:.82rem;font-weight:700;color:var(--green-dark);margin-bottom:4px}
.field input,.field select{
  width:100%;padding:11px 12px;font-size:1rem;font-family:inherit;
  border:1.5px solid var(--line);border-radius:10px;background:#fff;color:var(--ink);
}
.field input:focus,.field select:focus{outline:none;border-color:var(--green)}

/* ---------- bottom nav ---------- */
.bottom-nav{
  position:fixed;left:0;right:0;bottom:0;z-index:60;
  background:#fff;border-top:1px solid var(--line);
  padding-bottom:env(safe-area-inset-bottom,0px);
  box-shadow:0 -2px 10px rgba(0,0,0,.06);
}
.nav-in{display:grid;grid-template-columns:repeat(5,1fr);height:var(--nav-h)}
.bottom-nav a{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  color:var(--muted);font-size:.72rem;font-weight:600;gap:2px;
  border-top:3px solid transparent;
}
.bottom-nav a .ni{font-size:1.25rem;line-height:1}
.bottom-nav a.active{color:var(--green-dark);border-top-color:var(--gold)}

/* ---------- tables ---------- */
.tbl{width:100%;border-collapse:collapse;font-size:.88rem}
.tbl th{background:var(--green-light);color:var(--green-dark);text-align:left;padding:8px;font-size:.78rem}
.tbl td{padding:8px;border-bottom:1px solid var(--line)}
.tbl tr:last-child td{border-bottom:none}

/* ---------- chips ---------- */
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{
  background:#fff;border:1.5px solid var(--line);border-radius:999px;
  padding:7px 14px;font-size:.88rem;font-weight:600;color:var(--ink);cursor:pointer;
}
.chip.on{background:var(--green);border-color:var(--green);color:#fff}

/* ---------- lists ---------- */
.row-item{display:flex;justify-content:space-between;align-items:center;gap:10px;
  padding:11px 2px;border-bottom:1px solid var(--line)}
.row-item:last-child{border-bottom:none}
.row-item .t{font-weight:600}
.row-item .s{font-size:.78rem;color:var(--muted)}

/* ---------- news ---------- */
.news-item{padding:12px 2px;border-bottom:1px solid var(--line)}
.news-item:last-child{border-bottom:none}
.news-item .nh{font-weight:700;font-size:.98rem;margin-bottom:4px}
.news-item .nm{font-size:.75rem;color:var(--muted)}

/* ---------- states ---------- */
.empty-state{text-align:center;padding:38px 16px;color:var(--muted)}
.empty-state .empty-ico{font-size:2.6rem;margin-bottom:10px}
.empty-state p{font-size:1rem}
.skeleton{
  border-radius:10px;background:linear-gradient(90deg,#e8ece7 25%,#f4f6f3 50%,#e8ece7 75%);
  background-size:200% 100%;animation:sh 1.2s infinite linear;min-height:18px;margin:8px 0;
}
@keyframes sh{to{background-position:-200% 0}}
.alert-box{background:#fff8e6;border:1.5px solid var(--gold);border-radius:var(--radius);
  padding:12px 14px;margin-bottom:12px;font-size:.9rem}
.warn-box{background:#fdeeee;border:1.5px solid #e8a0a0;border-radius:var(--radius);
  padding:12px 14px;margin-bottom:12px;font-size:.9rem}
.src-line{font-size:.75rem;color:var(--muted);margin-top:10px;border-top:1px dashed var(--line);padding-top:8px}

@media (min-width:700px){
  .brand{font-size:1.6rem}
  .price-hero .p-val{font-size:2.5rem}
}
