:root {
    --bg: #121212; --card: #1e1e1e; --card-2: #252525; --line: #2c2c2c; --line-2: #333;
    --text: #e0e0e0; --text-strong: #ffffff; --muted: #888; --muted-2: #aaa;
    --bar: #3987e5; --track: #2e2e2e;
    --ok: #81c784; --ok-bg: rgba(46,125,50,0.18); --ok-line: #2e7d32;
    --warn: #ffd54f; --warn-bg: rgba(255,193,7,0.12); --warn-line: #8a6d0b;
    --bad: #ef9a9a; --bad-bg: rgba(198,40,40,0.18); --bad-line: #8e3b3b;
    --dh: #a330c9; --dk: #c41e3a; --druid: #ff7c0a;
  }
  * { box-sizing: border-box; }
  body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 20px; }
  .container { max-width: 1240px; margin: auto; }
  h1, h2 { color: var(--text-strong); }
  h1 { margin: 0 0 6px; }
  h2 { font-size: 1.17em; margin: 0; }
  .sub { color: var(--muted-2); font-size: 14px; margin: 0 0 4px; }
  .generated { color: var(--muted); font-size: 13px; margin: 0 0 20px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .src { padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; border: 1px solid; }
  .src.live { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
  .src.snap { color: var(--warn); border-color: #b28704; background: var(--warn-bg); }
  .card { background: var(--card); padding: 20px; border-radius: 8px; margin-bottom: 25px; box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
  .card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--line-2); margin-bottom: 14px; padding-bottom: 8px; }
  .hint { color: var(--muted); font-size: 12px; text-transform: none; letter-spacing: 0; font-weight: 400; }
  .topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
  .lock { background: #2a2a2a; color: #ccc; border: 1px solid #444; border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
  .lock.on { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }

  .stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin-bottom: 25px; }
  .stat-box { background: var(--card); padding: 15px 20px; border-radius: 8px; border-left: 4px solid #1976d2; }
  .stat-box h3 { margin: 0; font-size: 12px; color: var(--muted-2); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; }
  .stat-box p { margin: 6px 0 0; font-size: 24px; font-weight: bold; color: var(--text-strong); }
  .stat-box.wide { grid-column: span 2; }
  .stat-box.wide p { font-size: 17px; line-height: 1.35; }

  .section-title { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 12px; }
  .section-title h2 { font-size: 1.35em; }
  .acct { font-size: 11px; font-weight: 600; padding: 1px 8px; border-radius: 10px; background: #2a2a2a; border: 1px solid #444; color: #ccc; white-space: nowrap; }

  .chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; margin-bottom: 25px; }
  .char { background: var(--card); border-radius: 8px; padding: 16px 18px; border-top: 4px solid var(--accent, #555); box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
  .char-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
  .char-name { font-size: 21px; font-weight: 700; color: var(--text-strong); }
  .char-meta { color: var(--muted-2); font-size: 12px; margin-top: 2px; }
  .headline-row { display: flex; flex-direction: column; gap: 1px; align-items: flex-end; flex-shrink: 0; }
  .headline-row .headline { display: flex; align-items: baseline; gap: 7px; }
  .headline-row .headline .lbl { font-size: 10px; }
  .headline { text-align: right; }
  .headline .big { font-size: 17px; font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
  .headline .lbl { font-size: 11px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .4px; }
  .sec { margin-top: 14px; }
  .sec-title { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted-2); font-weight: 600; margin-bottom: 7px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .bis { margin: 7px 0; }
  .bis-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
  .bis-label span:last-child { color: var(--muted-2); }
  .meter { height: 8px; background: var(--track); border-radius: 4px; overflow: hidden; }
  .meter > div { height: 100%; background: var(--bar); border-radius: 0 4px 4px 0; }
  .star { color: #ffd54f; font-size: 12px; margin-left: 4px; }

  .vault-row { display: grid; grid-template-columns: 58px 1fr 86px; align-items: center; gap: 8px; margin: 6px 0; font-size: 13px; }
  .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
  .tile { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tile { border: 1px solid #3a3a3a; background: #222; border-radius: 5px; padding: 4px 5px; font-size: 10.5px; color: #777; text-align: center; min-height: 34px; display: flex; flex-direction: column; justify-content: center; line-height: 1.25; }
  .tile b { font-size: 11px; color: #999; }
  .tile.on { background: rgba(57,135,229,0.18); border-color: #3987e5; color: #cfe3ff; }
  .tile.on b { color: #fff; }
  .count { display: flex; align-items: center; justify-content: center; gap: 4px; font-variant-numeric: tabular-nums; }
  .count .n { min-width: 28px; text-align: center; color: var(--text-strong); font-weight: 600; }
  .step { width: 24px; height: 24px; border-radius: 5px; border: 1px solid #444; background: #2a2a2a; color: #ddd; cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
  .step:disabled { opacity: .35; cursor: not-allowed; }
  .auto { font-size: 10px; color: var(--muted); }
  .bonus-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; text-transform: none; letter-spacing: 0; color: var(--muted); border: 1px solid #3a3a3a; border-radius: 9px; padding: 1px 8px 1px 4px; }
  .bonus-chip .bx { width: 12px; height: 12px; border: 1px solid #555; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; line-height: 1; }
  .bonus-chip.on { color: #fff; border-color: #3987e5; background: #1d3b5f; }
  .bonus-chip.on .bx { background: #3987e5; border-color: #3987e5; color: #fff; }

  .checks { display: flex; flex-direction: column; gap: 5px; }
  .check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
  .check.done span { color: var(--muted); text-decoration: line-through; }
  input[type=checkbox] { width: 17px; height: 17px; accent-color: #3987e5; cursor: pointer; flex-shrink: 0; }
  input[type=checkbox]:disabled { cursor: not-allowed; opacity: .55; }
  select, input[type=text], input[type=number] { background: #2a2a2a; color: var(--text); border: 1px solid #444; border-radius: 5px; padding: 4px 7px; font: inherit; font-size: 13px; }
  select:disabled, input:disabled { opacity: .55; cursor: not-allowed; }

  .targets { display: flex; flex-direction: column; gap: 6px; }
  .target { font-size: 12.5px; background: #252525; border-radius: 6px; padding: 6px 9px; }
  .target .boss { color: var(--text-strong); font-weight: 600; }
  .target .items { color: #bdbdbd; margin-top: 2px; }
  .slot { color: var(--muted-2); }
  .specs-tag { font-size: 10.5px; color: var(--muted); margin-left: 4px; }
  .main-item { color: #fff; }
  .empty { color: var(--muted); font-size: 12.5px; margin: 0; }

  .ench-summary { display: flex; gap: 6px; flex-wrap: wrap; }
  .pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; border: 1px solid; }
  .pill.bad { color: var(--bad); border-color: var(--bad-line); background: var(--bad-bg); }
  .pill.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
  .pill.ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
  .ench-list { display: flex; flex-direction: column; gap: 4px; margin-top: 7px; }
  .ench { display: grid; grid-template-columns: 16px 82px 1fr; gap: 6px; font-size: 12.5px; align-items: start; }
  .ench .ico { font-weight: 700; text-align: center; }
  .ench.bad .ico { color: var(--bad); } .ench.warn .ico { color: var(--warn); }
  .ench .s { color: var(--muted-2); }
  .ench .want { color: var(--text-strong); }
  .ench .has { color: var(--muted); font-size: 11.5px; }
  .spec-sel { font-size: 12px; padding: 2px 6px; }

  .cur { display: grid; grid-template-columns: 70px 1fr; gap: 8px 10px; font-size: 13px; align-items: start; }
  .cur .k { color: var(--muted-2); padding-top: 5px; }
  .cur input[type=number] { width: 86px; }
  .cur .calc { color: var(--muted-2); font-size: 12px; margin-top: 3px; }
  .rating-input { width: 76px; text-align: right; font-size: 16px !important; font-weight: 700; }
  .chars.pvp-grid { grid-template-columns: repeat(auto-fill, minmax(560px, 1fr)); }
  .pvpc.open { grid-column: 1 / -1; }
  .pvp-more { display: none; margin-top: 6px; border-top: 1px solid var(--line-2); padding-top: 4px; }
  .pvpc.open .pvp-more { display: block; }
  .pvp-more-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; }
  .minis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
  #pve .pvpc:not(.open) .minis { grid-template-columns: repeat(2, 1fr); }
  .mini { background: #252525; border-radius: 6px; padding: 7px 10px; }
  .mini .k { font-size: 10.5px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .4px; }
  .mini .v { font-size: 17px; font-weight: 700; color: var(--text-strong); margin-top: 2px; font-variant-numeric: tabular-nums; }
  .mini .v.conq { color: #ff9d6e; } .mini .v.craft { color: #c9a5ff; } .mini .v.ok { color: var(--ok); }
  .links { display: inline-flex; gap: 4px; margin-left: 2px; }
  .links a { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 5px; font-size: 10.5px; font-weight: 800; text-decoration: none; color: #ddd; line-height: 1; background: #2a2a2a; border: 1px solid #3a3a3a; }
  .links a img { width: 16px; height: 16px; display: block; }
  .links a:hover { border-color: #3987e5; background: #333; }
  .ic { width: 18px; height: 18px; border-radius: 4px; vertical-align: middle; border: 1px solid #000; }
  .cls-ic { width: 24px; height: 24px; border-radius: 6px; border: 1px solid #000; vertical-align: middle; margin-right: 7px; flex-shrink: 0; }
  .cls-ic.sm { width: 18px; height: 18px; border-radius: 4px; margin-right: 5px; }
  .char, .mini-card, .member, .mtile { position: relative; overflow: hidden; }
  .char > *, .mini-card > *, .member > *, .mtile > * { position: relative; z-index: 1; }
  .char::after, .mini-card::after, .member::after, .mtile::after { content: ''; position: absolute; right: -28px; bottom: -28px; width: 150px; height: 150px;
    background: var(--clsicon, none) center / cover; opacity: .07; border-radius: 50%; pointer-events: none; z-index: 0; filter: grayscale(.2); }
  .mini-card::after, .member::after, .mtile::after { width: 110px; height: 110px; right: -20px; bottom: -20px; }
  .chars.has-open { grid-template-columns: 250px 1fr; align-items: start; }
  .chars.has-open > .pvpc.open { grid-column: 2; grid-row: 1 / span 6; }
  .chars.has-open > .mini-card { grid-column: 1; }
  .mini-card { background: var(--card); border-radius: 8px; padding: 10px 12px; border-left: 4px solid var(--accent, #555); box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
  .mini-card .name-row { justify-content: space-between; }
  .mini-card .char-name { font-size: 16px; }
  .mini-card .mc-stats { display: flex; gap: 14px; margin-top: 6px; font-size: 12px; color: var(--muted-2); }
  .mini-card .mc-stats b { color: var(--text-strong); font-size: 14px; }
  @media (max-width: 860px) { .chars.has-open { grid-template-columns: 1fr; } .chars.has-open > .pvpc.open { grid-column: 1; grid-row: auto; } }
  .team-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin-bottom: 16px; }
  .team-tile { background: var(--card); border-radius: 8px; padding: 14px 16px; border: 1px solid #2c2c2c; cursor: pointer; box-shadow: 0 4px 6px rgba(0,0,0,0.3); text-align: left; color: var(--text); font: inherit; }
  .team-tile:hover { border-color: #3987e5; }
  .team-tile.on { border-color: #3987e5; background: #1a2533; }
  .team-tile .tn { font-size: 18px; font-weight: 700; color: var(--text-strong); }
  .team-tile .td { font-size: 12px; color: var(--muted-2); }
  .team-tile .tstats { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; color: var(--muted-2); }
  .team-tile .tstats b { display: block; font-size: 18px; color: var(--text-strong); }
  .team-tile .tmembers { margin-top: 8px; font-size: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
  .matrix { width: 100%; border-collapse: collapse; }
  .matrix th, .matrix td { padding: 6px 8px; font-size: 12.5px; border-bottom: 1px solid var(--line); text-align: center; }
  .matrix th:first-child, .matrix td:first-child { text-align: left; }
  .matrix td.cell { font-variant-numeric: tabular-nums; }
  .matrix .lv { display: inline-block; min-width: 34px; padding: 1px 6px; border-radius: 4px; font-weight: 700; }
  .lv.good { background: rgba(46,125,50,0.35); color: #b9f6ca; } .lv.mid { background: rgba(255,193,7,0.18); color: #ffe082; } .lv.low { background: rgba(198,40,40,0.25); color: #ffab91; }
  .lv.untimed { outline: 1px dashed #888; }
  .matrix .sc { display: block; color: var(--muted); font-size: 11px; }
  .matrix tr.focus td:first-child { box-shadow: inset 3px 0 0 #ff9d6e; }
  .tag-focus { font-size: 10.5px; color: #ff9d6e; font-weight: 700; margin-left: 6px; }
  .members { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
  .member { background: #252525; border-radius: 8px; padding: 10px 12px; border-left: 4px solid var(--accent, #555); }
  .member .mh { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
  .member .mn { font-size: 15px; font-weight: 700; color: var(--text-strong); }
  .member .ms { font-size: 11.5px; color: var(--muted-2); }
  .member .mr { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .member .row2 { display: flex; gap: 14px; font-size: 12px; color: var(--muted-2); margin-top: 6px; flex-wrap: wrap; }
  .member .row2 b { color: var(--text-strong); }
  .member .chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 7px; }
  .member { display: flex; flex-direction: column; }
  .picker { margin-top: auto; padding-top: 7px; border-top: 1px solid #333; }
  .member .chips { margin-bottom: 9px; }
  .picker .pl { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted-2); margin-bottom: 4px; }
  .picker .row { display: flex; gap: 4px; }
  .pick { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; font-weight: 600; padding: 2px 6px; border-radius: 10px; background: #2a2a2a; border: 1px solid #444; cursor: pointer; color: #ccc; }
  .pick.on { background: #1d3b5f; border-color: #3987e5; color: #fff; }
  .res-badge { background: #2a2a2a; border: 1px solid #555; border-radius: 9px; padding: 0 8px; color: #fff; font-weight: 700; }
  .res-badge.low { border-color: #ff9d6e; color: #ffcfb6; }
  .res-strip { display: flex; gap: 16px; flex-wrap: wrap; align-items: stretch; margin-bottom: 12px; }
  .res-big { background: #1d3b5f; border: 1px solid #3987e5; border-radius: 8px; padding: 8px 14px; display: flex; flex-direction: column; min-width: 190px; }
  .res-big .k, .res-next .k { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: #cfe3ff; }
  .res-big .v { font-size: 26px; font-weight: 800; color: #fff; line-height: 1.1; }
  .res-next { flex: 1; background: #252525; border-radius: 8px; padding: 8px 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
  .res-next .k { width: 100%; color: var(--muted-2); }
  .res-need { background: #2a2a2a; border: 1px solid #444; border-radius: 6px; padding: 2px 8px; font-size: 12.5px; }
  .res-need b { color: #ff9d6e; }
  .res-limit { color: #ff9d6e; }
  .dbtn { margin-left: 8px; font-size: 10.5px; padding: 1px 8px; border-radius: 9px; background: #2a2a2a; border: 1px solid #444; color: #ccc; cursor: pointer; }
  .dbtn:hover { border-color: #3987e5; color: #fff; }
  .matrix tr.drow td { text-align: left; background: #191f27; padding: 8px 12px; }
  .ddet { font-size: 12.5px; line-height: 1.6; color: #d0d0d0; }
  .dchecks, .dtimes { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 3px; }
  .dchk.ok { color: var(--ok); } .dchk.no { color: var(--bad); }
  .dtime { background: #222; border: 1px solid #333; border-radius: 5px; padding: 0 7px; font-variant-numeric: tabular-nums; }
  .toolkit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .tk-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted-2); font-weight: 600; margin: 8px 0 4px; }
  .tk-col .tk-h:first-child { margin-top: 0; }
  .tk-item.miss .ic { filter: grayscale(1); opacity: .6; }
  .tk-item { display: grid; grid-template-columns: 16px 190px 1fr; gap: 6px; font-size: 12.5px; padding: 3px 0; border-bottom: 1px solid #262626; align-items: baseline; }
  .tk-item.have .tk-mark { color: var(--ok); font-weight: 800; }
  .tk-item.miss .tk-mark { color: var(--bad); font-weight: 800; }
  .tk-item.miss .tk-l { color: var(--bad); }
  .tk-util { font-size: 12.5px; padding: 2px 0; }
  @media (max-width: 900px) { .toolkit { grid-template-columns: 1fr; } }
  .swap { font-size: 11px; padding: 1px 8px; border-radius: 5px; background: #2a2a2a; border: 1px solid #444; color: #ccc; cursor: pointer; }
  .swap:hover { border-color: #3987e5; color: #fff; }
  .name-row { display: flex; align-items: center; gap: 10px; }
  .pct { font-weight: 800; font-variant-numeric: tabular-nums; }
  .logchip .lc { font-size: 11px; color: var(--muted-2); margin-left: 4px; }
  .logchip .lc .pct { font-size: 11.5px; margin: 0 4px 0 2px; }
  .logs-line { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted-2); }
  .logs-line .pct { font-size: 15px; margin: 0 2px 0 4px; }
  .logs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
  .logs-table { width: 100%; border-collapse: collapse; }
  .logs-table th, .logs-table td { padding: 4px 6px; font-size: 12.5px; border-bottom: 1px solid var(--line); text-align: right; }
  .logs-table th { background: transparent; color: var(--muted-2); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
  .logs-table th:first-child, .logs-table td:first-child { text-align: left; }
  .logs-table td.none { color: #555; }
  .logs-table td.cb, .logs-table th.cb { text-align: center; }
  .logchip .spec-ic { vertical-align: -3px; }
  .logs-table td:first-child { white-space: nowrap; }
  @media (max-width: 760px) { .logs-grid { grid-template-columns: 1fr; } }
  .meta-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
  .char-head > div:first-child { min-width: 0; }
  .toggle-btn { display: inline-flex; align-items: center; gap: 6px; background: #2a2a2a; color: #ddd; border: 1px solid #444; border-radius: 6px; padding: 3px 11px; font-size: 12px; font-weight: 600; cursor: pointer; }
  .toggle-btn:hover { background: #333; border-color: #3987e5; color: #fff; }
  .toggle-btn .chev { display: inline-block; transition: transform .15s; }
  .pvpc.open .toggle-btn .chev { transform: rotate(180deg); }
  .expand .chev { display: inline-block; transition: transform .15s; }
  .spec-tags { display: flex; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
  .spec-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 9px; background: #2a2a2a; border: 1px solid #444; color: #ccc; }
  @media (max-width: 760px) { .pvp-more-grid { grid-template-columns: 1fr; } .minis { grid-template-columns: repeat(2, 1fr); } }
  .gear { width: 100%; border-collapse: collapse; margin-top: 2px; }
  .gear th, .gear td { padding: 4px 6px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
  .gear th { background: transparent; color: var(--muted-2); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
  .gear td.il { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-strong); width: 42px; }
  .gear .bisname { color: #cfcfcf; }
  .gear tr.have .bisname { color: var(--ok); }
  .gear .src2 { color: var(--muted); font-size: 11px; }
  .gear td.cost { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .cost.conq { color: #ff9d6e; } .cost.hon { color: #8fc1ff; } .cost.craft { color: #c9a5ff; } .cost.done { color: var(--ok); }
  .gear tfoot td { border-bottom: 0; color: var(--muted-2); font-weight: 600; }
  .stat-box.full { grid-column: 1 / -1; }
  .need-grid { display: grid; grid-template-columns: 72px 82px minmax(180px, 1fr) auto; gap: 3px 12px; font-size: 12.5px; align-items: baseline; }
  .need-grid .c { font-weight: 600; }
  .need-grid .specs-tag { margin: 0; }
  .foot { margin-top: 12px; color: var(--muted); font-size: 11.5px; }

  .filters { display: flex; gap: 6px; flex-wrap: wrap; }
  .chip { background: #2a2a2a; color: #ccc; border: 1px solid #444; border-radius: 14px; padding: 3px 10px; font-size: 12px; cursor: pointer; }
  .chip.on { background: #1d3b5f; border-color: #3987e5; color: #fff; }
  #bonus-tabs .chip { font-size: 14px; padding: 6px 16px; border-radius: 18px; font-weight: 600; }
  .todo { display: grid; grid-template-columns: 26px 70px 150px 1fr; gap: 10px; align-items: start; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
  .todo-group { margin-top: 14px; }
  .todo-group:first-child { margin-top: 0; }
  .todo-group h3 { margin: 0 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted-2); display: flex; gap: 10px; align-items: baseline; }
  .todo-group h3 .hint { font-size: 11px; }
  .todo-group .todo:first-of-type { border-top: 0; }
  .todo.done .task, .todo.done .note { text-decoration: line-through; color: var(--muted); }
  .pri { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; text-align: center; border: 1px solid; }
  .pri.High { color: var(--bad); border-color: var(--bad-line); } .pri.Medium { color: var(--warn); border-color: var(--warn-line); } .pri.Low { color: var(--ok); border-color: var(--ok-line); }
  .who { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
  .who .toon { font-weight: 600; }
  .task { color: var(--text-strong); }
  .note { color: var(--muted); font-size: 12px; margin-top: 3px; }
  .lv { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 12px; color: var(--muted-2); }
  .lv input { width: 54px; padding: 2px 5px; font-size: 12px; }
  .lv .meter { width: 140px; height: 6px; }
  .rep { color: var(--muted); font-size: 11px; margin-left: 6px; }
  .addform { display: grid; grid-template-columns: 1fr 110px 140px 110px 100px auto; gap: 8px; margin-top: 14px; }
  .addform input[type=text] { width: 100%; }
  .btn { background: #1976d2; color: #fff; border: 0; border-radius: 5px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
  .btn:disabled { opacity: .5; cursor: not-allowed; }
  .twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }

  .crafters { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
  .crafter { display: flex; gap: 9px; align-items: center; background: #252525; border-radius: 6px; padding: 8px 10px; font-size: 13px; }
  .crafter .p { color: var(--muted-2); font-size: 11.5px; }

  table { width: 100%; border-collapse: collapse; }
  th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: top; }
  th { background: #252525; color: var(--text-strong); white-space: nowrap; }
  td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
  td.cb, th.cb { text-align: center; }
  tr.group td { background: #191919; color: var(--muted-2); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; font-weight: 600; padding: 7px 10px; }
  .table-wrap { overflow-x: auto; }
  .need-list { display: flex; flex-direction: column; gap: 3px; }
  .need { font-size: 12.5px; }
  .need .c { font-weight: 600; }
  select.plan { min-width: 150px; }
  select.plan.suggested { color: #9a9a9a; font-style: italic; border-style: dashed; }
  select.plan.chosen { color: #fff; font-weight: 600; border-color: #3987e5; background: #1d3b5f; }
  .bychar { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
  .bc { background: #252525; border-radius: 8px; padding: 12px 14px; border-top: 3px solid var(--accent, #555); }
  .bc-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
  .bc-head .n { font-size: 16px; font-weight: 700; }
  .bc-inst { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 10px 0 4px; }
  .bc-boss { background: #1e1e1e; border-radius: 6px; padding: 6px 9px; margin-bottom: 5px; }
  .bc-boss.killed { background: #1a2a1d; box-shadow: inset 3px 0 0 #2e7d32; }
  .bc-boss.notkilled { box-shadow: inset 3px 0 0 #8e3b3b; }
  .kdone { font-size: 10.5px; color: var(--ok); font-weight: 700; display: inline-flex; gap: 3px; align-items: center; }
  .ktodo { font-size: 10.5px; color: var(--bad); }
  .kbox { width: 14px; height: 14px; border: 1px solid #555; border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; flex-shrink: 0; }
  .kbox.on { background: #2e7d32; border-color: #2e7d32; color: #fff; }
  .bc-boss .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
  .bc-boss .top .b { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bc-boss .top > span:last-child { flex: 0 0 auto; white-space: nowrap; }
  .roll-tag, .kdone, .ktodo { white-space: nowrap; }
  .bc-boss .b { font-weight: 600; color: var(--text-strong); font-size: 12.5px; }
  .kills { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
  .kill { display: flex; align-items: center; gap: 4px; background: #222; border: 1px solid #2e2e2e; border-radius: 5px; padding: 3px 7px; font-size: 12px; color: #777; min-width: 0; }
  .kill.on { background: #1d2b1f; border-color: #2e5e33; color: #e0e0e0; }
  .kill .kn { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dbadge { font-size: 9.5px; font-weight: 800; border: 1px solid; border-radius: 4px; padding: 0 4px; line-height: 14px; }
  .irows { display: flex; flex-direction: column; gap: 2px; margin-top: 3px; }
  .irow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
  .irow .slot { flex: 0 0 64px; }
  .irow .iname { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vmark { flex: 0 0 14px; font-weight: 800; font-size: 12px; text-align: center; }
  .vmark.ok { color: var(--ok); } .vmark.no { color: var(--bad); }
  .vneed { font-size: 11.5px; color: var(--muted-2); margin: 6px 0 2px; padding-top: 5px; border-top: 1px dashed #333; line-height: 1.5; }
  .vneed-h { display: block; text-transform: uppercase; letter-spacing: .4px; font-size: 10px; color: var(--muted-2); }
  .vneed b { color: #ffab91; font-weight: 600; }
  .ichip { flex: 0 0 auto; font-size: 10px; padding: 0 6px; border-radius: 8px; border: 1px solid #555; color: var(--muted-2); white-space: nowrap; }
  .spl { flex: 0 0 auto; display: inline-flex; gap: 2px; }
  .spec-ic { width: 16px; height: 16px; border-radius: 4px; border: 1px solid #000; }
  .spl-t { font-size: 9.5px; font-weight: 700; width: 15px; height: 15px; border-radius: 4px; background: #2e2e2e; color: #bbb; display: inline-flex; align-items: center; justify-content: center; }
  .need-grid.one-line > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .bc-cat { font-size: 12px; font-weight: 700; color: var(--text-strong); margin: 12px 0 2px; padding-bottom: 3px; border-bottom: 1px solid #333; display: flex; justify-content: space-between; align-items: baseline; }
  .bc-cat:first-of-type { margin-top: 4px; }
  .vtiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 6px 0; }
  .vtiles .tile { min-height: 28px; font-size: 10px; }
  .src-tag { font-size: 10.5px; color: var(--muted); }
  .roll-tag { font-size: 10.5px; padding: 1px 7px; border-radius: 9px; white-space: nowrap; }
  .roll-tag.chosen { background: #1d3b5f; border: 1px solid #3987e5; color: #fff; }
  .roll-tag.suggested { border: 1px dashed #666; color: #9a9a9a; font-style: italic; }
  .roll-tag.other { color: var(--muted); border: 1px solid #333; }
  .legend { font-size: 12px; color: var(--muted-2); display: flex; gap: 14px; flex-wrap: wrap; }
  .legend .sw { display: inline-block; width: 26px; height: 14px; border-radius: 3px; vertical-align: middle; margin-right: 5px; }

  .mplus { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; }
  .mtile { background: #252525; border-radius: 8px; padding: 12px 14px; border-left: 4px solid var(--accent, #555); }
  .mtile-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
  .mtile-head .n { font-weight: 700; color: var(--text-strong); font-size: 16px; }
  .mtile-head .sc { font-weight: 700; color: var(--text-strong); font-size: 16px; font-variant-numeric: tabular-nums; }
  .run { display: grid; grid-template-columns: 1fr 38px 52px; gap: 8px; align-items: center; font-size: 12.5px; padding: 4px 0; border-top: 1px solid var(--line); }
  .run:first-of-type { border-top: 0; }
  .lvl { background: #1d3b5f; color: #cfe3ff; border-radius: 4px; text-align: center; font-weight: 700; font-size: 12px; padding: 1px 0; }
  .run .score { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-strong); }
  .run .spec { color: var(--muted); font-size: 11px; }

  #tip { position: fixed; pointer-events: none; background: #000; color: #fff; border: 1px solid #444; border-radius: 6px; padding: 6px 9px; font-size: 12px; line-height: 1.4; display: none; z-index: 10; max-width: 280px; }
  #toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #000; border: 1px solid #444; color: #fff; padding: 9px 16px; border-radius: 6px; font-size: 13px; display: none; z-index: 20; max-width: 90vw; }
  #toast.bad { border-color: var(--bad-line); color: var(--bad); }
  @media (max-width: 860px) { .twocol { grid-template-columns: 1fr; } }
  @media (max-width: 700px) {
    .stat-box.wide { grid-column: span 1; }
    .addform { grid-template-columns: 1fr 1fr; }
    .todo { grid-template-columns: 26px 62px 1fr; } .todo .who { display: none; }
    .chars, .chars.pvp-grid, .mplus { grid-template-columns: 1fr; }
  }

/* lite tiles */
.chars.lite-grid { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }
.wruns { display: flex; flex-direction: column; gap: 3px; }
.wrun { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; }
.wrun .ok { color: var(--ok); font-size: 11.5px; } .wrun .no { color: var(--bad); font-size: 11.5px; }
.wrun .wd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* page navigation */
.nav { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 18px; }
.nav a { color: #ccc; text-decoration: none; background: #2a2a2a; border: 1px solid #444; border-radius: 16px; padding: 5px 14px; font-size: 13px; font-weight: 600; }
.nav a:hover { border-color: #3987e5; color: #fff; }
.nav a.on { background: #1d3b5f; border-color: #3987e5; color: #fff; }
.lite:not(.open) .minis { grid-template-columns: repeat(2, 1fr); }

/* Stacked BiS bars on friend tiles: same height in every tile of a row; click one to pick the spec for bonus roll targets */
.bis-stack .bis { margin-bottom: 6px; }
.bis-pick { cursor: pointer; border-radius: 6px; padding: 2px 4px; margin-left: -4px; margin-right: -4px; border: 1px solid transparent; }
.bis-pick:hover { background: rgba(255,255,255,.04); }
.bis-pick.on { border-color: rgba(88,166,255,.45); background: rgba(88,166,255,.06); }
.bis-label .sl { margin-right: 2px; }

/* Tier set stats check */
.tier-grid { display: grid; grid-template-columns: 62px minmax(0,1fr) auto auto; gap: 4px 8px; align-items: center; font-size: 12px; }
.tier-grid .tn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tier-grid .tst { white-space: nowrap; font-size: 11.5px; }
.tier-grid .tst b.ok { color: var(--ok); } .tier-grid .tst b.no { color: var(--muted-2); font-weight: 500; }
.tier-grid .tv { font-size: 10.5px; font-weight: 700; white-space: nowrap; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line, #333); }
.tier-grid .tv.ok { color: var(--ok); border-color: rgba(63,185,80,.5); }
.tier-grid .tv.mid { color: #e3b341; border-color: rgba(227,179,65,.5); }
.tier-grid .tv.bad { color: #f85149; border-color: rgba(248,81,73,.5); }
.bis-stack .bis { padding: 2px 4px; margin-left: -4px; margin-right: -4px; border: 1px solid transparent; border-radius: 6px; }
.bis-stack .bis.bis-pick.on { border-color: rgba(88,166,255,.45); }
.bis-stack .bis-label { height: 18px; align-items: center; } .bis-stack .bis-label img { height: 16px; width: 16px; vertical-align: middle; }
