:root{
  --cream:#f2ebe1;
  --brown-dark:#5b4b3e;
  --brown-text:#5f5145;
  --green-script:#8cc63f;
  --panel-bg:#ffffff;
  --panel-border:#e4ddd2;
  --accent:#1CADA8;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*{box-sizing:border-box;}
body{margin:0;background:#f4f1eb;color:#2c261f;}

.app{
  display:flex;
  min-height:100vh;
}

/* ================= PANEL ================= */
.panel{
  width:400px;
  min-width:400px;
  background:var(--panel-bg);
  border-right:1px solid var(--panel-border);
  padding:24px 22px 60px;
  overflow-y:auto;
  height:100vh;
  position:sticky;
  top:0;
}
.panel h1{
  font-size:19px;
  margin:0 0 20px;
  line-height:1.3;
  color:var(--brown-dark);
}
.panel h1 span{
  font-weight:400;
  font-size:14px;
  color:#8a7f70;
}
.block{
  padding:16px 0;
  border-top:1px solid var(--panel-border);
}
.block:first-of-type{border-top:none;}
.block h2{
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.04em;
  color:var(--accent);
  margin:0 0 8px;
}
.hint{
  font-size:12px;
  color:#8a7f70;
  line-height:1.5;
  margin:4px 0 10px;
}
.hint code{
  background:#f2ebe1;
  padding:1px 4px;
  border-radius:3px;
  font-size:11px;
}

.file-btn{
  display:inline-block;
  background:var(--accent);
  color:#fff;
  font-size:13px;
  padding:9px 14px;
  border-radius:6px;
  cursor:pointer;
  margin-right:8px;
}
.file-btn input{display:none;}
.mini-btn{
  background:none;
  border:1px solid #d8d0c2;
  color:#7a6f5f;
  font-size:12px;
  padding:8px 12px;
  border-radius:6px;
  cursor:pointer;
}
.mini-btn:hover{background:#f2ebe1;}

.swatch-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:10px;
}
.swatch{
  width:56px;height:56px;
  border-radius:8px;
  border:2px solid transparent;
  background-size:cover;
  background-position:center;
  cursor:pointer;
}
.swatch.active{border-color:var(--accent);}

.topic-list{
  list-style:none;
  margin:0;padding:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}
.topic-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 10px;
  border:1px solid #eee3d3;
  border-radius:8px;
  cursor:pointer;
  font-size:13px;
}
.topic-item:hover{background:#faf6ef;}
.topic-item.selected{
  background:#fbf3e3;
  border-color:var(--accent);
}
.topic-item.disabled{
  opacity:.4;
  cursor:not-allowed;
}
.topic-dot{
  width:14px;height:14px;
  border-radius:50%;
  flex-shrink:0;
}
.topic-item input{margin:0;}

.slot-editors{
  display:flex;
  flex-direction:column;
  gap:10px;
}
.slot-card{
  border:1px solid #eee3d3;
  border-radius:8px;
  padding:10px;
}
.slot-card-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:6px;
}
.slot-card-head strong{font-size:12.5px;color:var(--brown-dark);}
.slot-order-btns button{
  border:none;background:#f2ebe1;
  width:22px;height:22px;border-radius:4px;
  cursor:pointer;font-size:11px;
  margin-left:2px;
}
.slot-card input[type=text]{
  width:100%;
  font-size:13px;
  font-weight:600;
  padding:6px 8px;
  margin-bottom:6px;
  border:1px solid #e4ddd2;
  border-radius:5px;
}
.slot-card textarea{
  width:100%;
  font-size:12.5px;
  padding:6px 8px;
  border:1px solid #e4ddd2;
  border-radius:5px;
  resize:vertical;
  min-height:52px;
  font-family:inherit;
}
.slot-card .icon-override{
  font-size:11px;
  color:#8a7f70;
  margin-top:4px;
}
.slot-card .icon-override input{font-size:11px;}
.empty-slots{
  font-size:12px;
  color:#a99d8c;
  font-style:italic;
}

.export-btn{
  width:100%;
  background:var(--brown-dark);
  color:#fff;
  border:none;
  padding:13px;
  font-size:14px;
  font-weight:600;
  border-radius:8px;
  cursor:pointer;
}
.export-btn:hover{background:#463930;}
.export-btn:disabled{opacity:.5;cursor:wait;}

/* ================= PREVIEW ================= */
.preview-wrap{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:30px;
  overflow:auto;
}
.preview-note{
  font-size:12px;
  color:#9a8f7e;
  margin-top:12px;
}

/* A3 portrait @ 96dpi reference size = 297mm x 420mm */
.page{
  width:297mm;
  height:420mm;
  background:var(--cream);
  position:relative;
  box-shadow:0 4px 30px rgba(0,0,0,.15);
  overflow:hidden;
  font-family:"Segoe UI", Arial, sans-serif;
}
.preview-scale{
  transform-origin:top center;
  transform:scale(0.42);
  margin-bottom:calc(-420mm * 0.58);
}

.page-header{
  display:flex;
  align-items:flex-start;
  gap:26px;
  padding:50px 60px 10px;
}
.logo-box{
  width:170px;
  height:150px;
  background:#fff;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.logo-box img{
  max-width:100%;
  max-height:100%;
  object-fit:contain;
}
.logo-placeholder{
  font-size:13px;
  color:#c9c0b2;
}
.titles{
  flex:1;
  padding-top:6px;
}
.title-script{
  font-family:"Brush Script MT", "Segoe Script", cursive;
  font-size:60px;
  color:var(--brown-dark);
  line-height:1.15;
}
.title-main{
  font-family:"Brush Script MT", "Segoe Script", cursive;
  font-size:56px;
  color:var(--green-script);
  line-height:1.15;
}
.badge-icon{
  width:120px;
  height:110px;
  flex-shrink:0;
  margin-top:10px;
}

.rows{
  padding:20px 60px 0;
  display:flex;
  flex-direction:column;
}
.row{
  display:flex;
  align-items:flex-start;
  gap:34px;
  padding:26px 0;
}
.row-icon{
  width:118px;
  height:118px;
  border-radius:50%;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  border:4px solid rgba(255,255,255,.6);
  box-shadow:0 0 0 2px rgba(0,0,0,.03);
}
.row-icon img{
  width:62%;
  height:62%;
  object-fit:contain;
  filter:brightness(0) invert(1);
}
.row-icon .fallback-initial{
  color:#fff;
  font-size:34px;
  font-weight:700;
  font-family:Arial, sans-serif;
}
.row-text{padding-top:8px;}
.row-title{
  font-size:23px;
  font-weight:700;
  color:var(--brown-dark);
  margin:0 0 8px;
}
.row-desc{
  font-size:16px;
  line-height:1.5;
  color:var(--brown-text);
  margin:0;
  max-width:560px;
  white-space:pre-wrap;
}

.page-footer{
  position:absolute;
  bottom:60px;
  left:60px;
  right:60px;
}
.footer-divider{
  border-top:2px dotted #d98a3d;
  margin-bottom:24px;
}
.footer-logos{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:40px;
}
.footer-logo{
  height:70px;
  object-fit:contain;
}

@media (max-width: 900px){
  .app{flex-direction:column;}
  .panel{width:100%;min-width:0;height:auto;position:relative;}
}
