/* =========================================================
   Tayyor hujjat shablonlari (/documents/templates)
   Faqat style.css tokenlari — dark mode o'zi ishlaydi.
   Rasmlar (birinchi sahifa) ataylab oq qog'oz: hujjat chop etilganda shunday.
   ========================================================= */

.tg { --tg-accent: var(--color-primary); --tg-accent-subtle: var(--color-primary-subtle); --tg-accent-text: var(--color-primary-on-subtle); }

/* ---------- Hero ---------- */
.tg-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-6);
  align-items: center;
  padding: var(--space-6) var(--space-6);
  margin-bottom: var(--space-5);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--color-primary-subtle) 0%, transparent 55%),
    var(--color-surface);
  overflow: hidden;
}
.tg-hero__eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--color-success-subtle); color: var(--color-success-text);
  font-size: var(--fs-xs); font-weight: 600;
}
.tg-hero h1 { font-size: var(--fs-2xl); margin: var(--space-3) 0 var(--space-2); }
.tg-hero__lead { color: var(--color-text-muted); margin: 0; max-width: 620px; line-height: 1.55; }
/* Sarlavha topbar'da (sahifaning yagona h1) — hero matn bilan boshlanadi. */
.tg-hero__eyebrow + .tg-hero__lead { margin-top: var(--space-3); }
.tg-hero__facts { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.tg-hero__facts li { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--color-text); font-weight: 500; }
.tg-hero__facts i { color: var(--color-primary); }

.tg-hero__art { position: relative; height: 190px; }
.tg-hero__sheet {
  position: absolute; top: 50%; left: 50%;
  width: 118px; height: auto; aspect-ratio: 595 / 842;
  background: #fff; border-radius: 4px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .16), 0 0 0 1px rgba(15, 23, 42, .06);
  transition: transform .35s ease;
}
.tg-hero__sheet--0 { transform: translate(-115%, -48%) rotate(-8deg); }
.tg-hero__sheet--1 { transform: translate(-50%, -54%); z-index: 2; }
.tg-hero__sheet--2 { transform: translate(15%, -48%) rotate(8deg); }
.tg-hero:hover .tg-hero__sheet--0 { transform: translate(-125%, -50%) rotate(-11deg); }
.tg-hero:hover .tg-hero__sheet--2 { transform: translate(25%, -50%) rotate(11deg); }

@media (max-width: 991.98px) {
  .tg-hero { grid-template-columns: 1fr; padding: var(--space-5); }
  .tg-hero__art { display: none; }
}

/* ---------- Asboblar qatori ---------- */
.tg-toolbar { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-bottom: var(--space-3); }
.tg-toolbar__search { flex: 1 1 320px; max-width: 520px; }

.tg-script {
  display: inline-flex; align-items: center; gap: 2px; margin-left: auto;
  padding: 3px; border: 1px solid var(--color-border); border-radius: var(--radius-pill);
  background: var(--color-surface);
}
.tg-script__label { font-size: var(--fs-sm); color: var(--color-text-muted); padding: 0 6px 0 10px; }
.tg-script__btn {
  border: 0; background: transparent; color: var(--color-text-muted);
  font-size: var(--fs-sm); font-weight: 500; padding: 5px 14px; border-radius: var(--radius-pill); cursor: pointer;
}
.tg-script__btn:hover { color: var(--color-text); }
.tg-script__btn.is-active { background: var(--color-primary); color: var(--color-on-primary); }
.tg-script__btn:focus-visible { outline: none; box-shadow: 0 0 0 var(--focus-ring-width, 3px) var(--focus-ring, var(--color-primary-border)); }
.tg-script--sm { margin-left: 0; }
.tg-script--sm .tg-script__btn { padding: 3px 10px; font-size: var(--fs-xs); }

.tg-chips { margin-bottom: var(--space-3); }
.tg-chips__n { font-size: var(--fs-2xs, 11px); opacity: .7; font-weight: 600; }

