:root { --wn-h: 40px; --wn-side: 16px; --wn-bottom: max(16px, env(safe-area-inset-bottom)); }

.wn-pill { position: fixed; right: var(--wn-side); bottom: var(--wn-bottom); z-index: 99; font-family: var(--font); font-size: 13px; color: var(--ink-1); }
.wn-pill.is-open { z-index: 101; }

.wn-btn {
  display: inline-flex; align-items: center; gap: 8px; height: var(--wn-h); padding: 0 16px 0 12px;
  border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 500; color: var(--ink-1);
  background: var(--glass); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: inset 0 0 0 1px var(--shell-ring), var(--ambient);
  transition: transform var(--t-fast, .28s) var(--spring, ease);
}
.wn-btn:active { transform: scale(0.97); }
.wn-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wn-btn svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.wn-btn b { font-weight: 600; font-variant-numeric: tabular-nums; }
.wn-btn[aria-expanded="true"] { box-shadow: inset 0 0 0 1px var(--shell-ring), 0 0 0 2px var(--accent-wash), var(--ambient); }

.wn-card {
  position: absolute; right: 0; bottom: calc(100% + 8px); box-sizing: border-box;
  width: min(380px, calc(100vw - 2 * var(--wn-side))); max-height: calc(100vh - var(--wn-bottom) - var(--wn-h) - 32px);
  display: flex; flex-direction: column; padding: 8px; border-radius: 18px;
  background: var(--glass); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: inset 0 0 0 1px var(--shell-ring), var(--ambient);
}
.wn-card[hidden] { display: none; }
.wn-top { padding: 8px 12px 6px; }
.wn-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-1); }
.wn-sub { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ink-2); }
.wn-all { display: inline-block; margin-top: 4px; font-size: 12.5px; color: var(--ink-1); text-decoration: underline; text-underline-offset: 2px; }
.wn-all:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wn-list { list-style: none; margin: 4px 0; padding: 0; display: grid; gap: 2px; overflow: auto; min-height: 0; flex: 1 1 auto; }
.wn-item {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; box-sizing: border-box; padding: 9px 12px; border: 0; border-radius: 12px;
  background: none; cursor: pointer; text-align: left; font: inherit; font-size: 13.5px; line-height: 1.35; color: var(--ink-1);
}
.wn-item:hover { background: var(--shell); }
.wn-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.wn-item[aria-current="true"] { background: var(--shell); box-shadow: inset 3px 0 0 var(--accent); }
.wn-item .wn-h { overflow-wrap: anywhere; }
.wn-gone { padding: 9px 12px; font-size: 13px; color: var(--ink-2); }
.wn-gone summary { cursor: pointer; }
.wn-gone p { margin: 6px 0 0; overflow-wrap: anywhere; }

.wn-mark { flex: none; display: inline-block; min-width: 58px; box-sizing: border-box; padding: 1px 7px; border-radius: 999px; text-align: center;
  font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 18px; }
.wn-mark-new { background: var(--accent-wash); color: var(--ink-1); box-shadow: inset 0 0 0 1px var(--accent); }
.wn-mark-changed { background: var(--warn-wash); color: var(--warn-ink); box-shadow: inset 0 0 0 1px var(--warn); }
.wn-mark-removed { background: var(--down-wash); color: var(--down-ink); box-shadow: inset 0 0 0 1px var(--down); }

.wn-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 4px 2px; border-top: 1px solid var(--hair); }
.wn-step { border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; color: var(--ink-1); background: var(--shell); }
.wn-step:hover { box-shadow: inset 0 0 0 1px var(--shell-ring); }
.wn-step:focus-visible, .wn-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wn-pos { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wn-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px 6px; }
.wn-switch-row span { font-size: 13.5px; }
.wn-switch { position: relative; flex: none; width: 40px; height: 24px; border: 0; border-radius: 999px; cursor: pointer; padding: 0;
  background: var(--hair-strong); transition: background var(--t-fast, .28s); }
.wn-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--core);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: transform var(--t-fast, .28s) var(--spring, ease); }
.wn-switch[aria-checked="true"] { background: var(--accent); }
.wn-switch[aria-checked="true"]::after { transform: translateX(16px); }

.wn-layer { position: absolute; top: 0; left: 0; width: 0; height: 0; pointer-events: none; z-index: 2; }
.wn-bar { position: absolute; width: 3px; border-radius: 3px; }
.wn-bar-new { background: var(--accent); }
.wn-bar-changed { background: repeating-linear-gradient(to bottom, var(--warn) 0 6px, transparent 6px 10px); }   
.wn-glow { position: absolute; border-radius: 14px; box-shadow: 0 0 0 2px var(--accent), 0 0 0 8px var(--accent-wash);   
  opacity: 0; transition: opacity .5s ease; }
.wn-glow.is-on { opacity: 1; }

.wn-tag { margin: 18px 0 -6px; font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wn-diff { margin: 12px 0 20px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--shell-ring); background: var(--core); font-size: 14px; line-height: 1.55; }
.wn-diff > summary { cursor: pointer; padding: 10px 14px; font-weight: 500; }
.wn-diff > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 14px; }
.wn-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 0 14px 14px; }
@media (min-width: 760px) { .wn-diff.is-side .wn-cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 759px) { .wn-layout { display: none; } }   
.wn-col h4 { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--ink-2); }
.wn-col p { margin: 0 0 6px; padding: 2px 6px 2px 22px; border-radius: 6px; position: relative; overflow-wrap: anywhere; }
.wn-col p::before { position: absolute; left: 6px; top: 2px; font-weight: 600; }
.wn-l-same { color: var(--ink-2); }
.wn-l-changed.is-before, .wn-l-removed { background: var(--down-wash); color: var(--down-ink); }
.wn-l-changed.is-before::before, .wn-l-removed::before { content: "−"; }
.wn-l-changed.is-after, .wn-l-new { background: var(--up-wash); color: var(--up-ink); }
.wn-l-changed.is-after::before, .wn-l-new::before { content: "+"; }
.wn-col del { text-decoration: line-through; background: var(--down-wash); color: var(--down-ink); }
.wn-col ins { text-decoration: underline; background: var(--up-wash); color: var(--up-ink); }
.wn-layout { display: flex; gap: 6px; padding: 0 14px 10px; }
.wn-layout button { border: 0; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; background: var(--shell); color: var(--ink-1); }
.wn-layout button[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); }
.wn-layout button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wn-table td { vertical-align: top; }
.wn-table th { text-align: left; vertical-align: bottom; font-size: 12.5px; font-weight: 600; color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--hair); }
.wn-sections { padding-left: 22px; }
.wn-sections li { margin: 4px 0; }
.wn-num { font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { .wn-btn, .wn-switch, .wn-switch::after, .wn-glow { transition: none; } }
@media print { .wn-pill, .wn-layer, .wn-tag, .wn-diff { display: none !important; } }
