/* DNS Proxyon app — white by default, optional night mode */
:root {
  --a-bg: #ffffff;
  --a-card: #f7f8fa;
  --a-ink: #111827;
  --a-muted: #6b7280;
  --a-line: #e5e7eb;
  --a-accent: #111827;
  --a-good: #059669;
  --a-warn: #d97706;
  --a-bad: #dc2626;
}
html[data-theme="night"] {
  --a-bg: #0b1220;
  --a-card: #151d2e;
  --a-ink: #f1f5f9;
  --a-muted: #94a3b8;
  --a-line: #243044;
  --a-accent: #e2e8f0;
  --a-good: #34d399;
  --a-warn: #fbbf24;
  --a-bad: #f87171;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body.px-app {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--a-bg);
  color: var(--a-ink);
  min-height: 100vh;
}
.px-top {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 10px;
  background: #5c5c5c;
  color: #fff;
  border-bottom: 0;
}
html[data-theme="night"] .px-top { background: #0b1220; }
.px-icon-btn {
  width: 40px; height: 40px; border: 0; background: transparent;
  color: #fff; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center;
}
.px-icon-btn:hover { background: rgba(255,255,255,.12); }
.px-brand {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px;
  color: #fff; text-decoration: none; border: 0; background: transparent; cursor: pointer;
}
.px-brand img {
  width: 34px; height: 34px; object-fit: contain;
  background: #111; border-radius: 8px;
}
.px-dots { width: 22px; height: 22px; display: block; }
.px-dots span { display: block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; margin: 3px auto; }
.px-main { max-width: 520px; margin: 0 auto; padding: 0 0 28px; }
.px-view:not(.t2-page) { padding: 22px 16px 0; }
#view-checker .px-card, #connectResult, #view-checker #resultBox { margin: 12px 16px; }
.px-kicker { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--a-muted); }
.px-main h1 { font-size: 26px; margin: 6px 0 8px; }
.px-lead { color: var(--a-muted); font-size: 14px; line-height: 1.55; margin-bottom: 18px; }
.px-card { background: var(--a-card); border: 1px solid var(--a-line); border-radius: 14px; padding: 16px; }
.px-card label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.px-card textarea, .px-card input {
  width: 100%; border: 1px solid var(--a-line); background: var(--a-bg); color: var(--a-ink);
  border-radius: 10px; padding: 12px; font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.px-help { margin-top: 10px; font-size: 12px; color: var(--a-muted); line-height: 1.6; }
.px-help code { display: block; color: var(--a-good); }
.px-go {
  margin-top: 12px; width: 100%; border: 0; border-radius: 12px;
  background: var(--a-accent); color: var(--a-bg); font-weight: 800;
  padding: 13px; cursor: pointer; font-size: 15px;
}
html[data-theme="night"] .px-go { color: #0b1220; background: #e2e8f0; }
.px-err { display: none; margin-top: 10px; color: var(--a-bad); font-size: 13px; }
.px-drawer {
  position: fixed; inset: 0; z-index: 50; pointer-events: none;
}
.px-drawer.open { pointer-events: auto; }
.px-shade { position: absolute; inset: 0; background: rgba(15,23,42,.35); opacity: 0; transition: opacity .2s; }
.px-drawer.open .px-shade { opacity: 1; }
.px-panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: min(86vw, 340px);
  background: var(--a-bg); border-right: 1px solid var(--a-line);
  transform: translateX(-105%); transition: transform .22s ease;
  overflow: auto; padding: 16px 14px 28px;
}
.px-drawer.open .px-panel { transform: none; }
.px-panel h2 { font-size: 16px; margin: 4px 0 14px; }
.px-sec { margin-bottom: 18px; }
.px-sec-title { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--a-muted); margin-bottom: 8px; }
.px-note { font-size: 12px; color: var(--a-muted); margin: 0 0 8px; }
.px-panel a, .px-panel button.linkish, .px-panel button.px-nav-item, .px-panel .px-nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; padding: 12px 4px;
  border-radius: 0; color: var(--a-ink); text-decoration: none;
  background: transparent; border: 0; border-bottom: 1px solid var(--a-line);
  font: inherit; cursor: pointer;
}
.px-panel a:hover, .px-panel button.linkish:hover, .px-panel .px-nav-item:hover { background: var(--a-card); }
.px-panel .px-nav-item.on { font-weight: 700; }
.px-acc-body { padding: 0 0 0 12px; }
.px-acc-body .px-nav-item { font-size: 14px; color: var(--a-muted); font-weight: 600; }
.px-chev { font-size: 12px; color: var(--a-muted); transition: transform .18s; display: inline-block; }
.px-nav-item.open .px-chev { transform: rotate(90deg); }
.px-free { font-size: 10px; font-weight: 800; letter-spacing: .04em; color: var(--a-good); margin-left: 6px; }
.px-lock { font-size: 10px; color: var(--a-muted); margin-left: 6px; }
.ipc-verdict { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; margin: 16px 0; font-weight: 700; }
.ipc-good { background: rgba(5,150,105,.1); color: var(--a-good); }
.ipc-bad { background: rgba(217,119,6,.1); color: var(--a-warn); }
.ipc-fail { background: rgba(220,38,38,.1); color: var(--a-bad); }
.ipc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--a-line); border: 1px solid var(--a-line); border-radius: 12px; overflow: hidden; }
.ipc-cell { background: var(--a-bg); padding: 12px 14px; }
.ipc-label { font-size: 11px; color: var(--a-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.ipc-val { font-size: 14px; font-weight: 600; word-break: break-word; }
.ipc-cell-hl { box-shadow: inset 0 0 0 1.5px rgba(5,150,105,.45); }
@media (max-width: 560px) { .ipc-grid { grid-template-columns: 1fr; } }

.px-tabs {
  display: flex; background: var(--a-card); border-radius: 999px; padding: 4px; margin-bottom: 18px;
  border: 1px solid var(--a-line);
}
.px-tab {
  flex: 1; border: 0; background: transparent; color: var(--a-muted);
  font-weight: 800; font-size: 14px; padding: 10px; border-radius: 999px; cursor: pointer;
}
.px-tab.on { background: var(--a-bg); color: var(--a-ink); box-shadow: 0 1px 4px rgba(15,23,42,.08); }
.px-field-label { display: block; font-size: 12px; font-weight: 700; color: var(--a-muted); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.px-select, .px-input {
  width: 100%; border: 1px solid var(--a-line); background: var(--a-bg); color: var(--a-ink);
  border-radius: 10px; padding: 12px 14px; font-size: 15px;
}
.px-block { margin-top: 18px; border: 1px solid var(--a-line); border-radius: 12px; padding: 12px 14px 16px; background: var(--a-card); }
.px-block-h { font-weight: 800; font-size: 14px; margin-bottom: 10px; }
.px-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 12px; }
.px-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.px-status { text-align: center; font-weight: 800; letter-spacing: .08em; margin-top: 14px; font-size: 13px; }
.px-status.off { color: var(--a-bad); }
.px-status.on { color: var(--a-good); }
.px-status.wait { color: var(--a-warn); }
.px-lockbox { background: var(--a-card); border: 1px dashed var(--a-line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.px-lockbox p { font-size: 14px; color: var(--a-muted); line-height: 1.5; margin-bottom: 12px; }
.px-go-link { display: block; text-align: center; text-decoration: none; }
.px-foot { text-align: center; font-size: 12px; color: var(--a-muted); padding: 8px 16px 28px; }
html[data-consent="pending"] .px-top,
html[data-consent="pending"] .px-main,
html[data-consent="pending"] .px-foot,
html[data-consent="pending"] .px-drawer { visibility: hidden; pointer-events: none; }
.px-consent {
  display: flex; position: fixed; inset: 0; z-index: 80;
  background: var(--a-bg); align-items: center; justify-content: center; padding: 20px;
}
html:not([data-consent="pending"]) .px-consent { display: none; }
.px-consent-card {
  width: min(440px, 100%); background: var(--a-card); border: 1px solid var(--a-line);
  border-radius: 16px; padding: 22px 20px 20px;
}
.px-consent-card h2 { font-size: 22px; margin-bottom: 8px; }
.px-consent-card > p { color: var(--a-muted); font-size: 14px; line-height: 1.5; margin-bottom: 16px; }
.px-consent-card .px-check { align-items: flex-start; line-height: 1.45; }
.px-consent-card .px-check a { color: var(--a-good); }
.px-consent-card .px-go:disabled { opacity: .45; cursor: not-allowed; }
.px-prod p { color: var(--a-muted); font-size: 14px; line-height: 1.55; margin: 8px 0 16px; }
.px-from { font-size: 22px; font-weight: 800; margin: 6px 0 14px; }
.px-from small { font-size: 13px; font-weight: 600; color: var(--a-muted); }
.px-pkg { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--a-line); font-size: 14px; }
.px-pkg:last-child { border-bottom: 0; }
.px-proto { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.px-proto button {
  border: 1px solid var(--a-line); background: var(--a-card); color: var(--a-ink);
  border-radius: 10px; padding: 12px; font-weight: 800; cursor: pointer;
}
.px-proto button.on { background: var(--a-accent); color: var(--a-bg); border-color: var(--a-accent); }
html[data-theme="night"] .px-proto button.on { color: #0b1220; background: #e2e8f0; }
.px-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.px-ghost {
  width: 100%; border: 1px solid var(--a-line); background: var(--a-bg); color: var(--a-ink);
  border-radius: 12px; padding: 12px; font-weight: 700; cursor: pointer; font-size: 13px;
}
.px-feats { list-style: none; margin: 0 0 16px; padding: 0; }
.px-feats li { padding: 9px 0; border-bottom: 1px solid var(--a-line); font-size: 14px; color: var(--a-ink); }
.px-feats li:last-child { border-bottom: 0; }
.px-badge { font-size: 10px; font-weight: 800; letter-spacing: .04em; color: var(--a-good); }
.t2-wrap { max-width: 520px; margin: 0 auto; }
.t2-tabs {
  display: flex; background: #ececec; border-radius: 999px; padding: 6px; margin: 8px 0 18px;
}
.t2-tabs button {
  flex: 1; border: 0; background: transparent; color: #666; font-weight: 700; font-size: 16px;
  padding: 10px 8px; border-radius: 999px; cursor: pointer;
}
.t2-tabs button.on { background: #fff; color: #222; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.t2-type { text-align: center; margin: 8px 12px 18px; }
.t2-type-lab { font-size: 13px; color: #888; }
.t2-type select {
  appearance: none; -webkit-appearance: none;
  border: 0; background: transparent; color: #222; font-size: 28px; font-weight: 500;
  text-align: center; width: 100%; padding: 4px 28px 4px 8px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.6' fill='none'/></svg>");
  background-repeat: no-repeat; background-position: right 8px center;
}
.t2-field { padding: 0 16px 8px; }
.t2-field label { display: block; font-size: 14px; color: #888; margin-bottom: 2px; }
.t2-underline {
  width: 100%; border: 0; border-bottom: 2px solid #e53935; border-radius: 0;
  padding: 8px 0; font-size: 16px; color: #222; background: transparent;
}
.t2-underline:focus { outline: 0; border-bottom-color: #c62828; }
.t2-acc {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; border: 0; background: #5c5c5c; color: #fff;
  font-weight: 700; font-size: 16px; padding: 14px 16px; cursor: pointer; margin-top: 2px;
}
.t2-acc .px-chev { color: #fff; transform: none; }
.t2-acc.open .px-chev { transform: rotate(180deg); }
.t2-acc-body { padding: 16px 16px 8px; background: #fff; }
.t2-auth-row { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 14px; }
.t2-auth-row input { width: 18px; height: 18px; accent-color: #e53935; }
.t2-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.t2-cols label { display: block; font-size: 13px; color: #888; }
.t2-line {
  width: 100%; border: 0; border-bottom: 1px solid #bbb; padding: 8px 0; font-size: 16px; background: transparent; color: #222;
}
.t2-line:focus { outline: 0; border-bottom-color: #e53935; }
.t2-pass { display: flex; align-items: center; gap: 4px; }
.t2-pass input { flex: 1; }
.t2-eye { border: 0; background: transparent; cursor: pointer; font-size: 16px; padding: 4px; }
.t2-udp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 15px; color: #444; margin-bottom: 16px;
}
.t2-switch { position: relative; width: 52px; height: 28px; flex: 0 0 52px; }
.t2-switch input { opacity: 0; width: 0; height: 0; }
.t2-switch span {
  position: absolute; inset: 0; background: #ccc; border-radius: 999px; cursor: pointer;
}
.t2-switch input:checked + span { background: #e53935; }
.t2-switch span:after {
  content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: transform .15s;
}
.t2-switch input:checked + span:after { transform: translateX(24px); }
.t2-connect {
  display: block; width: calc(100% - 28px); margin: 16px 14px 8px;
  border: 0; background: #5c5c5c; color: #fff; font-weight: 700; font-size: 16px;
  padding: 14px; cursor: pointer; letter-spacing: .04em;
}
.t2-status { text-align: center; font-weight: 800; margin: 8px 0 12px; font-size: 16px; }
.t2-status.off { color: #e53935; }
.t2-status.on { color: #2e7d32; }
.t2-status.wait { color: #ef6c00; }
.t2-quick { padding: 4px 16px 20px; font-size: 14px; color: #333; line-height: 1.55; }
.t2-quick b { font-weight: 800; }
.t2-quick ul { margin: 6px 0 0 18px; }
html[data-theme="night"] .t2-tabs { background: #151d2e; }
html[data-theme="night"] .t2-tabs button { color: #94a3b8; }
html[data-theme="night"] .t2-tabs button.on { background: #0b1220; color: #f1f5f9; }
html[data-theme="night"] .t2-type select,
html[data-theme="night"] .t2-underline,
html[data-theme="night"] .t2-line { color: #f1f5f9; }
html[data-theme="night"] .t2-acc-body { background: #0b1220; }
html[data-theme="night"] .t2-connect, html[data-theme="night"] .t2-acc { background: #243044; }
@media (max-width: 560px) { .px-two { grid-template-columns: 1fr; } }
