/* Neumorfik qora dizayn: yumshoq soyali kartalar, qizil-marjon urg'u */
:root {
  --bg: #2b2d31;
  --panel: #232529;
  --card: #26282c;
  --inset: #1e2024;
  --text: #eceef1;
  --muted: #8b9098;
  --border: #33363c;
  --accent: #ee5a4f;
  --accent-2: #c9443a;
  --true-bg: rgba(238, 90, 79, 0.14);
  --good: #5fcf8a;
  --bad: #ee5a4f;
  --raise: 8px 8px 18px rgba(0, 0, 0, 0.45), -6px -6px 14px rgba(255, 255, 255, 0.035);
  --raise-sm: 4px 4px 9px rgba(0, 0, 0, 0.45), -3px -3px 8px rgba(255, 255, 255, 0.035);
  --sunk: inset 3px 3px 7px rgba(0, 0, 0, 0.5), inset -2px -2px 6px rgba(255, 255, 255, 0.03);
}
* { box-sizing: border-box; }
body {
  margin: 0; color: var(--text);
  background: radial-gradient(1200px 600px at 50% -10%, #34373d, var(--bg) 60%) fixed;
  font: 15px/1.55 "Montserrat", "Segoe UI", system-ui, sans-serif;
}
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px; }

.site-header { padding: 18px 0 6px; }
.site-header .wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; letter-spacing: 0.02em; }
.brand::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 3px; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
nav a {
  color: var(--muted); text-decoration: none; margin-right: 10px; padding: 7px 16px;
  border-radius: 10px; font-size: 0.9rem;
}
nav a.active { color: var(--text); background: var(--card); box-shadow: var(--raise-sm); }

main { padding-bottom: 56px; }
h1 { font-size: 1.7rem; font-weight: 600; margin: 22px 0 16px; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 1rem; font-weight: 600; margin: 14px 0 4px; }

