/* PulseGuard | app shell. A frosted top bar, then pages laid out like a weather app:
   the list of sites ("cities") on the left, the chosen site's weather filling the rest. */
.app-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 40; background: rgba(12,22,46,.30); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 1px 0 var(--edge); }
.app-bar .in { display: flex; align-items: center; gap: 20px; height: 64px; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); max-width: 1440px; margin: 0 auto; }
.app-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.app-nav::-webkit-scrollbar { display: none; }
.app-nav a { padding: 8px 13px; border-radius: 999px; font-size: 14.5px; font-weight: 500; text-decoration: none; color: var(--dim); white-space: nowrap; transition: background .2s, color .2s; }
.app-nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.app-nav a[aria-current="page"] { color: var(--navy); background: #fff; font-weight: 600; }
.app-nav .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; }
.me { position: relative; }
.me-btn { display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #fff; font: inherit; cursor: pointer; padding: 4px; border-radius: 999px; }
.me-btn:hover { background: rgba(255,255,255,.08); }
.me-av { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--navy); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.me-txt { text-align: left; line-height: 1.25; font-size: 13.5px; }
.me-txt b { display: block; font-weight: 600; font-size: 14px; }
.me-txt span { color: var(--faint); }
.me-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; padding: 8px; border-radius: 18px; background: rgba(20,34,64,.95); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 1px var(--edge), 0 20px 40px -16px rgba(0,0,0,.5); transform-origin: top right; animation: rise .18s var(--ease); }
.me-menu a, .me-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; font: 500 14.5px var(--font); color: #fff; text-decoration: none; background: none; border: 0; cursor: pointer; }
.me-menu a:hover, .me-menu button:hover { background: rgba(255,255,255,.1); }
.me-menu .who { padding: 8px 12px 10px; font-size: 13px; color: var(--faint); border-bottom: 1px solid var(--edge); margin-bottom: 6px; word-break: break-all; }
@media (max-width: 760px) { .me-txt { display: none; } .app-bar .in { gap: 10px; } .app-bar .logo span { display: none; } }

