/* ============================================================
   ChatBase — 🧰 Toolkit (toolkit.js)
   ============================================================ */
#tkRoot { max-width: 1000px; }
.tk-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tk-nav button, .tk-seg button {
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--neo-line-hi, rgba(255,255,255,.16));
    background: transparent; color: var(--neo-dim, rgba(235,235,245,.7));
    font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.tk-nav button.on, .tk-seg button.on { background: rgba(255,255,255,.12); color: #fff; border-color: var(--neo-accent, #8ab4ff); }
.tk-panel {
    padding: 20px;
    border-radius: 22px;
    border: 1px solid var(--neo-line, rgba(255,255,255,.08));
    background: var(--neo-surface, rgba(22,22,28,.55));
    -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
}
.tk-panel h2 { margin: 0 0 14px; font-size: 19px; }
.tk-sub { margin: 20px 0 8px; font-size: 13px; color: var(--neo-dim, rgba(235,235,245,.6)); }
.tk-muted { font-size: 13px; color: var(--neo-dim, rgba(235,235,245,.6)); }
.tk-panel label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--neo-dim, rgba(235,235,245,.7)); }
.tk-panel label[hidden] { display: none; }
.tk-in {
    width: 100%; box-sizing: border-box; min-width: 0;
    padding: 10px 13px; border-radius: 12px;
    border: 1px solid var(--neo-line-hi, rgba(255,255,255,.16));
    background: rgba(255,255,255,.06); color: #fff;
    font: inherit; font-size: 14.5px; outline: none;
    color-scheme: dark;
}
.tk-in:focus { border-color: var(--neo-accent, #8ab4ff); }
.tk-area { min-height: 170px; resize: vertical; line-height: 1.5; }
.tk-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tk-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.tk-span2 { grid-column: span 2; }
.tk-out { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.05); font-size: 15px; line-height: 1.5; }
.tk-out.good { background: rgba(52,232,176,.12); }
.tk-out.bad { background: rgba(255,90,122,.12); }
.tk-out.big { font-size: 18px; }
.tk-out b { font-size: 1.15em; }
.tk-letters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tk-letters div { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border-radius: 14px; background: rgba(255,255,255,.04); }
.tk-letters b { font-size: 24px; }
.tk-letters span { font-size: 12px; color: var(--neo-dim, rgba(235,235,245,.65)); text-align: center; }
.tk-btn {
    padding: 9px 16px; border-radius: 999px;
    border: 1px solid var(--neo-line-hi, rgba(255,255,255,.16));
    background: rgba(255,255,255,.07); color: #fff;
    font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer; white-space: nowrap;
}
.tk-btn:hover { background: rgba(255,255,255,.14); }
.tk-btn.primary { background: var(--gradient-purple, linear-gradient(120deg,#7c5cff,#5b8cff)); border-color: transparent; }
.tk-panel > .tk-btn { margin-top: 12px; }

/* GPA */
.tk-gpa-head, .tk-gpa-row { display: grid; grid-template-columns: minmax(0, 2fr) 90px 80px 120px 34px; gap: 8px; align-items: center; }
.tk-gpa-head { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--neo-faint, rgba(235,235,245,.4)); margin-bottom: 6px; }
.tk-gpa-row { margin-bottom: 6px; }
.tk-x { width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,.06); color: #ff8aa0; cursor: pointer; }
.tk-gpa-out, .tk-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 14px; }
.tk-gpa-out div, .tk-stats div { display: flex; flex-direction: column; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.04); }
.tk-gpa-out b { font-size: 30px; font-weight: 800; }
.tk-stats b { font-size: 21px; font-weight: 800; }
.tk-gpa-out span, .tk-stats span { font-size: 12px; color: var(--neo-dim, rgba(235,235,245,.6)); }
.tk-note { grid-column: 1 / -1; margin: 4px 0 0; font-size: 13px; color: var(--neo-dim, rgba(235,235,245,.7)); }

/* Citation / units */
.tk-seg { display: inline-flex; gap: 6px; margin: 0 8px 8px 0; }
.tk-seg.tk-wrap { flex-wrap: wrap; display: flex; }
.tk-cite { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #fff; color: #111; font-family: 'Times New Roman', Times, serif; font-size: 16px; line-height: 1.6; padding-left: 2.6em; text-indent: -1.6em; overflow-wrap: anywhere; }
.tk-cite .tk-muted { color: #666; font-family: inherit; }
.tk-conv { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.tk-conv .tk-in { flex: 1; min-width: 110px; }
.tk-inline { flex-direction: row !important; align-items: center; gap: 6px !important; white-space: nowrap; }
.tk-inline .tk-in { width: 70px; flex: none; }

/* Periodic table */
.tk-search { margin-bottom: 12px; max-width: 360px; }
.tk-pt-wrap { overflow-x: auto; padding-bottom: 6px; }
.tk-pt { display: grid; grid-template-columns: repeat(18, minmax(34px, 1fr)); grid-template-rows: repeat(7, auto) 10px auto auto; gap: 3px; min-width: 660px; }
.tk-el {
    position: relative; aspect-ratio: 1;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 0; border: 1px solid rgba(255,255,255,.08); border-radius: 6px;
    color: #fff; font: inherit; cursor: pointer;
    transition: transform .12s, opacity .2s;
}
.tk-el small { position: absolute; top: 2px; left: 4px; font-size: 8.5px; opacity: .75; }
.tk-el b { font-size: 14px; }
.tk-el:hover, .tk-el.on { transform: scale(1.18); z-index: 2; border-color: #fff; }
.tk-el.dim { opacity: .15; }
.c-alkali { background: #b8394f; } .c-alkaline { background: #c2702b; } .c-transition { background: #3b5ba8; }
.c-post { background: #3f7f78; } .c-metalloid { background: #6e8a2e; } .c-nonmetal { background: #2f8f5b; }
.c-halogen { background: #8a5cc4; } .c-noble { background: #7b3fa0; } .c-lanthanide { background: #a8478a; }
.c-actinide { background: #9a3d6a; } .c-unknown { background: #4a4f5c; }
.tk-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.tk-legend span { padding: 3px 9px; border-radius: 999px; font-size: 11.5px; color: #fff; }
.tk-el-info { display: flex; gap: 16px; align-items: center; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.04); min-height: 70px; }
.tk-el-info h3 { margin: 0 0 4px; font-size: 20px; }
.tk-el-info p { margin: 0 0 3px; font-size: 13.5px; color: var(--neo-dim, rgba(235,235,245,.75)); }
.tk-el-big { position: relative; flex: 0 0 auto; width: 76px; height: 76px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.tk-el-big b { font-size: 32px; }
.tk-el-big small { position: absolute; top: 5px; left: 8px; font-size: 12px; }

/* Picker */
.tk-pick-out { margin-top: 14px; }
.tk-winner { padding: 22px; border-radius: 18px; background: rgba(255,180,67,.12); border: 1px solid rgba(255,180,67,.4); text-align: center; font-size: 28px; font-weight: 800; }
.tk-winner.rolling { opacity: .6; }
.tk-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.tk-teams div { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.05); }
.tk-teams b { margin-bottom: 4px; color: var(--neo-accent, #8ab4ff); }
.tk-teams span { font-size: 14px; }

@media (max-width: 700px) {
    .tk-grid3, .tk-grid2 { grid-template-columns: 1fr; }
    .tk-span2 { grid-column: auto; }
    .tk-letters { grid-template-columns: repeat(2, 1fr); }
    .tk-gpa-head { display: none; }
    .tk-gpa-row { grid-template-columns: 1fr 1fr; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.03); }
    .tk-gpa-row .tk-x { justify-self: end; }
}