.card {
  background: linear-gradient(145deg, #292b30, #232529);
  border-radius: 22px; padding: 22px; margin-bottom: 22px;
  box-shadow: var(--raise);
}
label { display: block; font-weight: 600; font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
label.inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; margin: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.options { margin-top: 18px; gap: 22px; }

input[type=text] {
  flex: 1; min-width: 200px; font: inherit; font-size: 1.1rem; padding: 12px 16px;
  border: 0; border-radius: 14px; background: var(--inset); color: var(--text); box-shadow: var(--sunk);
}
input[type=text]::placeholder { color: #5d6169; }
input[type=text]:focus { outline: 1px solid var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
select {
  font: inherit; font-size: 0.9rem; padding: 7px 12px; border-radius: 10px; border: 0;
  background: var(--inset); color: var(--text); box-shadow: var(--sunk);
}

button {
  font: inherit; font-size: 0.9rem; cursor: pointer; border-radius: 12px; border: 0;
  background: linear-gradient(145deg, #2d2f34, #25272b); color: var(--text);
  padding: 9px 16px; box-shadow: var(--raise-sm); transition: box-shadow .12s, transform .12s;
}
button:hover { color: #fff; }
button:active { box-shadow: var(--sunk); transform: translateY(1px); }
button.primary {
  background: linear-gradient(145deg, #f26d62, var(--accent-2)); color: #fff; font-weight: 600;
  padding: 11px 24px; box-shadow: 0 6px 16px rgba(238, 90, 79, 0.35);
}
button.primary:hover { filter: brightness(1.08); }
button.secondary { margin-top: 16px; }
.hero { display: flex; align-items: center; gap: 22px; margin: 26px 0 22px; }
.hero h1 { margin: 0 0 4px; font-size: 2rem; }
.hero p { margin: 0; color: var(--muted); max-width: 560px; font-size: 0.9rem; }
.step {
  flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 18px;
  font-size: 1.4rem; font-weight: 700; color: var(--accent); background: var(--card); box-shadow: var(--raise-sm);
}

.section-label { margin: 22px 0 10px; font-weight: 600; font-size: 0.85rem; color: var(--text); }
.section-label span { color: var(--muted); font-weight: 400; }
.row + .symbols { margin-top: 20px; }
.symbols { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 14px; }
.symbols button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px 9px;
  border-radius: 16px; min-height: 76px;
}
.symbols .sym { font-size: 1.6rem; line-height: 1.1; color: var(--text); }
.symbols small { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.02em; }
.symbols button:hover .sym { color: var(--accent); }

details.ref { margin-top: 22px; border-radius: 16px; background: var(--inset); box-shadow: var(--sunk); padding: 0 18px; }
details.ref summary { cursor: pointer; padding: 13px 0; font-weight: 600; font-size: 0.85rem; list-style: none; }
details.ref summary::before { content: "▸"; color: var(--accent); margin-right: 10px; display: inline-block; transition: transform .15s; }
details.ref[open] summary::before { transform: rotate(90deg); }
details.ref[open] { padding-bottom: 12px; }
table.ops { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.ops th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 10px 8px 0; }
table.ops td { padding: 7px 10px 7px 0; border-top: 1px solid var(--border); }
table.ops td.sym { font-size: 1.2rem; color: var(--accent); white-space: nowrap; }
code { background: var(--panel); padding: 1px 7px; border-radius: 6px; font-size: 0.8rem; color: var(--text); }

/* To'plamlar sahifasi */
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
label.set-field { display: flex; align-items: center; gap: 10px; margin: 0; }
.set-field input[type=text] { min-width: 0; width: 100%; }
.set-name {
  flex: none; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  font-weight: 700; font-size: 1.05rem; color: var(--text); background: var(--card); box-shadow: var(--raise-sm);
}
.set-A { color: var(--accent); } .set-B { color: #6fa8ff; } .set-C { color: #f2c14e; } .set-U { color: #a78bfa; }
.btn-add-set {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 42px;
  padding: 0 16px; background: var(--inset); border: 1.5px dashed var(--border); border-radius: 12px;
  color: var(--muted); font-size: 0.88rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease;
}
.btn-add-set:hover { border-color: #f2c14e; color: var(--text); background: var(--card); }
.btn-add-set .plus-icon { font-size: 1.2rem; line-height: 1; color: #f2c14e; }
.btn-remove-set {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px;
  background: transparent; border: 1px solid transparent; color: var(--muted); font-size: 1.25rem;
  line-height: 1; cursor: pointer; transition: all 0.15s ease; margin-left: 2px; padding: 0;
}
.btn-remove-set:hover { color: #ff5c5c; background: rgba(255, 92, 92, 0.15); border-color: rgba(255, 92, 92, 0.3); }
.universe-section { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.universe-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.universe-title { font-size: 0.85rem; font-weight: 600; color: #a78bfa; }
.universe-desc { font-size: 0.78rem; color: var(--muted); }
.universe-desc code { color: var(--text); font-size: 0.75rem; padding: 1px 5px; }
input[type=text].bad, .set-field.bad input[type=text] { outline: 1px solid var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  color: var(--text); text-decoration: none; font-size: 0.82rem; padding: 7px 14px; border-radius: 12px;
  background: linear-gradient(145deg, #2d2f34, #25272b); box-shadow: var(--raise-sm);
}
.chip:hover { color: var(--accent); }
.result-expr { font-size: 1.25rem; overflow-wrap: anywhere; }
.result-expr b { color: var(--accent); font-weight: 600; }
.venn-wrap { max-width: 640px; margin: 0 auto; }
svg.venn { width: 100%; height: auto; display: block; }
.venn-u { fill: var(--inset); stroke: var(--border); stroke-width: 1.5; }
.venn-ulabel { fill: var(--muted); font-size: 22px; font-weight: 700; }
.venn-c { fill: none; stroke-width: 3; }
.venn-hit { fill: var(--accent); opacity: 0.42; }
.venn-name { font-size: 24px; font-weight: 700; }
.venn-el { fill: var(--text); font-size: 14px; }
table.plain { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.plain th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 12px 8px 0; }
table.plain td { padding: 8px 12px 8px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
table.plain td.sym { white-space: nowrap; color: var(--muted); }
table.plain tr.hit td { color: var(--accent); }
table.plain tr.hit td.sym { color: var(--accent); }
ul.facts { margin: 0; padding-left: 20px; color: var(--text); }
ul.facts li { margin: 5px 0; }
small { color: var(--muted); }

.hint { color: var(--muted); font-size: 0.8rem; margin: 12px 0 0; }
.hint b { color: var(--text); }

.error { box-shadow: var(--raise), inset 0 0 0 1px rgba(238, 90, 79, 0.5); }
.error pre { margin: 10px 0 0; font-size: 1.05rem; white-space: pre-wrap; }
.error mark { background: var(--accent); color: #fff; padding: 0 3px; border-radius: 4px; }

.table-scroll { overflow-x: auto; padding: 4px; }
table.tt { border-collapse: separate; border-spacing: 0 4px; margin: 0 auto; }
table.tt th, table.tt td {
  padding: 7px 16px; text-align: center; white-space: nowrap; font-variant-numeric: tabular-nums;
  background: var(--inset);
}
table.tt th { color: var(--muted); font-weight: 600; font-size: 0.85rem; background: transparent; }
table.tt td:first-child { border-radius: 10px 0 0 10px; }
table.tt td:last-child { border-radius: 0 10px 10px 0; }
table.tt th.final { color: var(--accent); }
table.tt td.final { color: #fff; font-weight: 600; box-shadow: inset 2px 0 0 rgba(255, 255, 255, 0.05); }
table.tt .gap { width: 12px; padding: 0; background: transparent; border-radius: 0; }
table.tt tr.true td:not(.gap) { background: var(--true-bg); }
table.tt tr.true td.final { color: var(--accent); }

.kind { font-weight: 600; margin: 4px 0 10px; }
.kind.tautology { color: var(--good); }
.kind.contradiction { color: var(--bad); }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.analysis + .analysis { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 6px; }
@media (max-width: 520px) { .hero { flex-direction: column; align-items: flex-start; } table.ops { display: block; overflow-x: auto; } dl { grid-template-columns: 1fr; } dd { margin-bottom: 6px; } }