.tg-tip {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 0 0 var(--space-5); padding: 10px 14px;
  border-radius: var(--radius-md); background: var(--color-warning-subtle); color: var(--color-warning-text);
  font-size: var(--fs-sm); line-height: 1.5;
}
.tg-tip i { margin-top: 3px; }

/* ---------- Bo'limlar ---------- */
.tg-section { margin-bottom: var(--space-7); }
.tg-section--kadrlar   { --tg-accent: var(--color-success); --tg-accent-subtle: var(--color-success-subtle); --tg-accent-text: var(--color-success-text); }
.tg-section--xatlar    { --tg-accent: var(--color-info);    --tg-accent-subtle: var(--color-info-subtle);    --tg-accent-text: var(--color-info-text); }
.tg-section--tashkiliy { --tg-accent: var(--color-warning); --tg-accent-subtle: var(--color-warning-subtle); --tg-accent-text: var(--color-warning-text); }
.tg-section--shaxsiy   { --tg-accent: var(--color-danger);  --tg-accent-subtle: var(--color-danger-subtle);  --tg-accent-text: var(--color-danger-text); }

.tg-section__title { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); margin: 0 0 var(--space-4); }
.tg-section__icon {
  width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--tg-accent-subtle); color: var(--tg-accent-text); font-size: 15px;
}
.tg-section__count {
  font-size: var(--fs-xs); font-weight: 600; color: var(--color-text-muted);
  border: 1px solid var(--color-border); border-radius: var(--radius-pill); padding: 1px 9px;
}

.tg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: var(--space-4); }

/* ---------- Kartochka ---------- */
.tg-card {
  display: flex; flex-direction: column;
  background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  overflow: hidden; transition: border-color .15s, box-shadow .2s, transform .2s;
}
.tg-card:hover { border-color: var(--color-primary-border); box-shadow: var(--shadow-md); transform: translateY(-2px); }

.tg-card__thumb {
  position: relative; display: block; width: 100%; border: 0; padding: 18px 26px 0; cursor: zoom-in;
  height: 200px; overflow: hidden;
  background: linear-gradient(180deg, var(--tg-accent-subtle), var(--color-surface-hover));
  border-bottom: 1px solid var(--color-border);
}
.tg-card__thumb img {
  display: block; width: 100%; height: auto; background: #fff;
  border-radius: 3px 3px 0 0;
  box-shadow: 0 4px 16px rgba(15, 23, 42, .14), 0 0 0 1px rgba(15, 23, 42, .05);
  transition: transform .3s ease;
  transform-origin: top center;
}
.tg-card:hover .tg-card__thumb img { transform: translateY(-4px) scale(1.02); }
.tg-card__zoom {
  position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 6px);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, .82); color: #fff; font-size: var(--fs-xs); font-weight: 600;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.tg-card__thumb:hover .tg-card__zoom,
.tg-card__thumb:focus-visible .tg-card__zoom { opacity: 1; transform: translate(-50%, 0); }
.tg-card__thumb:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--color-primary-border); }

