/* Общие стили инструментов DELO AI (магазин и офлайн-версии). Цвета — через переменные хоста с запасными значениями. */
.t-root { --t-card: var(--card, #ffffff); --t-card2: var(--card2, #f4f5fb); --t-text: var(--text, #121530);
  --t-muted: var(--muted, #6b7194); --t-line: var(--line, rgba(18, 21, 48, .1)); --t-accent: var(--accent, #5b4cf0);
  --t-grad: var(--grad, linear-gradient(135deg, #6c5cff, #9b5cff)); --t-input: var(--input, #ffffff);
  --t-ok: #16a34a; color: var(--t-text); }
.t-root * { box-sizing: border-box; }
.t-root [hidden] { display: none !important; }
.t-card { background: var(--t-card); border: 1px solid var(--t-line); border-radius: 18px; padding: 14px; margin-bottom: 10px; }
.t-form { display: flex; flex-direction: column; gap: 12px; }
.t-row { display: flex; align-items: center; gap: 8px; }
.t-between { justify-content: space-between; }
.t-sec-title { font-weight: 700; font-size: 15px; margin: 18px 2px 10px; }
.t-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--t-muted); }
.t-field small { font-weight: 400; }
.t-field input, .t-field select, .t-field textarea, .t-name {
  width: 100%; border: 1px solid var(--t-line); background: var(--t-input); color: var(--t-text); border-radius: 12px;
  font: inherit; font-size: 15px; font-weight: 500; padding: 11px 12px; outline: none; min-height: 44px; }
.t-field textarea { resize: vertical; min-height: 84px; }
.t-field input:focus, .t-field select:focus, .t-field textarea:focus, .t-name:focus { border-color: var(--t-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--t-accent) 22%, transparent); }
.t-name { font-weight: 700; border-color: transparent; background: transparent; padding-left: 2px; }
.t-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.t-grid3 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 8px; }
@media (min-width: 520px) { .t-grid3 { grid-template-columns: repeat(4, 1fr); } }
.t-pos-out { margin-top: 10px; font-size: 13px; color: var(--t-muted); }
.t-pos-out b { color: var(--t-text); }
.t-x { border: 0; background: var(--t-card2); color: var(--t-muted); width: 32px; height: 32px; border-radius: 10px; cursor: pointer; flex: none; }
.t-btn { border: 0; border-radius: 14px; min-height: 50px; width: 100%; font: inherit; font-weight: 700; font-size: 15px;
  background: var(--t-grad); color: #fff; cursor: pointer; padding: 0 16px; box-shadow: 0 8px 24px -10px var(--t-accent); }
.t-btn:active { transform: scale(.985); }
.t-btn[disabled] { opacity: .6; }
.t-btn-ghost { background: var(--t-card); color: var(--t-text); border: 1px solid var(--t-line); box-shadow: none; }
.t-btn-excel { background: linear-gradient(135deg, #1fa463, #138a4f); box-shadow: 0 8px 24px -10px #1fa463; }
.t-actions { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0; }
@media (min-width: 420px) { .t-actions { grid-template-columns: 1.4fr 1fr; } }
.t-hint, .t-muted { color: var(--t-muted); font-size: 13px; }
.t-error { color: #ef4444; font-size: 14px; margin: 0; }
.t-honest { font-size: 13px; color: var(--t-muted); background: var(--t-card2); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.t-switch { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; cursor: pointer; margin: 10px 0; }
.t-switch input { position: absolute; opacity: 0; pointer-events: none; }
.t-switch span { width: 46px; height: 28px; border-radius: 99px; background: var(--t-line); position: relative; transition: background .2s; flex: none; }
.t-switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.t-switch input:checked + span { background: var(--t-accent); }
.t-switch input:checked + span::after { transform: translateX(18px); }
.t-switch input:focus-visible + span { outline: 2px solid var(--t-accent); outline-offset: 2px; }
.t-switch-sm { font-size: 13px; margin: 0; align-self: end; min-height: 44px; }
.t-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.t-tile { border-radius: 18px; padding: 14px; color: #fff; min-height: 86px; display: flex; flex-direction: column; justify-content: space-between; }
.t-tile small { opacity: .85; font-size: 12px; font-weight: 600; }
.t-tile b { font-size: 19px; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.t-tile-a { background: linear-gradient(135deg, #6c5cff, #8f6bff); }
.t-tile-b { background: linear-gradient(135deg, #12b76a, #0e9f5b); }
.t-tile-c { background: linear-gradient(135deg, #f79009, #f26a1b); }
.t-tile-d { background: linear-gradient(135deg, #2e90fa, #1570ef); }
.t-table-wrap { padding: 6px 14px; }
.t-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.t-table td { padding: 9px 0; border-bottom: 1px solid var(--t-line); }
.t-table td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.t-table tr:last-child td { border-bottom: 0; }
.t-table .t-strong td { font-weight: 800; color: var(--t-accent); }
.t-explain { font-size: 13.5px; line-height: 1.5; background: var(--t-card2); }
.t-out-text { white-space: pre-wrap; margin-top: 8px; font-size: 14.5px; line-height: 1.5; }
.t-copy { border: 1px solid var(--t-line); background: var(--t-card2); color: var(--t-accent); font: inherit; font-size: 13px; font-weight: 600;
  border-radius: 10px; padding: 6px 10px; cursor: pointer; }
.t-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--t-card2); border-radius: 14px; padding: 4px; margin-bottom: 12px; }
.t-tabs button { border: 0; background: transparent; color: var(--t-muted); font: inherit; font-weight: 700; padding: 10px; border-radius: 11px; cursor: pointer; }
.t-tabs button.on { background: var(--t-card); color: var(--t-text); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.t-preview { background: #e9ebf0; border-radius: 18px; overflow: hidden; border: 1px solid var(--t-line); }
.t-preview iframe { width: 100%; height: 70vh; min-height: 460px; border: 0; display: block; background: #fff; }
/* файловые инструменты */
.t-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; cursor: pointer;
  border: 2px dashed color-mix(in srgb, var(--t-accent) 45%, transparent); border-radius: 20px; padding: 22px 14px; margin-bottom: 10px;
  background: color-mix(in srgb, var(--t-accent) 7%, var(--t-card)); }
.t-drop:focus-within { outline: 2px solid var(--t-accent); outline-offset: 2px; }
.t-drop-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--t-grad); color: #fff; display: grid; place-items: center; font-size: 24px; margin-bottom: 4px; }
.t-drop small { color: var(--t-muted); font-size: 12.5px; }
.t-files { display: grid; gap: 8px; margin-bottom: 10px; }
.t-file { display: flex; gap: 10px; align-items: center; background: var(--t-card); border: 1px solid var(--t-line); border-radius: 14px; padding: 8px; }
.t-file img, .t-file-ic { width: 46px; height: 46px; border-radius: 10px; object-fit: cover; flex: none; transition: transform .2s; }
.t-file-ic { display: grid; place-items: center; background: #e5484d; color: #fff; font-size: 11px; font-weight: 800; }
.t-file-main { flex: 1; min-width: 0; }
.t-file-main b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-file-main small { color: var(--t-muted); font-size: 12px; }
.t-file-act { display: flex; gap: 4px; flex: none; }
.t-file-act button { width: 32px; height: 32px; border: 0; border-radius: 9px; background: var(--t-card2); color: var(--t-text); cursor: pointer; font-size: 15px; }
.t-file-act button[disabled] { opacity: .35; }
.t-seg { display: flex; gap: 6px; flex-wrap: wrap; }
.t-seg label { flex: 1; min-width: 90px; }
.t-seg input { position: absolute; opacity: 0; pointer-events: none; }
.t-seg span { display: block; text-align: center; padding: 10px 8px; border-radius: 12px; border: 1px solid var(--t-line); background: var(--t-card2); font-weight: 700; font-size: 13.5px; cursor: pointer; }
.t-seg input:checked + span { background: var(--t-grad); color: #fff; border-color: transparent; }
.t-seg input:focus-visible + span { outline: 2px solid var(--t-accent); outline-offset: 2px; }
.t-field input[type=range] { padding: 0; min-height: 32px; accent-color: var(--t-accent); }
.t-progress { margin: 12px 0; font-size: 13px; color: var(--t-muted); display: grid; gap: 6px; }
.t-bar { height: 8px; border-radius: 99px; background: var(--t-card2); overflow: hidden; }
.t-bar i { display: block; height: 100%; width: 0; background: var(--t-grad); transition: width .2s; }
.t-done { margin-top: 12px; border-color: color-mix(in srgb, #22c55e 40%, var(--t-line)); }
.t-done .t-row { flex-wrap: wrap; }
.t-ok { width: 26px; height: 26px; border-radius: 50%; background: #22c55e; color: #fff; display: grid; place-items: center; font-weight: 900; font-size: 14px; }
.t-res { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--t-line); font-size: 13.5px; overflow-wrap: anywhere; }
.t-btn-sm { min-height: 40px; width: auto; flex: none; font-size: 14px; border-radius: 12px; padding: 0 14px; }
.t-textout { width: 100%; min-height: 220px; margin: 10px 0; border-radius: 12px; border: 1px solid var(--t-line); background: var(--t-input);
  color: var(--t-text); font: 13.5px/1.5 ui-monospace, Consolas, monospace; padding: 10px; resize: vertical; }
.t-qr { display: block; width: min(260px, 80%); margin: 12px auto; border-radius: 12px; background: #fff; padding: 6px; }
.t-after { display: block; margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--t-accent); }
.t-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--t-muted); }
.t-presets button { border: 1px solid var(--t-line); background: var(--t-card2); color: var(--t-text); border-radius: 99px; padding: 6px 10px; font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.t-presets button.on { background: var(--t-grad); color: #fff; border-color: transparent; }
