/* go7.uz — раздел «Сертификаты» */
.cf-page [hidden] { display: none !important; }
.cf-back { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.cf-back:hover { color: var(--accent); text-decoration: none; }
.cf-lbl { font-weight: 700; font-size: 13px; color: var(--ink-2); }
.cf-g3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cf-g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cf-checks { display: flex; flex-direction: column; gap: 4px; }
.cf-chk { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; min-height: 34px; }
.cf-chk input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }

/* ---------- Новый сертификат: скриншоты → ИИ ---------- */
.cf-start { display: flex; justify-content: center; }
.cf-start-card { width: 100%; max-width: 760px; padding: 32px; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.cf-start-ic { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cf-start-card h3 { font-size: 24px; font-weight: 800; }
.cf-start-card > p { max-width: 560px; margin: -6px 0 0; }
.cf-drop { width: 100%; border: 2px dashed var(--line-2); border-radius: 18px; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; background: var(--surface-2); transition: border-color .15s, background .15s; outline: none; }
.cf-drop:hover, .cf-drop:focus-visible, .cf-drop.over { border-color: var(--accent); background: var(--sel-bg); }
.cf-drop.has { padding: 18px 20px; }
.cf-drop-ic { color: var(--accent); }
.cf-files { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.cf-files:empty { display: none; }
.cf-file { position: relative; width: 88px; height: 88px; border-radius: 12px; overflow: hidden; background: var(--bg-2); box-shadow: 0 0 0 1.5px var(--line); display: grid; place-items: center; }
.cf-file img { width: 100%; height: 100%; object-fit: cover; }
.cf-file i { font-style: normal; font-weight: 800; color: var(--ink-3); }
.cf-file-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(11,31,58,.75); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }
.cf-start-opts { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: center; }
.cf-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cf-gift0 { width: 100%; text-align: left; }
.cf-gen { width: 100%; max-width: 420px; justify-content: center; }
.cf-gen-note { margin: -6px 0 0; }
.cf-or { width: 100%; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.cf-or::before, .cf-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.cf-alt { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Редактор: шаблоны | сертификат | инструменты ---------- */
.cf-page-ed { padding-top: 18px; }
.cf-ed { display: grid; grid-template-columns: 212px minmax(0, 1fr) 360px; grid-template-areas: "rail stage tools"; gap: 18px; align-items: start; }
.cf-stage { grid-area: stage; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.cf-rail { grid-area: rail; }
.cf-tools { grid-area: tools; }
.cf-rail, .cf-tools { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); scrollbar-width: thin; }
.cf-stage-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cf-stage-top .cf-back { margin: 0; }
.cf-issued { flex: 1; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--teal-ink); min-width: 0; }
.cf-prev { width: 100%; aspect-ratio: 1600 / 1131; border-radius: 14px; overflow: hidden; background: var(--bg-2); box-shadow: 0 2px 4px rgba(11,31,58,.08), 0 18px 48px rgba(11,31,58,.16); }
.cf-prev canvas { width: 100%; height: 100%; display: block; }
.cf-prev.tall { max-width: min(100%, 600px); margin: 0 auto; }
.cf-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.cf-actions .btn { min-width: 170px; justify-content: center; }

/* Шаблоны (слева) */
.cf-rail { padding: 14px 12px; }
.cf-rail-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 0 4px 6px; }
.cf-rail-list { display: flex; flex-direction: column; gap: 10px; }
.cf-rail-sec { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 4px 0; display: flex; justify-content: space-between; }
.cf-rail-sec span { text-transform: none; letter-spacing: 0; font-weight: 600; }
.cf-rail-empty { margin: 0 4px; }
.cf-tpl-w { position: relative; }
.cf-tpl { width: 100%; border: 0; padding: 0; background: none; cursor: pointer; display: flex; flex-direction: column; gap: 5px; text-align: left; font: inherit; color: var(--ink); }
.cf-tpl canvas { width: 100%; height: auto; display: block; border-radius: 9px; background: var(--bg-2); min-height: 60px; box-shadow: 0 0 0 1.5px var(--line); transition: box-shadow .15s, transform .15s; }
.cf-tpl:hover canvas { transform: translateY(-1px); box-shadow: 0 0 0 2px var(--line-2), 0 8px 18px rgba(11,31,58,.12); }
.cf-tpl.on canvas { box-shadow: 0 0 0 3px var(--accent); }
.cf-tpl span { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.cf-tpl .cf-new { font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: .02em; color: #fff; background: var(--accent); border-radius: 5px; padding: 1px 5px; margin-right: 5px; vertical-align: 1px; }
.cf-tpl-tools { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.cf-tpl-w:hover .cf-tpl-tools, .cf-tpl-w:focus-within .cf-tpl-tools { opacity: 1; }
.cf-tpl-tools .av-ib { width: 30px; height: 30px; background: var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.18); }

/* Инструменты (справа) */
.cf-tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 4px; padding: 10px; background: var(--surface); border-bottom: 1px solid var(--line); }
.cf-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 6px; border: 0; border-radius: 10px; background: none; color: var(--ink-2); font: 700 13px var(--font); cursor: pointer; }
.cf-tabs button:hover { background: var(--bg-2); }
.cf-tabs button.on { background: var(--accent-soft); color: var(--accent-ink); }
.cf-pane { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.cf-sec { display: flex; flex-direction: column; gap: 8px; }
.cf-sec .seg { align-self: flex-start; }
.cf-cur-in { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.cf-cur-in .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.cf-cur-in b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-cur-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.cf-ai { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, var(--accent-soft), var(--sel-bg)); }
.cf-ai p { margin: 0; }
.cf-ai-btn { justify-content: center; }
.cf-colors { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-col { width: 40px; height: 32px; border-radius: 8px; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); transition: transform .12s; }
.cf-col:hover { transform: translateY(-1px); }
.cf-col.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.cf-col-auto { width: auto; padding: 0 12px; background: var(--surface-2); color: var(--ink-2); font: 700 12px var(--font); box-shadow: inset 0 0 0 1.5px var(--line); }
.cf-photos { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 6px; scrollbar-width: thin; }
.cf-ph { flex: none; width: 84px; height: 60px; border-radius: 10px; border: 0; padding: 0; overflow: hidden; cursor: pointer; background: var(--surface-2); color: var(--ink-2);
  box-shadow: inset 0 0 0 1.5px var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font: 700 11px var(--font); }
.cf-ph img { width: 100%; height: 100%; object-fit: cover; }
.cf-ph.on { box-shadow: 0 0 0 3px var(--accent); }
.cf-url { display: flex; gap: 8px; }
.cf-url .input { flex: 1; min-width: 0; }
.cf-find { display: flex; flex-wrap: wrap; gap: 6px; }
.cf-find .btn { padding: 7px 10px; }

/* Замена дизайна */
.modal.cf-repl-modal { width: min(820px, calc(100vw - 32px)); max-width: none; }
.cf-repl { display: grid; grid-template-columns: 220px 1fr; gap: 18px; align-items: start; }
.cf-repl-new { display: flex; flex-direction: column; gap: 4px; }
.cf-repl-pic { display: block; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1.5px var(--line); }
.cf-repl-pic canvas { width: 100%; height: auto; display: block; }
.cf-repl-new .cf-repl-pic { box-shadow: 0 0 0 3px var(--teal); }
.cf-repl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cf-repl-it { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; display: flex; flex-direction: column; gap: 4px; font: inherit; color: var(--ink); }
.cf-repl-it small { color: var(--danger); font-weight: 700; }
.cf-repl-it:hover .cf-repl-pic { box-shadow: 0 0 0 3px var(--danger); }

/* Заказы */
.cf-search { display: flex; align-items: center; gap: 8px; position: relative; }
.cf-search .ico { position: absolute; left: 14px; color: var(--muted); pointer-events: none; }
.cf-search .input { padding-left: 42px; }
.modal.cf-ord-modal { width: min(640px, calc(100vw - 32px)); }
.cf-orders { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; max-height: 60vh; overflow-y: auto; }
.cf-ord { border: 0; text-align: left; cursor: pointer; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 2px; font: inherit; color: var(--ink); }
.cf-ord:hover { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--sel-bg); }
.cf-ord small { color: var(--muted); }

/* Список «Выданные» */
.cf-empty .btn { margin-top: 18px; }
.cf-list-top { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.cf-list-top .cf-search { flex: 1 1 280px; max-width: 460px; }
.cf-list { display: flex; flex-direction: column; gap: 8px; }
.cf-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); color: var(--ink); text-decoration: none !important; }
.cf-row:hover { box-shadow: 0 0 0 1.5px var(--accent), var(--shadow); }
.cf-num { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-ink); background: var(--accent-soft); border-radius: 8px; padding: 4px 8px; font-size: 13px; flex: none; }
.cf-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.cf-row-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-row-main small, .cf-row-meta small { color: var(--muted); }
.cf-row-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; color: var(--ink-3); flex: none; }
.cf-none { padding: 20px; text-align: center; }