.tg-card__body { padding: 14px 16px 6px; flex: 1 1 auto; }
.tg-card__title { display: flex; gap: 8px; align-items: baseline; font-size: var(--fs-base); font-weight: 600; line-height: 1.35; margin: 0 0 6px; }
.tg-card__title i { color: var(--tg-accent); font-size: .9em; flex: 0 0 auto; }
.tg-card__desc {
  margin: 0; font-size: var(--fs-sm); color: var(--color-text-muted); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tg-card__actions { display: flex; gap: 8px; padding: 10px 16px 16px; }
.tg-card__actions .btn { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }

.tg-empty { text-align: center; color: var(--color-text-muted); padding: var(--space-8) 0; }
.tg-empty i { font-size: 28px; margin-bottom: var(--space-2); display: block; opacity: .6; }

/* ---------- Oldindan ko'rish oynasi ---------- */
.tg-modal .modal-content { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; }
.tg-modal .modal-header, .tg-modal .modal-footer { border-color: var(--color-border); }
.tg-modal .modal-title { font-size: var(--fs-lg); font-weight: 600; }
.tg-modal__body { position: relative; padding: 0; background: #eef1f5; }
.tg-modal__body iframe { display: block; width: 100%; height: min(74vh, 900px); border: 0; transition: opacity .2s; }
.tg-modal__body iframe.is-loading { opacity: .35; }
.tg-modal__loading {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--radius-pill); background: var(--color-surface); color: var(--color-text);
  box-shadow: var(--shadow-md); font-size: var(--fs-sm);
}
.tg-modal__hint { margin-right: auto; font-size: var(--fs-sm); color: var(--color-text-muted); display: inline-flex; gap: 8px; align-items: center; }
@media (max-width: 767.98px) {
  .tg-modal__hint { display: none; }
  .tg-modal .modal-footer .btn { flex: 1 1 auto; }
}

/* ---------- /documents sahifasidagi qisqa ro'yxat ---------- */
.template-card__thumb { width: 100%; height: 100%; object-fit: cover; object-position: top center; background: #fff; display: block; }
.template-card--thumb .template-card__preview { padding: 10px 12px 0; align-items: flex-start; overflow: hidden; }
.template-card--thumb .template-card__preview img { box-shadow: 0 2px 8px rgba(15, 23, 42, .12); border-radius: 2px 2px 0 0; height: auto; }
.template-card--more .template-card__preview { background-color: var(--color-surface-hover); flex-direction: column; gap: 6px; }
.template-card--more .template-card__preview i { font-size: 18px; color: var(--color-primary); }
.template-card--more .template-card__preview span { font-size: var(--fs-xs); color: var(--color-text-muted); font-weight: 600; }
.template-gallery--docs .template-card { flex: 0 0 132px; width: 132px; }
.template-gallery--docs .template-card__label {
  white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  min-height: calc(2 * 1.35em + 2 * var(--space-2)); line-height: 1.35; font-size: var(--fs-xs);
}

/* =========================================================
   Ommaviy sahifalar: /hujjat-namunalari va /hujjat-namunalari/{slug}
   (.tg kartochka/asboblar qatori uslublari qayta ishlatiladi)
   ========================================================= */

/* ---------- Katalog hero ---------- */
.tp-hero { padding: var(--space-7) 0 var(--space-5); background-image: var(--gradient-hero); }
.tp-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--space-6); align-items: center; }
.tp-hero h1 { font-size: var(--fs-3xl); margin: var(--space-2) 0 var(--space-3); line-height: 1.15; }
.tp-hero__lead { color: var(--color-text-muted); font-size: var(--fs-lg); line-height: 1.55; max-width: 680px; margin: 0; }
.tp-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin-top: var(--space-5); }
.tp-hero__free { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--color-success-text); font-size: var(--fs-sm); }
.tp-hero__art { height: 260px; }
.tp-hero__art .tg-hero__sheet { width: 150px; }
@media (max-width: 991.98px) {
  .tp-hero__grid { grid-template-columns: 1fr; }
  .tp-hero__art { display: none; }
}
@media (max-width: 575.98px) {
  .tp-hero { padding-top: var(--space-5); }
  .tp-hero h1 { font-size: var(--fs-2xl); }
  .tp-hero__lead { font-size: var(--fs-base); }
}

.tp-catalog { padding-top: var(--space-5); }
.tp-catalog .tg-section { scroll-margin-top: 90px; }

