/* MASTER POSTER — Admin Template Editor */

:root {
  --bg: #0b0f14;
  --panel: #121821;
  --panel-2: #171e29;
  --line: #273142;
  --text: #e8eef8;
  --muted: #8b98ad;
  --accent: #3b82f6;
  --accent-2: #2563eb;
  --guide: #60a5fa;
  --warn: #f59e0b;
  --danger: #ef4444;
  --ok: #34d399;
  --zone: rgba(59, 130, 246, 0.18);
  --zone-border: #3b82f6;
  --font: "IBM Plex Sans Thai", "Sarabun", system-ui, sans-serif;
  --display: "Sora", "IBM Plex Sans Thai", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.te-page {
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.te-top {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: #0e141c;
}
.te-top__left, .te-top__right { display: flex; align-items: center; gap: 12px; }
.te-top__right a.te-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
#btn-preview-toggle.is-active {
  background: rgba(52, 211, 153, 0.18);
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.45);
}
.te-back {
  color: var(--text);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  font-size: 0.88rem;
}
.te-brand { display: flex; flex-direction: column; line-height: 1.2; }
.te-brand strong {
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.te-brand span { color: var(--muted); font-size: 0.78rem; }

.te-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 14px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.te-btn:hover { border-color: #3d4d66; }
.te-btn-primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
}
.te-btn-danger {
  width: 100%;
  margin-top: 14px;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}

.te-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 300px;
  overflow: hidden;
}
/* Grid item default min-height:auto ทำให้คอลัมน์สูงตามโปสเตอร์ → ลูก overflow:auto ไม่มี scroll */
.te-workspace > * {
  min-height: 0;
  max-height: 100%;
}

.te-panel {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}
.te-props { border-right: 0; border-left: 1px solid var(--line); }

.te-panel__head {
  padding: 14px 14px 10px;
  font-family: var(--display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a9b6cc;
}
.te-panel__head--sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.te-count {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: #1c2736;
  color: var(--muted);
  letter-spacing: 0;
  text-transform: none;
}

.te-add-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px 12px;
}
.te-add {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}
.te-add:hover {
  border-color: rgba(59, 130, 246, 0.55);
  background: #182233;
}
.te-add__ico {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  font-size: 0.75rem;
  font-weight: 800;
}
.te-visual-hint {
  margin: 0 12px 8px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}
.te-visual-grid .te-add--visual .te-add__ico {
  background: rgba(232, 201, 138, 0.12);
  color: #e8c98a;
}
.te-visual-grid .te-add--visual:hover {
  border-color: rgba(232, 201, 138, 0.45);
}
.te-visual-grid .te-add--visual.is-active {
  border-color: rgba(232, 201, 138, 0.7);
  background: #2a2418;
  box-shadow: inset 0 0 0 1px rgba(232, 201, 138, 0.25);
}

