:root{
  --bg:#f5f7fb;
  --card-bg:#ffffff;
  --border:#dfe3ec;
  --text:#1f2933;
  --muted:#64748b;
  --accent:#2563eb;
  --accent-soft:#dbeafe;
  --shadow:0 12px 24px rgba(15,23,42,0.08);
}

@keyframes spin{
  to{transform:rotate(360deg)}
}

@keyframes pulse{
  0%,100%{opacity:1}
  50%{opacity:.4}
}

body{
  font-family:system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:var(--bg);
  color:var(--text);
  margin:0;
}

header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:1.5rem clamp(1rem,4vw,3rem);
  background:var(--card-bg);
  box-shadow:var(--shadow);
  position:sticky;
  top:0;
  z-index:10;
}

header h1{margin:0;font-size:1.4rem}

main{
  max-width:960px;
  margin:0 auto;
  padding:clamp(1rem,4vw,3rem);
}

nav a{
  margin-right:1rem;
  color:var(--muted);
  text-decoration:none;
  font-weight:600;
}

nav a:last-child{margin-right:0}
nav a:hover{color:var(--accent)}
nav{
  display:flex;
  align-items:center;
}

.card{
  border:1px solid var(--border);
  padding:1.25rem;
  border-radius:.75rem;
  background:var(--card-bg);
  margin:1rem 0;
  box-shadow:var(--shadow);
}

.prompt-list{
  display:flex;
  flex-direction:column;
  gap:1.5rem;
  margin:1.5rem 0;
}

.prompt-card pre{
  overflow:auto;
  background:var(--accent-soft);
  border:none;
  border-radius:.5rem;
  padding:1rem;
  max-height:22rem;
}

.prompt-edit textarea{
  min-height:220px;
  font-family:Menlo,Consolas,monospace;
  background:#f8fafc;
}

.callout{
  border:1px solid var(--accent);
  background:var(--accent-soft);
  border-radius:.5rem;
  padding:1rem;
  margin-top:1rem;
}

pre{
  overflow:auto;
  background:var(--card-bg);
  border:1px solid var(--border);
  padding:.75rem;
  border-radius:.5rem;
}

.button,
button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:.5rem;
  padding:.65rem 1.35rem;
  border:none;
  border-radius:.6rem;
  background:var(--accent);
  color:#fff;
  cursor:pointer;
  font-weight:600;
  transition:transform .2s ease, box-shadow .2s ease, background .2s ease;
  box-shadow:0 10px 20px rgba(37,99,235,0.18);
}

.button:hover,
button:hover{
  transform:translateY(-1px);
  box-shadow:0 12px 24px rgba(37,99,235,0.24);
  background:#1d4ed8;
}

button.loading{
  pointer-events:none;
  opacity:.8;
}

.button.secondary,
button.secondary{
  background:#e2e8f0;
  color:var(--text);
  box-shadow:none;
}

.button.secondary:hover,
button.secondary:hover{
  background:#cbd5f5;
  transform:none;
  box-shadow:none;
}

label{
  display:block;
  margin:.75rem 0;
  font-weight:600;
}

input,
textarea{
  width:100%;
  padding:.5rem .75rem;
  border-radius:.5rem;
  border:1px solid var(--border);
  font-size:1rem;
  transition:border .2s ease, box-shadow .2s ease;
}

input:focus,
textarea:focus{
  border-color:var(--accent);
  box-shadow:0 0 0 3px rgba(37,99,235,0.2);
  outline:none;
}

fieldset{
  border:1px solid var(--border);
  margin:.75rem 0;
  border-radius:.75rem;
  padding:1rem;
}

.hint{
  font-size:.9rem;
  color:var(--muted);
  margin-top:.25rem;
}

.error{
  color:#dc2626;
  font-weight:600;
  margin:.75rem 0;
}

.user{
  background:var(--accent-soft);
  color:var(--accent);
  padding:.35rem .65rem;
  border-radius:999px;
  margin-right:.75rem;
}

.loader{
  width:2.5rem;
  height:2.5rem;
  border-radius:50%;
  border:3px solid rgba(37,99,235,0.2);
  border-top-color:var(--accent);
  animation:spin 1s linear infinite;
  margin:1rem auto;
}

#loading-screen{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(15,23,42,0.86);
  backdrop-filter:blur(6px);
  z-index:9999;
  opacity:0;
  pointer-events:none;
  transition:opacity .3s ease;
}

body.loading #loading-screen{
  opacity:1;
  pointer-events:auto;
}

.loaded #loading-screen{
  opacity:0;
  pointer-events:none;
}

.loading-content{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:.75rem;
  color:#fff;
}

.loading-content .loader{
  border-color:rgba(255,255,255,0.25);
  border-top-color:#fff;
}

.loading-content .loading-text{
  color:#e2e8f0;
}

.loading-text{
  text-align:center;
  color:var(--muted);
  animation:pulse 1.5s ease-in-out infinite;
  margin-top:.5rem;
}

.status-grid{
  display:grid;
  gap:1.5rem;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  margin-top:1.5rem;
}

.status-card h3{margin-top:0}

.status-grid ul{
  padding-left:1.2rem;
  margin:0;
}

.actions{
  display:flex;
  gap:1rem;
  flex-wrap:wrap;
  margin-top:1.5rem;
}

.layout-two-up{
  display:grid;
  gap:1.5rem;
  grid-template-columns:repeat(auto-fit,minmax(320px,1fr));
}

.card-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:1rem;
  margin-bottom:1rem;
}

.card-header h3{
  margin:0;
}

.muted{
  color:var(--muted);
  margin:0;
}

.stacked-form{
  display:flex;
  flex-direction:column;
  gap:1rem;
}

.form-grid{
  display:grid;
  gap:1rem;
  grid-template-columns:repeat(auto-fit,minmax(240px,1fr));
}

.project-list{
  display:flex;
  flex-direction:column;
  gap:1rem;
  max-height:600px;
  overflow:auto;
  padding-right:.25rem;
}

.project-tile{
  border:1px solid var(--border);
  border-radius:.75rem;
  padding:1rem 1.25rem;
  background:var(--card-bg);
  box-shadow:0 4px 12px rgba(15,23,42,0.08);
}

.project-tile header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:1rem;
  margin-bottom:1rem;
}

.project-tile h4{
  margin:0;
  font-size:1.1rem;
}

.tile-actions{
  display:flex;
  gap:.5rem;
  flex-wrap:wrap;
}

.tile-columns{
  display:grid;
  gap:1.25rem;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr));
}

.tile-columns dl{
  margin:0;
}

.tile-columns dt{
  font-weight:600;
  margin-bottom:.25rem;
}

.tile-columns dd{
  margin:0 0 .75rem;
  color:var(--muted);
}

.change-list{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-direction:column;
  gap:.5rem;
}

.change-list li{
  background:var(--accent-soft);
  border-radius:.5rem;
  padding:.5rem .75rem;
  border:1px solid rgba(37,99,235,0.2);
}

.change-list code{
  font-family:Menlo,Consolas,monospace;
}

.empty-state{
  text-align:center;
  padding:2rem 0;
  border:1px dashed var(--border);
  border-radius:.75rem;
}

.page-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:1.5rem;
}