/* Kartochka ommaviy sahifada — havola (modal emas); butun kartochka bosiladi */
.tp-page .tg-card { position: relative; }
.tp-card__thumb { cursor: pointer; text-decoration: none; }
.tp-card__badge {
  position: absolute; left: 12px; bottom: 12px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--color-surface); color: var(--tg-accent-text); border: 1px solid var(--color-border);
  font-size: var(--fs-2xs, 11px); font-weight: 600; box-shadow: var(--shadow-sm);
}
.tp-card__link { color: inherit; text-decoration: none; }
.tp-card__link::after { content: ""; position: absolute; inset: 0; }
.tp-card__link:hover { color: var(--color-primary); }
.tp-card__link:focus-visible { outline: none; }
.tp-page .tg-card:has(.tp-card__link:focus-visible) { box-shadow: 0 0 0 3px var(--color-primary-border); }
.tp-page .tg-card__actions { position: relative; z-index: 1; }

/* ---------- Qadamlar ---------- */
.tp-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-4); counter-reset: tp; }
.tp-step {
  position: relative; padding: var(--space-5); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); counter-increment: tp;
}
.tp-step::before {
  content: counter(tp); position: absolute; top: var(--space-4); right: var(--space-4);
  font-size: 40px; font-weight: 800; line-height: 1; color: var(--color-primary-subtle);
}
.tp-step__icon {
  width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-primary-subtle); color: var(--color-primary-on-subtle); font-size: 18px; margin-bottom: var(--space-3);
}
.tp-step h3 { font-size: var(--fs-lg); margin: 0 0 var(--space-2); }
.tp-step p { margin: 0; color: var(--color-text-muted); line-height: 1.55; }
@media (max-width: 767.98px) { .tp-steps { grid-template-columns: 1fr; } }

.tp-more-help { margin-top: var(--space-4); text-align: center; color: var(--color-text-muted); }

/* ---------- Bitta shablon ---------- */
.tp-detail__top { padding: var(--space-5) 0 var(--space-6); background-image: var(--gradient-hero); }
.tp-crumbs { margin-bottom: var(--space-4); }
.tp-detail__grid {
  display: grid; gap: var(--space-6); align-items: start;
  grid-template-columns: minmax(0, 1fr) 380px; grid-template-areas: "viewer info";
}
.tp-info { grid-area: info; position: sticky; top: 88px; }
.tp-viewer { grid-area: viewer; min-width: 0; }
@media (max-width: 991.98px) {
  .tp-detail__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "info" "viewer"; gap: var(--space-5); }
  .tp-info { position: static; }
}

.tp-info__cat {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: var(--radius-pill);
  background: var(--tg-accent-subtle); color: var(--tg-accent-text); font-size: var(--fs-xs); font-weight: 600;
}
.tp-info h1 { font-size: var(--fs-2xl); line-height: 1.2; margin: var(--space-3) 0 var(--space-2); }
.tp-info__lead { color: var(--color-text-muted); line-height: 1.55; margin: 0 0 var(--space-4); }

.tp-actions {
  padding: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); box-shadow: var(--shadow-sm);
}
.tp-actions__main { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tp-actions__hint { margin: var(--space-2) 0 var(--space-3); font-size: var(--fs-xs); color: var(--color-text-muted); text-align: center; line-height: 1.45; }
.tp-actions__dl { display: grid; gap: var(--space-2); }
.tp-actions__dl .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

.tp-facts { margin: var(--space-4) 0 0; border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface); }
.tp-facts > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--space-3); padding: 9px 14px; border-top: 1px solid var(--color-border); font-size: var(--fs-sm); }
.tp-facts > div:first-child { border-top: 0; }
.tp-facts dt { color: var(--color-text-muted); font-weight: 500; }
.tp-facts dd { margin: 0; font-weight: 500; }

.tp-tips { margin-top: var(--space-4); }
.tp-tips h2 { font-size: var(--fs-base); margin: 0 0 var(--space-2); }
.tp-tips ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.tp-tips li { display: flex; gap: 10px; font-size: var(--fs-sm); line-height: 1.5; }
.tp-tips li i { color: var(--tg-accent); margin-top: 4px; flex: 0 0 auto; }

