
    :root {
      box-sizing: border-box;
      padding-top: env(safe-area-inset-top, 0px);
      padding-bottom: env(safe-area-inset-bottom, 0px);
      --bg: #f5f6fa;
      --card: #fff;
      --text: #1b2030;
      --muted: #5d6580;
      --line: #d9dde8;
      --accent: #3b5bdb;
      --alkali: #ffb3a7;
      --alkaline: #ffd59e;
      --transition: #ffe99a;
      --post: #b8e6b0;
      --metalloid: #a8e6d6;
      --nonmetal: #a9d4ff;
      --halogen: #c9b8ff;
      --noble: #f2b3e6;
      --lanth: #ffc9d9;
      --actin: #d9c3a8
    }

    @media (prefers-color-scheme:dark) {
      :root:not([data-theme="light"]) {
        --bg: #10131c;
        --card: #1a1f2d;
        --text: #eef0f7;
        --muted: #9aa3bd;
        --line: #2c3348;
        --accent: #8ea2ff;
        --alkali: #7a3b32;
        --alkaline: #7a5524;
        --transition: #756320;
        --post: #2f6a2a;
        --metalloid: #1f6a58;
        --nonmetal: #244f80;
        --halogen: #503a8f;
        --noble: #7a2f6c;
        --lanth: #80374f;
        --actin: #6b5238
      }
    }

    :root[data-theme="dark"] {
      --bg: #10131c;
      --card: #1a1f2d;
      --text: #eef0f7;
      --muted: #9aa3bd;
      --line: #2c3348;
      --accent: #8ea2ff;
      --alkali: #7a3b32;
      --alkaline: #7a5524;
      --transition: #756320;
      --post: #2f6a2a;
      --metalloid: #1f6a58;
      --nonmetal: #244f80;
      --halogen: #503a8f;
      --noble: #7a2f6c;
      --lanth: #80374f;
      --actin: #6b5238
    }

    * {
      box-sizing: border-box
    }

    html,
    body {
      margin: 0
    }

    body {
      background: var(--bg);
      color: var(--text);
      font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
      padding: 16px;
      line-height: 1.4
    }

    .wrap {
      max-width: 1280px;
      margin: 0 auto
    }

    header {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 14px
    }
#head{
text-align: center;

width: 70%;

}
    h1 {
      font-size: clamp(1.3rem, 3vw, 1.9rem);

      margin: 0
    }

    .panel {
      background: var(--card);
      border: 1px solid var(--line);
      border-radius: 12px;
      padding: 12px;
      margin-bottom: 12px
    }

    .controls {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: end
    }

    label {
      display: flex;
      flex-direction: column;
      font-size: .75rem;
      color: var(--muted);
      gap: 4px
    }

    input,
    select,
    button {
      font: inherit;
      color: var(--text);
      background: var(--bg);
      border: 1px solid var(--line);
      border-radius: 8px;
      padding: 8px 10px
    }

    input {
      min-width: 200px
    }

    button {
      cursor: pointer
    }

    button:hover {
      border-color: var(--accent)
    }

    :focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px
    }

    .legend {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-top: 10px
    }

    .chip {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: .78rem;
      padding: 4px 10px;
      border-radius: 999px
    }

    .chip i {
      width: 12px;
      height: 12px;
      border-radius: 3px;
      background: var(--c);
      border: 1px solid var(--line)
    }

    .chip[aria-pressed="true"] {
      border-color: var(--accent);
      box-shadow: 0 0 0 1px var(--accent)
    }

    #status {
      font-size: .85rem;
      color: var(--muted);
      margin: 0 0 8px
    }

    .scroll {
      overflow-x: auto;
      padding-bottom: 8px
    }

    #table {
      display: grid;
      grid-template-columns: 24px repeat(18, minmax(48px, 1fr));
      grid-template-rows: auto repeat(7, auto) 12px auto auto;
      gap: 3px;
      min-width: 960px
    }

    .el {
      background: var(--c);
      border: 1px solid rgba(0, 0, 0, .12);
      border-radius: 6px;
      padding: 3px 4px;
      text-align: left;
      display: flex;
      flex-direction: column;
      min-height: 58px;
      transition: transform .12s, opacity .2s
    }

    .el:hover {
      transform: scale(1.12);
      z-index: 2;
      box-shadow: 0 4px 14px rgba(0, 0, 0, .25)
    }

    .el .n {
      font-size: .62rem;
      color: var(--muted)
    }

    .el .s {
      font-size: 1.1rem;
      font-weight: 700;
      line-height: 1
    }

    .el .m {
      font-size: .55rem;
      margin-top: auto;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis
    }

    .el.dim {
      opacity: .12;
      pointer-events: none
    }

    .lab {
      font-size: .7rem;
      color: var(--muted);
      display: flex;
      align-items: center;
      justify-content: center;
      border: 0;
      background: none;
      padding: 0;
      border-radius: 4px
    }

    .lab.on {
      background: var(--accent);
      color: #fff
    }

    .ph {
      font-size: .62rem;
      color: var(--muted);
      border: 1px dashed var(--line);
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center
    }

    .alkali {
      --c: var(--alkali)
    }

    .alkaline {
      --c: var(--alkaline)
    }

    .transition {
      --c: var(--transition)
    }

    .post {
      --c: var(--post)
    }

    .metalloid {
      --c: var(--metalloid)
    }

    .nonmetal {
      --c: var(--nonmetal)
    }

    .halogen {
      --c: var(--halogen)
    }

    .noble {
      --c: var(--noble)
    }

    .lanth {
      --c: var(--lanth)
    }

    .actin {
      --c: var(--actin)
    }

    dialog {
      border: 1px solid var(--line);
      border-radius: 14px;
      background: var(--card);
      color: var(--text);
      width: min(380px, 92vw);
      padding: 0
    }

    dialog::backdrop {
      background: rgba(0, 0, 0, .5)
    }

    .dh {
      background: var(--c);
      padding: 18px;
      display: flex;
      justify-content: space-between;
      align-items: flex-end;
      color: var(--text)
    }

    .dh .big {
      font-size: 3.2rem;
      font-weight: 800;
      line-height: 1
    }

    dl {
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 6px 14px;
      margin: 0;
      padding: 16px
    }

    dt {
      color: var(--muted);
      font-size: .85rem
    }

    dd {
      margin: 0;
      font-weight: 600
    }

    .df {
      display: flex;
      justify-content: space-between;
      padding: 0 16px 16px
    }
