.wr-trigger {
  position:relative; display:inline-grid; place-items:center; flex:none; width:36px; height:36px;
  padding:0; color:#365462; background:#fff; border:1px solid #cfdce0; border-radius:5px;
}
.wr-trigger:hover,.wr-trigger[aria-expanded=true] { background:#eef6f4; border-color:#9ebfb9; color:var(--teal-deep) }
.wr-trigger span {
  position:absolute; right:-5px; top:-5px; min-width:16px; padding:1px 4px; border:2px solid white;
  border-radius:20px; color:white; background:#a53f36; font-size:10px; font-weight:800;
  font-variant-numeric:tabular-nums; line-height:12px;
}
.wr-panel {
  position:fixed; inset:var(--wr-top,62px) var(--wr-right,18px) auto auto; margin:0;
  width:min(444px,calc(100vw - 24px)); max-height:min(650px,calc(100dvh - var(--wr-top,62px) - 14px));
  padding:0; border:1px solid #c8d7dc; border-radius:5px; background:white; color:var(--ink);
  box-shadow:0 18px 50px #172f422a,0 3px 9px #172f420a; overflow:hidden;
}
.wr-panel::backdrop { background:#142f410e; backdrop-filter:none }
.wr-panel[open] { display:flex; flex-direction:column }
.wr-panel header { display:flex; align-items:center; flex:none; gap:11px; padding:18px 18px 14px }
.wr-heading-icon {
  display:grid; place-items:center; width:38px; height:38px; flex:none; color:#126d62;
  border:1px solid #cce2db; border-radius:5px; background:#edf7f3;
}
.wr-panel h2 { margin:0; font-size:1.04rem; line-height:1.35; letter-spacing:-.035em }
.wr-date { margin:2px 0 0; color:var(--muted); font-size:.73rem; line-height:1.5 }
.wr-date::first-letter { text-transform:uppercase }
.wr-panel header button { margin-left:auto; width:30px; height:30px; background:transparent; border-color:transparent; color:var(--muted) }
.wr-panel header button:hover { border-color:var(--line); background:#f3f7f7 }
.wr-filters { display:flex; flex:none; gap:3px; border-bottom:1px solid #e0e8eb; padding:0 16px }
.wr-filters button {
  position:relative; background:transparent; color:#536a76; border:0; border-radius:4px 4px 0 0;
  font-size:.78rem; font-weight:650; padding:8px 12px 11px;
}
.wr-filters button:hover { background:#f2f7f6; color:#145c53 }
.wr-filters button[aria-pressed=true] { color:#00665d; font-weight:800 }
.wr-filters button[aria-pressed=true]::after {
  content:''; position:absolute; right:11px; left:11px; bottom:0; height:3px; border-radius:2px 2px 0 0; background:#06766a;
}
.wr-content { overflow:auto; min-height:0; overscroll-behavior:contain; padding:3px 16px 15px; scrollbar-gutter:stable }
.wr-group { --wr-accent:#51778b; --wr-tint:#eff4f7 }
.wr-events { --wr-accent:#8460a7; --wr-tint:#f4eff9 }
.wr-overdue { --wr-accent:#ae4f3c; --wr-tint:#faf0ed }
.wr-today { --wr-accent:#237b68; --wr-tint:#edf6f2 }
.wr-group h3 {
  display:flex; gap:7px; align-items:center; margin:15px 3px 6px; color:#314c5b;
  font-size:.75rem; line-height:1.4; letter-spacing:0; font-weight:750;
}
.wr-group h3 i { width:6px; height:6px; border-radius:50%; background:var(--wr-accent) }
.wr-group h3 span {
  padding:0 5px; border:1px solid #e1e9ec; border-radius:4px; color:#566a75; font-size:.65rem; font-variant-numeric:tabular-nums;
}
.wr-group ul { list-style:none; margin:0; padding:0; border:1px solid #e1e8ea; border-radius:5px }
.wr-group li + li { border-top:1px solid #edf1f3 }
.wr-group li:first-child button { border-radius:4px 4px 0 0 }
.wr-group li:last-child button { border-radius:0 0 4px 4px }
.wr-group li:only-child button { border-radius:4px }
.wr-group li button {
  width:100%; min-height:53px; display:grid; align-items:center; grid-template-columns:27px minmax(0,1fr) auto 12px; gap:8px;
  border:0; padding:8px; text-align:left; background:white;
}
.wr-group li button:hover { background:#f5f9f8 }
.wr-group li button:focus-visible { position:relative; z-index:1; outline-offset:0 }
.wr-row-icon {
  width:27px; height:30px; display:grid; place-items:center; border-radius:4px;
  color:var(--wr-accent); background:var(--wr-tint);
}
.wr-row-copy { min-width:0; overflow-wrap:anywhere }
.wr-row-copy b,.wr-row-copy small { display:block }
.wr-row-copy b { color:var(--navy); font-size:.80rem; font-weight:720; line-height:1.45 }
.wr-row-copy small,.wr-time { color:#596c76; font-size:.695rem; line-height:1.5 }
.wr-time { font-variant-numeric:tabular-nums; text-align:right; max-width:8.5em }
.wr-group li button>.j-icon { color:#718792 }
.wr-events .wr-time,.wr-overdue .wr-time { color:var(--wr-accent); font-weight:700 }
.wr-empty { text-align:center; padding:28px 28px 19px }
.wr-empty>span {
  display:grid; place-items:center; width:45px; height:45px; margin:0 auto 12px;
  background:#eef6f2; color:#2b7867; border-radius:50%;
}
.wr-empty b { color:var(--navy); font-size:.92rem }
.wr-empty p { font-size:.79rem; line-height:1.6; margin:5px auto 0; max-width:30ch; color:var(--muted) }
@media (max-width:520px) {
  .wr-panel {
    inset:auto 8px max(8px,env(safe-area-inset-bottom)) 8px; width:auto; max-height:min(83dvh,650px);
  }
  .wr-panel::backdrop { background:#142f4136 }
  .wr-panel header { padding:15px 14px 10px }
  .wr-filters { padding-inline:12px }
  .wr-content { padding:2px 11px 13px; scrollbar-gutter:auto }
  .wr-group li button { min-height:53px; gap:6px; padding:7px }
  .wr-panel header button { width:36px; height:36px }
}
@media (max-width:360px) {
  .wr-group li button { grid-template-columns:24px minmax(0,1fr) auto }
  .wr-group li button>.j-icon { display:none }
  .wr-row-icon { width:24px }
  .wr-time { max-width:6.8em }
}

/* Los avisos del calendario comparten una tarjeta de fecha en la campana y en pantalla. */
:is(.wr-events,.wr-scheduled) ul { border:0; border-radius:0; display:grid; gap:6px }
:is(.wr-events,.wr-scheduled) li+li { border:0 }
.wr-group li button.wr-event-card {
  display:block; padding:10px; border:1px solid #dce5e8; border-radius:8px; background:#f8fafb;
}
.wr-group li button.wr-event-card:hover { background:#f1f6f7; border-color:#bcced1 }
.wr-card-content { display:grid; align-items:center; grid-template-columns:38px minmax(0,1fr); gap:11px; text-align:left }
.wr-date-tile {
  display:grid; align-content:center; justify-items:center; gap:2px; width:38px; height:43px;
  border:1px solid #dce4e7; border-top:3px solid var(--wr-event-color);
  border-radius:6px; background:white; color:#183746; font-variant-numeric:tabular-nums;
}
.wr-date-tile>span { font-size:.52rem; line-height:1; font-weight:750; text-transform:uppercase; letter-spacing:.075em }
.wr-date-tile>b { font-size:1.06rem; font-weight:690; line-height:1; letter-spacing:-.04em }
.wr-event-copy { min-width:0; overflow-wrap:anywhere }
.wr-event-head { display:flex; align-items:baseline; flex-wrap:wrap; justify-content:space-between; gap:2px 9px }
.wr-event-source,.wr-event-head>.wr-time { color:#50646c; font-size:.68rem; font-weight:620; line-height:1.4 }
.wr-event-source::before {
  content:''; display:inline-block; width:6px; height:6px; margin-inline-end:5px;
  border-radius:2px; background:var(--wr-event-color); box-shadow:inset 0 0 0 1px #172f401a;
}
.wr-event-head>.wr-time { max-width:none; text-align:left; font-variant-numeric:tabular-nums }
.wr-events .wr-time,.wr-banner .wr-time { color:#175e56; font-weight:730 }
.wr-event-copy>strong { display:block; margin:2px 0; color:var(--navy); font-size:.87rem; line-height:1.35; font-weight:750 }
.wr-event-details { display:block; color:#50636e; font-size:.72rem; line-height:1.4; font-variant-numeric:tabular-nums }
.wr-banner {
  position:fixed; z-index:85; top:max(68px,calc(env(safe-area-inset-top) + 12px)); right:max(16px,env(safe-area-inset-right));
  display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:start; gap:0 4px;
  width:min(390px,calc(100vw - 32px)); max-height:50dvh; overflow:auto;
  padding:9px; border:1px solid #bfced2; border-radius:12px; background:#fcfefe; color:var(--ink);
  box-shadow:0 10px 30px #173c4826,0 2px 6px #173c480e;
}
.wr-banner>.wr-card-content,.wr-open-event { padding:4px }
.wr-banner .wr-card-content { grid-template-columns:40px minmax(0,1fr) }
.wr-banner .wr-date-tile { width:40px; height:45px }
.wr-banner .wr-event-copy>strong { font-size:.94rem }
.wr-open-event,.wr-dismiss,.wr-extra { border:0; border-radius:5px; background:transparent; color:inherit; font:inherit }
.wr-open-event:hover,.wr-dismiss:hover,.wr-extra:hover { background:#edf4f3 }
.wr-dismiss { padding:0; width:28px; height:28px; display:grid; place-items:center; color:#526971 }
.wr-extra { grid-column:1; justify-self:start; margin:4px 0 0 49px; padding:3px 6px; color:var(--teal-deep); font-size:.72rem; font-weight:720 }
@media(max-width:520px) {
  .wr-banner { top:max(10px,env(safe-area-inset-top)); right:10px; width:calc(100vw - 20px) }
  .wr-dismiss { width:33px; height:33px }
}
@media(prefers-reduced-motion:no-preference) {
  .wr-banner { animation:wr-enter .18s ease-out }
  @keyframes wr-enter { from { opacity:0; transform:translateY(-5px) } to { opacity:1; transform:translateY(0) } }
}
@media print { .wr-banner { display:none } }
