/* ip.bitig.uz — светлая и тёмная темы на CSS-переменных, без сборки */
:root {
    --bg: #f6f7f9;
    --surface: #ffffff;
    --surface-2: #eef1f5;
    --text: #1b1f27;
    --muted: #5f6673;
    --border: #dfe3ea;
    --accent: #1f6feb;
    --accent-text: #ffffff;
    --ok: #1a7f37;
    --ok-bg: #e6f4ea;
    --no: #b42318;
    --no-bg: #fdecea;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
    --radius: 12px;
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #14171c; --surface: #1d2127; --surface-2: #252a32; --text: #e8eaee; --muted: #9aa3b2;
        --border: #30363f; --accent: #5aa0ff; --accent-text: #0b1220; --ok: #4ade80; --ok-bg: #16301f;
        --no: #f87171; --no-bg: #3a1c1c; --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #14171c; --surface: #1d2127; --surface-2: #252a32; --text: #e8eaee; --muted: #9aa3b2;
    --border: #30363f; --accent: #5aa0ff; --accent-text: #0b1220; --ok: #4ade80; --ok-bg: #16301f;
    --no: #f87171; --no-bg: #3a1c1c; --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
    font-size: 16px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem); margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 2rem 0 .75rem; }
p { margin: 0 0 .9rem; }
.container { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
main.container { flex: 1; padding-top: 1.5rem; padding-bottom: 2rem; }
.mono { font-family: var(--mono); font-size: .9em; word-break: break-all; }

/* шапка */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 56px; }
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); letter-spacing: -.01em; }
.brand span { color: var(--muted); font-weight: 500; }
.main-nav { display: flex; gap: .25rem; margin-left: .5rem; }
.main-nav a { color: var(--muted); padding: .35rem .6rem; border-radius: 8px; }
.main-nav a.active, .main-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.lang-switch { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.lang-switch a { padding: .25rem .55rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.lang-switch a.active { background: var(--accent); color: var(--accent-text); }
.lang-switch a:hover { text-decoration: none; }
.theme-toggle {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    border: 1px solid var(--border); border-radius: 8px; background: transparent; color: var(--text); cursor: pointer;
}
.theme-toggle:hover { background: var(--surface-2); }
.icon-moon { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }
:root[data-theme="dark"] .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .icon-moon { display: block; }
    :root:not([data-theme="light"]) .icon-sun { display: none; }
}

/* главный блок IP */
.ip-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: .5rem 1.25rem; }
.ip-row { display: flex; align-items: center; gap: .75rem; padding: .85rem 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.ip-row:first-child { border-top: 0; }
.ip-label { color: var(--muted); font-weight: 600; min-width: 3.2rem; font-size: .9rem; }
.ip-value { font-family: var(--mono); font-size: clamp(1.15rem, 1rem + 1.4vw, 1.7rem); font-weight: 600; word-break: break-all; }
.ip-value[data-state="none"] { color: var(--muted); font-weight: 400; font-size: 1rem; font-family: var(--font); }
.ip-value[data-state="loading"] { color: var(--muted); font-weight: 400; font-size: 1rem; font-family: var(--font); }
.copy {
    border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); border-radius: 6px;
    width: 30px; height: 30px; cursor: pointer; font-size: 1rem; line-height: 1; position: relative;
}
.copy:hover { color: var(--text); }
.copy.copied::after {
    content: attr(data-copied); position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
    background: var(--text); color: var(--bg); font-size: .7rem; padding: .2rem .5rem; border-radius: 4px; white-space: nowrap;
}

/* сведения */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; margin: 0; }
.info-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; min-width: 0; }
.info-item.wide { grid-column: 1 / -1; }
.info-item dt { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin-bottom: .2rem; }
.info-item dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.flag { font-size: 1.2em; margin-right: .15rem; }
.badge { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.badge-yes { background: var(--ok-bg); color: var(--ok); }
.badge-no { background: var(--no-bg); color: var(--no); }
.badge-muted { background: var(--surface-2); color: var(--muted); }

/* текст */
.prose { max-width: 720px; color: var(--text); }
.prose p { color: var(--muted); }
pre {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem;
    overflow-x: auto; font-family: var(--mono); font-size: .85rem; line-height: 1.5; margin: 0 0 1rem;
}
code { font-family: var(--mono); }

/* подвал */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .8rem; padding: 1rem 0; }
.site-footer p { margin: 0 0 .3rem; }
.sources .source { margin-right: .75rem; white-space: nowrap; }

@media (max-width: 640px) {
    .main-nav { display: none; }
    .sources .source { display: block; margin: 0; white-space: normal; }
}

/* утилиты */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .9rem; margin: 1rem 0 2rem; }
.tool-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; color: var(--text); }
.tool-card:hover { border-color: var(--accent); text-decoration: none; }
.tool-card h3 { margin: 0 0 .3rem; font-size: 1.02rem; }
.tool-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.intro { color: var(--muted); font-size: 1.05rem; max-width: 720px; }
.tool-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin: 1rem 0 1.5rem; }
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; min-width: 0; }
.field > label, .field > .label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: flex-end; }
.row > .field { flex: 1 1 180px; }
.row > .field.narrow { flex: 0 1 140px; }
input[type="text"], input[type="number"], select, textarea {
    width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; padding: .55rem .7rem;
}
input[type="text"].mono, textarea.mono { font-family: var(--mono); font-size: .95rem; }
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type="range"] { width: 100%; }
.btn {
    display: inline-flex; align-items: center; gap: .35rem; font: inherit; font-weight: 600; cursor: pointer;
    padding: .5rem .9rem; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn-sm { padding: .3rem .6rem; font-size: .85rem; }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; margin: .5rem 0; }
.checks { display: flex; gap: .4rem 1.1rem; flex-wrap: wrap; }
.checks label { display: inline-flex; align-items: center; gap: .35rem; cursor: pointer; }
.error { color: var(--no); font-size: .9rem; margin: .4rem 0; min-height: 1.2em; }
.hint { color: var(--muted); font-size: .85rem; }
.result-table { width: 100%; border-collapse: collapse; margin-top: .5rem; }
.result-table th, .result-table td { text-align: left; padding: .5rem .6rem; border-top: 1px solid var(--border); vertical-align: top; }
.result-table th { color: var(--muted); font-weight: 600; font-size: .85rem; width: 38%; }
.result-table td { font-family: var(--mono); font-size: .92rem; overflow-wrap: anywhere; }
.result-table td.text { font-family: var(--font); }
.result-box { font-family: var(--mono); background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .7rem; overflow-wrap: anywhere; min-height: 2.4rem; }
.result-big { font-family: var(--mono); font-size: clamp(1.3rem, 1rem + 1.5vw, 2rem); font-weight: 700; }
.copy-inline { margin-left: .4rem; vertical-align: middle; }
.perm-grid { display: grid; grid-template-columns: auto repeat(3, 1fr); gap: .35rem .9rem; align-items: center; max-width: 420px; }
.perm-grid .head { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.perm-grid label { display: inline-flex; align-items: center; gap: .3rem; }
.pw-list { list-style: none; padding: 0; margin: .5rem 0; display: flex; flex-direction: column; gap: .4rem; }
.pw-list li { display: flex; align-items: center; gap: .5rem; }
.pw-list code { flex: 1; font-size: 1rem; word-break: break-all; }
@media (max-width: 640px) {
    .result-table th { width: 42%; }
    .tool-panel { padding: .9rem; }
}
