:root{
  --bg:#eef1f6;
  --card:#ffffff;
  --text:#0f1420;
  --muted:#5f6b7c;
  --border:#dde3ec;
  --field:#ffffff;
  --primary:#2563eb;
  --primaryText:#ffffff;
  --ghost:#f4f6fa;
  --code:#0b1020;
  --codeText:#e6edf3;
  --note:#b45309;
  --accent:#7c3aed;
  --accent2:#06b6d4;
  --ok:#15803d;
  --bad:#b91c1c;
  --ring:rgba(37,99,235,.35);
  --shadow:0 1px 2px rgba(15,20,32,.04), 0 8px 24px rgba(15,20,32,.06);
}

[data-theme="dark"]{
  --bg:#070910;
  --card:#10141d;
  --text:#e8ecf3;
  --muted:#93a0b4;
  --border:#222836;
  --field:#0b0f18;
  --primary:#3b82f6;
  --primaryText:#06111f;
  --ghost:#171c27;
  --code:#080b13;
  --codeText:#e6edf3;
  --note:#fbbf24;
  --accent:#a78bfa;
  --accent2:#22d3ee;
  --ok:#4ade80;
  --bad:#f87171;
  --ring:rgba(96,165,250,.4);
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45);
}

*{box-sizing:border-box}

body{
  margin:0;
  padding:32px 16px 40px;
  background:
    radial-gradient(1100px 520px at 12% -8%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    radial-gradient(900px 460px at 92% 0%, color-mix(in srgb, var(--accent2) 15%, transparent), transparent 58%),
    var(--bg);
  color:var(--text);
  font-family:system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  font-size:15px;
  line-height:1.55;
  -webkit-text-size-adjust:100%;
  min-height:100vh;
}

.wrap{
  max-width:700px;
  margin:0 auto;
}

.card{
  position:relative;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:20px;
  padding:28px;
  box-shadow:var(--shadow);
}

/* thin accent line along the top of the card */
.card::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:3px;
  border-radius:20px 20px 0 0;
  background:linear-gradient(90deg, var(--accent), var(--primary), var(--accent2));
}

.top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}

.top-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}

h1{
  margin:0;
  font-size:24px;
  font-weight:700;
  letter-spacing:-.02em;
  background:linear-gradient(90deg, var(--text), var(--primary));
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
}

.sub{
  margin:5px 0 0;
  font-size:13.5px;
  color:var(--muted);
}

/* developer info button */
.dev-btn{
  display:flex;
  align-items:center;
  gap:9px;
  padding:6px 13px 6px 6px;
  text-decoration:none;
  color:var(--text);
  background:var(--ghost);
  border:1px solid var(--border);
  border-radius:999px;
  transition:border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.dev-btn:hover{
  border-color:var(--primary);
  transform:translateY(-1px);
  box-shadow:0 6px 16px color-mix(in srgb, var(--primary) 22%, transparent);
}
.dev-btn:active{transform:translateY(0)}
.dev-avatar{
  display:grid;
  place-items:center;
  width:28px;
  height:28px;
  border-radius:50%;
  font-size:13px;
  font-weight:700;
  color:#fff;
  background:linear-gradient(135deg, var(--primary), var(--accent));
  flex:0 0 auto;
}
.dev-text{
  display:flex;
  flex-direction:column;
  line-height:1.15;
  text-align:left;
}
.dev-text b{font-size:13px; font-weight:600}
.dev-text i{
  font-size:11px;
  font-style:normal;
  color:var(--muted);
}

.icon-btn{
  flex:0 0 auto;
  width:38px;
  height:38px;
  border:1px solid var(--border);
  border-radius:10px;
  background:var(--ghost);
  color:var(--text);
  font-size:17px;
  line-height:1;
  cursor:pointer;
  transition:border-color .16s ease, background .16s ease;
}
.icon-btn:hover{border-color:var(--primary)}

/* trust badges */
.badges{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:20px;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:5px 11px;
  font-size:12px;
  font-weight:500;
  color:var(--muted);
  background:var(--ghost);
  border:1px solid var(--border);
  border-radius:999px;
}
.badge::before{
  content:"";
  width:6px;
  height:6px;
  border-radius:50%;
  background:linear-gradient(135deg, var(--ok), var(--accent2));
}

/* tabs */
.tabs{
  display:flex;
  gap:4px;
  padding:5px;
  margin-bottom:20px;
  background:var(--ghost);
  border:1px solid var(--border);
  border-radius:14px;
}
.tab{
  flex:1;
  padding:10px 10px;
  font-family:inherit;
  font-size:14px;
  color:var(--muted);
  background:transparent;
  border:0;
  border-radius:10px;
  cursor:pointer;
  transition:color .16s ease, background .16s ease;
}
.tab:hover{color:var(--text)}
.tab.active{
  background:var(--card);
  color:var(--primary);
  font-weight:600;
  box-shadow:0 1px 3px rgba(15,20,32,.1);
}

/* fields */
.grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-bottom:18px;
}

