:root {
  --bg: #f3f6fb;
  --panel: rgba(255,255,255,0.76);
  --panel-strong: rgba(255,255,255,0.92);
  --text: #111827;
  --muted: #667085;
  --line: rgba(17,24,39,0.08);
  --accent: #4f46e5;
  --accent-soft: rgba(79,70,229,0.12);
  --shadow: 0 10px 30px rgba(15,23,42,0.08);
  --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: radial-gradient(circle at top, #ffffff 0%, #f3f6fb 40%, #eef2f8 100%); color: var(--text); }
body { overscroll-behavior-y: none; }
button, input, select { font: inherit; }
button { border: 0; background: white; color: var(--text); }
button, .cardish, input, select { border-radius: 18px; }
#app { display: grid; grid-template-columns: 280px 1fr; gap: 16px; padding: 12px; min-height: 100vh; }
.cardish { background: var(--panel); backdrop-filter: blur(18px); border: 1px solid rgba(255,255,255,0.8); box-shadow: var(--shadow); }
.topbar { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: var(--panel-strong); backdrop-filter: blur(16px); border-radius: 28px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,0.85); position: sticky; top: 8px; z-index: 40; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; color: white; font-weight: 800; background: linear-gradient(135deg, #4f46e5, #9333ea); box-shadow: inset 0 1px 1px rgba(255,255,255,.25), 0 8px 20px rgba(79,70,229,.3); }
.brand h1 { font-size: 1.05rem; margin: 0; }
.brand p { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted); }
.header-actions { display: flex; gap: 10px; align-items: center; }
.sidebar, .main-area { min-width: 0; }
.sidebar { padding: 14px; display: flex; flex-direction: column; gap: 14px; align-self: start; position: sticky; top: 92px; }
.main-area { display: flex; flex-direction: column; gap: 16px; }
.section-head, .cards-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.section-head h2, .cards-header h2 { margin: 0; font-size: 1rem; }
.project-list, .cards-list { display: flex; flex-direction: column; gap: 10px; }
.project-item { display: flex; gap: 8px; padding: 8px; }
.project-main { flex: 1; padding: 14px; text-align: left; background: rgba(255,255,255,0.72); }
.project-item.active .project-main { background: var(--accent-soft); color: #312e81; font-weight: 700; }
.inline-actions { display: flex; gap: 6px; align-items: center; }
.inline-actions button { min-width: 34px; height: 34px; border-radius: 12px; background: rgba(255,255,255,0.82); box-shadow: inset 0 0 0 1px var(--line); }
.inline-actions button:hover, .mini-btn:hover, .pill:hover, .wide-btn:hover { transform: translateY(-1px); }
.toolbar { padding: 12px; position: sticky; top: 88px; z-index: 30; }
.toolbar-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.tool-group { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: rgba(255,255,255,0.72); border-radius: 20px; border: 1px solid rgba(255,255,255,0.7); white-space: nowrap; }
.group-label { font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.tool-buttons { display: flex; gap: 6px; }
.tool-btn { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,0.9); box-shadow: inset 0 0 0 1px var(--line); }
.tool-btn.active { background: var(--accent-soft); color: #312e81; font-weight: 700; box-shadow: inset 0 0 0 1px rgba(79,70,229,.2); }
.mini-btn, .pill, .wide-btn { background: rgba(255,255,255,0.88); box-shadow: inset 0 0 0 1px var(--line); transition: transform .14s ease, background .14s ease; }
.pill { padding: 11px 15px; }
.mini-btn { height: 38px; min-width: 38px; padding: 0 12px; }
.wide-btn { padding: 13px 14px; text-align: center; width: 100%; margin-top: 8px; }
.primary { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: white; box-shadow: 0 10px 20px rgba(79,70,229,.25); }
.value-pill { min-width: 52px; text-align: center; background: rgba(255,255,255,0.92); padding: 9px 10px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.toggle-row { display: flex; align-items: center; gap: 8px; }
.cards-shell { display: flex; flex-direction: column; gap: 14px; }
.soft-text { color: var(--muted); margin: 4px 0 0; font-size: 0.86rem; }
.board-card { position: relative; padding: 12px; border-radius: 26px; background: rgba(255,255,255,0.76); border: 1px solid rgba(255,255,255,0.86); box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.board-card.active { transform: translateY(-2px) scale(1.005); box-shadow: 0 18px 36px rgba(15,23,42,.13); }
.board-card:nth-child(odd) { margin-left: 0; }
.board-card:not(.active) { opacity: 0.92; }
.board-stack-shadow { position: absolute; inset: 10px 14px auto auto; width: calc(100% - 28px); height: calc(100% - 20px); border-radius: 24px; background: linear-gradient(180deg, rgba(226,232,240,.8), rgba(248,250,252,.95)); transform: translate(10px, 10px); z-index: 0; }
.board-card-header, .canvas-shell { position: relative; z-index: 1; }
.board-card-header { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.board-title-wrap { display: flex; align-items: center; gap: 10px; }
.focus-btn { padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.92); box-shadow: inset 0 0 0 1px var(--line); font-weight: 700; }
.board-card.active .focus-btn { background: var(--accent-soft); color: #312e81; }
.zip-label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.9rem; }
.canvas-shell { width: 100%; overflow: auto; background: linear-gradient(180deg, rgba(255,255,255,.84), rgba(248,250,252,.95)); border-radius: 22px; border: 1px solid rgba(17,24,39,.05); padding: 10px; }
.board-canvas { display: block; width: 100%; height: auto; border-radius: 18px; background:
  linear-gradient(#ffffff, #ffffff) padding-box,
  linear-gradient(transparent 31px, rgba(17,24,39,.045) 32px) border-box;
  border: 1px solid rgba(17,24,39,.06); touch-action: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,.65); }
.hidden { display: none !important; }
.notes-panel, .export-panel { padding-top: 2px; }
#sizeSlider, #ghostOpacity { width: 140px; }
#colorPicker { width: 42px; height: 42px; border-radius: 14px; padding: 0; border: 0; background: transparent; overflow: hidden; }
.mini-select { height: 38px; border: 0; padding: 0 12px; background: rgba(255,255,255,.92); box-shadow: inset 0 0 0 1px var(--line); }
input[type="range"] { accent-color: #4f46e5; }

@media (max-width: 980px) {
  #app { grid-template-columns: 1fr; }
  .sidebar { position: static; order: 3; }
  .toolbar { top: 78px; }
}

@media (max-width: 640px) {
  #app { padding: 10px; gap: 12px; }
  .topbar { padding: 12px; top: 6px; }
  .brand-mark { width: 42px; height: 42px; }
  .toolbar { padding: 10px; }
  .tool-group { padding: 9px 10px; }
  .board-card { padding: 10px; }
  .board-stack-shadow { transform: translate(8px, 8px); }
}