/* Ko‘ruvchi */
.tp-viewer__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: var(--space-3); }
.tp-viewer__label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: var(--fs-sm); }
.tp-seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--radius-pill); border: 1px solid var(--color-border); background: var(--color-surface); }
.tp-seg__btn {
  display: inline-flex; align-items: center; gap: 7px; border: 0; background: transparent; cursor: pointer;
  padding: 6px 14px; border-radius: var(--radius-pill); font-size: var(--fs-sm); font-weight: 500; color: var(--color-text-muted);
}
.tp-seg__btn:hover { color: var(--color-text); }
.tp-seg__btn.is-active { background: var(--color-primary); color: var(--color-on-primary); }
.tp-seg__btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--color-primary-border); }
.tp-viewer__frame {
  position: relative; border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden;
  background: #eef1f5; box-shadow: var(--shadow-md);
}
.tp-viewer__frame iframe { display: block; width: 100%; height: min(82vh, 1000px); min-height: 520px; border: 0; transition: opacity .2s; }
.tp-viewer__frame iframe.is-loading { opacity: .35; }
.tp-viewer__note { display: flex; gap: 8px; align-items: flex-start; margin: var(--space-3) 0 0; font-size: var(--fs-sm); color: var(--color-text-muted); line-height: 1.5; }
.tp-viewer__note[hidden] { display: none; }
.tp-viewer__note i { margin-top: 3px; }
@media (max-width: 575.98px) {
  .tp-seg__btn { padding: 6px 10px; font-size: var(--fs-xs); }
  .tp-viewer__frame iframe { height: 70vh; min-height: 420px; }
}

/* Hujjat matni */
.tp-text__head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-3); }
.tp-text__head h2 { margin: 0 0 4px; font-size: var(--fs-xl); }
.tp-text__head p { margin: 0; color: var(--color-text-muted); font-size: var(--fs-sm); }
.tp-doc-text {
  padding: var(--space-5) var(--space-6); border: 1px solid var(--color-border); border-radius: var(--radius-lg);
  background: var(--color-surface); font-family: "Times New Roman", Georgia, serif; font-size: 17px; line-height: 1.6;
}
.tp-doc-text p { margin: 0 0 .55em; overflow-wrap: anywhere; }
.tp-doc-text p:last-child { margin-bottom: 0; }
@media (max-width: 575.98px) {
  .tp-doc-text { padding: var(--space-4); font-size: 16px; }
  .tp-text__head { flex-direction: column; align-items: stretch; }
}

.tp-related__head { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); margin-bottom: var(--space-4); }
.tp-related__head h2 { margin: 0; font-size: var(--fs-xl); }

/* ---------- Yopiq shablonlar (mehmon uchun) ---------- */
/* Kichik (≈150 px) rasm cho'ziladi va xiralashtiriladi — matnni o'qib bo'lmaydi, sahifa shakli seziladi. */
.tp-card--locked .tg-card__thumb img { filter: blur(2.5px) saturate(.6); opacity: .85; }
.tp-card--locked:hover .tg-card__thumb img { transform: none; }
.tp-card__badge--locked { color: var(--color-text); background: var(--color-surface); }
.tp-card__badge--locked i { color: var(--color-warning-text); }
.tp-card__badge--open { color: var(--color-success-text); }

