/* Shared Pnakotic components, based on Tracker. */
:root {
  --ui-bg:#f7f8f9; --ui-panel:#fff; --ui-panel-alt:#fcfcfd; --ui-field:#fff;
  --ui-border:#dce1e5; --ui-text:#27313a; --ui-muted:#78828b; --ui-soft:#f1f3f5;
  --ui-primary:#354b5d; --ui-primary-text:#fff; --ui-error:#a45250;
  --pnakotic-accent:#526f8b;
}
@media (prefers-color-scheme:dark) {
  :root {
    --ui-bg:#11161c; --ui-panel:#1a222b; --ui-panel-alt:#202a34; --ui-field:#202a34;
    --ui-border:#3b4754; --ui-text:#dce5ec; --ui-muted:#92a0ad; --ui-soft:#2a3540;
    --ui-primary:#3b617f; --ui-primary-text:#f6f9fc; --ui-error:#f1b0a9;
    --pnakotic-accent:#89b6dd;
  }
}
:root {
      font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      color: #27313a; background: #f7f8f9; color-scheme: light dark; font-size: 13px; font-synthesis: none;
    }
    * { box-sizing: border-box; }
    body { margin: 0; }
    a { color:var(--pnakotic-accent); }
    p { line-height:1.6; }
    input:not([type=checkbox]):not([type=range]), select, textarea { border:1px solid var(--ui-border); border-radius:6px; padding:8px 10px; background:var(--ui-field); color:var(--ui-text); }
    input[type=checkbox] { accent-color:var(--ui-primary); }
    a:focus-visible { outline:2px solid var(--pnakotic-accent); outline-offset:3px; }
    .pnakotic-nav { padding-bottom:14px; border-bottom:1px solid var(--ui-border); margin-bottom:22px; color:var(--ui-muted); }
    .pnakotic-nav [aria-current=page] { color:var(--ui-text); font-weight:650; }
    .small { font-size:12px; }
    .actions { display:flex; flex-wrap:wrap; align-items:center; gap:7px; }
    .intro { color:var(--ui-muted); font-size:12px; margin:8px 0 0; }
    .btn.close, .btn.close-x { border:0; background:none; color:var(--ui-muted); font-size:22px; padding:0 4px; min-height:28px; }
    button, input, select, textarea { font: inherit; }
    button { cursor: pointer; }
    button:disabled { cursor: default; opacity: .55; }
    button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid #6086ad; outline-offset: 2px; }
    .app-shell { max-width: 1320px; margin: 0 auto; padding: 16px 24px 40px; }
    .head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
    .eyebrow { text-transform: uppercase; letter-spacing: .10em; font-size: 10px; font-weight: 750; color: #869099; margin-top:0; margin-bottom: 5px; }
    h1 { font-size: 23px; letter-spacing: -.7px; font-weight: 690; line-height: 1.15; margin: 0; }
    .head-actions, .toolbar-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
    .mode { display: inline-flex; gap: 6px; align-items: center; color: #6b7580; font-size: 12px; padding: 0 7px; }
    .mode .dot { width: 7px; height: 7px; background: #acb3b9; border-radius: 50%; }
    .mode.shared .dot { background: #4c9c79; }
    .mode.issue .dot { background: #d99a36; }
    .btn { border: 1px solid #dce1e5; background: #fff; color: #3b4752; border-radius: 6px; font-size: 12px; font-weight: 540; min-height: 32px; padding: 6px 11px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
    .btn:hover { background: #f1f3f5; border-color: #cbd3d9; }
    .btn.primary { color: #fff; border-color: #354b5d; background: #354b5d; }
    .btn.primary:hover { background: #253848; }
    .btn.quiet { border-color: transparent; background: transparent; }
    .btn.quiet:hover { background: #edf0f2; }
    .summary { background: #fff; border: 1px solid #e5e9ec; border-radius: 8px; margin-bottom: 14px; padding: 15px 17px 14px; }
    .summary-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
    .summary-head { font-weight: 650; font-size: 13px; }
    .muted { color: #78828b; }
    .summary-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 17px; margin-top: 12px; }
    .legend-item { color: #5f6c77; font-size: 11.5px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
    .legend-item b { font-weight: 650; font-variant-numeric: tabular-nums; color: #313d47; }
    .legend-dot { width: 8px; height: 8px; border-radius: 2px; background: #dde2e6; }
    .legend-dot.verified { background: #5a9f73; }.legend-dot.paper { background: #a1cba8; }
    .legend-dot.unclear { background: #dec36c; }.legend-dot.rework { background: #dca09c; }
    .progress-line { background: #e7eaed; display: flex; height: 6px; border-radius: 3px; margin-top: 13px; overflow: hidden; }
    .progress-line > span { height: 100%; transition: width .15s ease; }
    .progress-line .verified { background: #5a9f73; }.progress-line .paper { background: #a1cba8; }
    .progress-line .unclear { background: #dec36c; }.progress-line .rework { background: #dca09c; }
    .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin: 0 0 10px; }
    .filter-left { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; flex: 1; }
    .search-wrap { position: relative; width: min(100%, 245px); flex: 1 1 190px; max-width: 310px; }
    .search-wrap svg { position: absolute; left: 10px; top: 9px; color: #8f9ba4; pointer-events: none; }
    .search, .filter-select { border: 1px solid #dfe4e8; background: #fff; border-radius: 6px; height: 34px; color: #3c4853; }
    .search { width: 100%; padding: 7px 11px 7px 32px; }
    .filter-select { padding: 6px 28px 6px 10px; max-width: 170px; }
    .search::placeholder { color: #9da6ad; }
    .result-count { color: #889199; white-space: nowrap; font-size: 11.5px; }
    .table-panel { background: #fff; border: 1px solid #e5e9ec; border-radius: 8px; overflow-x: auto; }
    table { width: 100%; border-spacing: 0; border-collapse: collapse; min-width: 735px; }
    thead th { text-align: left; color: #86919a; background: #fcfcfd; font-size: 10.5px; text-transform: uppercase; letter-spacing: .075em; font-weight: 690; padding: 11px 13px; border-bottom: 1px solid #e7eaed; white-space: nowrap; }
    tbody td { padding: 8px 13px; border-bottom: 1px solid #f0f2f4; vertical-align: middle; }
    tbody tr:last-child td { border-bottom: 0; }
    tbody tr:hover { background: #fcfcfd; }
    .card-col { width: 34%; }.faction-col { width: 13%; }.xp-col { width: 7%; }
    .status-col { width: 17%; }.markers-col { width: 15%; }.notes-col { width: 14%; }
    .card-cell { display: flex; gap: 12px; align-items: center; min-width: 215px; }
    .thumb { display: block; flex: 0 0 auto; width: 46px; height: 46px; border-radius: 4px; border: 1px solid #dce0e3; padding: 0; background: #eef0f2; overflow: hidden; }
    .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .card-info { min-width: 0; }
    .name { color: #27333d; font-weight: 630; border: 0; background: none; padding: 0; text-align: left; font-size: 12.5px; line-height: 1.4; }
    .name:hover { text-decoration: underline; text-underline-offset: 3px; }
    .card-meta { font-size: 11px; color: #95a0a9; line-height: 1.6; margin-top: 2px; }
    .faction { display: inline-flex; gap: 7px; align-items: center; color: #5c6873; font-size: 12px; text-transform: capitalize; }
    .faction:before { content: ''; display: block; width: 3px; height: 14px; border-radius: 2px; background: var(--faction, #b2bac1); }
    .xp { color: #66737e; font-variant-numeric: tabular-nums; }
    .status-btn { border: 1px solid transparent; border-radius: 5px; min-height: 30px; padding: 5px 9px; display: inline-flex; gap: 6px; align-items: center; justify-content: flex-start; white-space: nowrap; font-size: 11.5px; font-weight: 600; }
    .status-btn svg { flex-shrink: 0; }
    .status-btn .arrow { margin-left: 6px; opacity: .55; }
    .status-none { background: #f2f4f5; color: #818c95; border-color: #e8ecef; }
    .status-verified { background: #e1f1e5; color: #226b3d; border-color: #c9e6d2; }
    .status-paper { background: #eff7ed; color: #538552; border-color: #dbebd8; }
    .status-unclear { background: #fff4cb; color: #8c6c1c; border-color: #f4e7b5; }
    .status-rework { background: #fbe7e5; color: #a45250; border-color: #f4d8d4; }
    .status-btn:hover { filter: brightness(.98); }
    .marker-btn, .note-btn { color: #65717b; background: transparent; border: 1px solid transparent; border-radius: 5px; padding: 4px 5px; min-height: 29px; display: inline-flex; gap: 5px; align-items: center; max-width: 100%; font-size: 11.5px; text-align: left; }
    .marker-btn:hover, .note-btn:hover { background: #f1f3f5; border-color: #e3e6e8; }
    .tag { display: inline-flex; align-items: center; border: 1px solid #e2e5e9; background: #f4f5f7; color: #586674; font-size: 10.5px; padding: 3px 6px; border-radius: 4px; white-space: nowrap; }
    .tag.stress { background: #eff0f8; color: #65668f; border-color: #e0e0ef; }
    .add-mark { color: #a0a7af; font-size: 12px; }
    .note-text { max-width: 160px; display: inline-block; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; vertical-align: middle; }
    .note-empty { color: #adb5bd; }
    .empty { text-align: center; padding: 54px; color: #8c969e; }
    .menu { position: fixed; z-index: 30; width: 215px; background: #fff; border: 1px solid #dce1e5; box-shadow: 0 9px 30px rgba(33,45,55,.12); border-radius: 7px; padding: 6px; }
    .hidden { display: none !important; }
    .menu-item { display: flex; align-items: center; gap: 9px; width: 100%; color: #46535f; border: 0; background: none; padding: 9px 8px; border-radius: 4px; font-size: 12px; text-align: left; }
    .menu-item:hover, .menu-item.selected { background: #f3f5f6; }
    .menu-item .right { margin-left: auto; color: #849098; }
    .marker-new { display: flex; gap: 5px; padding: 9px 4px 3px; border-top: 1px solid #edf0f2; margin-top: 5px; }
    .marker-new input { min-width: 0; width: 100%; border: 1px solid #dce1e5; border-radius: 5px; padding: 6px; }
    .marker-new button { border: 1px solid #dce1e5; background: #f7f8f9; border-radius: 5px; padding: 4px 8px; }
    dialog { border: 1px solid #dce2e6; border-radius: 10px; padding: 0; background: #fff; color: #293540; box-shadow: 0 18px 70px rgba(21,32,43,.2); max-width: calc(100vw - 26px); }
    dialog::backdrop { background: rgba(24,34,43,.38); }
    .detail-dialog { width: 700px; }
    .dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 20px; border-bottom: 1px solid #e9edf0; }
    .dialog-header h2 { margin: 0; font-size: 16px; letter-spacing: -.2px; }
    .close-x { border: 0; background: none; color: #7b858f; font-size: 22px; padding: 0 4px; line-height: 1; }
    .detail-main { display: grid; grid-template-columns: 270px 1fr; gap: 24px; padding: 19px 21px; }
    .art-preview { min-width: 0; text-align: center; }
    .art-preview img { width: 100%; max-width: 270px; height: auto; max-height: 375px; object-fit: contain; border-radius: 5px; background: #f2f3f4; }
    .flip { margin: 9px auto 0; }
    .field { display: block; margin-bottom: 15px; }
    .field .field-title { display: block; color: #56636d; font-size: 11px; font-weight: 650; margin-bottom: 7px; }
    .field select, .field textarea, .sync-fields input { width: 100%; border: 1px solid #d9e0e5; border-radius: 5px; padding: 8px 10px; color: #34414b; background: #fff; }
    textarea { resize: vertical; min-height: 100px; }
    .marker-choices { display: grid; gap: 7px; max-height: 145px; overflow-y: auto; }
    .marker-choices label { display: flex; align-items: center; gap: 7px; color: #5c6771; font-size: 12px; }
    .marker-choices input { accent-color: #647d96; }
    .dialog-footer { padding: 12px 20px 17px; display: flex; justify-content: flex-end; align-items: center; gap: 8px; border-top: 1px solid #eef0f2; }
    .small-dialog { width: 440px; }
    .sync-fields { padding: 20px; }
    .sync-fields p { color: #64717c; font-size: 12px; line-height: 1.6; margin: 0 0 15px; }
    .sync-fields input { margin: 5px 0 12px; }
    .sync-fields label { font-weight: 570; }
    .sync-fields .checkbox-line { display: flex; align-items: flex-start; gap: 9px; font-weight: 400; line-height: 1.45; color: #606d77; }
    .sync-fields .checkbox-line input { width: auto; margin: 2px 0 0; }
    .sync-help { font-size: 11.5px; color: #9c4b45; min-height: 16px; margin-top: 8px; }
    .foot { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; justify-content: space-between; color: #9aa3ab; font-size: 11px; margin-top: 12px; }
    .packs-body { padding: 16px 20px 20px; }
    .packs-body > p { color: #64717c; font-size: 12px; line-height: 1.55; margin: 0 0 12px; }
    .packs-list { display: grid; gap: 7px; }
    .pack-entry { border: 1px solid #e5e9ec; background: #fff; border-radius: 6px; padding: 11px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .pack-entry .pack-name { font-weight: 640; font-size: 12px; }
    .pack-entry .pack-meta { color: #88939c; font-size: 11px; margin-top: 3px; }
    .pack-empty { color: #88939c; font-size: 12px; padding: 12px 0; }
    .pack-entry .btn { flex-shrink: 0; }
    .pack-entry .btn.danger { color: #a45250; }
    .pack-entry .btn.danger:hover { background: #fbe7e5; border-color: #eac7c4; }
    .toast { position: fixed; z-index: 80; bottom: 22px; right: 22px; background: #344552; color: #fff; border-radius: 6px; padding: 10px 14px; max-width: min(400px, 90vw); box-shadow: 0 4px 18px #28323b33; font-size: 12px; }
    /* Follow the operating system's preferred color scheme. */
    @media (prefers-color-scheme: dark) {
      :root { color: #dce5ec; background: #11161c; }
      button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: #89b6dd; }
      .eyebrow, .muted, .result-count, .foot, .card-meta, .pack-entry .pack-meta { color: #92a0ad; }
      .mode { color: #abb7c2; }
      .mode .dot { background: #788695; }
      .mode.shared .dot { background: #62c494; }
      .mode.issue .dot { background: #e8b45d; }
      .btn { background: #242d37; border-color: #3b4754; color: #d4e0e8; }
      .btn:hover { background: #303b48; border-color: #536477; }
      .btn.primary { color: #f6f9fc; border-color: #4c789c; background: #3b617f; }
      .btn.primary:hover { background: #4b7596; }
      .btn.quiet:hover { background: #2a3540; }
      .summary, .table-panel, .pack-entry { background: #1a222b; border-color: #313d49; }
      .legend-item, .faction, .marker-btn, .note-btn, .marker-choices label { color: #b1c0cd; }
      .legend-item b { color: #e1e9f0; }
      .legend-dot { background: #566370; }
      .progress-line { background: #333e49; }
      .search, .filter-select, .field select, .field textarea, .sync-fields input, .marker-new input { background: #202a34; border-color: #3b4855; color: #e1e9f0; }
      .search::placeholder, textarea::placeholder, .sync-fields input::placeholder, .marker-new input::placeholder { color: #8293a2; }
      .search-wrap svg { color: #91a1af; }
      thead th { background: #202a34; color: #aab9c6; border-bottom-color: #35414d; }
      tbody td { border-bottom-color: #2a3541; }
      tbody tr:hover { background: #222d38; }
      .thumb { background: #29343f; border-color: #46515d; }
      .name { color: #e6edf3; }
      .xp, .field .field-title { color: #bac7d2; }
      .status-none { background: #2a3440; color: #b4c2cf; border-color: #42505e; }
      .status-verified { background: #1b3e30; color: #a5ebc1; border-color: #306247; }
      .status-paper { background: #2b3d2d; color: #c4e6b8; border-color: #47634a; }
      .status-unclear { background: #453b23; color: #f2d58c; border-color: #65542e; }
      .status-rework { background: #462b31; color: #f1b5ae; border-color: #69424a; }
      .status-btn:hover { filter: brightness(1.13); }
      .marker-btn:hover, .note-btn:hover { background: #2c3742; border-color: #45535f; }
      .tag { background: #283440; border-color: #40505f; color: #c3d0df; }
      .tag.stress { background: #30344d; border-color: #454b6a; color: #ccd0ff; }
      .add-mark, .note-empty { color: #9aabb9; }
      .empty, .pack-empty { color: #a5b2bf; }
      .menu, dialog { background: #1d2630; color: #e2ebf3; border-color: #40505e; box-shadow: 0 15px 50px rgba(0,0,0,.48); }
      .menu-item { color: #d1dfeb; }
      .menu-item:hover, .menu-item.selected { background: #2e3b48; }
      .menu-item .right { color: #acbecd; }
      .marker-new, .dialog-header, .dialog-footer { border-color: #35414d; }
      .marker-new button { background: #2b3642; border-color: #455260; color: #e4edf5; }
      .close-x { color: #abb9c6; }
      .art-preview img { background: #28333e; }
      .sync-fields p, .sync-fields .checkbox-line, .packs-body > p { color: #b2c0cc; }
      .sync-help, .pack-entry .btn.danger { color: #f1b0a9; }
      .pack-entry .btn.danger:hover { background: #482e34; border-color: #855058; }
      .toast { background: #354c61; color: #eff6fc; box-shadow: 0 8px 30px rgba(0,0,0,.45); }
      dialog::backdrop { background: rgba(0,0,0,.66); }
    }
    @media (max-width: 710px) {
      .app-shell { padding: 12px 12px 28px; } .head { align-items: flex-start; } h1 { font-size: 21px; }
      .summary { padding: 13px; } .filter-select { flex-grow: 1; }
      .detail-main { grid-template-columns: 1fr; gap: 14px; } .art-preview img { max-width: 200px; max-height: 270px; }
      .detail-dialog { max-height: 94vh; overflow-y: auto; } .dialog-header { padding: 13px 15px; }
      .detail-main { padding: 14px; } .dialog-footer { padding: 12px 15px; }
    }

/* One compact navigation and control header for every app. */
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.app-header { position:sticky; top:0; z-index:600; display:flex; flex-wrap:wrap; align-items:center; gap:6px 18px; min-height:40px; padding:5px 14px; background:var(--ui-panel); color:var(--ui-text); border-bottom:1px solid var(--ui-border); }
.app-header .pnakotic-nav { flex:none; display:flex; flex-wrap:nowrap; align-items:center; gap:12px; padding:0; margin:0; border:0; height:29px; font-size:12px; white-space:nowrap; }
.app-header .pnakotic-nav a { display:inline-flex; align-items:center; min-height:28px; }
.app-header .pnakotic-nav [aria-current=page] { color:var(--pnakotic-accent); }
.app-header-actions { display:flex; align-items:center; flex-wrap:wrap; gap:5px 7px; min-width:0; margin-left:auto; }
.header-group { display:flex; align-items:center; gap:5px; min-width:0; }
.app-header .btn { flex-shrink:0; min-height:28px; padding:4px 8px; font-size:11px; white-space:nowrap; }
.app-header select { min-height:28px; padding:4px 7px; font-size:11px; }
.app-header .mode { font-size:11px; padding:0 4px; }
@media(max-width:710px) {
  .app-header { gap:4px 12px; padding:4px 8px; }
  .app-header .pnakotic-nav { gap:10px; }
  .app-header-actions { margin-left:0; flex:1 1 100%; }
}
