/* Text-Generator – tool-specific styles (shared look: ../../shared/css/ui.css) */

/* ---------- text blocks ---------- */

.text-list { display: grid; gap: 10px; }
.text-card {
  display: grid;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
}
.text-card.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.text-card-head { display: flex; align-items: center; gap: 4px; padding: 6px 6px 0 10px; min-height: 30px; }
.text-card-title { font-weight: 650; font-size: 12px; color: var(--text-muted); }
.text-card-body { display: grid; gap: 10px; padding: 6px 10px 12px; }
.text-card-body > * { min-width: 0; }

.ctl-textarea textarea {
  width: 100%;
  min-height: 38px;
  resize: vertical;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font: 600 15px/1.35 var(--font);
}
.ctl-textarea textarea:focus { outline: none; border-color: var(--accent); }

.font-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.font-row .btn { height: 32px; }
.font-status { font-size: 11.5px; color: var(--text-faint); min-height: 0; }
.font-status:empty { display: none; }
.font-status.warn { color: var(--warn); }

/* ---------- font dialog ---------- */

.font-dialog { width: min(760px, calc(100vw - 24px)); }
.font-body { grid-template-rows: auto auto minmax(0, 1fr) auto; min-height: min(560px, calc(100dvh - 160px)); }
.font-body input[type="search"] {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
}
.font-body input[type="search"]:focus { outline: none; border-color: var(--accent); }
.font-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 28px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--text-muted);
  font-size: 12px;
}
.chip:hover { color: var(--text); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.font-list {
  overflow-y: auto;
  min-height: 220px;
  max-height: 46dvh;
  display: grid;
  align-content: start;
  gap: 4px;
  padding-right: 4px;
}
.font-item {
  display: grid;
  gap: 2px;
  justify-items: start;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  text-align: left;
}
.font-item:hover { border-color: var(--line-strong); }
.font-item.active { border-color: var(--accent); background: var(--accent-soft); }
.font-name { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.font-name .tag { padding: 0 6px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: 10.5px; }
.font-cat { color: var(--text-faint); }
.font-sample { font-size: 24px; line-height: 1.25; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.font-detail { display: grid; gap: 6px; }
.font-detail:empty { display: none; }
.segmented.weights { flex-wrap: wrap; }

@media (max-width: 860px) {
  .font-list { max-height: 50dvh; }
}

.help ol { margin: 0; padding-left: 18px; }
.help li + li { margin-top: 3px; }

/* ---------- symbols ---------- */

/* The built-in symbol outlines, so the palette shows what gets printed. */
@font-face {
  font-family: "TG Symbols";
  src: url("../fonts/tg-symbols.otf") format("opentype");
  font-display: swap;
}

.symbol-bar { display: flex; gap: 6px; }
.symbol-btn { height: 28px; font-size: 12px; }
.symbol-btn.active { border-color: var(--accent); color: var(--text); }
.symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(30px, 1fr));
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}
.symbol-grid[hidden] { display: none; }
.symbol {
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 17px;
  line-height: 1;
  font-family: "TG Symbols", "Noto Emoji", "Segoe UI Symbol", system-ui, sans-serif;
  color: var(--text);
  cursor: pointer;
}
.symbol:hover { background: var(--card); }

.seg-btn:disabled { opacity: 0.4; cursor: default; }
.seg-btn:disabled:hover { color: var(--text-muted); }

/* ---------- blocks: QR codes, graphics, back ---------- */

.add-row { display: flex; flex-wrap: wrap; gap: 6px; }
.add-row .btn { height: 30px; }
.side-tag {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
}
.side-tag[hidden] { display: none; }
.graphic-row { display: flex; align-items: center; gap: 8px; }
.graphic-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.side-switch {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.side-switch[hidden] { display: none; }
@media (max-width: 860px) {
  .side-switch { bottom: auto; top: 10px; }
}

.symbol-grid.chooser .symbol.active { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