.te-compat { margin-top: 12px; }
.te-compat__scroll { overflow-x: auto; }
.te-compat__table { width: 100%; border-collapse: collapse; font-size: 11px; }
.te-compat__table th,
.te-compat__table td { padding: 6px 4px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.te-compat__table th { color: var(--muted); font-weight: 600; }
.te-compat__table code { color: inherit; font-size: inherit; word-break: break-word; }
.te-compat__outcome { display: inline-block; padding: 2px 5px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.te-compat__outcome.is-allow { color: #9ed8a8; background: #1e3020; }
.te-compat__outcome.is-deny { color: #e8a0a0; background: #3a2020; }
.te-compat__empty { margin: 6px 0 0; color: var(--muted); font-size: 11px; }
.te-layer__role {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(232, 201, 138, 0.14);
  color: #e8c98a;
  text-transform: uppercase;
}

.te-layers {
  list-style: none;
  margin: 0;
  padding: 0 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.te-layer-order {
  display: flex;
  gap: 6px;
  padding: 0 8px 6px;
}
.te-layer-order-hint {
  margin: 0 8px 8px;
  font-size: 0.72rem;
}
.te-btn-sm {
  padding: 4px 10px;
  font-size: 0.78rem;
}
.te-layer {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text);
  font-size: 0.86rem;
}
.te-layer.is-dragging {
  opacity: 0.45;
}
.te-layer.is-drop-target {
  border-color: rgba(59, 130, 246, 0.55);
  background: rgba(59, 130, 246, 0.08);
}
.te-layer__drag {
  cursor: grab;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1;
  padding: 0 2px;
  user-select: none;
}
.te-layer__drag:active { cursor: grabbing; }
.te-layer__z {
  margin-left: auto;
  font-size: 0.68rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.te-layer:hover { background: #182233; }
.te-layer.is-active {
  background: rgba(59, 130, 246, 0.14);
  border-color: rgba(59, 130, 246, 0.4);
}
.te-layer__ico {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  background: #1c2736;
  color: #93c5fd;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
}
.te-layer__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.te-layer__type {
  color: var(--muted);
  font-size: 0.72rem;
}

.te-guide-ref {
  margin-top: auto;
  padding: 0 12px 14px;
  border-top: 1px solid var(--line);
}
.te-guide-ref img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
  background: #000;
}
.te-guide-ref p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.4;
}
.te-pill {
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 700;
}
.te-pill-guide {
  background: rgba(96, 165, 250, 0.15);
  color: var(--guide);
}

.te-canvas-col {
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(800px 400px at 50% 0%, rgba(37, 99, 235, 0.08), transparent 60%),
    #0a0e13;
}
.te-canvas-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(18, 24, 33, 0.9);
}
.te-tools { display: flex; gap: 6px; }
.te-tool {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.te-tool.is-active {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
}
.te-canvas-meta {
  color: var(--muted);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.te-canvas-meta code { color: #cbd5e1; }
.te-badge {
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  font-weight: 700;
}

.te-canvas-row {
  flex: 1;
  min-height: 0;
  display: flex;
  min-width: 0;
  overflow: hidden;
}
.te-canvas-row.has-ref-side .te-ref-side { display: flex; }

.te-ref-side {
  width: 240px;
  flex-shrink: 0;
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-right: 1px solid var(--line);
  background: #0e141c;
  overflow: auto;
}
.te-ref-side__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--muted);
}
.te-ref-side img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
  background: #000;
}
.te-ref-side p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.te-ref-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  opacity: 0.45;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: normal;
}
.te-layers-abs { z-index: 2; }

.te-zone.is-locked {
  outline-color: #94a3b8;
  cursor: default;
  opacity: 0.92;
}
.te-zone.is-locked .te-zone__tag {
  background: #64748b;
}
.te-zoom {
  display: flex;
  align-items: center;
  gap: 6px;
}
.te-zoom button {
  min-width: 32px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
}
#zoom-label {
  min-width: 48px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}

.te-canvas-scroll {
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 0;
  cursor: default;
}
.te-canvas-scroll.is-panning { cursor: grab; }
.te-canvas-scroll.is-panning.is-dragging { cursor: grabbing; }
.te-canvas-frame {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  /* กว้าง/สูงตั้งโดย JS = max(viewport, poster+pad) — อย่า min-height:100% ที่ทำให้ยืดไม่จบ */
  flex-shrink: 0;
}
.te-stage {
  position: relative;
  background: #000;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  border: 1px solid #2a3548;
  transform-origin: center center;
  user-select: none;
}
.te-bg {
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
}
.te-bg-props .te-bg-library-select {
  width: 100%;
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line, #334155);
  background: var(--panel-2, #0f172a);
  color: inherit;
}
.te-bg-props .te-img-preview img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
}
.te-bg-reject {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #b45309;
  background: #2a1a0e;
  color: #fdba74;
  font-size: 0.86rem;
}
.te-bg-reject strong { display: block; margin-bottom: 6px; color: #fb923c; }
.te-bg-reject p { margin: 0 0 8px; }
.te-layers-abs {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/*
 * INVARIANT — EDITOR CONTENT BOX = PREVIEW CONTENT BOX = EXPORT CONTENT BOX
 * padding / line-height / box-sizing / alignment ชุดเดียวกัน 100%
 * กรอบฟ้า · handle · ชื่อ Layer = Editor Overlay (absolute) — ห้ามกิน Content Box
 */
.te-zone {
  position: absolute;
  pointer-events: auto;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  border: none;
  background: var(--zone);
  color: #fff;
  cursor: move;
  overflow: visible;
  /* overlay chrome — ไม่กินพื้นที่ content */
  outline: 1.5px solid var(--zone-border);
  outline-offset: 0;
}
.te-zone.is-selected {
  outline-color: #93c5fd;
  outline-width: 2px;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.28);
  z-index: 10000 !important;
}
.te-zone__tag {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-100%);
  padding: 1px 6px;
  border-radius: 4px 4px 0 0;
  background: var(--zone-border);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}
.te-zone__img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  background: transparent;
}
/* 9A-4 — fitted media (fit → scale → position) · shared Preview / Export math */
.te-zone__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: transparent !important;
  background-color: transparent !important;
}
.te-zone__media .te-zone__img,
.te-zone__media-canvas {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  pointer-events: none;
  user-select: none;
}
.te-zone--image,
.te-zone--logo,
.te-zone--qr {
  overflow: visible;
  background: rgba(15, 23, 42, 0.45);
}
/* มีรูปแล้ว — ให้ alpha ของ PNG ทะลุเห็นพื้นหลังโปสเตอร์ (ไม่เติมดำ) */
.te-zone--image:has(.te-zone__img),
.te-zone--logo:has(.te-zone__img),
.te-zone--qr:has(.te-zone__img) {
  background: transparent;
}
.te-zone--image .te-zone__tag,
.te-zone--logo .te-zone__tag,
.te-zone--qr .te-zone__tag {
  z-index: 2;
}
.te-img-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  border: 1px solid var(--line);
  background-color: #f0f2f5;
  background-image:
    linear-gradient(45deg, #d8dde4 25%, transparent 25%),
    linear-gradient(-45deg, #d8dde4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d8dde4 75%),
    linear-gradient(-45deg, transparent 75%, #d8dde4 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  overflow: hidden;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
}
.te-img-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
}
.te-img-empty {
  color: var(--muted);
  font-size: 0.8rem;
}
.te-img-actions {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.te-img-actions .te-btn {
  width: 100%;
}
#fit-group {
  grid-template-columns: 1fr 1fr;
}

.te-zone__text.has-max-lines {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.te-zone__text.is-clip {
  overflow: hidden;
  padding-top: 0.20em;
  padding-bottom: 0.10em;
}
.te-zone__line {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: visible;
}
.te-zone.is-overflow {
  outline-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35);
}
.te-zone__overflow-badge {
  position: absolute;
  right: 2px;
  bottom: 2px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #f59e0b;
  color: #1a1208;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.04em;
  pointer-events: none;
}
.te-stress {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.te-stress button {
  flex: 1;
  min-width: 56px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #0e131a;
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}
.te-stress button:hover {
  border-color: rgba(59, 130, 246, 0.55);
}
.te-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.te-overflow-warn {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fcd34d;
  font-size: 0.82rem;
  line-height: 1.4;
}
.te-zone__handle {
  position: absolute;
  width: 14px;
  height: 14px;
  background: #93c5fd;
  border: 2px solid #0f172a;
  border-radius: 2px;
  box-sizing: border-box;
  z-index: 6;
  pointer-events: auto;
}
.te-zone__handle--nw { top: -7px; left: -7px; cursor: nwse-resize; }
.te-zone__handle--ne { top: -7px; right: -7px; cursor: nesw-resize; }
.te-zone__handle--sw { bottom: -7px; left: -7px; cursor: nesw-resize; }
.te-zone__handle--se { bottom: -7px; right: -7px; cursor: nwse-resize; }
.te-zone--logo,
.te-zone--image,
.te-zone--qr {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #dbeafe;
  outline-style: dashed;
}
.te-zone--logo:not(:has(.te-zone__img)),
.te-zone--image:not(:has(.te-zone__img)),
.te-zone--qr:not(:has(.te-zone__img)) {
  background: rgba(59, 130, 246, 0.22);
}
.te-zone--qr:not(:has(.te-zone__img)) {
  background: rgba(15, 23, 42, 0.35);
  outline-color: #38bdf8;
}
.te-zone__qr {
  width: 78%;
  height: 78%;
  max-width: 140px;
  max-height: 140px;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.35));
}
.te-zone__body {
  pointer-events: none;
  opacity: 0.9;
}