/* Средние экраны: шаблоны — лентой под сертификатом */
@media (max-width: 1360px) {
  .cf-ed { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "stage tools" "rail tools"; }
  .cf-rail { position: static; max-height: none; overflow: hidden; }
  .cf-rail-list { flex-direction: row; overflow-x: auto; padding-bottom: 6px; align-items: flex-start; }
  .cf-rail-sec { writing-mode: vertical-rl; transform: rotate(180deg); padding: 4px 0; flex: none; align-self: stretch; justify-content: center; gap: 6px; }
  .cf-tpl, .cf-tpl-w { flex: none; width: 150px; }
  .cf-rail-empty { flex: none; width: 170px; }
}
/* Телефон и планшет: всё друг под другом */
@media (max-width: 960px) {
  .cf-ed { grid-template-columns: minmax(0, 1fr); grid-template-areas: "stage" "rail" "tools"; }
  .cf-tools { position: static; max-height: none; overflow: visible; }
  .cf-tabs { top: 0; }
  .cf-issued { order: 3; flex-basis: 100%; }
  .cf-stage-top { justify-content: space-between; }
  .cf-start-card { padding: 22px 16px; }
}
@media (max-width: 560px) {
  .cf-g3, .cf-g2 { grid-template-columns: 1fr 1fr; }
  .cf-g3 > :last-child:nth-child(3) { grid-column: 1 / -1; }
  .cf-actions .btn { flex: 1 1 100%; }
  .cf-repl { grid-template-columns: 1fr; }
  .cf-repl-new { max-width: 220px; }
  .cf-row-meta { display: none; }
  .cf-tpl, .cf-tpl-w { width: 130px; }
}
/* Сенсорные экраны: кнопки «переименовать / удалить» видны всегда */
@media (hover: none) { .cf-tpl-tools { opacity: 1; } }

