
:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --muted: #5f6b7a;
  --text: #152033;
  --primary: #2563eb;
  --primary-soft: #dbeafe;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #15803d;
  --success-soft: #dcfce7;
  --border: #dbe3ee;
  --shadow: 0 10px 32px rgba(17, 24, 39, 0.08);
  --radius: 18px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: linear-gradient(180deg, #eff4fb 0%, #f8fbff 120px, #f3f6fb 100%);
  color: var(--text);
}
a { color: var(--primary); }
.container { max-width: 1480px; margin: 0 auto; padding: 28px 20px 42px; }
.container.narrow { max-width: 640px; }
.toolbar {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.hero {
  background: linear-gradient(135deg, #172554 0%, #1d4ed8 55%, #60a5fa 100%);
  color: #fff; border-radius: 26px; padding: 28px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.hero h1 { margin: 0 0 10px; font-size: 32px; }
.hero p { margin: 0; max-width: 920px; line-height: 1.55; color: rgba(255,255,255,.92); }
.toolbar-actions, .lang-switch, .actions-row, .inline-actions, .item-row, .stats-grid, .steps-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.lang-switch { align-items: center; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: rgba(255,255,255,.14);
  color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.14);
}
.pill.active { background: #fff; color: #17316f; font-weight: 700; }
.grid { display: grid; gap: 20px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.card {
  background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); border: 1px solid rgba(219, 227, 238, .9);
}
.card h2, .card h3 { margin-top: 0; }
.card-intro { margin: -4px 0 14px; color: var(--muted); line-height: 1.55; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat {
  background: linear-gradient(180deg, #fff, #f8fbff); border: 1px solid var(--border); border-radius: 16px; padding: 16px;
}
.stat .label { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.stat .value { font-size: 26px; font-weight: 800; }
.steps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.step {
  background: #f8fbff; border: 1px solid var(--border); border-radius: 16px; padding: 16px;
}
.step h3 { margin: 0 0 8px; font-size: 18px; }
.step p { margin: 0; color: var(--muted); line-height: 1.55; }
.stack { display: flex; flex-direction: column; gap: 12px; }
form { display: flex; flex-direction: column; gap: 12px; }
label { font-weight: 700; font-size: 14px; }
.help, .muted { color: var(--muted); font-size: 13px; line-height: 1.55; }
input[type="text"], input[type="url"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; border: 1px solid #cbd5e1; border-radius: 12px; padding: 12px 14px; background: #fff; font-size: 14px; color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.18);
}
textarea { min-height: 96px; resize: vertical; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 10px 16px; border-radius: 12px; border: 1px solid transparent; cursor: pointer;
  background: var(--primary); color: #fff; text-decoration: none; font-size: 14px; font-weight: 700;
}
button:hover, .btn:hover { filter: brightness(0.97); }
.btn.secondary, button.secondary { background: #475569; }
.btn.ghost, button.ghost { background: #fff; color: var(--text); border-color: var(--border); }
.btn.small { min-height: 34px; padding: 7px 12px; font-size: 13px; }
button.danger, .btn.danger { background: var(--danger); }
.alert { border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; border: 1px solid transparent; }
.alert.success { background: var(--success-soft); color: #14532d; border-color: #bbf7d0; }
.alert.error { background: var(--danger-soft); color: #991b1b; border-color: #fecaca; }
.badge {
  display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: #eef2ff; color: #3730a3;
}
.badge.success { background: var(--success-soft); color: var(--success); }
.badge.muted { background: #eef2f7; color: #475569; }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.item-row {
  justify-content: space-between; background: #f8fbff; border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px;
}
.item-row code { flex: 1; }
.examples-list { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.65; }
details { border: 1px dashed var(--border); border-radius: 14px; padding: 10px 14px; background: #fbfdff; }
details summary { cursor: pointer; font-weight: 700; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
th, td { border-bottom: 1px solid #e5e7eb; padding: 12px 8px; text-align: left; vertical-align: top; }
th { position: sticky; top: 0; background: #f8fbff; z-index: 1; }
code { font-size: 12px; word-break: break-word; }
.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 16px; }
.login-meta { color: var(--muted); margin-bottom: 16px; }
.section-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sticky-actions {
  position: sticky; bottom: 16px; z-index: 5; background: rgba(243,246,251,.92); backdrop-filter: blur(8px); padding: 12px; border-radius: 18px; border: 1px solid var(--border);
}
pre.pretty-json {
  white-space: pre-wrap; word-break: break-word; background: #0f172a; color: #e2e8f0; padding: 16px; border-radius: 16px; overflow: auto;
}
@media (max-width: 860px) {
  .hero h1 { font-size: 26px; }
  .container { padding: 16px 12px 32px; }
  .card { padding: 18px; }
  table { min-width: 760px; }
}


body { padding: 18px; }
.container { padding-left: 28px; padding-right: 28px; }
.section-card { position: relative; overflow: hidden; }
.section-card::before { content: ''; position: absolute; inset: 0 auto auto 0; width: 100%; height: 6px; border-radius: 18px 18px 0 0; }
.section-sources::before { background: linear-gradient(90deg, #0ea5e9, #38bdf8); }
.section-prefix::before { background: linear-gradient(90deg, #14b8a6, #5eead4); }
.section-quick-rules::before { background: linear-gradient(90deg, #8b5cf6, #c084fc); }
.section-editor::before { background: linear-gradient(90deg, #6366f1, #818cf8); }
.section-rules::before { background: linear-gradient(90deg, #475569, #94a3b8); }
.section-scanner::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.section-audit::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.section-run-tools::before { background: linear-gradient(90deg, #10b981, #34d399); }
.section-logout::before { background: linear-gradient(90deg, #b91c1c, #ef4444); }
.function-card { border-width: 2px; }
.rename-card { background: linear-gradient(180deg, #f8fbff, #ffffff); border-color: #bfdbfe; }
.removal-card { background: linear-gradient(180deg, #fffaf5, #ffffff); border-color: #fed7aa; }
.replace-card { background: linear-gradient(180deg, #faf5ff, #ffffff); border-color: #ddd6fe; }
.inline-form { display: inline-flex; margin: 0; }
.scanner-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.run-tools-grid { align-items: stretch; }
.actions-row .btn, .actions-row button { min-width: 190px; }
.item-row { gap: 12px; }
.card > h2 { margin-bottom: 8px; }
.card > h2 + .card-intro, .card > h3 + .help { max-width: 980px; }
.table-wrap { border: 1px solid var(--border); border-radius: 16px; background: #fff; }
th, td { padding: 14px 10px; }
tr:hover td { background: #f8fbff; }
.footer-note { padding-bottom: 16px; }
@media (max-width: 860px) {
  body { padding: 8px; }
  .container { padding-left: 10px; padding-right: 10px; }
  .actions-row .btn, .actions-row button { min-width: 100%; }
  .scanner-toolbar { align-items: flex-start; }
}


.dashboard-top-grid { align-items: start; margin-top: 20px; }
.dashboard-top-grid > .card { height: 100%; }
.section-card { padding: 24px; }
.scanner-preview-list { display: grid; gap: 10px; margin-top: 12px; }
.scanner-chip { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.82); border: 1px solid var(--border); }
.scanner-chip span { color: var(--muted); font-size: 13px; }
.instruction-box { border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(180deg,#ffffff,#f8fbff); padding: 16px 18px; margin-top: 16px; }
.instruction-box h3 { margin: 0 0 10px; font-size: 17px; }
.code-block { white-space: pre-wrap; word-break: break-word; background: #0f172a; color: #e2e8f0; border-radius: 14px; padding: 14px 16px; overflow: auto; }
.btn-run { min-height: 48px; min-width: 210px; border-width: 1px; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08); }
.btn-preview { background: linear-gradient(135deg,#2563eb,#60a5fa); }
.btn-merge { background: linear-gradient(135deg,#059669,#34d399); }
.btn-download { background: linear-gradient(135deg,#475569,#94a3b8); }
.btn-report { background: linear-gradient(135deg,#7c3aed,#a78bfa); }
.run-instruction-grid { margin-top: 18px; }
.section-run-tools .card-intro { max-width: 920px; }
#panel-notice { position: sticky; top: 12px; z-index: 12; }
.inline-actions { align-items: center; }
@media (min-width: 1100px) {
  .dashboard-top-grid { grid-template-columns: 1.15fr 1.1fr .95fr; }
}
@media (max-width: 860px) {
  .section-card { padding: 18px; }
  .btn-run { min-width: 100%; }
  .scanner-chip { flex-direction: column; align-items: flex-start; }
}


.percent-card { background: linear-gradient(180deg, #f0fdf4, #ffffff); border-color: #86efac; }
.image-card { background: linear-gradient(180deg, #eff6ff, #ffffff); border-color: #93c5fd; }
.checkbox-group { display: flex; flex-direction: column; gap: 10px; padding: 10px 0; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); }
.check input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
.full-row { grid-column: 1 / -1; }
@media (max-width: 860px) { .full-row { grid-column: auto; } }
