:root {
      --bg: #0f1117;
      --surface: rgba(24, 27, 38, 0.6);
      --surface2: rgba(30, 33, 48, 0.8);
      --surface3: #242840;
      --border: rgba(255, 255, 255, 0.1);
      --border2: rgba(255, 255, 255, 0.15);
      --accent: #5b8dee;
      --accent2: #7aa3f5;
      --green: #3ecf8e;
      --red: #f07070;
      --yellow: #f5c842;
      --text: #dde2f0;
      --text2: #8a90aa;
      --text3: #555c7a;
      --od-color: #0078d4;
      --acc-color: #0696d7;
      --mono: 'Consolas', 'Cascadia Code', 'JetBrains Mono', monospace;
      --sans: 'Segoe UI', system-ui, sans-serif;
      --r: 10px;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body {
      background: radial-gradient(circle at 10% 0%, #1e2540 0%, var(--bg) 40%);
      background-attachment: fixed;
      color: var(--text);
      font-family: var(--sans);
      min-height: 100vh;
      padding: 20px 12px 60px;
    }

    /*  layout  */
    .wrap {
      max-width: 820px;
      margin: 0 auto;
    }

    .header {
      text-align: center;
      padding: 8px 0 24px;
    }

    .header h1 {
      font-size: 1.4rem;
      font-weight: 700;
      letter-spacing: -.02em;
      margin-bottom: 4px;
    }

    .header p {
      font-size: .82rem;
      color: var(--text2);
    }

    .logo {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 4px 12px 4px 8px;
      margin-bottom: 12px;
      font-size: .78rem;
      font-weight: 600;
      color: var(--accent2);
    }

    .logo svg {
      opacity: .9;
    }

    /*  tabs  */
    .tabs {
      display: flex;
      gap: 4px;
      margin-bottom: 14px;
    }

    .tab {
      flex: 1;
      text-align: center;
      padding: 8px 16px;
      border-radius: 8px;
      font-size: .82rem;
      font-weight: 600;
      cursor: pointer;
      background: var(--surface);
      border: 1px solid var(--border);
      color: var(--text2);
      transition: all .15s;
      user-select: none;
    }

    .tab.active {
      background: var(--accent);
      border-color: var(--accent);
      color: #fff;
    }

    .panel {
      display: none;
    }

    .panel.active {
      display: block;
    }

    /*  card  */
    .card {
      background: var(--surface);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      border: 1px solid var(--border);
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
      border-radius: var(--r);
      padding: 18px;
      margin-bottom: 14px;
      transition: transform 0.2s, box-shadow 0.2s;
    }
    .card:hover {
      box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    .card-hd {
      font-size: .75rem;
      font-weight: 700;
      color: var(--text2);
      letter-spacing: .07em;
      text-transform: uppercase;
      margin-bottom: 14px;
      display: flex;
      align-items: center;
      gap: 7px;
    }

    .card-hd .pip {
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: var(--accent);
      flex-shrink: 0;
    }

    /*  form  */
    label {
      display: block;
      font-size: .78rem;
      color: var(--text2);
      margin-bottom: 4px;
      margin-top: 10px;
    }

    label:first-of-type {
      margin-top: 0;
    }

    input[type=text],
    textarea,
    select {
      width: 100%;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 7px;
      color: var(--text);
      font-family: var(--mono);
      font-size: .76rem;
      padding: 9px 11px;
      outline: none;
      transition: border-color .15s;
      resize: vertical;
    }

    input[type=text]:focus,
    textarea:focus,
    select:focus {
      border-color: var(--accent);
    }

    input::placeholder,
    textarea::placeholder {
      color: var(--text3);
    }

    select {
      font-family: var(--sans);
      font-size: .82rem;
    }

    /*  buttons  */
    .btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: 7px;
      padding: 8px 16px;
      font-size: .82rem;
      font-weight: 600;
      cursor: pointer;
      transition: opacity .15s;
    }

    .btn:hover {
      opacity: .85;
    }

    .btn-sm {
      padding: 5px 10px;
      font-size: .75rem;
    }

    .btn-ghost {
      background: var(--surface2);
      border: 1px solid var(--border);
      color: var(--text2);
    }

    .btn-ghost:hover {
      border-color: var(--accent);
      color: var(--accent);
      opacity: 1;
    }

    .btn-green {
      background: var(--green);
      color: #0f1117;
    }

    .btn-red {
      background: transparent;
      border: 1px solid var(--border);
      color: var(--text3);
      border-radius: 6px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 4px 10px;
      cursor: pointer;
      font-size: .85rem;
      transition: all .15s;
      flex-shrink: 0;
    }

    .btn-red:hover {
      border-color: var(--red);
      color: var(--red);
    }

    .actions {
      display: flex;
      gap: 7px;
      margin-top: 12px;
      flex-wrap: wrap;
    }

    /*  status  */
    .status {
      font-size: .72rem;
      color: var(--green);
      margin-top: 7px;
      min-height: 16px;
      opacity: 0;
      transition: opacity .25s;
    }

    .status.show {
      opacity: 1;
    }

    .status.err {
      color: var(--red);
    }

    /*  result  */
    .result-box {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 11px 38px 11px 12px;
      font-family: var(--mono);
      font-size: .76rem;
      color: var(--green);
      word-break: break-all;
      min-height: 42px;
      position: relative;
      margin-top: 11px;
      line-height: 1.55;
      white-space: pre-wrap;
    }

    .result-box.empty {
      color: var(--text2);
      font-family: var(--sans);
      font-size: .8rem;
    }

    .result-box.err {
      color: var(--red);
    }

    .copy-btn {
      position: absolute;
      top: 7px;
      right: 7px;
      background: var(--border);
      border: none;
      border-radius: 5px;
      color: var(--text2);
      font-size: .68rem;
      padding: 3px 7px;
      cursor: pointer;
      transition: all .15s;
      white-space: nowrap;
    }

    .copy-btn:hover {
      background: var(--accent);
      color: #fff;
    }

    /*  table  */
    .member-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 6px;
      table-layout: fixed;
    }

    .member-table th {
      font-size: .7rem;
      font-weight: 600;
      color: var(--text2);
      text-transform: uppercase;
      letter-spacing: .05em;
      padding: 5px 8px;
      text-align: left;
      background: var(--surface3);
      border-bottom: 1px solid var(--border);
    }

    .member-table th:first-child {
      border-radius: 6px 0 0 0;
      width: 35%;
    }

    .member-table th:last-child {
      border-radius: 0 6px 0 0;
      width: 36px;
    }

    .mem-row td {
      padding: 5px 4px;
      border-bottom: 1px solid var(--border);
      vertical-align: top;
    }

    .mem-row:last-child td {
      border-bottom: none;
    }

    .proj-table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 6px;
      table-layout: fixed;
    }

    .proj-table th {
      font-size: .7rem;
      font-weight: 600;
      color: var(--text2);
      text-transform: uppercase;
      letter-spacing: .05em;
      padding: 5px 8px;
      text-align: left;
      background: var(--surface3);
      border-bottom: 1px solid var(--border);
    }

    .proj-table th:first-child {
      border-radius: 6px 0 0 0;
      width: 28%;
    }

    .proj-table th:last-child {
      border-radius: 0 6px 0 0;
      width: 36px;
    }

    .proj-row td {
      padding: 5px 4px;
      border-bottom: 1px solid var(--border);
      vertical-align: middle;
    }

    .proj-row td input {
      font-size: .74rem;
      padding: 7px 9px;
      border-radius: 6px;
      width: 100%;
    }

    .proj-row:last-child td {
      border-bottom: none;
    }

    .hint {
      font-size: .72rem;
      color: var(--text3);
      background: var(--surface2);
      border-radius: 6px;
      padding: 8px 10px;
      margin-top: 8px;
      line-height: 1.6;
      font-family: var(--mono);
    }

    .hint b {
      font-weight: normal;
    }

    /*  multi result  */
    .multi-result {
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-top: 11px;
    }

    .mrow {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 9px 11px;
      display: flex;
      align-items: flex-start;
      gap: 10px;
    }

    .mrow .lbl {
      font-size: .68rem;
      color: var(--text2);
      margin-bottom: 3px;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .mrow .val {
      font-family: var(--mono);
      font-size: .75rem;
      color: var(--green);
      word-break: break-all;
      line-height: 1.5;
    }

    .mrow.err .val {
      color: var(--red);
    }

    .mrow .cpy {
      background: var(--border);
      border: none;
      border-radius: 5px;
      color: var(--text2);
      font-size: .68rem;
      padding: 3px 7px;
      cursor: pointer;
      transition: all .15s;
      white-space: nowrap;
      flex-shrink: 0;
      margin-top: 2px;
    }

    .mrow .cpy:hover {
      background: var(--accent);
      color: #fff;
    }

    /*  match badge  */
    .match-badge {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: .72rem;
      margin-top: 7px;
      color: var(--text2);
    }

    .match-badge .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--green);
    }

    .match-badge.warn .dot {
      background: var(--yellow);
    }

    .match-badge.err .dot {
      background: var(--red);
    }

    .type-badge {
      color: #fff;
      padding: 1px 5px;
      border-radius: 4px;
      font-size: 0.65rem;
      font-weight: bold;
    }

    /*  history  */
    .hist-wrap {
      margin-top: 4px;
    }

    .hist-item {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      padding: 8px 10px;
      border-radius: 7px;
      border: 1px solid var(--border);
      background: var(--surface2);
      margin-bottom: 5px;
      cursor: pointer;
      transition: border-color .15s;
    }

    .hist-item:hover {
      border-color: var(--accent);
    }

    .hist-item:hover .hist-copy {
      opacity: 1;
    }

    .hist-meta {
      font-size: .67rem;
      color: var(--text2);
      margin-bottom: 2px;
      white-space: nowrap;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .hist-path {
      font-family: var(--mono);
      font-size: .73rem;
      color: var(--text);
      line-height: 1.45;
      word-break: break-all;
      flex: 1;
    }

    .hist-copy {
      background: var(--border);
      border: none;
      border-radius: 5px;
      color: var(--text2);
      font-size: .68rem;
      padding: 3px 7px;
      cursor: pointer;
      white-space: nowrap;
      flex-shrink: 0;
      opacity: 0;
      transition: all .15s;
      margin-top: 1px;
      align-self: flex-start;
    }

    .hist-copy:hover {
      background: var(--accent);
      color: #fff;
    }

    .hist-hd {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 8px;
    }

    .hist-hd-lbl {
      font-size: .75rem;
      font-weight: 700;
      color: var(--text2);
      letter-spacing: .06em;
      text-transform: uppercase;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .hist-count {
      background: var(--surface3);
      color: var(--text2);
      font-size: .65rem;
      padding: 1px 6px;
      border-radius: 10px;
      font-weight: 600;
    }

    .hist-clear {
      background: transparent;
      border: none;
      font-size: .72rem;
      color: var(--text3);
      cursor: pointer;
      padding: 2px 6px;
      border-radius: 4px;
    }

    .hist-clear:hover {
      color: var(--red);
    }

    hr.div {
      border: none;
      border-top: 1px solid var(--border);
      margin: 14px 0;
    }

    .inp-od {
      border-left: 3px solid var(--od-color);
      margin-bottom: 6px;
    }

    .inp-acc {
      border-left: 3px solid var(--acc-color);
    }

    @media(max-width:520px) {

      .proj-table th:nth-child(2),
      .proj-row td:nth-child(2) {
        display: none;
      }
    }

    /*  toast  */
    #toast-container {
      position: fixed;
      bottom: 20px;
      right: 20px;
      display: flex;
      flex-direction: column;
      gap: 10px;
      z-index: 9999;
      pointer-events: none;
    }

    .toast {
      background: var(--surface2);
      border: 1px solid var(--border);
      border-left: 4px solid var(--green);
      border-radius: 6px;
      padding: 12px 16px;
      color: var(--text);
      font-size: .82rem;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      animation: slideIn .3s ease, fadeOut .3s ease 2.7s forwards;
      pointer-events: auto;
    }

    .toast.err {
      border-left-color: var(--red);
    }

    @keyframes slideIn {
      from {
        transform: translateX(100%);
        opacity: 0;
      }

      to {
        transform: translateX(0);
        opacity: 1;
      }
    }

    @keyframes fadeOut {
      from {
        opacity: 1;
      }

      to {
        opacity: 0;
      }
    }

    /*  search  */
    .search-box {
      width: 100%;
      margin-bottom: 12px;
      position: relative;
    }

    .search-box input {
      padding-left: 30px;
    }

    .search-box::before {
      content: '';
      position: absolute;
      left: 10px;
      top: 9px;
      font-size: .85rem;
      opacity: 0.6;
    }

    /*  os toggle  */
    .os-toggle {
      display: inline-flex;
      background: var(--surface2);
      border: 1px solid var(--border);
      border-radius: 6px;
      overflow: hidden;
    }

    .os-toggle-btn {
      padding: 4px 10px;
      font-size: .7rem;
      color: var(--text2);
      cursor: pointer;
      user-select: none;
    }

    .os-toggle-btn.active {
      background: var(--accent);
      color: #fff;
    }

    /*  pin  */
    .hist-pin {
      background: transparent;
      border: none;
      font-size: .8rem;
      color: var(--text3);
      cursor: pointer;
      padding: 2px 4px;
      border-radius: 4px;
      margin-right: 4px;
      transition: color .15s;
    }

    .hist-pin:hover,
    .hist-pin.active {
      color: var(--yellow);
    }
