:root{
  font-family:'Inter', system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif;
  color:#111;
  background:#f5f5f8;
}
body{
  margin:0;
  background:radial-gradient(circle at top,#fef3c7,transparent 60%), #f5f5f8;
  min-height:100vh;
}
.wrap{
  max-width:960px;
  margin:0 auto;
  padding:32px 20px 60px;
  display:flex;
  flex-direction:column;
  gap:20px;
}
.hero{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  flex-wrap:wrap;
}
.hero h1{margin-bottom:8px}
.hero p{margin:0;color:#4b5563}
button.ghost{
  background:transparent;
  color:#111827;
  border:1px solid rgba(17,24,39,.2);
  padding:10px 18px;
}
button.ghost:hover{
  background:rgba(17,24,39,.05);
}
.card{
  background:#fff;
  border-radius:16px;
  padding:24px;
  box-shadow:0 18px 50px rgba(0,0,0,.05);
}
.card h2{margin-top:0}
#login-card{
  border:1px dashed rgba(17,24,39,.2);
}
form{
  display:flex;
  flex-direction:column;
  gap:16px;
}
label{display:flex;flex-direction:column;font-weight:600;gap:6px}
input[type="text"],input[type="url"],input[type="password"],input:not([type]){
  border-radius:10px;
  border:1px solid #d4d4d4;
  padding:12px;
  font-size:1rem;
}
button{
  border:none;
  background:#111827;
  color:#fff;
  padding:12px 18px;
  border-radius:999px;
  font-size:1rem;
  cursor:pointer;
  align-self:flex-start;
}
button:hover{background:#0f172a}
.checkbox{flex-direction:row;align-items:center;font-weight:500}
.checkbox input{margin-right:8px}
.table-head, .card-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}
table{width:100%;border-collapse:collapse;font-size:.95rem}
th,td{padding:10px;border-bottom:1px solid #eee;text-align:left}
td:last-child{width:60px}
table button{
  background:#fee2e2;
  color:#b91c1c;
  padding:6px 12px;
  border-radius:999px;
  margin-right:6px;
}
.table td.actions{white-space:nowrap}
table button[data-action="reset"]{
  background:#e0e7ff;
  color:#312e81;
}
table button[data-action="reset"]:hover{
  background:#c7d2fe;
}
table button:hover{background:#fecaca}
table button:disabled{
  cursor:not-allowed;
  opacity:.55;
}
.muted{color:#6b7280}
pre{
  background:#111827;
  color:#e5e7eb;
  padding:16px;
  border-radius:12px;
  overflow:auto;
}
#form-status,#table-status,#login-status{min-height:1.2em;font-size:.9rem;color:#555}
#form-status.error,#table-status.error,#login-status.error{color:#b91c1c}
#form-status.success,#login-status.success{color:#15803d}

/* Toggle switch */
.toggle{
  position:relative;
  display:inline-flex;
  align-items:center;
  flex-direction:row;
  width:44px;
  height:24px;
  font-weight:400;
  gap:0;
  cursor:pointer;
}
.toggle input{
  opacity:0;
  width:0;
  height:0;
  position:absolute;
}
.toggle-slider{
  position:absolute;
  inset:0;
  background:#d1d5db;
  border-radius:999px;
  transition:background .2s;
}
.toggle-slider::before{
  content:'';
  position:absolute;
  left:2px;
  top:2px;
  width:20px;
  height:20px;
  background:#fff;
  border-radius:50%;
  transition:transform .2s;
  box-shadow:0 1px 3px rgba(0,0,0,.15);
}
.toggle input:checked + .toggle-slider{
  background:#4f46e5;
}
.toggle input:checked + .toggle-slider::before{
  transform:translateX(20px);
}
.toggle input:disabled + .toggle-slider{
  opacity:.5;
  cursor:wait;
}

body:not(.authed) [data-protected="true"]{display:none}
body.authed #login-card{display:none}
