/* ---------------------------------------------------------------------------
   Design system: UK motorway signage.
   Motorway blue plates with white inner keyline, road-marking yellow accents,
   roadworks amber/black stripes for warning states. Light, bright base.
--------------------------------------------------------------------------- */
:root {
  --mblue: #0b3d91;        /* motorway sign blue */
  --mblue-deep: #072a66;
  --yellow: #ffd335;       /* road-marking yellow */
  --amber: #f7a600;        /* roadworks amber */
  --ink: #14213d;
  --muted: #5b6579;
  --bg: #f2f5fa;
  --card: #ffffff;
  --line: #dde4ee;
  --green: #0f7b4d;        /* primary-route green for OK chips */
  --radius: 14px;
  --display: 'Chivo', sans-serif;
  --body: 'Albert Sans', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; }
a { color: var(--mblue); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* --- top bar --- */
.topbar { background: linear-gradient(180deg, var(--mblue) 0%, var(--mblue-deep) 100%); color: #fff; border-bottom: 4px solid var(--yellow); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 14px; align-items: center; }
.brand-badge { font-family: var(--display); font-weight: 900; background: var(--yellow); color: var(--mblue-deep); border-radius: 8px; padding: 8px 10px; letter-spacing: .5px; font-size: 15px; }
.brand h1 { font-family: var(--display); font-weight: 900; font-size: 20px; margin: 0; letter-spacing: .2px; }
.brand p { margin: 2px 0 0; font-size: 12.5px; opacity: .85; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.gen-at { font-size: 12.5px; opacity: .85; }
.btn-ghost { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; padding: 7px 12px; font-family: var(--body); font-weight: 600; font-size: 13px; cursor: pointer; }
.btn-ghost:hover { background: rgba(255,255,255,.22); }

/* --- layout --- */
.wrap { max-width: 1240px; margin: 0 auto; padding: 22px 20px 40px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; }
.loading { padding: 40px; color: var(--muted); font-weight: 600; }

.status-strip { margin: 0 0 16px; border-radius: 10px; padding: 10px 14px; font-weight: 600; font-size: 13.5px;
  background: #fff7e0; border: 1px solid var(--amber); color: #6b4a00; }

/* --- section cards with motorway sign-plate headers --- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.signplate { background: var(--mblue); color: #fff; padding: 14px 16px; position: relative; box-shadow: inset 0 0 0 3px var(--mblue), inset 0 0 0 5px rgba(255,255,255,.9); border-radius: 10px; margin: 10px; }
.signplate h2 { font-family: var(--display); font-weight: 700; font-size: 16.5px; margin: 0; line-height: 1.25; }
.signplate .blurb { margin: 5px 0 0; font-size: 12.5px; opacity: .88; }
.plate-flag { position: absolute; top: -9px; right: 12px; background: var(--yellow); color: var(--mblue-deep); font-family: var(--display); font-weight: 900; font-size: 11px; letter-spacing: .8px; padding: 4px 9px; border-radius: 6px; box-shadow: 0 2px 6px rgba(7,42,102,.35); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }

.card-body { padding: 4px 16px 14px; }
.item { padding: 11px 0; border-bottom: 1px dashed var(--line); }
.item:last-child { border-bottom: 0; }
.item-title { font-weight: 600; font-size: 14.5px; display: inline; }
.badge-new { display: inline-block; vertical-align: 2px; margin-left: 7px; background: var(--yellow); color: var(--mblue-deep); font-family: var(--display); font-weight: 900; font-size: 10px; letter-spacing: .6px; padding: 2px 7px; border-radius: 5px; }
.item-meta { margin-top: 4px; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.src-chip { background: #eef2f9; border: 1px solid var(--line); color: var(--mblue-deep); border-radius: 6px; padding: 1px 7px; font-weight: 600; font-size: 11.5px; }
.date-chip { font-weight: 600; color: var(--ink); }
.elapsed { color: var(--muted); }
.item-note { margin-top: 5px; font-size: 12.5px; color: var(--muted); background: #f7f9fc; border-left: 3px solid var(--yellow); padding: 6px 9px; border-radius: 0 7px 7px 0; }

/* --- watched-source states --- */
.watch-warn { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: #5a4300; background:
  linear-gradient(0deg, #fff8e2, #fff8e2) padding-box; border: 1px solid var(--amber); border-radius: 8px; padding: 8px 10px; position: relative; }
.watch-warn::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; border-radius: 8px 0 0 8px;
  background: repeating-linear-gradient(45deg, var(--amber) 0 7px, #2b2b2b 7px 14px); }
.watch-warn { padding-left: 18px; }
.watch-ok { margin-top: 6px; font-size: 12.5px; font-weight: 600; color: var(--green); }
.deeplinks { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 7px; }
.deeplinks a { font-size: 12.5px; font-weight: 600; border: 1px solid var(--line); background: #f2f6fc; padding: 4px 9px; border-radius: 7px; }

/* --- feasibility table --- */
.feas-section { margin-top: 26px; }
details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 0; }
summary { cursor: pointer; font-weight: 700; font-family: var(--display); padding: 12px 16px; color: var(--mblue-deep); }
.feas-table-wrap { overflow-x: auto; padding: 0 12px 12px; }
.feas-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.feas-table th, .feas-table td { text-align: left; padding: 8px 10px; border-top: 1px solid var(--line); vertical-align: top; }
.feas-table th { color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; border-top: 0; }
.st-live { color: var(--green); font-weight: 700; }
.st-down { color: #a05a00; font-weight: 700; }

.foot { margin-top: 26px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); padding-top: 14px; }

/* --- login --- */
.login-body { display: grid; place-items: center; min-height: 100vh; background:
  linear-gradient(160deg, #eef3fb 0%, #f7f9fd 55%, #fff 100%); }
.login-card { width: min(400px, 92vw); background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 20px; box-shadow: 0 18px 50px rgba(11,61,145,.12); }
.login-plate { margin: 0 0 16px; }
.login-plate h1 { font-size: 21px; }
.plate-route { display: inline-block; background: var(--yellow); color: var(--mblue-deep); font-family: var(--display); font-weight: 900; font-size: 11px; letter-spacing: .8px; padding: 3px 8px; border-radius: 5px; margin-bottom: 8px; }
.plate-sub { margin: 6px 0 0; font-size: 12px; opacity: .85; }
.login-card form { display: grid; gap: 7px; padding: 0 4px; }
.login-card label { font-weight: 600; font-size: 13px; margin-top: 6px; }
.login-card input { border: 1.5px solid var(--line); border-radius: 9px; padding: 10px 12px; font-size: 15px; font-family: var(--body); }
.login-card input:focus { border-color: var(--mblue); outline: none; box-shadow: 0 0 0 3px rgba(11,61,145,.15); }
.btn-primary { margin-top: 12px; background: var(--mblue); color: #fff; font-family: var(--display); font-weight: 700; letter-spacing: .3px; border: 0; border-radius: 9px; padding: 12px; font-size: 15px; cursor: pointer; }
.btn-primary:hover { background: var(--mblue-deep); }
.fail-msg { background: #fdecec; border: 1px solid #e5a3a3; color: #8f1f1f; font-weight: 600; font-size: 13px; border-radius: 8px; padding: 9px 11px; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 14px 0 0; }

@media (max-width: 480px) {
  .grid { grid-template-columns: 1fr; }
  .topbar-inner { padding: 12px 14px; }
  .brand h1 { font-size: 17px; }
}
