:root{
  --bg:#f6f8fc;
  --panel:#ffffff;
  --ink:#0f172a;
  --muted:#475569;
  --border:#e5e7eb;
  --blue:#2563eb;
  --blue2:#1d4ed8;
  --soft2:#f1f5f9;
  --shadow:0 8px 30px rgba(15,23,42,.06);
  --radius:16px;
  --max:980px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--ink);
  background:linear-gradient(180deg,#f8fbff 0%, var(--bg) 55%, #ffffff 100%);
  line-height:1.55;
}

a{color:inherit}
.wrap{max-width:var(--max); margin:0 auto; padding:0 18px}

.topbar{
  position:sticky; top:0; z-index:50;
  background:rgba(248,251,255,.82);
  backdrop-filter:saturate(180%) blur(10px);
  border-bottom:1px solid rgba(229,231,235,.8);
}
.topbar-inner{
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 0;
  gap:12px;
}
.brand{
  display:flex; align-items:center; gap:10px; font-weight:800; letter-spacing:.2px;
}
.logo{
  width:34px;height:34px;border-radius:10px;
  background:radial-gradient(120% 120% at 20% 20%, #93c5fd 0%, #2563eb 38%, #0b1220 100%);
  box-shadow:0 8px 18px rgba(37,99,235,.22);
}
.nav{
  display:flex; align-items:center; gap:14px; flex-wrap:wrap;
  font-size:14px;
  color:var(--muted);
}
.nav a{
  text-decoration:none;
  padding:8px 10px;
  border-radius:10px;
}
.nav a:hover{background:rgba(15,23,42,.05); color:var(--ink)}

main{padding:26px 0 44px}

.card{
  background:var(--panel);
  border:1px solid rgba(229,231,235,.9);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:22px;
}

.kicker{
  display:inline-flex; align-items:center; gap:8px;
  font-size:12px;
  padding:7px 10px;
  border-radius:999px;
  background:rgba(37,99,235,.08);
  color:rgba(29,78,216,.95);
  border:1px solid rgba(37,99,235,.16);
  font-weight:700;
  margin-bottom:12px;
}

h1{margin:0; font-size:28px; letter-spacing:-.3px; line-height:1.2}
p{margin:10px 0; color:var(--muted)}

.row{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; align-items:center}

/* Button typography fix: force consistent sizing across pages */
.btn{
  display:inline-flex; align-items:center; justify-content:center;
  padding:11px 16px;               /* slightly tighter */
  border-radius:12px;
  border:1px solid rgba(37,99,235,.18);
  background:var(--blue);
  color:white;
  font-weight:800;
  font-size:14px;                  /* key fix */
  line-height:1.2;                 /* key fix */
  text-decoration:none;
  box-shadow:0 10px 22px rgba(37,99,235,.18);
  cursor:pointer;
}
.btn:hover{background:var(--blue2)}
.btn.secondary{
  background:white;
  color:var(--ink);
  border:1px solid var(--border);
  box-shadow:none;
}
.btn.secondary:hover{background:rgba(15,23,42,.04)}
.btn:disabled{opacity:.6; cursor:not-allowed}

.small{font-size:12px; color:rgba(71,85,105,.95)}
.sep{height:1px; background:rgba(229,231,235,.9); margin:14px 0}

.hint{
  margin-top:12px;
  background:var(--soft2);
  border:1px solid rgba(229,231,235,.85);
  border-radius:14px;
  padding:14px;
  color:rgba(71,85,105,.95);
  font-size:13px;
}

.err{
  margin-top:12px;
  background:#fff1f2;
  border:1px solid #fecaca;
  border-radius:14px;
  padding:12px;
  color:#991b1b;
  font-size:13px;
  display:none;
}

.list{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:12px;
}

.item{
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px;
  border:1px solid rgba(229,231,235,.95);
  border-radius:14px;
  background:white;
}
.handle{
  width:34px;
  height:34px;
  border-radius:12px;
  border:1px solid rgba(229,231,235,.95);
  background:rgba(15,23,42,.03);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:grab;
  user-select:none;
  font-weight:900;
  color:rgba(71,85,105,.95);
}
.meta{
  flex:1 1 auto;
  min-width:0;
}
.name{
  font-weight:900;
  font-size:14px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.sub{
  margin-top:4px;
  font-size:12px;
  color:rgba(71,85,105,.95);
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.actions{
  display:flex;
  gap:8px;
  flex:0 0 auto;
}
.iconbtn{
  width:38px;
  height:38px;
  border-radius:12px;
  border:1px solid rgba(229,231,235,.95);
  background:white;
  cursor:pointer;
  font-weight:900;
  color:rgba(71,85,105,.95);
  font-size:14px;
  line-height:1;
}
.iconbtn:hover{background:rgba(15,23,42,.04)}

.preview{
  margin-top:14px;
  border:1px solid rgba(229,231,235,.95);
  border-radius:14px;
  background:white;
  overflow:hidden;
}
.preview-head{
  padding:12px 12px;
  border-bottom:1px solid rgba(229,231,235,.95);
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}
.preview-title{
  font-weight:900;
  font-size:13px;
}
.preview-body{
  height:560px;
}
.preview-body iframe{
  width:100%;
  height:100%;
  border:0;
  background:white;
}

.footer{
  padding:22px 0 44px;
  color:var(--muted);
  font-size:13px;
}
.footer-inner{
  border-top:1px solid rgba(229,231,235,.9);
  padding-top:18px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  justify-content:space-between;
}
.footlinks{display:flex; gap:10px; flex-wrap:wrap}
.footlinks a{color:var(--muted); text-decoration:none; padding:6px 8px; border-radius:10px}
.footlinks a:hover{background:rgba(15,23,42,.05); color:var(--ink)}

@media (max-width: 860px){
  h1{font-size:26px}
  .preview-body{height:520px}
}
