:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --border:#d7dbe7;
  --text:#1b1f2a;
  --muted:#5a6473;
  --ok:#1f883d;
  --bad:#d1242f;
  --accent:#2563eb;
  --shadow:0 10px 30px rgba(15,23,42,.10);
}


*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;
  background:
    radial-gradient(1200px 600px at 20% 0%, rgba(37,99,235,.10), transparent 60%),
    radial-gradient(900px 500px at 80% 10%, rgba(31,136,61,.08), transparent 55%),
    var(--bg);
  color:var(--text);
}

.top{

  display:flex;
  gap:16px;
  align-items:center;
  justify-content:space-between;
  padding:18px 22px;
  border-bottom:1px solid var(--border);
  background:rgba(255,255,255,.85);
  backdrop-filter:blur(10px);
  position:sticky; top:0; z-index:10;
}

h1{margin:0;font-size:20px}
h2{margin:0;font-size:16px}

.muted{margin:6px 0 0;color:var(--muted);font-size:13px}
.hint{color:var(--muted);font-size:12px;margin-top:6px}
.hint[data-kind="ok"]{color:var(--ok)}
.hint[data-kind="bad"]{color:var(--bad)}
code{color:#0f172a}

.top-actions{display:flex;gap:10px}
button{
  border:1px solid var(--border);
  background:#ffffff;
  color:var(--text);
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
}
button:hover{border-color:rgba(37,99,235,.35)}
button.primary{
  background:linear-gradient(180deg, rgba(37,99,235,.18), rgba(37,99,235,.08));
  border-color:rgba(37,99,235,.35);
}

.layout{
  display:grid;
  grid-template-columns: 60% 40%;
  gap:16px;
  padding:16px;
  align-items:start;
}
@media (max-width:1100px){
  .layout{grid-template-columns:1fr}
  .sticky{position:static!important}
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:14px;
  box-shadow:var(--shadow);
}

.sticky{position:sticky; top:88px}

.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.pill{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  color:var(--muted);
}
.pill[data-kind="ok"]{color:var(--ok);border-color:rgba(126,231,135,.35)}
.pill[data-kind="bad"]{color:var(--bad);border-color:rgba(255,123,114,.35)}

.preview{
  margin:10px 0 0;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#f3f4f6;
  color:var(--text);
  min-height:360px;
  max-height:calc(100vh - 210px);
  overflow:auto;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:12.5px;
  line-height:1.45;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* Collapsible sections */
.section{
  background:rgba(255,255,255,.92);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow);
  margin-bottom:14px;
  overflow:hidden;
}

.section-summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  user-select:none;
  background:rgba(255,255,255,.96);
}
.section-summary::-webkit-details-marker{display:none}

.section-title{
  display:flex;
  flex-direction:column;
  gap:2px;
;min-width:0}
.section-title > span:first-child{font-weight:600}
.section-sub{font-size:12px;color:var(--muted);font-weight:400}

.enabled{
  display:inline-flex;
  gap:10px;
  align-items:center;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  background:#f1f5f9;
  cursor:default;
}
.enabled span{font-size:12px;color:var(--muted)}
.enabled input{width:16px;height:16px; accent-color: var(--accent);}

.section-body{
  padding:12px 14px 14px;
}

.kv{
  display:grid;
  grid-template-columns: minmax(180px, 320px) 1fr;
  gap:12px;
  padding:10px 0;
  border-top:1px solid rgba(35,38,52,.55);
}
.kv:first-child{border-top:none}

.k{font-size:13px;color:var(--muted);padding-top:9px;overflow-wrap:anywhere}
.v{display:flex;flex-direction:column;gap:8px}

input, textarea{
  width:100%;
  border:1px solid var(--border);
  background:#f1f5f9;
  color:var(--text);
  padding:9px 10px;
  border-radius:10px;
  font-size:13px;
  outline:none;
}
textarea{resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}
input:focus, textarea:focus{
  border-color:rgba(110,168,254,.55);
  box-shadow:0 0 0 3px rgba(110,168,254,.15);
}

.check{
  display:inline-flex;
  align-items:center;
  gap:10px;
}
.check input{width:16px;height:16px; accent-color: var(--accent);}
.check span{color:var(--muted); font-size:13px}

.radios{
  display:flex;
  flex-wrap:wrap;
  gap:14px;
  padding-top:6px;
}
.radio{
  display:inline-flex;
  align-items:center;
  gap:8px;
}
.radio input{width:16px;height:16px; accent-color: var(--accent);}

.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.group{
  margin-top:10px;
  padding:12px;
  border-radius:14px;
  border:1px dashed #2b3046;
  background:rgba(15,17,24,.65);
}
.group-title{
  font-size:12px;
  color:var(--muted);
  margin-bottom:8px;
  text-transform:uppercase;
  letter-spacing:.05em;
}

.disabled{
  opacity:.55;
  filter:grayscale(.1);
}


.left,.right{min-width:0}

.right .card{max-width:100%}
.preview{max-width:100%}

.section-summary{min-width:0}
.section-title-wrap{min-width:0}