.app-main { max-width: 1440px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); }
.app-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 12px 0 20px; }
.app-head h1 { font-size: clamp(28px, 3vw, 38px); font-weight: 500; }
.app-head p { color: var(--dim); margin-top: 6px; }
.app-head .acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Overview: cities + the chosen site ---------- */
.wx-app { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.wx-app > * { min-width: 0; }
.cities-col { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; padding: 2px; }
.cities { display: flex; flex-direction: column; gap: 10px; }
.city { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 14px 16px; border-radius: 20px; position: relative; overflow: hidden; isolation: isolate; color: #fff; transition: transform .25s var(--ease), box-shadow .2s; }
.city::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(160deg, #3a7bd5, #8fc2f5); }
.city.cloudy::before { background: linear-gradient(160deg, #5f708a, #a3aebf); }
.city.storm::before { background: linear-gradient(160deg, #1c2232, #4a5468); }
.city.fog::before { background: linear-gradient(160deg, #858b96, #b9bec6); }
.night .city.clear::before { background: linear-gradient(160deg, #0f1c3d, #2c4a82); }
.city:hover { transform: translateY(-2px); }
.city:active { transform: scale(.98); }
.city[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff; }
.city:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.city b { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 8px rgba(0,0,0,.2); }
.city .t { font-size: 24px; font-weight: 300; letter-spacing: -.05em; grid-row: 1 / 3; grid-column: 2; align-self: center; text-align: right; line-height: 1; }
.city small { font-size: 13.5px; color: rgba(255,255,255,.9); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.city-add { all: unset; box-sizing: border-box; cursor: pointer; text-align: center; padding: 13px; border-radius: 20px; box-shadow: inset 0 0 0 1.5px var(--edge-2); color: var(--dim); font-weight: 600; }
.city-add:hover { color: #fff; box-shadow: inset 0 0 0 1.5px #fff; }
.usage { padding: 14px 16px; font-size: 13.5px; color: var(--dim); }
.usage .track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.18); margin: 8px 0 6px; overflow: hidden; }
.usage .fill { height: 100%; background: #fff; border-radius: 3px; transition: width .6s var(--ease); }

.wx-main { min-width: 0; }
.wx-top { text-align: center; padding: 24px 0 30px; }
.wx-top .where { font-size: 20px; font-weight: 500; }
.wx-top .where small { display: block; font-size: 14px; color: var(--faint); font-weight: 400; margin-top: 2px; word-break: break-all; }
.wx-top .temp { font-size: clamp(84px, 12vw, 172px); font-weight: 200; letter-spacing: -.07em; line-height: .9; margin-top: 6px; }
.wx-top .temp small { font-size: .3em; letter-spacing: -.02em; font-weight: 300; }
.wx-top .cond { display: flex; justify-content: center; align-items: center; gap: 10px; font-size: 22px; font-weight: 500; margin-top: 8px; }
.wx-top .why { color: var(--dim); margin: 8px auto 0; font-size: 17px; max-width: 52ch; }
.wx-top .acts { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { padding: 16px 18px; min-width: 0; }
.tile.wide { grid-column: 1 / -1; }
.tile.half { grid-column: span 2; }
.tile.half.tall { grid-row: span 2; }
.tiles { grid-auto-flow: row dense; }
/* "This week" in the narrow column: day and icon on a line, the note under it */
.wk { display: grid; grid-template-columns: 26px 1fr; gap: 2px 10px; padding: 10px 2px; }
.wk + .wk { border-top: 1px solid var(--edge); }
.wk svg { grid-row: 1 / 3; margin-top: 2px; }
.wk b { font-weight: 600; font-size: 14px; }
.wk p { color: var(--dim); font-size: 14px; line-height: 1.45; }
.tile .big { font-size: 32px; font-weight: 300; letter-spacing: -.05em; line-height: 1.1; }
.tile p { color: var(--dim); font-size: 14px; margin-top: 4px; }
.tile .warn { color: var(--cloud); }
.tile .bad { color: var(--storm); }
@media (max-width: 1180px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tile.half { grid-column: 1 / -1; } }
@media (max-width: 900px) {
  .wx-app { grid-template-columns: 1fr; }
  /* On a phone: sites, then the chosen site's weather, then the week and the plan */
  .cities-col { display: contents; }
  .cities { order: 1; } .city-add { order: 2; } .wx-main { order: 3; } .cities-col > .panel { order: 4; }
  .cities { flex-direction: row; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; }
  .cities::-webkit-scrollbar { display: none; }
  .city { flex: 0 0 250px; scroll-snap-align: start; }
}
@media (max-width: 560px) { .tiles { grid-template-columns: 1fr; } .tile.half, .tile.wide { grid-column: auto; } }

/* Response chart */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tipline { position: absolute; top: 0; bottom: 24px; width: 1px; background: rgba(255,255,255,.6); pointer-events: none; opacity: 0; transition: opacity .15s; }
.chart .tip { position: absolute; top: -6px; transform: translate(-50%, -100%); background: #fff; color: var(--navy); border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .15s; }
.chart.hovering .tipline, .chart.hovering .tip { opacity: 1; }

/* ---------- Sites page ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.search { flex: 1; min-width: 200px; max-width: 360px; }
.site-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.site-card { text-decoration: none; display: flex; flex-direction: column; gap: 6px; min-height: 168px; padding: 18px 20px 16px; }
.site-card .city-t { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.site-card b { font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card .u { font-size: 13.5px; color: rgba(255,255,255,.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-card .t { font-size: 40px; font-weight: 200; letter-spacing: -.06em; line-height: 1; margin-top: auto; grid-row: auto; grid-column: auto; text-align: left; align-self: auto; }
.site-card .t small { display: inline; font-size: 15px; letter-spacing: 0; font-weight: 400; opacity: .85; }
.site-card .bars { height: 22px; margin-top: 8px; }

/* ---------- Lists (incidents, maintenance, status pages) ---------- */
.rows { padding: 6px; }
.row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 14px; border-radius: 16px; text-decoration: none; transition: background .15s; }
.row + .row { box-shadow: 0 -1px 0 var(--edge); }
a.row:hover, button.row:hover { background: rgba(255,255,255,.07); }
.row b { display: block; font-weight: 600; }
.row small { display: block; color: var(--dim); font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.row .r { text-align: right; font-size: 14px; color: var(--dim); white-space: nowrap; }
.row .r b { color: #fff; }
.row .acts { display: flex; gap: 6px; }
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
@media (max-width: 700px) { .summary { grid-template-columns: 1fr; } .row { grid-template-columns: 30px minmax(0, 1fr); } .row .r { grid-column: 2; text-align: left; } }

/* ---------- Settings and billing ---------- */
.settings { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; align-items: start; }
.settings section h2 { font-size: 20px; font-weight: 600; margin-bottom: 16px; }
.pref { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; }
.pref + .pref { box-shadow: 0 -1px 0 var(--edge); }
.pref b { display: block; font-weight: 600; }
.pref small { display: block; color: var(--dim); font-size: 14px; }
@media (max-width: 900px) { .settings { grid-template-columns: 1fr; } }

/* "Updated" stamp */
.stamp { font-size: 13px; color: var(--faint); }

/* Phones: no live blur over the moving sky (it flickers while scrolling); see styles.css */
@media (max-width: 900px), (pointer: coarse) {
  .app-bar { background: rgba(12,22,46,.72); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .me-menu { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Status page editor: each site's checkbox with the name it shows under */
.sp-site { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 10px; align-items: center; padding: 4px 0; }
.sp-site .form-input { height: 40px; font-size: 14.5px; }
@media (max-width: 560px) { .sp-site { grid-template-columns: 1fr; gap: 4px; padding-bottom: 10px; } }

/* "Confirm your email" card: alerts can't be sent until the address is confirmed */
.verify-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 22px; margin: 4px 0 20px; box-shadow: inset 0 0 0 1.5px rgba(255,210,122,.55); animation: rise .35s var(--ease); }
.verify-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255,210,122,.18); }
.verify-text h2 { font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.verify-text p { color: var(--dim); font-size: 15px; margin-top: 4px; max-width: 70ch; }
.verify-text p b { color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.verify-status:empty { display: none; }
.verify-status.ok { color: var(--ok); }
.verify-status.bad { color: #ffd0d0; }
.verify-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.verify-acts .link { font-size: 14px; color: var(--dim); }
.verify-card.done { box-shadow: inset 0 0 0 1.5px rgba(158,240,192,.6); }
.verify-card.done .verify-icon { background: rgba(158,240,192,.16); }
@media (max-width: 760px) {
  .verify-card { grid-template-columns: auto minmax(0, 1fr); padding: 16px; gap: 12px 14px; }
  .verify-icon { width: 44px; height: 44px; border-radius: 14px; }
  .verify-acts { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
}
