/* ============================================================
   THE 100 NETWORK — Card designer
   ============================================================ */

.designer {
  display: grid;
  gap: var(--sp-4);
  grid-template-columns: 1fr;
  padding-block: var(--sp-4) var(--sp-6);
  align-items: start;
}
@media (min-width: 1000px) {
  .designer { grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr); gap: var(--sp-5); }
  .designer-panel { position: sticky; top: 84px; }
}

/* ---- Stage ---- */
.stage-wrap { min-width: 0; }

.side-tabs { display: flex; gap: 0.4rem; margin-bottom: var(--sp-3); }
.side-tab {
  flex: none;
  padding: 0.5rem 1.1rem;
  background: var(--surface); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: 999px;
  font-size: var(--step--1); font-weight: 500; cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.side-tab[aria-selected="true"] { background: var(--surface-2); color: var(--gold-200); border-color: var(--gold-700); }
.side-tab[disabled] { opacity: 0.4; cursor: not-allowed; }

.canvas-shell {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1rem, 4vw, 2.5rem);
  display: grid; place-items: center;
}
.canvas-frame {
  position: relative;
  width: 100%; max-width: 620px;
  aspect-ratio: var(--card-ratio);
  border-radius: var(--card-radius);
  overflow: hidden;
  background: #fbfbfa;
  box-shadow: var(--shadow-card);
}
.canvas-frame canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; touch-action: none; }

/* Safe-zone guide — 2mm inset. Purely visual, never exported. */
.safe-zone {
  position: absolute; inset: 2.34%;   /* 2mm of 85.6mm */
  border: 1px dashed rgba(10,10,15,0.22);
  border-radius: 2.4%;
  pointer-events: none; z-index: 5;
  transition: opacity var(--dur) var(--ease-out);
}
.canvas-frame.hide-guides .safe-zone { opacity: 0; }

.stage-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: var(--sp-3); align-items: center; }
.tool-btn {
  padding: 0.5rem 0.9rem; font-size: var(--step--1);
  background: var(--surface); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: all var(--dur-fast) var(--ease-out);
}
.tool-btn:hover:not(:disabled) { color: var(--text-primary); border-color: var(--border-lit); }
.tool-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.tool-btn.danger:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.spacer { flex: 1 1 auto; }

/* ---- Panel ---- */
.designer-panel { display: grid; gap: var(--sp-3); min-width: 0; }

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-3);
}
.panel-card > h3 {
  font-size: var(--step-0); margin-bottom: var(--sp-2);
  display: flex; align-items: center; gap: 0.5rem;
}
.panel-card > h3 .step {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--gold-700);
  color: var(--gold-300); font-family: var(--font-mono); font-size: 11px;
  display: grid; place-items: center;
}

.mode-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: var(--sp-3); }
.mode-btn {
  padding: 0.8rem 0.6rem; text-align: left;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-secondary); cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.mode-btn strong { display: block; color: var(--text-primary); font-size: var(--step--1); font-weight: 600; }
.mode-btn span { display: block; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; line-height: 1.35; }
.mode-btn[aria-pressed="true"] { border-color: var(--gold-600); background: var(--surface-2); }
.mode-btn[aria-pressed="true"] strong { color: var(--gold-200); }

/* ---- Dropzone ---- */
.dropzone {
  border: 1.5px dashed var(--border-lit); border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-3); text-align: center; cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
  background: var(--bg);
}
.dropzone:hover, .dropzone.over { border-color: var(--gold-500); background: var(--surface-2); }
.dropzone strong { display: block; color: var(--text-primary); font-size: var(--step--1); }
.dropzone span { display: block; color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; }

/* ---- Fields ---- */
.field { display: grid; gap: 0.35rem; margin-bottom: var(--sp-2); }
.field label { font-size: 0.78rem; color: var(--text-secondary); letter-spacing: 0.02em; }
.field input[type="text"], .field input[type="url"], .field select {
  width: 100%; padding: 0.65rem 0.75rem;
  background: var(--bg); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: var(--step-0);
  transition: border-color var(--dur-fast) var(--ease-out);
}
.field input:focus { border-color: var(--neon); }
.field .hint { font-size: 0.72rem; color: var(--text-muted); }

.counter { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-muted); text-align: right; }
.counter.warn { color: var(--warn); }
.counter.over { color: var(--danger); font-weight: 500; }

/* ---- Notices ---- */
.notice {
  display: flex; gap: 0.6rem; align-items: flex-start;
  padding: 0.7rem 0.8rem; border-radius: var(--radius-sm);
  font-size: 0.78rem; line-height: 1.45; margin-top: var(--sp-2);
}
.notice .ico { flex: none; font-size: 0.9rem; line-height: 1.3; }
.notice-warn { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.3); color: var(--gold-100); }
.notice-bad  { background: rgba(239,68,68,0.08);  border: 1px solid rgba(239,68,68,0.32); color: #fecaca; }
.notice-ok   { background: rgba(16,185,129,0.07); border: 1px solid rgba(16,185,129,0.28); color: #a7f3d0; }
.notice[hidden] { display: none; }

/* ---- Quantity ---- */
.qty-row { display: flex; align-items: center; gap: 0.5rem; }
.qty-btn {
  width: 38px; height: 38px; flex: none;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 1.1rem; cursor: pointer;
}
.qty-btn:hover { border-color: var(--gold-600); }
.qty-input {
  width: 68px; text-align: center; padding: 0.55rem;
  background: var(--bg); color: var(--text-primary);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-mono); font-size: var(--step-0);
}
.tier-note { font-size: 0.72rem; color: var(--gold-300); margin-top: 0.4rem; min-height: 1em; }

/* ---- Totals ---- */
.totals { display: grid; gap: 0.45rem; font-size: var(--step--1); }
.totals .row { display: flex; justify-content: space-between; color: var(--text-secondary); }
.totals .row.total {
  border-top: 1px solid var(--border); padding-top: 0.6rem; margin-top: 0.25rem;
  color: var(--text-primary); font-size: var(--step-0); font-weight: 600;
}
.totals .row.total b { font-family: var(--font-display); font-size: var(--step-1); color: var(--gold-200); }

/* ---- Approval ---- */
.approve {
  display: flex; gap: 0.7rem; align-items: flex-start;
  padding: 0.8rem; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
  cursor: pointer; margin-bottom: var(--sp-2);
}
.approve input { margin-top: 0.2rem; width: 17px; height: 17px; accent-color: var(--gold-400); flex: none; }
.approve span { font-size: 0.78rem; color: var(--text-secondary); line-height: 1.45; }
.approve.ready { border-color: var(--gold-700); }

.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; box-shadow: none; }
