/* Shablonni brauzerda toʻldirish (js/tpl-fill.js, v112): toʻliq ekranli oyna — chapda maydonlar, oʻngda jonli «qogʻoz» koʻrinishi;
   < 900px — ikki varaq (Maydonlar | Hujjat koʻrinishi), pastda yopishqoq «Word yuklab olish». «Mening hujjatlarim» — katalog tepasida. */
html.tf-lock, html.tf-lock body { overflow: hidden; }
.tf { position: fixed; inset: 0; z-index: 135; background: rgba(12, 22, 44, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  --t-bg: #f4f6fb; --t-card: #fff; --t-ink: #16223d; --t-mut: #5b6884; --t-line: rgba(31, 59, 115, .13); --t-field: #fff; --t-focus: #2f54a8;
  --t-mark: rgba(235, 198, 90, .38); --t-mark-set: rgba(47, 84, 168, .1); --t-cur: rgba(235, 198, 90, .75); font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif; color: var(--t-ink); }
body.dark .tf { --t-bg: #0f1a33; --t-card: #16223f; --t-ink: #e7edfb; --t-mut: #9fb0d2; --t-line: rgba(140, 165, 215, .18); --t-field: rgba(20, 32, 60, .9); --t-focus: #9db9ff;
  --t-mark: rgba(235, 198, 90, .28); --t-mark-set: rgba(140, 170, 230, .16); --t-cur: rgba(235, 198, 90, .55); }
.tf-box { position: absolute; inset: 16px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto; background: var(--t-bg); border-radius: 20px; overflow: hidden;
  box-shadow: 0 30px 90px rgba(8, 18, 42, .35); border: 1px solid var(--t-line); }
/* qatorlar aniq: kompyuterda varaqlar yashirin boʻlsa ham xabar va pastki tugma oʻz qatorida qoladi */
.tf-h { grid-row: 1; } .tf-tabs { grid-row: 2; } .tf-main { grid-row: 3; } .tf-msg { grid-row: 4; } .tf-mf { grid-row: 5; }
.tf-h { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--t-card); border-bottom: 1px solid var(--t-line); }
.tf-ib { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--t-line); background: transparent; color: var(--t-ink); cursor: pointer; }
.tf-ib svg { width: 20px; height: 20px; }
.tf-ht { flex: 1; min-width: 0; }
.tf-ht p { font-size: 12px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--t-mut); }
.tf-ht h2 { font: 800 17px/1.3 'Manrope', 'Inter', sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; outline: none; }
.tf-save { font-size: 12.5px; color: var(--t-mut); white-space: nowrap; }
.tf-dl { white-space: nowrap; }
.tf-dl svg, .tf-mf svg { width: 17px; height: 17px; }
.tf-tabs { display: none; }
.tf-main { display: grid; grid-template-columns: minmax(320px, 440px) minmax(0, 1fr); min-height: 0; }
.tf-form { overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px 28px; border-right: 1px solid var(--t-line); background: var(--t-card); }
.tf-prog { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 14px; font-size: 13px; color: var(--t-mut); }
.tf-prog b { color: var(--t-ink); }
.tf-bar { flex: 1 1 100%; height: 6px; border-radius: 3px; background: var(--t-line); overflow: hidden; }
.tf-bar i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #2f54a8, #4c7be0); transition: width .25s; }
.tf-grp + .tf-grp { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--t-line); }
.tf-grp h3 { font: 800 14px/1.3 'Manrope', 'Inter', sans-serif; margin-bottom: 2px; }
.tf-grp > p { font-size: 12.5px; color: var(--t-mut); margin-bottom: 8px; }
.tf-fld { margin-top: 10px; }
.tf-fld label { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 5px; line-height: 1.35; }
.tf-fld label em { font-style: normal; font-size: 11px; font-weight: 700; color: #1d7a4f; background: rgba(29, 122, 79, .1); padding: 1px 6px; border-radius: 6px; flex: none; }
.tf-ctl { display: flex; gap: 6px; }
.tf-in { flex: 1; min-width: 0; min-height: 42px; padding: 9px 12px; border-radius: 11px; border: 1px solid var(--t-line); background: var(--t-field); color: var(--t-ink);
  font: 400 14.5px/1.45 'Inter', sans-serif; resize: vertical; }
textarea.tf-in { min-height: 76px; }
.tf-in:focus { outline: none; border-color: var(--t-focus); box-shadow: 0 0 0 3px rgba(47, 84, 168, .15); }
.tf-fld.is-set .tf-in { border-color: rgba(47, 84, 168, .3); }
.tf-today { flex: none; padding: 0 10px; border-radius: 10px; border: 1px solid var(--t-line); background: transparent; color: var(--t-mut); font: 600 12.5px 'Inter', sans-serif; cursor: pointer; }
.tf-today:hover { color: var(--t-ink); }
.tf-note { display: flex; gap: 8px; margin-top: 16px; font-size: 12.5px; line-height: 1.5; color: var(--t-mut); }
.tf-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.tf-load, .tf-err { padding: 30px 10px; text-align: center; color: var(--t-mut); font-size: 14px; }
.tf-err { color: #b3261e; }
.tf-prevw { overflow-y: auto; overscroll-behavior: contain; padding: 22px; min-width: 0; }
.tf-paper { max-width: 800px; margin: 0 auto; padding: 56px 60px; background: #fff; color: #111; border-radius: 6px; box-shadow: 0 8px 30px rgba(20, 42, 82, .12);
  font: 12.5pt/1.5 'Times New Roman', Times, serif; overflow-wrap: anywhere; overflow-x: auto; }
.tf-tbl td { overflow-wrap: anywhere; }
.tf-p { margin: 0 0 4px; min-height: 1.2em; }
.tf-p.gap { min-height: .8em; }
.tf-tab { display: inline-block; width: 2.5em; }
.tf-tbl { width: 100%; border-collapse: collapse; margin: 4px 0 8px; }
.tf-tbl td { vertical-align: top; padding: 2px 4px; }
/* qogʻoz doim oq — maydon ranglari tun rejimiga bogʻliq emas (umumiy mark uslubi ham bosiladi) */
.tf-paper .tf-m { background: rgba(235, 198, 90, .38); color: #111; border-radius: 3px; padding: 0 2px; cursor: pointer; transition: background-color .15s; }
.tf-paper .tf-m.is-set { background: rgba(47, 84, 168, .1); }
.tf-paper .tf-m.is-cur { background: rgba(235, 198, 90, .75); box-shadow: 0 0 0 2px rgba(235, 198, 90, .75); }
.tf-ins { color: #8a6510; font-style: italic; font-size: .9em; }
.tf-pnote { display: flex; justify-content: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--t-mut); }
.tf-pnote svg { width: 14px; height: 14px; }
.tf-msg { margin: 0; padding: 10px 16px; font-size: 13.5px; color: #b3261e; background: var(--t-card); border-top: 1px solid var(--t-line); }
.tf-msg.ok { color: #1d7a4f; }
.tf-msg:empty, .tf-msg[hidden] { display: none; }
.tf-mf { display: none; }
@media (max-width: 899.98px) {
  .tf-box { inset: 0; border-radius: 0; border: 0; padding-top: env(safe-area-inset-top); }
  .tf-h { padding: 8px 10px; gap: 8px; }
  .tf-h .tf-dl, .tf-save { display: none; }
  .tf-tabs { display: flex; gap: 4px; padding: 6px 10px; background: var(--t-card); border-bottom: 1px solid var(--t-line); }
  .tf-tabs button { flex: 1; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--t-mut); font: 700 13.5px 'Inter', sans-serif; cursor: pointer; }
  .tf-tabs button[aria-selected="true"] { background: rgba(47, 84, 168, .1); color: var(--t-ink); }
  .tf-main { grid-template-columns: minmax(0, 1fr); }
  .tf-main[data-tab="form"] .tf-prevw, .tf-main[data-tab="prev"] .tf-form { display: none; }
  .tf-form { border-right: 0; padding: 12px 14px 24px; }
  .tf-in { font-size: 16px; }   /* iOS maydonga kattalashtirmaydi */
  .tf-prevw { padding: 12px 8px; }
  .tf-paper { padding: 26px 18px; font-size: 11pt; }
  .tf-tab { width: 1.2em; }
  .tf-mf { display: block; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--t-card); border-top: 1px solid var(--t-line); }
  .tf-mf .op-btn { width: 100%; justify-content: center; min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { .tf-bar i, .tf-m { transition: none; } }

/* ---------- «Mening hujjatlarim» (katalog tepasida) ---------- */
.odc-mine[hidden] { display: none; }
.tf-mine { margin: 0 0 18px; padding: 16px 18px; border-radius: var(--op-r-card, 18px); background: var(--g1-bg, rgba(255, 255, 255, .78)); border: 1px solid var(--op-line, rgba(31, 59, 115, .12)); box-shadow: var(--shadow-sm); }
body.dark .tf-mine { background: rgba(20, 32, 60, .7); }
.tf-mine h2 { display: flex; align-items: center; gap: 8px; font: 800 16px/1.3 'Manrope', 'Inter', sans-serif; color: var(--op-ink, inherit); }
.tf-mine h2 svg { width: 18px; height: 18px; color: var(--navy-light, #2f54a8); }
.tf-mine header p { margin: 2px 0 8px; font-size: 13px; color: var(--muted); }
.tf-mine ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.tf-mine li { display: flex; align-items: stretch; gap: 2px; border-radius: 12px; border: 1px solid var(--op-line, rgba(31, 59, 115, .12)); background: var(--op-field, rgba(255, 255, 255, .7)); }
body.dark .tf-mine li { background: rgba(20, 32, 60, .55); }
.tf-mi { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: center; padding: 10px; border: 0; background: transparent; text-align: left; cursor: pointer; color: inherit; font: inherit; border-radius: 12px; }
.tf-mi:hover { background: var(--op-tint-h, rgba(31, 59, 115, .06)); }
.tf-mi-ic { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 10px; background: rgba(47, 84, 168, .1); color: var(--navy-light, #2f54a8); }
.tf-mi-ic svg { width: 17px; height: 17px; }
.tf-mi-t { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tf-mi-t b { font-size: 13.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--op-ink, inherit); }
.tf-mi-t small { font-size: 12px; color: var(--muted); }
.tf-md { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); border-radius: 12px; cursor: pointer; font: 600 12px 'Inter', sans-serif; }
.tf-md svg { width: 16px; height: 16px; }
.tf-md:hover { color: #b3261e; }
.tf-md.is-arm { background: #c43a3a; color: #fff; }
.tf-md span:empty { display: none; }
.tf-mine .odc-tlink { margin-top: 8px; }
