:root{
  --bg:#0b0c10;
  --panel:rgba(255,255,255,0.08);
  --text:rgba(255,255,255,0.92);
  --muted:rgba(255,255,255,0.70);
  --border:rgba(255,255,255,0.14);
  --shadow:0 10px 40px rgba(0,0,0,0.45);
  --radius:18px;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family:Inter,system-ui,sans-serif;
  background:var(--bg);
  color:var(--text);
}

.wrap{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:18px;
  gap:14px;
}

header{
  width:min(980px,100%);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
}

.brand h1{ margin:0; font-size:16px; }
.brand p{ margin:0; font-size:12px; color:var(--muted); }

a.link{
  color:var(--muted);
  text-decoration:none;
  padding:8px 10px;
  border-radius:12px;
  border:1px solid transparent;
}
a.link:hover{
  color:var(--text);
  border-color:rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06);
}

/* KEY: lock main column width */
main{
  width:min(980px,100%);
}

/* KEY: card takes full width of main always */
.card{
  width:100%;
  background:var(--panel);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:22px;
  box-shadow:var(--shadow);

  /* KEY: prevents button row jumping */
  display:flex;
  flex-direction:column;
  gap:14px;
}

.prompt{
  background:rgba(255,255,255,0.10);
  border:1px solid var(--border);
  border-radius:12px;
  padding:18px;

  /* KEY: stable panel height so controls don't shift vertically */
  min-height:160px;

  /* mobile overflow safety */
  overflow:hidden;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.promptText{
  margin:0;
  font-size:clamp(18px,3vw,28px);
  font-weight:700;
  line-height:1.18;
}

/* KEY: controls stay in a fixed place within the card */
.controls{
  display:flex;
  gap:10px;
  justify-content:flex-end;
  align-items:center;
}

button{
  background:rgba(255,255,255,0.08);
  border:1px solid var(--border);
  color:var(--text);
  padding:12px 14px;
  border-radius:14px;
  cursor:pointer;
  font-weight:600;
}
button.primary{ background:rgba(110,231,183,0.20); }

.toast{
  position:fixed;
  bottom:18px;
  left:50%;
  transform:translateX(-50%);
  background:rgba(0,0,0,0.8);
  border:1px solid rgba(255,255,255,0.18);
  color:#fff;
  padding:10px 14px;
  border-radius:999px;
  opacity:0;
  transition:0.2s;
  pointer-events:none;
}
.toast.show{ opacity:1; }

.modalOverlay{
  position:fixed;
  inset:0;
  display:none;
  background:rgba(0,0,0,0.6);
  align-items:center;
  justify-content:center;
  padding:18px;
}
.modalOverlay.show{ display:flex; }

.modal{
  background:#111;
  padding:16px;
  border-radius:16px;
  width:min(480px,100%);
  border:1px solid rgba(255,255,255,0.14);
}
.modalActions{
  display:flex;
  justify-content:flex-end;
  margin-top:10px;
}

/* --- Editor --- */
.editorCard { width: 100%; }

.editorHeader{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  flex-wrap:wrap;
}

.editorTitle{
  margin:0;
  font-size:14px;
  font-weight:800;
  color:var(--text);
}

.editorActions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}

.editorGrid{
  display:grid;
  grid-template-columns: 1fr;
  gap:12px;
}

@media (min-width: 860px){
  .editorGrid{
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.editorField{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.editorLabel{
  font-size:12px;
  color:var(--muted);
}

textarea{
  width:100%;
  min-height: 180px;
  resize: vertical;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.35;
  outline: none;
}

textarea:focus{
  border-color: rgba(110,231,183,0.35);
}

.editorHint{
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  min-height: 1.2em;
}

.modeToggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);
  font-size: 13px;
  user-select: none;
}

.modeToggle input{
  width: 16px;
  height: 16px;
  accent-color: rgba(110,231,183,0.9);
}

.editorCard.isLocked .editorGrid,
.editorCard.isLocked #applyListsBtn,
.editorCard.isLocked #resetListsBtn{
  display:none;
}

.editorCard.isLocked .editorHint{
  margin-top: 0;
}

.siteFooter{
  margin-top: auto;              /* <- this is the key */
  padding-top: 18px;
  font-size: 11px;
  color: rgba(255,255,255,0.45);
  text-align: center;
  letter-spacing: 0.2px;
}