.field.wide{grid-column:1 / -1}

.field{
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:13px;
  color:var(--muted);
  min-width:0;
}

select,
input[type="number"]{
  width:100%;
  padding:11px 13px;
  font-size:14.5px;
  font-family:inherit;
  color:var(--text);
  background:var(--field);
  border:1px solid var(--border);
  border-radius:11px;
  transition:border-color .16s ease, box-shadow .16s ease;
}
select{cursor:pointer}
select:hover,
input[type="number"]:hover{border-color:var(--muted)}
select:focus,
input[type="number"]:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px var(--ring);
  outline:none;
}
input[type="number"]{-moz-appearance:textfield}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.btn:focus-visible,
.icon-btn:focus-visible,
.presets button:focus-visible,
.tab:focus-visible,
.dev-btn:focus-visible,
.foot a:focus-visible{
  outline:2px solid var(--primary);
  outline-offset:2px;
}

textarea:focus{
  border-color:var(--primary);
  box-shadow:0 0 0 3px var(--ring);
}

.presets{
  display:flex;
  gap:8px;
  margin-top:10px;
}
.presets button{
  flex:1;
  padding:8px 4px;
  font-family:inherit;
  font-size:13px;
  color:var(--text);
  background:var(--ghost);
  border:1px solid var(--border);
  border-radius:9px;
  cursor:pointer;
}
.presets button:hover{border-color:var(--muted)}

.check{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:12px;
  font-size:13.5px;
  color:var(--muted);
  cursor:pointer;
}
.check input{
  width:16px;
  height:16px;
  accent-color:#15181e;
  cursor:pointer;
}

.source-line{
  display:flex;
  align-items:center;
  gap:8px;
  margin:12px 0 0;
  font-size:13px;
  color:var(--muted);
}
.source-line b{
  color:var(--text);
  font-weight:600;
}
.source-badge{
  display:inline-block;
  padding:4px 12px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--ghost);
  font-size:13px;
  font-weight:600;
  color:var(--text);
}

/* checker */
.result{
  margin-top:18px;
  padding:16px;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--ghost);
  font-size:13.5px;
}
.result.ok{border-color:var(--ok)}
.result.bad{border-color:var(--bad)}
.result h3{
  margin:0 0 4px;
  font-size:15px;
}
.result.ok h3{color:var(--ok)}
.result.bad h3{color:var(--bad)}
.result ul{
  margin:10px 0 0;
  padding-left:18px;
}
.result li{margin:2px 0}
.fields{
  display:grid;
  grid-template-columns:auto 1fr;
  gap:4px 12px;
  margin-top:10px;
}
.fields span:nth-child(odd){color:var(--muted)}
.fields span:nth-child(even){
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  word-break:break-all;
}
.tag{
  display:inline-block;
  padding:1px 8px;
  border-radius:999px;
  font-size:11.5px;
  background:var(--card);
  border:1px solid var(--border);
  color:var(--muted);
}
.actions.spaced{margin-top:12px}

/* buttons */
.btn{
  display:block;
  width:100%;
  padding:13px 16px;
  font-size:15px;
  font-family:inherit;
  font-weight:600;
  color:var(--primaryText);
  background:linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--accent) 55%, var(--primary)));
  border:1px solid transparent;
  border-radius:12px;
  cursor:pointer;
  box-shadow:0 6px 18px color-mix(in srgb, var(--primary) 26%, transparent);
  transition:transform .14s ease, box-shadow .16s ease, opacity .14s ease;
}
.btn:hover{
  opacity:1;
  transform:translateY(-1px);
  box-shadow:0 10px 24px color-mix(in srgb, var(--primary) 34%, transparent);
}
.btn:active{transform:translateY(1px); box-shadow:none}
.spaced{margin-top:14px}