.te-stage.is-preview .te-zone {
  outline: none;
  background: transparent;
  box-shadow: none;
  cursor: default;
  padding: 0;
}
.te-stage.is-preview .te-zone__tag,
.te-stage.is-preview .te-zone__handle,
.te-stage.is-preview .te-zone__overflow-badge {
  display: none;
}
.te-stage.is-preview .te-zone--qr,
.te-stage.is-preview .te-zone--image,
.te-stage.is-preview .te-zone--logo {
  background: transparent;
}
.te-stage.is-preview .te-zone__img {
  background: transparent;
}

/* สระไทย — inner text box · ไม่ดึงด้วย margin ลบ · ไม่ขยาย Template Slot */
.te-zone__text {
  overflow: visible;
  padding-top: 0.20em;
  padding-bottom: 0.10em;
  margin-top: 0;
  box-sizing: border-box;
}

.te-status {
  flex-shrink: 0;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  background: #0e141c;
}

.te-empty {
  padding: 8px 14px 16px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}
.te-form { padding: 0 14px 18px; }
.te-section {
  margin: 14px 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8fa0ba;
}
.te-field {
  display: block;
  margin-bottom: 10px;
  font-size: 0.82rem;
  color: #c5d0e0;
}
.te-field > span { display: block; margin-bottom: 5px; }
.te-field input,
.te-field select,
.te-field textarea,
.te-xywh input,
.te-xywh select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0e131a;
  color: var(--text);
  font: inherit;
}
.te-field input[type=color] { height: 40px; padding: 4px; }
.te-xywh {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.te-xywh label {
  font-size: 0.75rem;
  color: var(--muted);
}
.te-zorder {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 6px;
}
.te-zorder label {
  font-size: 0.75rem;
  color: var(--muted);
}
.te-zorder__btns {
  display: flex;
  gap: 4px;
  padding-bottom: 1px;
}
.te-align {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.te-align button {
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #0e131a;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
.te-align button.is-active {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.18);
  color: #bfdbfe;
}
.te-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  font-size: 0.88rem;
  color: #d5deec;
}
.te-check input { width: 16px; height: 16px; }
.te-allow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin: 0 0 12px;
}
.te-allow-grid .te-check {
  margin: 0;
  font-size: 0.82rem;
}
.te-font-allow {
  display: grid;
  gap: 6px;
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(0,0,0,0.18);
  margin: 0 0 12px;
}
.te-font-allow__item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.95rem;
}
.te-font-allow__item span { flex: 1; font-weight: 600; }
.te-font-allow__src {
  font-size: 0.68rem;
  font-style: normal;
  opacity: 0.55;
  font-family: ui-sans-serif, system-ui, sans-serif;
}
.hidden { display: none !important; }

@media (max-width: 1100px) {
  .te-workspace { grid-template-columns: 230px minmax(0, 1fr) 260px; }
}
@media (max-width: 900px) {
  body.te-page { overflow: auto; }
  .te-workspace {
    grid-template-columns: 1fr;
    height: auto;
  }
  .te-canvas-scroll { min-height: 60vh; }
}
