@import url('https://fonts.googleapis.com/css2?family=Cormorant+Upright:ital,wght@0,300;0,400;0,500;1,300;1,400&family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&family=Alegreya+Sans:ital,wght@0,300;0,400;0,500;1,300;1,400&family=Lekton&family=IBM+Plex+Sans:wght@300;400;500&family=Dancing+Script:wght@400;500&display=swap');

body{font-family:'IBM Plex Sans',system-ui,sans-serif;background:var(--bg);color:var(--text);min-height:100vh;display:flex;flex-direction:column;transition:background .3s,color .3s}

/* ══════════════════════════════════════════
   RESPONSIVE
   768px — tablet
   480px — mobile
══════════════════════════════════════════ */
/* ===== LAYOUT ===== */
.app-layout{display:grid;grid-template-columns:350px 1fr;flex:1;min-height:0}
@media(max-width:860px){
  .app-layout{grid-template-columns:1fr}
  .sidebar{max-height:none;border-right:none;border-bottom:1px solid var(--sb-border)}
}

/* ===== SIDEBAR ===== */
.sidebar{background:var(--sidebar);border-right:1px solid var(--sb-border);padding:1rem;overflow-y:auto;display:flex;flex-direction:column;gap:1rem;transition:background .3s}
.sh{font-size:.6rem;font-weight:600;text-transform:uppercase;letter-spacing:.1em;color:var(--accent);margin-bottom:.35rem}
.fi{width:100%;padding:.45rem .6rem;background:var(--input-bg);border:1px solid var(--input-border);border-radius:5px;color:var(--text);font-family:inherit;font-size:.76rem;outline:none;transition:border-color .15s}
.fi:focus{border-color:var(--accent)}.fi::placeholder{color:var(--text3)}
.fchips{display:flex;flex-wrap:wrap;gap:3px;margin-top:.3rem}
.fc{padding:2px 7px;font-size:.58rem;border:1px solid var(--input-border);border-radius:11px;background:transparent;color:var(--text2);cursor:pointer;font-family:inherit;transition:all .15s}
.fc:hover{border-color:var(--accent);color:var(--accent)}
.fc.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.fdrop{position:absolute;top:100%;left:0;right:0;background:var(--drop-bg);border:1px solid var(--input-border);border-radius:5px;max-height:180px;overflow-y:auto;z-index:100;display:none;margin-top:2px;box-shadow:0 4px 12px var(--paper-shadow)}
.fdrop.open{display:block}
.fdi{padding:.35rem .6rem;cursor:pointer;font-size:.73rem;color:var(--text);border-bottom:1px solid var(--sb-border)}
.fdi:hover{background:var(--drop-hover)}.fdi .cat{font-size:.55rem;color:var(--text3);margin-left:.3rem}
select,textarea{width:100%;padding:.4rem .55rem;background:var(--input-bg);border:1px solid var(--input-border);border-radius:5px;color:var(--text);font-family:inherit;font-size:.73rem;outline:none;transition:border-color .15s}
select:focus,textarea:focus{border-color:var(--accent)}
textarea{resize:vertical;min-height:52px}
.sr{display:flex;align-items:center;gap:.35rem;margin-bottom:.35rem}
.sl-label{font-size:.68rem;color:var(--text2);min-width:82px}
.sl-val{font-size:.68rem;color:var(--accent);min-width:28px;text-align:right;font-weight:500}
input[type=range]{flex:1;-webkit-appearance:none;height:3px;border-radius:2px;background:var(--input-border);outline:none}
input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:12px;height:12px;border-radius:50%;background:var(--accent);cursor:pointer;border:none}
.sp{display:flex;flex-wrap:wrap;gap:4px}
.pill{padding:3px 9px;font-size:.63rem;border:1px solid var(--input-border);border-radius:4px;background:transparent;color:var(--text2);cursor:pointer;font-family:inherit;transition:all .15s}
.pill:hover{border-color:var(--accent);color:var(--accent)}
.pill.active{border-color:var(--accent);background:var(--accent-bg);color:var(--accent)}
.tr{display:flex;justify-content:space-between;align-items:center;padding:.15rem 0}
.tl-text{font-size:.7rem;color:var(--text2)}
.tog{width:32px;height:17px;border-radius:9px;background:var(--toggle-off);position:relative;cursor:pointer;transition:background .2s}
.tog.on{background:var(--accent)}
.tog::after{content:'';width:13px;height:13px;border-radius:50%;background:#fff;position:absolute;top:2px;left:2px;transition:transform .2s}
.tog.on::after{transform:translateX(15px)}
.btn-row{display:flex;gap:.4rem;margin-top:.15rem}
.btn-p{flex:1;padding:.5rem;background:var(--accent);color:#fff;border:none;border-radius:5px;font-family:inherit;font-size:.73rem;font-weight:500;cursor:pointer;transition:background .15s}
.btn-p:hover{background:var(--accent-hover)}
.btn-s{flex:1;padding:.5rem;background:transparent;color:var(--text2);border:1px solid var(--input-border);border-radius:5px;font-family:inherit;font-size:.73rem;cursor:pointer}
.btn-s:hover{border-color:var(--text2)}
.lbl{font-size:.63rem;color:var(--text3);display:block;margin-bottom:2px}
.mi{font-size:.55rem;color:var(--text3);text-align:center;margin-top:.3rem}

/* ===== PREVIEW AREA ===== */
.preview-area{display:flex;flex-direction:column;min-height:0;overflow:hidden}

/* Sticky toolbar */
.preview-toolbar{display:flex;align-items:center;gap:1rem;padding:.4rem .8rem;background:var(--sidebar);border-bottom:1px solid var(--sb-border);flex-shrink:0;flex-wrap:wrap}
.tb-group{display:flex;align-items:center;gap:.25rem}
.tb-label{font-size:.58rem;text-transform:uppercase;letter-spacing:.06em;color:var(--text3);margin-right:.2rem}
.tb-btn{width:24px;height:24px;display:flex;align-items:center;justify-content:center;border:1px solid var(--input-border);border-radius:4px;background:transparent;color:var(--text2);font-size:.65rem;cursor:pointer;font-family:inherit;transition:all .15s}
.tb-btn:hover{border-color:var(--accent);color:var(--accent)}
.tb-btn.tb-active{background:var(--accent-bg);border-color:var(--accent);color:var(--accent)}
.tb-val{font-size:.62rem;color:var(--text2);min-width:32px;text-align:center}

/* Paper scroll area */
.paper-scroll{flex:1;overflow:auto;padding:1rem;display:flex;justify-content:center;align-items:flex-start}
.paper{background:var(--paper);border-radius:3px;box-shadow:0 4px 20px var(--paper-shadow);transform-origin:top center;transition:transform .15s}
.paper-hdr{display:flex;justify-content:space-between;align-items:baseline;padding:.75rem 1.2rem .4rem;border-bottom:1px solid #e0dcd6}
.paper-hdr .fn{font-size:.85rem;font-style:italic;color:#555}
.paper-hdr .df{font-size:.68rem;color:#aaa}
.paper-hdr .df span{display:inline-block;width:80px;border-bottom:1px solid #ccc;margin-left:3px}
.canvas-wrap{padding:.25rem 0}
#cv{width:100%;display:block}
.sbar{font-size:.62rem;color:#999;text-align:center;padding:.25rem 0 .55rem}

/* ===== FOOTER ===== */
.site-footer{background:var(--nav-bg);padding:.6rem 1.25rem;flex-shrink:0}
.footer-inner{max-width:900px;margin:0 auto;display:flex;justify-content:center;align-items:center}
.footer-info{display:flex;gap:.4rem;align-items:center;font-size:.5rem;color:var(--nav-text);flex-wrap:wrap;justify-content:center}
.footer-dot{opacity:.3}

/* ===== LOADING ===== */
.lo{display:none;position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:1000;justify-content:center;align-items:center;flex-direction:column;gap:.6rem}
.lo.visible{display:flex}
.spin{width:24px;height:24px;border:3px solid rgba(255,255,255,.2);border-top-color:var(--accent);border-radius:50%;animation:sp .7s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
.lo-text{font-size:.75rem;color:#ccc}
.hidden{display:none!important}

/* ===== MOBILE ===== */
@media(max-width:860px){
  .preview-toolbar{padding:.35rem .6rem}
  .paper-scroll{padding:.5rem}
  .paper{max-width:100%}
  .site-footer{padding:.5rem .8rem}
}

/* ──────────────────────────────────────────
   FOOTER
────────────────────────────────────────── */
footer {
  background: var(--nav-bg);
  border-top: 1px solid rgba(255,255,255,0.06);
  transition: background 0.35s;
}
.footer-main { display: grid; grid-template-columns: 10rem 2fr 1fr 1fr 1fr; }
.footer-cell {
  padding: 2.5rem 1.8rem;
  border-right: 1px solid rgba(255,255,255,0.06);
  transition: border-color 0.35s;
}
.footer-cell:last-child { border-right: none; }
.footer-brand {
  font-family: 'Cormorant Upright', serif;
  font-size: 1.05rem;
  color: var(--nav-logo);
  display: block;
  margin-bottom: 0.7rem;
}
.footer-tagline { font-size: 0.85rem; color: var(--nav-text); line-height: 1.7; }
.footer-col-label {
  font-size: 0.58rem;
  color: rgba(255,255,255,0.18);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 1.1rem;
}
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.55rem; }
.footer-links a { font-size: 0.88rem; color: var(--nav-text); text-decoration: none; transition: color 0.15s; }
.footer-links a:hover { color: var(--nav-logo); }
.footer-bottom {
  display: grid;
  grid-template-columns: 10rem 1fr auto;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-bottom-cell {
  padding: 0.9rem 1.8rem;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
}
.footer-bottom-cell:last-child { border-right: none; justify-content: flex-end; }
.footer-copy { font-size: 0.58rem; color: rgba(255,255,255,0.2); letter-spacing: 0.06em; }
.footer-script { font-size: 1.05rem; color: var(--accent); opacity: 0.55; }