/* Фото: «Другие фото» — новая лента из медиатеки */
.cf-lbl-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cf-lbl-row .cf-lbl { margin: 0; }
.cf-renew { padding: 5px 10px; font-size: 12.5px; }
.cf-renew .ico { width: 15px; height: 15px; }
.cf-renew:not(:disabled):active .ico { transform: rotate(180deg); transition: transform .3s; }

/* Сохранение: статус, «Сохранить», «Удалить» */
.cf-issued.ok { color: var(--teal-ink); }
.cf-issued.wait, .cf-issued.busy { color: var(--ink-3); }
.cf-issued.err { color: var(--danger, #D93025); }
.cf-issued .spinner { width: 14px; height: 14px; }
.cf-stage-top .cf-save { flex: none; }
.cf-stage-top .cf-save:disabled { opacity: 1; cursor: default; }
.cf-stage-top .cf-save.ghost:disabled { color: var(--teal-ink); }
.cf-stage-top .cf-del { flex: none; color: var(--ink-3); }
.cf-stage-top .cf-del:hover { color: var(--danger, #D93025); }
.cf-row-w { position: relative; }
.cf-row-w .cf-row { padding-right: 56px; }
.cf-row-del { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); opacity: 0; transition: opacity .15s; color: var(--ink-3); }
.cf-row-w:hover .cf-row-del, .cf-row-del:focus-visible { opacity: 1; }
.cf-row-del:hover { color: var(--danger, #D93025); }
@media (hover: none) { .cf-row-del { opacity: 1; } }
