  :root {
    --bg: #12100e; --panel: #1c1916; --panel-2: #24201c; --line: #35302a;
    --text: #efe8dc; --muted: #9a9082;
    --safe: #5fbf7a; --alert: #ff4a3d; --alert-bg: #3a1613; --ack: #e8b04a; --ack-bg: #342a14;
  }
  * { box-sizing: border-box; }
  body { margin: 0; background: var(--bg); color: var(--text);
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
  .wrap { max-width: 960px; margin: 0 auto; padding: 24px 16px 48px; }
  header { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
  h1 { margin: 0; font-size: 28px; letter-spacing: .5px; }
  h1 span { color: var(--alert); }
  .tag { color: var(--muted); margin-top: 2px; }
  .meta { color: var(--muted); font-size: 13px; text-align: right; }
  .banner { background: var(--alert-bg); border: 1px solid var(--alert); color: #ffb3ad;
    padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; display: none; }
  .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
  .card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
  .card.alert { border-color: var(--alert); background: var(--alert-bg); animation: pulse 1.4s infinite; }
  .card.acked { border-color: var(--ack); background: var(--ack-bg); }
  @keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(255,74,61,.25); } }
  @media (prefers-reduced-motion: reduce) { .card.alert { animation: none; } }
  .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .name { font-size: 20px; font-weight: 700; word-break: break-word; }
  .badge { font-size: 12px; font-weight: 700; letter-spacing: .6px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
  .offline .badge { background: rgba(95,191,122,.15); color: var(--safe); }
  .alert .badge { background: var(--alert); color: #fff; }
  .acked .badge { background: var(--ack); color: #1a1405; }
  .world { color: var(--muted); font-size: 13px; margin-top: 2px; }
  .info { margin: 14px 0; min-height: 22px; }
  button { font: inherit; font-weight: 700; border: 0; border-radius: 8px; padding: 11px 14px; cursor: pointer; width: 100%; }
  button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
  .btn-ack { background: var(--alert); color: #fff; font-size: 16px; }
  .btn-ack:hover { filter: brightness(1.1); }
  .btn-pause { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
  .btn-pause:hover { border-color: var(--muted); }
  .btn-cancel { background: transparent; color: var(--ack); border: 1px solid var(--ack); }
  h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin: 32px 0 10px; }
  .log { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
  .row { display: flex; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 14px; }
  .row:first-child { border-top: 0; }
  .row time { color: var(--muted); min-width: 112px; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .row.online { color: #ff9a92; } .row.ack { color: var(--ack); } .row.offline { color: var(--safe); }
  .empty { padding: 16px; color: var(--muted); }
  .loghead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 32px 0 10px; }
  .loghead h2 { margin: 0; }
  .seg { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
  .seg div { display: flex; }
  .seg button, .pager button { width: auto; padding: 5px 12px; background: transparent; color: var(--muted);
    border: 1px solid var(--line); font-weight: 600; border-radius: 0; }
  .seg button:first-child { border-radius: 8px 0 0 8px; } .seg button:last-child { border-radius: 0 8px 8px 0; }
  .seg button + button { border-left: 0; }
  .seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); border-color: var(--muted); }
  .seg button[aria-pressed="true"] + button { border-left: 1px solid var(--line); }
  .pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; color: var(--muted); font-size: 13px; min-height: 32px; }
  .pager .nav { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
  .pager button { border-radius: 8px; color: var(--text); min-width: 34px; padding: 5px 8px; }
  .pager button:hover:not(:disabled) { border-color: var(--muted); }
  .pager button:disabled { opacity: .35; cursor: default; }
  .pager button[aria-current="page"] { background: var(--panel-2); border-color: var(--muted); cursor: default; }
  .pager .gap { padding: 0 4px; }
  .row.added, .row.removed { color: var(--muted); }
  .row.pause { color: var(--ack); } .row.resume { color: var(--safe); }
  .pausebar { display: none; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: var(--ack-bg); border: 1px solid var(--ack); color: var(--ack); padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
  .pausebar button { width: auto; padding: 7px 14px; background: var(--ack); color: #1a1405; }
  .opts { display: grid; gap: 8px; margin-top: 14px; }
  .opts button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
  .opts button:hover { border-color: var(--muted); }
  .head-right { display: flex; align-items: center; gap: 14px; }
  .btn-add { width: auto; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font-weight: 600; padding: 8px 14px; }
  .btn-add:hover { border-color: var(--muted); }
  .card { position: relative; }
  .x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; padding: 0; border-radius: 6px;
    background: transparent; color: var(--muted); font-size: 16px; line-height: 1; opacity: 0; }
  .card:hover .x, .x:focus-visible { opacity: 1; }
  .x:hover { color: var(--alert); background: rgba(255,255,255,.06); }
  .top { padding-right: 22px; }
  @media (hover: none) { .x { opacity: .6; } }
  .tile { background: transparent; border: 2px dashed var(--line); color: var(--muted); border-radius: 12px;
    min-height: 150px; font-size: 16px; font-weight: 600; }
  .tile:hover { border-color: var(--muted); color: var(--text); }
  dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
    padding: 22px; width: min(400px, calc(100vw - 32px)); }
  dialog::backdrop { background: rgba(0,0,0,.65); }
  dialog h3 { margin: 0 0 4px; font-size: 20px; }
  dialog p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
  label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 5px; }
  input { width: 100%; font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
    background: var(--bg); color: var(--text); }
  input:focus-visible { outline: 2px solid var(--alert); outline-offset: 1px; }
  #wlist { list-style: none; margin: 6px 0 0; padding: 4px; max-height: 188px; overflow-y: auto;
    background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; }
  #wlist li { padding: 7px 10px; border-radius: 6px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
  #wlist li small { color: var(--muted); white-space: nowrap; }
  #wlist li.on, #wlist li:hover { background: var(--line); }
  #wlist li mark { background: none; color: var(--alert); font-weight: 700; }
  #wlist .none { color: var(--muted); cursor: default; }
  .err { color: #ff9a92; font-size: 14px; margin-top: 10px; min-height: 20px; }
  .actions { display: flex; gap: 10px; margin-top: 14px; }
  .actions button { width: auto; flex: 1; }
  .btn-go { background: var(--alert); color: #fff; }
  .btn-go:disabled { opacity: .6; cursor: wait; }
  .btn-add.who { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #adlg { width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
  .sec { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 14px; }
  .sec h4 { margin: 0 0 8px; font-size: 14px; letter-spacing: .5px; text-transform: uppercase; color: var(--muted); }
  .codebox { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); border: 1px solid var(--line);
    border-radius: 8px; padding: 9px 12px; word-break: break-all; user-select: all; }
  .inline { display: flex; gap: 8px; margin-top: 8px; }
  .inline input, .inline select { flex: 1; }
  select { font: inherit; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
  button.mini { width: auto; padding: 6px 12px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
  button.mini:hover { border-color: var(--muted); }
  button.mini.danger { color: #ff9a92; }
  .note { font-size: 13px; color: var(--safe); min-height: 18px; margin-top: 6px; }
  .note.bad { color: #ff9a92; }
  .arow { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
  .arow:first-child { border-top: 0; }
  .grow { flex: 1; }
  .authwrap { max-width: 400px; margin: 12vh auto 0; padding: 0 16px; }
  .authwrap .card { padding: 24px; }
  .authwrap h1 { font-size: 26px; margin-bottom: 4px; }
  .authwrap .btn-go { width: 100%; margin-top: 16px; }
  .hint { color: var(--muted); font-size: 13px; margin-top: 6px; }

  .red { color: var(--alert); }
  .tagm { margin-bottom: 18px; }
  .sec h4.mt { margin-top: 14px; }
