/* NexDay website. Dark-first like the app; a light theme too. */
:root {
  --bg: #0e0e10;
  --surface: #17161b;
  --raise: #201e25;
  --fg: #f3eee9;
  --muted: #a39b94;
  --line: #2a2730;
  --accent: #ff7a1a;
  --blue: #4c8dff;
  --up: #2bb24c;
  --down: #ef5350;
  --display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --body: "Mukta", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f2ee; --surface: #ffffff; --raise: #f8f5f1; --fg: #1d1a17; --muted: #6c645d;
    --line: #e6dfd8; --accent: #e5650b; --blue: #1a73e8; --up: #1e8e3e; --down: #d93025; color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f2ee; --surface: #ffffff; --raise: #f8f5f1; --fg: #1d1a17; --muted: #6c645d;
  --line: #e6dfd8; --accent: #e5650b; --blue: #1a73e8; --up: #1e8e3e; --down: #d93025; color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 16px/1.55 var(--body); }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.sel { user-select: all; color: var(--fg); }
[hidden] { display: none !important; }

.bar, main {
  max-width: 1280px; margin: 0 auto;
  padding-left: max(18px, env(safe-area-inset-left, 0px));
  padding-right: max(18px, env(safe-area-inset-right, 0px));
}

/* Header */
.top { position: sticky; top: 0; z-index: 1000; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.top .bar { display: flex; align-items: center; gap: 24px; height: 62px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; flex: none; }
.brand img { border-radius: 10px; }
.brand b { font: 800 22px/1 var(--display); }
.brand b span { color: var(--accent); }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav a { text-decoration: none; padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.nav a:hover { color: var(--fg); }
.nav a.on { background: var(--raise); color: var(--fg); }
.tools { display: flex; gap: 8px; align-items: center; flex: none; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 18px; }
.app-btn, .btn { display: inline-flex; align-items: center; justify-content: center; padding: 9px 16px; border-radius: 12px; background: var(--accent); color: #1b0d03; font: 600 14px var(--display); text-decoration: none; border: 0; cursor: pointer; }
.ticker { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 12px; height: 40px; overflow: hidden;
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
.live { flex: none; background: #e53935; color: #fff; font: 700 12px/1 var(--display); letter-spacing: .08em; padding: 5px 9px; border-radius: 6px; }
.ticker-track { flex: 1; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 3%, #000 92%, transparent); min-width: 0; }
.ticker-move { display: inline-flex; gap: 36px; will-change: transform; }
.ticker-track a { text-decoration: none; font-weight: 500; }
.ticker-track a:hover { color: var(--accent); }
.ticker-track .src { color: var(--muted); font-size: 13px; margin-left: 6px; }

main { padding-block: 24px 48px; }
h1 { font: 800 clamp(28px, 4vw, 38px)/1.1 var(--display); margin: 0; }
h2 { font: 700 18px/1.3 var(--display); margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sec-h { margin: 28px 0 12px; }
.note { color: var(--muted); font-size: 13px; margin-top: 18px; }

/* Home */
.home-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.main-col { display: grid; gap: 22px; min-width: 0; }
.hero-card { position: relative; border-radius: 26px; overflow: hidden; height: 340px; align-self: start; isolation: isolate; }
.hero-card canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-txt { position: relative; height: 100%; padding: 28px 30px; display: flex; flex-direction: column; justify-content: space-between; }
.hero-card.ink-dark { color: #241a12; } .hero-card.ink-light { color: #fff; }
.hello { font: 800 clamp(26px, 3.4vw, 40px)/1.1 var(--display); }
.date { opacity: .85; }
.clock { position: absolute; top: 26px; right: 30px; font: 600 clamp(28px, 4vw, 46px)/1 var(--display); font-variant-numeric: tabular-nums; }
.wx-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.temp { font: 800 clamp(34px, 4.6vw, 52px)/1 var(--display); }
.wx-mood { font-weight: 600; font-size: 18px; }
.city-btn { background: none; border: 0; padding: 0; opacity: .85; cursor: pointer; text-decoration: underline dotted; }
.aqi { margin-left: auto; padding: 6px 12px; border-radius: 999px; font: 700 14px var(--display); color: #fff; }
.side { display: grid; gap: 22px; align-content: start; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px 18px; min-width: 0; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-h a { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 14px; }
.stories { min-width: 0; }
.promo p { color: var(--muted); margin: 6px 0 14px; }
.skeleton { height: 44px; border-radius: 12px; background: linear-gradient(90deg, var(--raise), var(--line), var(--raise)); background-size: 200% 100%; animation: sh 1.4s infinite; margin-bottom: 8px; }
@keyframes sh { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* Cricket mini + full */
.list { display: grid; gap: 10px; }
.match { display: grid; gap: 4px; padding: 10px 12px; border-radius: 14px; background: var(--raise); }
.match .lg { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match .row { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.match .st { font-size: 13px; color: var(--muted); }
.match.live .st { color: #e53935; font-weight: 600; }
.cr-group { margin-bottom: 22px; }
.cr-group h2 { margin-bottom: 10px; }
.cr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

/* Markets */
.mkts { display: grid; gap: 10px; }
.mk { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.mk b { font: 600 15px var(--display); }
.mk .px { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.up { color: var(--up); } .down { color: var(--down); }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.mk-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.mk-card .name { color: var(--muted); font-weight: 600; }
.mk-card .val { font: 700 26px/1.2 var(--display); font-variant-numeric: tabular-nums; margin: 4px 0; }
.mk-card svg { width: 100%; height: 54px; display: block; margin-top: 8px; }
.mk-table { display: grid; gap: 8px; }
.mk-table .mk { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; }

/* Stories */
.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.story-grid.wide { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.story { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; text-decoration: none; min-width: 0; transition: transform .15s; }
.story:hover { transform: translateY(-2px); }
.story .img { aspect-ratio: 16 / 9; background: var(--raise) center / cover no-repeat; }
.story .body { padding: 12px 14px 14px; display: grid; gap: 6px; }
.story h3 { font: 600 16px/1.35 var(--display); margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.story .meta { font-size: 13px; color: var(--muted); }
.story.lead { grid-column: span 2; }
.story.lead h3 { font-size: 21px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chips button, .seg button { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.chips button.on, .seg button.on { background: var(--accent); color: #1b0d03; border-color: transparent; }
.seg { display: flex; gap: 6px; }
.empty { color: var(--muted); padding: 20px 0; }

/* Weather page */
.search { display: flex; gap: 8px; }
.search input, .map-search input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--fg); font: inherit; }
.city-results, .map-results { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 14px; }
.city-results button, .map-results button { display: block; width: 100%; text-align: left; padding: 10px 14px; background: none; border: 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.city-results button:hover, .map-results button:hover { background: var(--raise); }
.city-results small, .map-results small { color: var(--muted); display: block; }
.wx-now { display: grid; grid-template-columns: auto 1fr; gap: 6px 26px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.wx-now .big { font: 800 64px/1 var(--display); grid-row: span 2; }
.wx-now .lbl { font: 600 20px var(--display); }
.wx-now .facts { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); }
.hours { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.hour-c { flex: none; width: 74px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 6px; }
.hour-c .ic { font-size: 22px; } .hour-c .t { font-weight: 700; } .hour-c .p { font-size: 12px; color: var(--blue); }
.days { display: grid; gap: 8px; }
.day-r { display: grid; grid-template-columns: 110px 34px 1fr auto; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.range { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #4c8dff, #ffb74d, #ef5350); opacity: .8; }
.week { display: grid; gap: 6px; }
.week .w { display: grid; grid-template-columns: 48px 28px 1fr auto; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; }

/* Maps */
.map-page { position: relative; height: calc(100vh - 102px - 48px); min-height: 480px; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); }
#map { position: absolute; inset: 0; background: var(--raise); }
.map-ui { position: absolute; left: 14px; top: 14px; width: min(380px, calc(100% - 28px)); z-index: 500; display: grid; gap: 10px; }
.map-search { display: grid; gap: 8px; grid-template-columns: 1fr auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.map-search #mapFrom { grid-column: 1 / -1; }
.map-tools { display: flex; gap: 8px; }
.pill { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; }
.pill.on { background: #e53935; color: #fff; border-color: transparent; }
.route-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.route-card h3 { font: 700 17px var(--display); margin: 0 0 4px; }
.modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.mode { text-align: center; padding: 8px 4px; border-radius: 12px; background: var(--raise); border: 1.5px solid transparent; cursor: pointer; }
.mode.on { border-color: var(--blue); }
.mode b { display: block; font: 700 14px var(--display); font-variant-numeric: tabular-nums; }
.mode span { font-size: 12px; color: var(--muted); }
.leaflet-container { font: inherit; }

/* Footer */
.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.foot .bar { display: flex; gap: 14px 30px; flex-wrap: wrap; justify-content: space-between; padding-block: 22px; }

@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .story.lead { grid-column: auto; }
  .app-btn { display: none; }
  .top .bar { gap: 12px; }
}
@media (max-width: 560px) {
  .hero-card { height: 280px; }
  .day-r { grid-template-columns: 70px 28px 1fr auto; }
  .hero-txt { padding: 22px; }
  .clock { top: 20px; right: 22px; }
  .map-page { height: calc(100vh - 150px); border-radius: 0; margin-inline: -18px; }
}

/* News: headline-first, like a newspaper (small photos, source icons). */
.news-list { display: grid; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.news-list.two { grid-template-columns: 1fr 1fr; }
.news-list.two .lead-story { grid-column: 1 / -1; }
.lead-story { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); text-decoration: none; border-bottom: 1px solid var(--line); }
.lead-img { min-height: 240px; background: var(--raise) center / cover no-repeat; }
.lead-txt { padding: 20px 22px; display: grid; gap: 10px; align-content: center; }
.lead-txt h3 { font: 700 23px/1.3 var(--display); margin: 0; }
.lead-txt p { margin: 0; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 14px 18px; text-decoration: none; border-bottom: 1px solid var(--line); }
.news-list.two .news-row:nth-child(odd) { border-left: 1px solid var(--line); }
.news-row:hover h3, .lead-story:hover h3 { color: var(--accent); }
.news-row h3 { font: 600 16.5px/1.38 var(--display); margin: 0 0 4px; }
.news-row p { margin: 0 0 6px; color: var(--muted); font-size: 14.5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nr-img { width: 116px; height: 78px; border-radius: 10px; background: var(--raise) center / cover no-repeat; flex: none; }
.meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.meta b { color: var(--fg); font-weight: 600; }
.meta .fav { width: 16px; height: 16px; border-radius: 4px; background: #fff; }
.seg.small button { padding: 4px 11px; font-size: 13px; }
.stories .panel-h { gap: 12px; }
@media (max-width: 900px) {
  .news-list.two { grid-template-columns: 1fr; }
  .news-list.two .news-row:nth-child(odd) { border-left: 0; }
  .lead-story { grid-template-columns: 1fr; }
  .lead-img { min-height: 190px; }
}
@media (max-width: 480px) { .nr-img { width: 88px; height: 64px; } .lead-txt h3 { font-size: 19px; } }

/* E-Paper */
.lead-p { color: var(--muted); max-width: 64ch; margin: -6px 0 6px; }
.paper-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.paper { display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; }
.paper:hover { border-color: var(--accent); }
.mast { width: 56px; height: 72px; border-radius: 6px; background: linear-gradient(160deg, var(--raise), var(--line)); display: grid; place-items: center; font: 800 18px var(--display); color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); }
.p-txt { display: grid; gap: 2px; min-width: 0; }
.p-txt b { font: 600 16px var(--display); }
.p-txt .hi { font-size: 14px; }
.p-txt .muted { font-size: 13px; }
.badges { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--raise); border: 1px solid var(--line); }
.badge.free { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, transparent); }
.badge.login { color: #c77700; }
