/* One alerts flow (ADR 0129): the rows on /alerts and /account, and the
   /alerts/new form. Dark overrides in alerts-dark.css. */

.al { --al-aur: #1a9c5b; --al-aur-ink: #146c41; --al-aur-soft: #e3f4ea;
  --al-ton: #4a5a8c; --al-ton-soft: #eceff8; --al-day: #c4720d; --al-day-ink: #8a4f00; --al-day-soft: #fdf1e1;
  --al-pick: var(--accent-moon); --al-pick-soft: var(--accent-moon-soft); --al-go: #e8735a; --al-go-ink: #fff; }
.al-page { max-width: 980px; margin: 0 auto; padding: 8px 20px 48px; }
.al-page > h1 { font-size: 2rem; margin: 4px 0; }
.al-crumb { font-size: 0.88rem; color: var(--muted); margin: 16px 0 0; }
.al-crumb a { color: inherit; }
.al-sub { color: var(--muted); margin: 0 0 18px; }
.al a:not(.al-btn, .al-chip) { color: var(--al-pick); }
.al-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 18px; }
.al-head { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 4px; }
.al-head h2 { margin: 0; font-size: 1.25rem; }
.al-head p { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.al-btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.al-btns form { margin: 0; }
.al-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 0.9rem; font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.al-btn:hover { border-color: var(--nav-tile-hover-line); }
.al-btn.is-go { background: var(--al-go); border-color: var(--al-go); color: var(--al-go-ink); }
.al-btn.is-big { padding: 10px 22px; font-size: 1rem; }
.al-btn.is-danger { color: #c0392b; }
.al-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.al-muted { color: var(--muted); }
.al-small { font-size: 0.85rem; }
.al-notice, .al-error { border-radius: 12px; padding: 10px 14px; margin: 0 0 14px; }
.al-notice { background: var(--al-aur-soft); }
.al-error { background: #fde7e4; color: #8b1d12; }

/* Rows: one per place, a chip per alert. */
.al-rows { list-style: none; margin: 8px 0 0; padding: 0; }
.al-row { display: grid; grid-template-columns: 36px minmax(140px, 220px) 1fr; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.al-rows > li:first-child .al-row { border-top: 0; }
.al-tile { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: linear-gradient(160deg, #6a7bb8, #3f4f86); }
.al-tile.is-home { background: linear-gradient(160deg, #f0956f, #d0583a); }
.al-tile.is-fav { background: linear-gradient(160deg, #f6c35d, #e08a2a); }
.al-tile svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linejoin: round; stroke-linecap: round; }
.al-pname { font-weight: 650; line-height: 1.2; min-width: 0; overflow-wrap: anywhere; }
.al-pname small { display: block; font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.al-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.al-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 999px; font-size: 0.85rem; font-weight: 600;
  text-decoration: none; border: 1px solid transparent; max-width: 100%; }
.al-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.al-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.al-chip.aur { background: var(--al-aur-soft); color: var(--al-aur-ink); }
.al-chip.aur i { background: var(--al-aur); }
.al-chip.ton { background: var(--al-ton-soft); color: var(--al-ton); }
.al-chip.day { background: var(--al-day-soft); color: var(--al-day-ink); }
.al-chip.is-paused { opacity: 0.6; }
.al-chip.is-paused .al-what { text-decoration: line-through; }
.al-chip.is-on { box-shadow: inset 0 0 0 1.5px currentColor; }
.al-chip .al-via { font-weight: 400; opacity: 0.85; }
.al-chip:hover { border-color: currentColor; }
.al-foot { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.al-foot form { margin: 0; }
.al-link { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }
.al-empty { margin: 6px 0 4px; }
.al-offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }

/* An alert's panel: under its row, shown when its chip is the link target. */
.al-panel { display: none; background: var(--bg); border-radius: 14px; padding: 12px 14px; margin: 2px 0 10px 48px; scroll-margin-top: 120px; }
.al-panel:target, .al-panel.is-open { display: block; }
.al-panel h3 { margin: 0; font-size: 1rem; }
.al-panel .al-meta { margin: 2px 0 10px; }
.al-panel .aa-form { margin: 0 0 10px; }
.al-flash { margin: 0 0 8px; font-weight: 600; color: var(--al-aur-ink); }
.al-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 12px; }
.al-fields label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 3px; }
.al-fields input { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: var(--surface); color: var(--text); font: inherit; }
.al-fields small { color: var(--muted); font-size: 0.8rem; }
.al-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.al-acts form { margin: 0; }
.al-acts details { display: inline-block; }
.al-acts details[open] { display: block; width: 100%; }
.al-acts summary { list-style: none; }
.al-acts summary::-webkit-details-marker { display: none; }
.al-confirm { margin: 8px 0 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* /alerts/new: four steps. */
.al-step { display: grid; grid-template-columns: 30px 1fr; gap: 14px; padding: 16px 0; border: 0; border-top: 1px solid var(--line); margin: 0; min-width: 0; }
.al-step:first-of-type { border-top: 0; padding-top: 4px; }
.al-num { width: 28px; height: 28px; border-radius: 50%; background: var(--al-pick-soft); color: var(--al-pick); font-weight: 700; display: grid; place-items: center; font-size: 0.9rem; }
.al-step h2 { margin: 3px 0 10px; font-size: 1.05rem; }
.al-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.al-type { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; display: grid; grid-template-columns: 26px 1fr; gap: 4px 10px; align-items: start;
  text-decoration: none; color: var(--text); }
.al-type svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; grid-row: span 2; }
.al-type b { font-size: 0.97rem; }
.al-type span { font-size: 0.82rem; color: var(--muted); line-height: 1.35; }
.al-type:hover { border-color: var(--nav-tile-hover-line); }
.al-type.is-on { border-color: var(--al-pick); background: var(--al-pick-soft); box-shadow: inset 0 0 0 1px var(--al-pick); }
.al-type.aur svg { color: var(--al-aur); }
.al-type.ton svg { color: var(--al-ton); }
.al-type.day svg { color: var(--al-day); }
.al-places { display: flex; flex-wrap: wrap; gap: 8px; }
.al-pl { position: relative; display: inline-flex; align-items: center; gap: 8px; border: 1.5px solid var(--line); border-radius: 12px; padding: 7px 12px 7px 8px; font-size: 0.92rem;
  background: var(--surface); cursor: pointer; color: var(--text); text-decoration: none; }
.al-pl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.al-box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--muted); display: grid; place-items: center; flex: none; box-sizing: border-box; }
.al-pl:has(input:checked) { border-color: var(--al-pick); background: var(--al-pick-soft); }
.al-pl input:checked + .al-box { background: var(--al-pick); border-color: var(--al-pick); }
.al-pl input:checked + .al-box::after, .al-tick input:checked + .al-box::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.al-pl input:focus-visible + .al-box, .al-tick input:focus-visible + .al-box { outline: 2px solid var(--al-pick); outline-offset: 2px; }
.al-pl input:disabled ~ * { opacity: 0.55; }
.al-pl:has(input:disabled) { cursor: default; }
.al-pl svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); flex: none; }
.al-pl small { color: var(--muted); }
.al-pl.is-add { border-style: dashed; color: var(--al-pick); font-weight: 600; }
.al-pl.is-add svg { color: var(--al-pick); }
.al-note { margin: 8px 0 0; }
.al-tick { position: relative; display: flex; gap: 10px; align-items: flex-start; font-size: 0.93rem; cursor: pointer; }
.al-tick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.al-tick .al-box { margin-top: 2px; }
.al-tick input:checked + .al-box { background: var(--al-pick); border-color: var(--al-pick); }
.al-tick small { display: block; color: var(--muted); font-size: 0.82rem; }
.al-ticks { display: grid; gap: 10px; }
.al-time { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 0.93rem; }
.al-time input { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; background: var(--surface); color: var(--text); font: inherit; }
.al-more { margin-top: 10px; }
.al-more summary { color: var(--al-pick); font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.al-more[open] summary { margin-bottom: 8px; }
.al-email { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.al-email input { flex: 1 1 240px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); color: var(--text); font: inherit; }
.al-submit { display: flex; align-items: center; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.al-submit p { margin: 0; }
/* The aurora options reuse the alert form's fields (aurora-alerts.css); the page supplies the steps around them. */
.al-new .aa-form .aa-submit { display: none; }

@media (max-width: 640px) {
  .al-page { padding: 4px 14px 32px; }
  .al-page > h1 { font-size: 1.5rem; }
  .al-card { padding: 14px; }
  .al-row { grid-template-columns: 32px 1fr; gap: 6px 10px; }
  .al-row .al-chips { grid-column: 1 / 3; }
  .al-tile { width: 32px; height: 32px; }
  .al-types, .al-offers { grid-template-columns: 1fr; }
  .al-type span { display: none; }
  .al-type { padding: 9px 12px; align-items: center; }
  .al-type svg { grid-row: auto; }
  .al-step { grid-template-columns: 1fr; gap: 6px; }
  .al-num { display: none; }
  .al-panel { margin-left: 0; }
  .al-head .is-wide { display: none; }
}
.al-panel:focus { outline: none; }
