.e10-root {
  --brand: #145aff;
  --brand-dark: #0d45cc;
  --brand-light: rgba(20,90,255,0.08);
  --brand-border: rgba(20,90,255,0.2);
  --bg: #F2F5FC;
  --surface: #FFFFFF;
  --surface2: #EEF1F8;
  --border: #DDE3EF;
  --text: #0F1A2E;
  --muted: #6B7A99;
  --success: #00A876;
  position: relative;
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.e10-root *, .e10-root *::before, .e10-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', sans-serif !important;
}

/* ── GATE ── */
.e10-root .gate-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  min-height: 100vh;
  background: rgba(230,236,250,0.80);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 24px 40px;
}

.e10-root .gate-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 44px 40px;
  max-width: 420px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 64px rgba(20,90,255,0.13), 0 4px 16px rgba(0,0,0,0.06);
  animation: e10SlideUp 0.4s cubic-bezier(0.16,1,0.3,1);
}

@keyframes e10SlideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.e10-root .gate-icon {
  width: 60px; height: 60px;
  background: var(--brand-light);
  border: 1.5px solid var(--brand-border);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 22px;
}

.e10-root .gate-card h2 { font-weight: 700; font-size: 22px; margin-bottom: 8px; color: var(--text); }
.e10-root .gate-card > p { color: var(--muted); font-size: 14px; margin-bottom: 28px; line-height: 1.65; }

.e10-root .gate-field { margin-bottom: 14px; text-align: left; }
.e10-root .gate-field label {
  display: block; font-size: 11px; color: var(--muted);
  margin-bottom: 6px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em;
}
.e10-root .gate-field input {
  width: 100%; background: var(--surface2);
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 12px 16px; color: var(--text); font-size: 15px;
  transition: border-color 0.2s, background 0.2s; outline: none;
}
.e10-root .gate-field input:focus { border-color: var(--brand); background: #fff; }

.e10-root .btn-unlock {
  width: 100%; background: var(--brand); color: #fff;
  border: none; border-radius: 10px; padding: 14px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; margin-top: 6px; transition: background 0.2s;
}
.e10-root .btn-unlock:hover { background: var(--brand-dark); }

.e10-root .gate-note { font-size: 11px; color: var(--muted); margin-top: 14px; }

/* ── LAYOUT ── */
.e10-root .container { max-width: 1100px; margin: 0 auto; padding: 40px 24px; }

.e10-root .hero { text-align: center; margin-bottom: 40px; }
.e10-root .hero h1 { font-size: clamp(28px,5vw,42px); font-weight: 800; margin-bottom: 12px; line-height: 1.1; }
.e10-root .hero h1 span { color: var(--brand); }
.e10-root .hero p { color: var(--muted); font-size: 16px; max-width: 520px; margin: 0 auto; }

/* ── TOOL CONTENT ── */
.e10-root .tool-content { display: none; }
.e10-root .tool-content.visible { display: block; }

/* ── TOOLBAR ── */
.e10-root .toolbar {
  display: flex; gap: 12px; flex-wrap: wrap;
  align-items: center; margin-bottom: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
}
.e10-root .search-box {
  flex: 1; min-width: 200px;
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 10px; padding: 11px 16px;
  color: var(--text); font-size: 14px;
  outline: none; transition: border-color 0.2s;
}
.e10-root .search-box:focus { border-color: var(--brand); }
.e10-root .search-box::placeholder { color: var(--muted); }

.e10-root .filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.e10-root .ftab {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 8px; padding: 7px 14px;
  font-size: 12px; cursor: pointer;
  color: var(--muted); white-space: nowrap; font-weight: 500;
  transition: all 0.2s;
}
.e10-root .ftab:hover { border-color: var(--brand-border); color: var(--brand); }
.e10-root .ftab.active { background: var(--brand-light); border-color: var(--brand-border); color: var(--brand); font-weight: 600; }
.e10-root .count-badge { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ── TEMPLATE GRID ── */
.e10-root .template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px,1fr));
  gap: 12px; margin-bottom: 24px;
}
.e10-root .template-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px; padding: 18px 20px;
  cursor: pointer; transition: all 0.2s;
  position: relative;
}
.e10-root .template-card:hover {
  border-color: var(--brand-border);
  box-shadow: 0 4px 16px rgba(20,90,255,0.08);
  transform: translateY(-1px);
}
.e10-root .template-card.selected {
  border-color: var(--brand);
  background: var(--brand-light);
}
.e10-root .tc-cat {
  font-size: 10px; color: var(--brand);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 700; margin-bottom: 6px;
}
.e10-root .tc-title { font-weight: 700; font-size: 14px; margin-bottom: 6px; line-height: 1.3; color: var(--text); }
.e10-root .tc-subj { font-size: 12px; color: var(--muted); line-height: 1.4; }
.e10-root .tc-timing {
  font-size: 11px; color: var(--muted); margin-top: 8px;
  background: var(--surface2); padding: 3px 8px;
  border-radius: 6px; display: inline-block;
  border: 1px solid var(--border);
}

/* ── EMPTY STATE ── */
.e10-root .empty-state { text-align: center; padding: 48px 24px; color: var(--muted); }
.e10-root .empty-state .ei { font-size: 40px; margin-bottom: 12px; }

