:root{
  --bg: #0f1711;
  --panel: rgba(255,255,255,0.06);
  --panel2: rgba(255,255,255,0.09);
  --text: #e9f2eb;
  --muted: rgba(233,242,235,0.72);
  --line: rgba(233,242,235,0.12);
  --accent: #7fe3a8;
  --accent2: #ffd27e;
  --danger: #ff6b6b;
  --shadow: 0 14px 35px rgba(0,0,0,0.4);
  --radius: 16px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  background:
    radial-gradient(1200px 800px at 15% 20%, rgba(127,227,168,0.18), transparent 60%),
    radial-gradient(900px 700px at 85% 15%, rgba(255,210,126,0.14), transparent 65%),
    radial-gradient(900px 700px at 60% 85%, rgba(148,107,255,0.12), transparent 60%),
    var(--bg);
  color:var(--text);
}

.topbar{
  display:flex;
  gap:16px;
  justify-content:space-between;
  align-items:flex-start;
  padding:18px 18px 10px;
}

.brand{ display:flex; gap:12px; align-items:flex-start; }
.logo{ font-size:34px; filter: drop-shadow(0 8px 18px rgba(0,0,0,0.45)); }
.topbar h1{ margin:0; font-size:18px; letter-spacing:0.2px; }
.tagline{ margin:4px 0 0; color:var(--muted); font-size:13px; max-width:58ch; }

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

.layout{
  display:grid;
  grid-template-columns: 380px 1fr;
  gap:16px;
  padding: 10px 18px 18px;
}

.panel{
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border:1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  padding:14px;
  position:sticky;
  top:10px;
  height: calc(100vh - 24px);
  overflow:auto;
}

.panel h2{ margin:10px 0 10px; font-size:14px; letter-spacing:0.4px; text-transform:uppercase; color:rgba(233,242,235,0.92); }

.field{ margin:10px 0; }
label{ display:block; font-size:12px; color:rgba(233,242,235,0.86); margin-bottom:6px; }
input, select, textarea{
  width:100%;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid rgba(233,242,235,0.18);
  background: rgba(15,23,17,0.55);
  color:var(--text);
  outline:none;
}
textarea{ resize:vertical; min-height:74px; }
input:focus, select:focus, textarea:focus{ border-color: rgba(127,227,168,0.55); box-shadow: 0 0 0 4px rgba(127,227,168,0.12); }

.grid2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }

.details{
  margin-top:10px;
  border:1px solid rgba(233,242,235,0.12);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0,0,0,0.08);
}
.details summary{ cursor:pointer; color:rgba(233,242,235,0.92); font-weight:650; }

.divider{ height:1px; background: rgba(233,242,235,0.12); margin:14px 0; }

.actions{ display:flex; gap:10px; flex-wrap:wrap; }
.btn{
  border:1px solid rgba(233,242,235,0.16);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 14px;
  cursor:pointer;
  transition: transform .05s ease, background .2s ease, border-color .2s ease;
}
.btn:hover{ background: rgba(255,255,255,0.1); border-color: rgba(233,242,235,0.28); }
.btn:active{ transform: translateY(1px); }
.btn-primary{ background: linear-gradient(180deg, rgba(127,227,168,0.22), rgba(127,227,168,0.1)); border-color: rgba(127,227,168,0.45); }
.btn-ghost{ background: transparent; }

.preview{
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border:1px solid rgba(233,242,235,0.10);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}

.preview-head{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.preview-head h2{ margin:0; font-size:14px; letter-spacing:0.4px; text-transform:uppercase; color:rgba(233,242,235,0.92); }
.preview-actions{ display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }

.canvas-wrap{
  margin-top:12px;
  border-radius: 18px;
  overflow:auto;
  border:1px solid rgba(233,242,235,0.12);
  background:
    radial-gradient(700px 520px at 30% 35%, rgba(127,227,168,0.09), transparent 65%),
    rgba(0,0,0,0.18);
  padding: 14px;
  max-height: calc(100vh - 190px);
}

canvas#planner{
  display:block;
  margin:0 auto;
  border-radius: 18px;
  background: #f6f7f2;
  box-shadow: 0 18px 42px rgba(0,0,0,0.45);
}

.hint{ color:var(--muted); font-size:12px; line-height:1.35; }
.muted{ color:var(--muted); }
.tiny{ font-size:12px; margin-top:10px; }

.foot{ margin-top:10px; display:flex; gap:8px; align-items:center; justify-content:flex-start; font-size:12px; color:var(--muted); }
.foot a{ color: rgba(233,242,235,0.85); text-decoration:none; }
.foot a:hover{ text-decoration:underline; }

.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  background: rgba(10,10,10,0.65);
  border: 1px solid rgba(233,242,235,0.16);
  border-radius: 999px;
  padding: 10px 14px;
  color: rgba(255,255,255,0.92);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  opacity: 0;
  pointer-events:none;
  transition: opacity .18s ease;
}
.toast.show{ opacity:1; }

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .panel{ position:relative; height:auto; }
  .canvas-wrap{ max-height: none; }
}

@media print{
  body{ background:white; color:black; }
  .topbar,.panel,.preview-head,.tiny,.toast{ display:none !important; }
  .preview{ border:none; box-shadow:none; padding:0; }
  .canvas-wrap{ border:none; background:transparent; padding:0; }
  canvas#planner{ box-shadow:none; margin:0; width:100%; height:auto; }
}