.ghost{
  color:var(--text);
  background:var(--ghost);
  border-color:var(--border);
  font-weight:500;
  box-shadow:none;
}
.ghost:hover{
  border-color:var(--primary);
  color:var(--primary);
  box-shadow:0 6px 16px color-mix(in srgb, var(--primary) 16%, transparent);
}

.out{
  margin-top:20px;
}

.label{
  display:block;
  margin-bottom:8px;
  font-size:13px;
  color:var(--muted);
}

textarea{
  width:100%;
  padding:12px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:13.5px;
  line-height:1.6;
  color:var(--codeText);
  background:var(--code);
  border:1px solid var(--border);
  border-radius:10px;
  resize:vertical;
  word-break:break-all;
  white-space:pre-wrap;
}

.actions{
  display:flex;
  gap:10px;
  margin-top:10px;
}
.actions .btn{
  width:auto;
  flex:1;
  padding:10px 14px;
  font-size:14px;
}

#custom[aria-pressed="true"]{
  border-color:var(--primary);
  color:var(--primary);
  background:color-mix(in srgb, var(--primary) 10%, var(--ghost));
}

.hint{
  margin:10px 0 0;
  font-size:12.5px;
  color:var(--muted);
}

.stats{
  display:flex;
  flex-wrap:wrap;
  gap:6px 16px;
  margin-top:16px;
  font-size:13px;
  color:var(--muted);
}
.stats b{color:var(--text);font-weight:600}

#bulkNote{color:var(--note)}

/* history */
.history{
  margin-top:24px;
  padding-top:20px;
  border-top:1px solid var(--border);
}
.history ul{
  margin:0;
  padding:0;
  list-style:none;
}
.history li{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:12px;
  color:var(--muted);
  padding:6px 0;
  border-bottom:1px dashed var(--border);
  cursor:pointer;
  word-break:break-all;
}
.history li:last-child{border-bottom:0}
.history li:hover{color:var(--text)}

/* toast */
.toast{
  position:fixed;
  left:50%;
  bottom:24px;
  transform:translate(-50%,16px);
  padding:11px 20px;
  font-size:14px;
  color:#fff;
  background:color-mix(in srgb, var(--code) 92%, transparent);
  border:1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius:999px;
  box-shadow:0 10px 30px rgba(0,0,0,.35);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
  z-index:10;
}
.toast.show{
  opacity:1;
  transform:translate(-50%,0);
}

/* footer */
.foot{
  margin-top:20px;
  padding:20px 18px;
  text-align:center;
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:var(--shadow);
}
.foot .copy{
  margin:0;
  font-size:13.5px;
  font-weight:600;
  color:var(--text);
}
.foot .built{
  margin:6px 0 0;
  font-size:12.5px;
  color:var(--muted);
}
.foot a{
  color:var(--primary);
  text-decoration:none;
  font-weight:600;
  border-bottom:1px solid transparent;
}
.foot a:hover{border-bottom-color:var(--primary)}

@media (max-width:520px){
  body{padding:20px 12px 28px}
  .card{padding:20px 14px}
  .card::before{border-radius:20px 20px 0 0}
  .grid{grid-template-columns:1fr; gap:12px}
  .actions{flex-direction:column}
  .actions .btn{width:100%; flex:none}
  .tabs{gap:2px}
  .tab{font-size:13px; padding:10px 4px}
  h1{font-size:20px}
  .top{flex-direction:column; gap:12px}
  .top-actions{width:100%; justify-content:space-between}
  .dev-btn{flex:1}
  .badges{gap:6px}
  .badge{font-size:11.5px}
  .foot{padding:16px 14px}
}

.hints-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--field);
  padding: 10px 12px;
  margin-bottom: 10px;
  min-height: 24px;
}

.hints-box .fields {
  margin: 0;
}

.result ul.notes {
  color: var(--muted);
}