.tp-viewer--locked { min-width: 0; }
.tp-locked {
  position: relative; display: grid; place-items: center; overflow: hidden;
  min-height: 560px; padding: var(--space-6) var(--space-4);
  border: 1px solid var(--color-border); border-radius: var(--radius-lg); background: #eef1f5;
}
.tp-locked__sheet {
  position: absolute; top: 28px; left: 50%; transform: translateX(-50%);
  width: min(78%, 560px); height: auto; background: #fff;
  filter: blur(4px); opacity: .7; box-shadow: 0 2px 12px rgba(15, 23, 42, .12);
}
.tp-locked__card {
  position: relative; max-width: 420px; text-align: center;
  padding: var(--space-5); border-radius: var(--radius-lg);
  background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); box-shadow: var(--shadow-lg);
}
.tp-locked__icon {
  width: 48px; height: 48px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-primary-subtle); color: var(--color-primary-on-subtle); font-size: 20px; margin-bottom: var(--space-3);
}
.tp-locked__card h2 { font-size: var(--fs-lg); margin: 0 0 var(--space-2); }
.tp-locked__card p { color: var(--color-text-muted); margin: 0 0 var(--space-4); line-height: 1.5; font-size: var(--fs-sm); }
.tp-locked__actions { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }
.tp-locked__actions .btn { display: inline-flex; align-items: center; gap: 8px; }

.tp-lockbox p { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 var(--space-3); font-size: var(--fs-xs); color: var(--color-text-muted); line-height: 1.45; }
.tp-lockbox p i { color: var(--color-warning-text); margin-top: 2px; }

.tp-doc-text--excerpt { position: relative; max-height: 220px; overflow: hidden; }
.tp-doc-text--excerpt::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 110px;
  background: linear-gradient(to bottom, transparent, var(--color-surface));
}
.tp-text__locked { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin: var(--space-3) 0 0; color: var(--color-text-muted); font-size: var(--fs-sm); }
.tp-text__locked i { color: var(--color-warning-text); }

/* =========================================================
   Mening shablonlarim (/documents/my-templates) + ikki sahifa
   orasidagi yorliqlar. tg-* kartochka/hero qayta ishlatiladi.
   ========================================================= */
.mt-tabs { display: inline-flex; gap: 4px; padding: 4px; margin-bottom: var(--space-4); border: 1px solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-surface); }
.mt-tabs__tab { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: var(--radius-pill); color: var(--color-text-muted); font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.mt-tabs__tab:hover { color: var(--color-text); background: var(--color-surface-hover); }
.mt-tabs__tab.is-active { background: var(--color-primary); color: var(--color-on-primary); }
.mt-tabs__n { font-size: var(--fs-2xs, 11px); padding: 1px 7px; border-radius: var(--radius-pill); background: rgba(255,255,255,.22); }

.mt-hero { grid-template-columns: minmax(0, 1fr) auto; }
.mt-hero__eyebrow { background: var(--color-primary-subtle); color: var(--color-primary-on-subtle); }
.mt-hero__cta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.mt-hero__hint { font-size: var(--fs-xs); color: var(--color-text-muted); }
@media (max-width: 991.98px) { .mt-hero { grid-template-columns: 1fr; } .mt-hero__cta { align-items: flex-start; } }
@media (max-width: 575.98px) { .mt-tabs { display: flex; } .mt-tabs__tab { flex: 1 1 0; justify-content: center; padding: 7px 10px; } .mt-sort { margin-left: 0; } }

.mt-sort { display: inline-flex; gap: 2px; margin-left: auto; padding: 3px; border: 1px solid var(--color-border); border-radius: var(--radius-pill); background: var(--color-surface); }

.mt-card { position: relative; }
.mt-card.is-busy { opacity: .55; pointer-events: none; }
.mt-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--color-text-muted); margin-bottom: 6px; }
.mt-badge { padding: 1px 9px; border-radius: var(--radius-pill); background: var(--color-primary-subtle); color: var(--color-primary-on-subtle); font-weight: 600; }
.mt-card__actions { display: flex; gap: 8px; align-items: center; }
.mt-card__actions > .btn-primary { flex: 1 1 auto; }
.mt-card .tg-card__thumb { background: linear-gradient(180deg, var(--color-primary-subtle), var(--color-surface-hover)); }

