/* T-005 routing: alert routing panel and sheet (US15.3) and weekly summary timing (US15.7). Tokens only, so light and dark follow. */

/* Alerts panel: compact section under the alert level */
.route-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.route-panel-text { margin: 2px 0 0; font-size: var(--t-sm); color: var(--ink); text-wrap: pretty; }
.route-panel-stat { margin: 0; font-size: var(--t-xs); color: var(--ink-3); }
.route-panel-stat b { color: var(--ink-2); font-weight: 600; }
.route-panel .route-open { margin-top: 6px; }

/* "To Kira" on alert items */
.route-sent { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.route-sent::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; margin-right: 2px; }

/* Sheet */
.route-sheet, .digest-time-sheet { display: flex; flex-direction: column; gap: 14px; }
.route-intro { font-size: var(--t-xs); line-height: 1.5; }
.route-intro .ico { flex: none; }
.route-type { display: flex; flex-direction: column; padding: 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface-2); }
.route-type-head { display: flex; gap: 10px; align-items: flex-start; }
.route-type-head > span:last-child { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.route-type-head b { font-size: var(--t-sm); font-weight: 600; color: var(--ink); }
.route-type-head small { font-size: var(--t-xs); color: var(--ink-3); text-wrap: pretty; }
.route-type-ico { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }
.route-type[aria-labelledby="rt-risk"] .route-type-ico { color: var(--neg-text); background: var(--neg-soft); border-color: transparent; }
.route-cap { margin: 8px 0 0; padding: 6px 10px; border-radius: var(--r-sm); background: var(--warn-soft); color: var(--ink); font-size: var(--t-xs); text-wrap: pretty; }

.route-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; padding: 10px 0 0; margin-top: 10px; border-top: 1px solid var(--line); }
.route-who { display: flex; align-items: center; gap: 9px; flex: 1 1 140px; min-width: 0; }
.route-who > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.route-who b { font-size: var(--t-sm); font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-who small { font-size: var(--t-xs); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-seg { flex: none; }
.route-seg button { height: 32px; padding: 0 11px; font-size: var(--t-xs); }
.route-seg button:disabled, .digest-time-seg button:disabled { opacity: .38; cursor: not-allowed; }
.route-seg button:disabled:hover, .digest-time-seg button:disabled:hover { color: var(--ink-3); }
.route-mode-text { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); padding: 4px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ink) 5.5%, transparent); white-space: nowrap; }
.route-lock { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 600; color: var(--ink); padding: 4px 10px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2); white-space: nowrap; }
.route-why { flex: 1 1 100%; margin: 0; font-size: var(--t-xs); color: var(--ink-3); display: flex; gap: 6px; align-items: flex-start; text-wrap: pretty; }
.route-why .ico { flex: none; margin-top: 2px; }
.route-add { margin-top: 12px; align-self: flex-start; padding-right: 30px; }
.route-add .flabel { display: inline-flex; }
.route-add select { max-width: 220px; }

/* Last week, folded (progressive disclosure) */
.route-week { border-radius: var(--r-md); border: 1px solid var(--line); }
.route-week summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); }
.route-week summary::-webkit-details-marker { display: none; }
.route-week summary .ico { transition: transform var(--t-med) var(--spring); }
.route-week[open] summary .ico { transform: rotate(180deg); }
.route-week summary:hover { color: var(--ink); }
.route-week ul { list-style: none; margin: 0; padding: 0 14px 10px; }
.route-week li { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--t-xs); }
.route-week li b { display: block; font-weight: 500; color: var(--ink); font-size: var(--t-xs); }
.route-week li small { display: block; color: var(--ink-3); }
.route-week-when { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.route-foot-note { margin: 0; font-size: var(--t-xs); color: var(--ink-3); }

/* Sticky preview + save at the bottom of the sheet: the consequence stays in view while changing */
.route-foot, .digest-time-foot { display: flex; flex-direction: column; gap: 10px; }
.route-foot { position: sticky; bottom: -24px; z-index: 2; margin: 0 -20px -24px; padding: 14px 20px 18px; background: var(--surface); border-top: 1px solid var(--line-2); box-shadow: 0 -10px 24px -18px rgba(0, 0, 0, .35); }
.route-preview p, .digest-time-preview p { margin: 0; font-size: var(--t-sm); color: var(--ink-2); text-wrap: pretty; }
.route-preview b, .digest-time-preview b { color: var(--ink); font-weight: 600; }
.route-people { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.route-people li { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); color: var(--ink-2); }
.route-people li b { color: var(--ink); font-weight: 600; }
.route-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.route-actions .btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.route-actions .btn:disabled:active { transform: none; }

/* Weekly summary timing */
.digest-time-lead { margin: 0; font-size: var(--t-sm); color: var(--ink-2); }
.digest-time-label { margin: 4px 0 -6px; }
.digest-time-seg { align-self: flex-start; max-width: 100%; }
.digest-time-seg button { padding: 0 12px; }
.digest-time-preview { padding: 12px 14px; border-radius: var(--r-md); background: color-mix(in srgb, var(--mint) 55%, var(--surface)); border: 1px solid var(--line); }
.digest-time-btn .digest-time-change { color: var(--ink-3); font-weight: 500; padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--line-2); }

@media (max-width: 767px) {
  .route-panel .route-open { height: 44px; padding: 0 16px; font-size: var(--t-sm); }
  .route-row { gap: 8px; }
  .route-seg { flex: 1 1 100%; display: flex; }
  .route-seg button { flex: 1 1 0; height: 44px; padding: 0 6px; font-size: var(--t-sm); }
  .route-add { align-self: stretch; height: 44px; }
  .route-add select { max-width: none; flex: 1; }
  .route-foot .route-actions .btn { height: 44px; }
  .route-foot .route-save, .digest-time-save { flex: 1; }
  .digest-time-seg { align-self: stretch; display: flex; }
  .digest-time-seg button { flex: 1 1 0; height: 44px; padding: 0 4px; }
  .digest-time-foot .route-actions .btn { height: 44px; }
  .digest-time-btn { height: 40px; }
}
