/* chemdb.chromoshub.ru — compound reference. Palette mirrors the other tools. */
:root {
    --bg: #0d1117; --bg-2: #161b22; --bg-3: #1c2430; --card: #10151d;
    --line: #26303c; --line-2: #313d4d;
    --txt: #e6edf3; --txt-2: #9aa7b4; --txt-3: #6b7684;
    --accent: #58b0ff; --accent-2: #2f81f7;
    --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", "DejaVu Sans Mono", "Consolas", monospace;
    --ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="light"] {
    --bg: #f4f6fa; --bg-2: #ffffff; --bg-3: #eef1f6; --card: #ffffff;
    --line: #dde3ec; --line-2: #c8d1de;
    --txt: #16202f; --txt-2: #52617a; --txt-3: #808d9b;
    --accent: #1f6feb; --accent-2: #1a5fd0;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
body { font-family: var(--ui); background: var(--bg); color: var(--txt); min-height: 100vh; display: flex; flex-direction: column; }
.muted { color: var(--txt-3); font-size: 12px; }
sub { font-size: .72em; }

/* topbar */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.brand__mark { font-size: 18px; }
.actions { display: flex; align-items: center; gap: 10px; }
.lang { display: inline-flex; height: 32px; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.lang__btn { font-family: var(--mono); font-size: 11px; font-weight: 600; padding: 0 9px; border: 0; background: var(--bg-3); color: var(--txt-2); cursor: pointer; }
.lang__btn + .lang__btn { border-left: 1px solid var(--line-2); }
.lang__btn:hover { color: var(--accent); }
.lang__btn.is-active { background: var(--accent-2); color: #fff; }
.icon-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-3); color: var(--txt-2); cursor: pointer; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .i-moon { display: none; }
:root[data-theme="light"] .icon-btn .i-sun { display: none; }
:root[data-theme="light"] .icon-btn .i-moon { display: block; }

/* layout + search */
.wrap { max-width: 1040px; width: 100%; margin: 0 auto; padding: 18px; display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 0; }
.searchbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search { flex: 1; min-width: 240px; font-family: var(--ui); font-size: 15px; background: var(--card); color: var(--txt); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 16px; }
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.count { color: var(--txt-3); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* hint / empty */
.hint { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; color: var(--txt-2); padding: 48px 20px; }
.hint__icon { font-size: 46px; opacity: .7; }

/* table */
.table-wrap { flex: 1 1 auto; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; background: var(--bg-2); text-align: left; padding: 10px 12px; color: var(--txt-3); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.num, .tbl td.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--txt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.tbl tbody tr { cursor: pointer; }
.tbl tbody tr:hover { background: var(--bg-3); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .nm { font-weight: 500; }
.tbl .fm { font-family: var(--mono); }
.tbl .cas { font-family: var(--mono); color: var(--txt-2); font-size: 12.5px; }
.tbl .cas-ext { border-bottom: 1px dotted var(--txt-3); }
mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* modal detail */
.modal { position: fixed; inset: 0; display: flex; align-items: flex-start; justify-content: center; background: rgba(0,0,0,.55); padding: 24px 16px; z-index: 20; overflow: auto; }
.modal__card { position: relative; width: 100%; max-width: 640px; background: var(--card); border: 1px solid var(--line-2); border-radius: 16px; padding: 22px 26px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.5); margin: auto; }
.modal__close { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--bg-3); color: var(--txt-2); font-size: 18px; cursor: pointer; line-height: 1; z-index: 2; }
.modal__close:hover { color: var(--accent); border-color: var(--accent); }
.md-loading { color: var(--txt-3); padding: 20px 0; }
.md-name { font-size: 22px; font-weight: 700; padding-right: 34px; }
.md-img { margin: 14px 0; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.md-img img { max-width: 100%; height: auto; }
.md-sec { padding: 11px 0; border-top: 1px solid var(--line); }
.md-sec:first-of-type { border-top: 0; }
.md-h { color: var(--txt-3); font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 3px; }
.md-b { font-size: 13.5px; line-height: 1.5; color: var(--txt); word-break: break-word; }

@media (max-width: 620px) {
    .tbl .cas, .tbl th:nth-child(3) { display: none; }
    .tbl td { max-width: 160px; }
}