.mt-empty { text-align: center; padding: var(--space-8) var(--space-4); border: 2px dashed var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface); }
.mt-empty__art { width: 76px; height: 76px; margin: 0 auto var(--space-3); border-radius: 22px; display: grid; place-items: center; font-size: 32px; background: var(--color-primary-subtle); color: var(--color-primary); }
.mt-empty h2 { font-size: var(--fs-xl); margin: 0 0 var(--space-2); }
.mt-empty > p { color: var(--color-text-muted); max-width: 560px; margin: 0 auto var(--space-4); line-height: 1.55; }
.mt-steps { list-style: none; padding: 0; margin: 0 auto var(--space-5); display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); max-width: 820px; }
.mt-steps li { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 14px; border-radius: var(--radius-md); background: var(--color-surface-hover); font-size: var(--fs-sm); flex: 1 1 220px; }
.mt-steps span { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--color-primary); color: var(--color-on-primary); font-weight: 700; font-size: var(--fs-xs); }
.mt-empty__actions { display: flex; gap: var(--space-2); justify-content: center; flex-wrap: wrap; }

.mt-security { display: flex; gap: 10px; align-items: flex-start; margin: var(--space-6) 0 0; font-size: var(--fs-xs); color: var(--color-text-muted); line-height: 1.5; }
.mt-security i { margin-top: 2px; color: var(--color-success); }

.mt-modal .modal-content { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
.mt-modal .modal-header, .mt-modal .modal-footer { border-color: var(--color-border); }
.mt-modal__hint { margin-right: auto; font-size: var(--fs-xs); color: var(--color-text-muted); display: inline-flex; gap: 6px; align-items: center; }
.mt-source { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: var(--space-3); border: 1px solid var(--color-border); border-radius: var(--radius-pill); }
.mt-source .tg-script__btn i { margin-right: 6px; }
.mt-dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 16px; border: 2px dashed var(--color-border); border-radius: var(--radius-lg); background: var(--color-surface-hover); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.mt-dropzone:hover, .mt-dropzone.is-picked { border-color: var(--color-primary); background: var(--color-primary-subtle); }
.mt-dropzone i { font-size: 30px; color: var(--color-primary); }
.mt-dropzone strong { font-size: var(--fs-base); word-break: break-all; }
.mt-dropzone span { font-size: var(--fs-xs); color: var(--color-text-muted); }
.mt-docs { max-height: 240px; overflow: auto; border: 1px solid var(--color-border); border-radius: var(--radius-md); }
.mt-doc { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--color-border); background: transparent; color: var(--color-text); text-align: left; font-size: var(--fs-sm); }
.mt-doc:last-child { border-bottom: 0; }
.mt-doc i { color: #2b579a; }
.mt-doc span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-doc small { color: var(--color-text-muted); flex: none; }
.mt-doc:hover { background: var(--color-surface-hover); }
.mt-doc.is-active { background: var(--color-primary-subtle); box-shadow: inset 3px 0 0 var(--color-primary); }

.mt-pages { display: flex; flex-direction: column; align-items: center; gap: 18px; background: #eef1f5; padding: 24px 12px; }
.mt-page { width: min(794px, 100%); height: auto; background: #fff; border-radius: 4px; box-shadow: 0 2px 12px rgba(15, 23, 42, .14); }

.mt-drop { position: fixed; inset: 0; z-index: 2000; display: none; align-items: center; justify-content: center; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); pointer-events: none; }
.mt-drop.is-on { display: flex; }
.mt-drop div { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 60px; border: 3px dashed #fff; border-radius: 24px; color: #fff; font-size: var(--fs-lg); font-weight: 600; }
.mt-drop i { font-size: 44px; }

.mt-toast { position: fixed; left: 50%; bottom: 28px; z-index: 2100; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; padding: 12px 20px; border-radius: 12px; background: #0f172a; color: #fff; font-size: var(--fs-sm); box-shadow: 0 12px 30px rgba(0,0,0,.3); transition: opacity .2s, transform .2s; max-width: min(560px, 92vw); }
.mt-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.mt-toast.is-bad { background: var(--color-danger, #dc2626); }
