:root {
  --bg: #f4f7fb;
  --card: #fff;
  --ink: #142033;
  --muted: #65748b;
  --brand: #0b6cff;
  --brand2: #00b894;
  --line: #e3e9f2;
  --err: #d63031;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a {
  color: var(--brand);
  text-decoration: none;
}
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 16px;
}
header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
}
.logo {
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--ink);
  flex-shrink: 0;
}
.logo span {
  color: var(--brand);
}
.menu {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.menu a {
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
}
.menu a:hover {
  background: #eef3fb;
}
.hero {
  text-align: center;
  padding: 30px 0 8px;
}
.hero.left {
  text-align: left;
  padding: 14px 0 4px;
}
.hero h1 {
  font-size: clamp(1.5rem, 3.5vw, 2.3rem);
  line-height: 1.2;
}
.hero p {
  color: var(--muted);
  margin-top: 8px;
}
.search {
  margin-top: 18px;
  width: 100%;
  max-width: 520px;
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 1rem;
  outline: 0;
}
.search:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 108, 255, 0.15);
}
.crumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 14px;
}
.cat-sec {
  margin: 26px 0;
}
.cat-sec h2 {
  font-size: 1.2rem;
  margin-bottom: 12px;
}
.cat-sec h2 a {
  color: var(--ink);
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin: 14px 0;
}
.tcard {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  color: var(--ink);
  transition: 0.15s;
}
.tcard:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(20, 32, 51, 0.08);
}
.tcard .ic {
  font-size: 1.5rem;
  display: block;
}
.tcard b {
  display: block;
  margin: 4px 0 2px;
}
.tcard span:last-child {
  color: var(--muted);
  font-size: 0.85rem;
  display: block;
  line-height: 1.45;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  margin: 14px 0 40px;
}
@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 2px 10px rgba(20, 32, 51, 0.04);
}
article.card h2 {
  margin: 18px 0 8px;
  font-size: 1.2rem;
}
article.card h2:first-child {
  margin-top: 0;
}
article h3 {
  margin: 14px 0 4px;
  font-size: 1.02rem;
}
article p {
  color: #3b4b66;
  margin-bottom: 8px;
}
article.legal {
  margin: 24px 0;
}
.legal h1 {
  margin-bottom: 10px;
}
.side > * + * {
  margin-top: 20px;
}
.related h3 {
  margin-bottom: 6px;
}
.related a {
  display: block;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
code {
  background: #eef2f8;
  padding: 1px 6px;
  border-radius: 5px;
}

/* ---- shared tool UI ---- */
.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 0;
  padding: 11px 20px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn.ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn.sm {
  padding: 6px 12px;
  font-size: 0.82rem;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 0;
}
.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  border: 2px dashed #b9c6da;
  border-radius: 14px;
  padding: 34px 16px;
  cursor: pointer;
  background: #f8fafd;
  transition: 0.15s;
}
.drop:hover,
.drop.over {
  border-color: var(--brand);
  background: #eef5ff;
}
.drop span {
  color: var(--muted);
  font-size: 0.85rem;
}
.queue,
.results {
  margin-top: 12px;
}
.qi {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-top: 8px;
  background: #fff;
}
.qi img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
}
.qi.err {
  color: var(--err);
}
.qn {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 0.92rem;
}
.qi small {
  color: var(--muted);
  white-space: nowrap;
}
.qi button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 3px 9px;
  cursor: pointer;
}
.qi button:disabled {
  opacity: 0.35;
}
.results .btn {
  margin-top: 12px;
}
.opts {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 16px;
  align-items: flex-end;
}
.opts label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #33445f;
}
.opts input[type="number"],
.opts input[type="text"],
.opts select,
.field-in {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
.opts input[type="checkbox"] {
  width: 18px;
  height: 18px;
}
.opts label.row {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.hint {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 10px;
}
.status {
  margin-top: 12px;
  font-weight: 600;
  min-height: 1.4em;
}
.status.ok {
  color: #0a8a5f;
}
.status.err {
  color: var(--err);
}
textarea.tx {
  width: 100%;
  min-height: 200px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  resize: vertical;
}
textarea.tx.mono {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.9rem;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.stat {
  background: #f4f8ff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}
.stat b {
  display: block;
  font-size: 1.5rem;
}
.stat span {
  font-size: 0.8rem;
  color: var(--muted);
}
.pw {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 1.3rem;
  word-break: break-all;
  background: #f4f8ff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  margin: 14px 0;
}
.qr-wrap {
  text-align: center;
  margin-top: 16px;
}
.qr-wrap canvas {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.conv-out {
  font-size: 1.4rem;
  font-weight: 800;
  margin-top: 16px;
  padding: 16px;
  background: #f4f8ff;
  border-radius: 10px;
  word-break: break-word;
}

/* ---- calculators ---- */
.calc {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 700px) {
  .calc {
    grid-template-columns: 1fr;
  }
}
.field {
  margin-bottom: 14px;
}
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: #33445f;
}
.inp {
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}
.inp:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 108, 255, 0.15);
}
.inp i {
  font-style: normal;
  padding: 0 12px;
  color: var(--muted);
  background: #f6f8fc;
  align-self: stretch;
  display: flex;
  align-items: center;
}
.inp input,
.inp select {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 11px 12px;
  font-size: 1rem;
  background: transparent;
  min-width: 0;
}
.result {
  background: linear-gradient(135deg, #0b6cff, #2f8bff);
  color: #fff;
  border-radius: 14px;
  padding: 22px;
}
.result .lbl {
  opacity: 0.85;
  font-size: 0.9rem;
}
.result .big {
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 2px 0 14px;
}
.rows div {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.95rem;
}
.bar {
  display: flex;
  height: 14px;
  border-radius: 99px;
  overflow: hidden;
  margin: 16px 0 8px;
  background: rgba(255, 255, 255, 0.25);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  font-size: 0.8rem;
}
.legend span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 5px;
  background: var(--c);
}
.sched {
  display: none;
  margin-top: 14px;
  max-height: 340px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.sched table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.sched th,
.sched td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid var(--line);
}
.sched th {
  position: sticky;
  top: 0;
  background: #f6f8fc;
}
.sched th:first-child,
.sched td:first-child {
  text-align: left;
}
#schedBtn {
  margin-top: 18px;
}

/* ---- ads ---- */
.ad {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    #f1f4f9,
    #f1f4f9 10px,
    #eaeff6 10px,
    #eaeff6 20px
  );
  border: 1px dashed #c3cedd;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.ad::before {
  content: "Advertisement";
  position: absolute;
  top: 2px;
  left: 8px;
  font-size: 0.62rem;
  color: #8b99ae;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.ad-leader {
  min-height: 90px;
  margin: 14px auto;
  max-width: 728px;
  width: 100%;
}
.ad-rect {
  min-height: 250px;
  width: 100%;
}
.ad-tall {
  min-height: 600px;
  width: 100%;
}
.ad-inline {
  min-height: 280px;
  margin: 22px 0;
  width: 100%;
}
.sticky {
  position: sticky;
  top: 76px;
}
.anchor {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: #fff;
  border-top: 1px solid var(--line);
  display: none;
  padding: 6px;
}
.anchor .ad {
  min-height: 50px;
  max-width: 320px;
  margin: 0 auto;
}
.anchor button {
  position: absolute;
  top: -24px;
  right: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px 8px 0 0;
  padding: 2px 10px;
  cursor: pointer;
}
@media (max-width: 700px) {
  .anchor.show {
    display: block;
  }
}

footer {
  background: #142033;
  color: #a9b6cc;
  padding: 30px 0;
  font-size: 0.88rem;
  margin-top: 30px;
}
footer a {
  color: #cfe0ff;
  margin-right: 14px;
}
footer p {
  margin-top: 10px;
}
.fcats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 0;
}
.consent {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  max-width: 520px;
  background: #142033;
  color: #fff;
  padding: 18px;
  border-radius: 14px;
  z-index: 100;
  display: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
.consent p {
  font-size: 0.88rem;
  margin-bottom: 12px;
  color: #d6dff0;
}
.consent button {
  padding: 9px 16px;
  border-radius: 9px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  margin-right: 8px;
}
.consent .ok {
  background: var(--brand2);
  color: #052;
}
.consent .no {
  background: #2a3a55;
  color: #fff;
}