/* ── MODAL ── */
.e10-root .modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,16,8,0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 24px;
  overflow-y: auto;
}
.e10-root .modal-overlay.open { display: flex; }

.e10-root .modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  max-width: 700px;
  width: 100%;
  margin: auto;
  box-shadow: 0 32px 80px rgba(0,0,0,0.18), 0 4px 16px rgba(0,0,0,0.08);
  animation: e10ModalIn 0.3s cubic-bezier(0.16,1,0.3,1);
  position: relative;
}
@keyframes e10ModalIn {
  from { transform: scale(0.96) translateY(12px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.e10-root .modal-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; margin-bottom: 24px; gap: 16px;
}
.e10-root .modal-meta { flex: 1; }
.e10-root .modal-cat {
  font-size: 11px; color: var(--brand);
  text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 700; margin-bottom: 4px;
}
.e10-root .modal-title { font-weight: 700; font-size: 20px; color: var(--text); line-height: 1.2; }

.e10-root .close-btn {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 10px; padding: 8px 14px;
  font-size: 14px; cursor: pointer; color: var(--muted);
  transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
  font-weight: 500;
}
.e10-root .close-btn:hover { border-color: var(--text); color: var(--text); }

/* ── EDITOR FIELDS ── */
.e10-root .editor-field { margin-bottom: 14px; }
.e10-root .editor-field label {
  display: block; font-size: 11px; color: var(--muted);
  margin-bottom: 6px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em;
}
.e10-root .editor-field input {
  width: 100%; background: var(--surface2);
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 11px 14px; color: var(--text); font-size: 14px;
  outline: none; transition: border-color 0.2s;
}
.e10-root .editor-field input:focus { border-color: var(--brand); }

.e10-root .token-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.e10-root .token-label { font-size: 12px; color: var(--muted); align-self: center; }
.e10-root .token-chip {
  background: var(--brand-light);
  border: 1.5px solid var(--brand-border);
  color: var(--brand); border-radius: 6px; padding: 4px 10px;
  font-size: 12px; cursor: pointer;
  transition: all 0.2s; font-weight: 500;
}
.e10-root .token-chip:hover { background: rgba(20,90,255,0.15); }

.e10-root .subject-preview {
  background: var(--surface2);
  border: 1.5px solid var(--border);
  border-radius: 10px; padding: 14px 16px; margin-bottom: 14px;
}
.e10-root .subject-preview .sp-label {
  font-size: 11px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px;
  font-weight: 600;
}
.e10-root .subject-preview .sp-val { font-size: 14px; font-weight: 600; color: var(--text); }

.e10-root .body-area {
  width: 100%; background: var(--surface2);
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 14px 16px; color: var(--text); font-size: 14px;
  outline: none;
  resize: vertical; min-height: 260px; line-height: 1.7;
  transition: border-color 0.2s;
}
.e10-root .body-area:focus { border-color: var(--brand); }

.e10-root .btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; align-items: center; }

.e10-root .btn-copy {
  background: var(--brand); color: #fff; border: none;
  border-radius: 10px; padding: 12px 20px; font-size: 14px;
  font-weight: 600; cursor: pointer; transition: background 0.2s;
}
.e10-root .btn-copy:hover { background: var(--brand-dark); }

.e10-root .btn-secondary-action {
  background: var(--surface2); color: var(--text);
  border: 1.5px solid var(--border); border-radius: 10px;
  padding: 12px 20px; font-size: 14px;
  cursor: pointer; transition: all 0.2s; font-weight: 500;
}
.e10-root .btn-secondary-action:hover { border-color: var(--brand); color: var(--brand); }

.e10-root .copied-toast {
  display: none; background: var(--success); color: white;
  border-radius: 10px; padding: 7px 14px; font-size: 13px;
  font-weight: 600; align-items: center; gap: 6px;
}
.e10-root .copied-toast.show { display: flex; }

/* ── CTA STRIP ── */
.e10-root .cta-strip {
  background: linear-gradient(135deg, var(--brand-light), rgba(20,90,255,0.02));
  border: 1.5px solid var(--brand-border);
  border-radius: 16px; padding: 24px 28px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 20px; margin-top: 24px; flex-wrap: wrap;
}
.e10-root .cta-strip p { font-size: 14px; color: var(--muted); }
.e10-root .cta-strip strong { display: block; font-size: 16px; color: var(--text); font-weight: 700; margin-bottom: 4px; }
.e10-root .btn-cta {
  background: var(--brand); color: white; border: none;
  border-radius: 10px; padding: 13px 24px; font-size: 14px;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  text-decoration: none; display: inline-block;
  transition: background 0.2s;
}
.e10-root .btn-cta:hover { background: var(--brand-dark); }

/* ── DIVIDER ── */
.e10-root .section-divider {
  border: none; border-top: 1px solid var(--border); margin: 20px 0;
}

@media (max-width: 600px) {
  .e10-root .modal-card { padding: 24px 18px; }
  .e10-root .gate-card { padding: 32px 24px; }
  .e10-root .container { padding: 28px 16px; }
  .e10-root .toolbar { padding: 12px 14px; gap: 8px; }
}
