/* Arkusz „Nowy trade / Edytuj trade”. Wszystkie klasy z przedrostkiem .tf- */

.tf-sheet [hidden] { display: none !important; }
.tf-sheet .sheet-body { gap: 0; padding-top: 6px; padding-bottom: 28px; overscroll-behavior: contain; }
.tf-sheet button { -webkit-tap-highlight-color: transparent; }
.tf-sheet:focus { outline: none; }

/* ---------- sekcje: cienkie linie zamiast kart ---------- */
.tf-sec { display: grid; gap: 14px; padding: 20px 0; border-top: 1px solid var(--line); min-width: 0; }
.tf-sec:first-child, .tf-restored + .tf-sec { border-top: 0; }
.tf-fast { padding-top: 12px; }
.tf-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; }
.tf-sec-head h3 { font-size: 16px; }
.tf-hint { font-size: 13px; color: var(--fog); margin-top: -4px; }

.tf-link {
  min-height: 32px; padding: 4px 0; border: 0; background: none; cursor: pointer;
  color: var(--violet-hi); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.tf-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.tf-err { color: var(--down); font-size: 12.5px; line-height: 1.35; }
.tf-sheet .input[aria-invalid="true"], .tf-sheet .select[aria-invalid="true"] { border-color: rgba(242, 104, 125, .65); background: var(--down-wash); }

.tf-restored {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 6px; padding: 8px 14px;
  border-radius: var(--r-md); background: var(--violet-wash); border: 1px solid rgba(141, 107, 255, .35); font-size: 13px;
}

/* ---------- szybka ścieżka ---------- */
/* konto: przyciski z podpisem „N strat do dna”, jak panel zapisu w szablonie 11 */
.tf-accs { display: flex; flex-wrap: wrap; gap: 6px; }
.tf-accb {
  display: grid; align-content: center; gap: 1px; min-height: 48px; padding: 6px 13px; border-radius: 11px; text-align: left; line-height: 1.2;
  border: 1px solid var(--line-2); background: var(--bg-up); color: var(--ink-2); font: 500 14px/1.2 var(--f-body);
  transition: border-color .15s, background-color .15s, color .15s;
}
.tf-accb:hover { color: var(--ink); border-color: rgba(170, 200, 240, .3); }
.tf-accb small { font-size: 11.5px; font-weight: 400; color: var(--fog); }
.tf-accb small.danger { color: var(--down); font-weight: 500; }
.tf-accb[aria-pressed="true"] { border-color: var(--vio-2); background: var(--vio-wash); color: var(--ink); box-shadow: 0 0 0 3px rgba(103, 76, 240, .14); }

.tf-row2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; }
/* .seg.tf-… : musi przebić .seg.big button z app.css */
.seg.tf-side button { height: 46px; font-size: 16px; font-weight: 500; }
.seg.tf-inst button { height: 46px; padding: 0 6px; font: 500 13.5px var(--f-disp); }

/* linijka R:R pod cenami */
.tf-ruler { margin-top: -6px; min-height: 0; }
.tf-ruler:empty { display: none; }
.tf-ruler svg { display: block; max-width: 100%; height: 46px; overflow: visible; }
.tf-ruler text { font: 500 11.5px var(--f-disp); font-variant-numeric: tabular-nums; }

.tf-prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: start; }
.tf-prices .input, .tf-size .input { height: 52px; padding: 0 12px; font-size: 20px; }

.tf-read { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin-top: -2px; font-size: 13px; color: var(--fog); }
.tf-ri { display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.tf-ri b { font-size: 16px; font-weight: 500; color: var(--text); }
.tf-ri.is-warn b { color: var(--warn); }
.tf-tp3 { margin-left: auto; }

.tf-warns { display: grid; gap: 6px; margin-top: -4px; }
.tf-warn { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.4; color: var(--warn); }
.tf-warn svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.tf-warn.is-bad { color: var(--down); }

.tf-size { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 12px; align-items: end; }
.tf-size-hint { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-height: 52px; align-content: center; font-size: 13px; line-height: 1.4; }
.tf-size-hint b { font-weight: 500; color: var(--text); }
.tf-size-hint .num, .tf-ri b, .tf-res-usd, .tf-closed-line .num { white-space: nowrap; } /* „$” nie spada sam do nowej linii */

.tf-when { display: flex; align-items: center; gap: 10px; }
.tf-dt { flex: 1; min-width: 0; height: 44px; font: 400 16px var(--f-disp); font-variant-numeric: tabular-nums; }
.tf-sess { height: 30px; padding: 0 10px; font-size: 13px; flex: none; }

/* ---------- wynik ---------- */
.tf-status button { height: 34px; }
.tf-outbox { display: grid; gap: 8px; }
.seg.tf-out button { height: 48px; font-size: 16px; }
.tf-out button:disabled { opacity: .35; cursor: not-allowed; }
.tf-out button.is-tp[aria-pressed="true"] { background: var(--up-wash); color: var(--up); }
.tf-out button.is-sl[aria-pressed="true"] { background: var(--down-wash); color: var(--down); }
.tf-out button.is-be[aria-pressed="true"] { background: rgba(186, 215, 247, .14); color: var(--text); }
.tf-out button.is-manual[aria-pressed="true"] { background: var(--violet-wash); color: #b9a6ff; }

.tf-res { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; padding: 2px 0; }
.tf-res-r { font-size: clamp(40px, 11vw, 52px); line-height: 1; font-weight: 500; letter-spacing: -.03em; }
.tf-res-r.is-empty { font: 400 15px/1.4 var(--f-body); letter-spacing: 0; color: var(--dim); }
.tf-res-usd { font-size: 20px; color: var(--fog); }

.tf-closed { display: grid; gap: 8px; }
.tf-closed-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.tf-closed-line .num { font-size: 14px; color: var(--text); }

.tf-ov > summary {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; cursor: pointer; list-style: none;
  font-size: 13px; font-weight: 500; color: var(--fog);
}
.tf-ov > summary::-webkit-details-marker { display: none; }
.tf-ov > summary:hover { color: var(--text); }
.tf-ov-body { display: grid; gap: 6px; padding-top: 2px; }
.tf-ov-row { display: flex; gap: 8px; }
.tf-ov-row .input { flex: 1; min-width: 0; height: 48px; font-size: 18px; }
.tf-sign { width: 48px; height: 48px; padding: 0; font: 500 20px var(--f-disp); }

.tf-chev { width: 16px; height: 16px; flex: none; transition: transform .18s var(--ease); }
.tf-ov[open] > summary .tf-chev, .tf-det[open] > summary .tf-chev { transform: rotate(90deg); }

.tf-flash { animation: tf-flash 1.8s var(--ease); border-radius: var(--r-md); }
@keyframes tf-flash {
  0%, 35% { background: var(--violet-wash); box-shadow: 0 0 0 10px var(--violet-wash); }
  100% { background: transparent; box-shadow: 0 0 0 10px transparent; }
}

/* ---------- checklista ---------- */
/* Nagłówek z werdyktem zostaje na górze, gdy przewijasz punkty (jak w szablonie 11). */
.tf-check > .tf-sec-head {
  position: sticky; top: -6px; z-index: 2; margin: 0 -22px; padding: 10px 22px;
  background: var(--panel-bg); border-bottom: 1px solid var(--line);
}
.tf-cl-title { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.tf-cl-count { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fog); }
.tf-cl-count b { font-size: 15px; font-weight: 500; color: var(--text); }
.tf-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--violet-hi); vertical-align: middle; }
.tf-must svg { width: 15px; height: 15px; }
.tf-must[aria-pressed="true"] { background: var(--violet-wash); border-color: rgba(141, 107, 255, .55); }
.tf-cl-missing { margin-top: -6px; font-size: 13px; color: var(--fog); }

.tf-cl { display: grid; gap: 10px; }
.tf-cl-group { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: start; }
.tf-cl-glabel { padding-top: 9px; font-size: 12px; color: var(--dim); }
.tf-cl-text { display: none; }
.tf-cl-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; font-size: 12px; }

/* Zaznaczenie widać nie tylko po kolorze: ptaszek przed tekstem. */
.tf-sheet .chip { height: 36px; }
.tf-sheet .chip[aria-pressed="true"]::before {
  content: ''; width: 9px; height: 5px; margin: -3px 1px 0 -2px; flex: none;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
}

.tf-cl.is-full .chips { display: grid; gap: 6px; }
.tf-cl.is-full .chip {
  position: relative; height: auto; display: grid; gap: 2px; justify-items: start; text-align: left;
  padding: 9px 30px 10px 34px; border-radius: 12px;
}
.tf-cl.is-full .chip::before { position: absolute; left: 14px; top: 15px; margin: 0; }
.tf-cl.is-full .chip.must::after { position: absolute; right: 13px; top: 16px; }
.tf-cl.is-full .tf-cl-text { display: block; font-weight: 400; line-height: 1.4; color: var(--fog); }
.tf-cl.is-full .chip[aria-pressed="true"] .tf-cl-short { color: var(--text); }

/* ---------- szczegóły ---------- */
.tf-det { display: block; }
.tf-det > summary { display: flex; align-items: center; gap: 12px; min-height: 40px; cursor: pointer; list-style: none; }
.tf-det > summary::-webkit-details-marker { display: none; }
.tf-det > summary h3 { flex: none; }
.tf-det > summary .tf-chev { margin-left: auto; color: var(--fog); }
.tf-det-sum { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; color: var(--dim); }
.tf-det-sum.has-bad { color: var(--fog); }
.tf-det-body { display: grid; gap: 18px; padding-top: 14px; }
.tf-grp { display: grid; gap: 8px; min-width: 0; }
.tf-tfs { display: grid; grid-template-columns: 4fr 3fr; gap: 12px; }
.seg.tf-tf button { height: 40px; font-size: 14px; }
.seg.tf-mood button { height: 58px; display: grid; place-content: center; justify-items: center; gap: 1px; padding: 0 2px; }
.tf-mood .num { font-size: 18px; line-height: 1.1; }
.tf-mood small { font: 500 11px/1.2 var(--f-body); color: var(--dim); white-space: nowrap; }
.tf-mood button[aria-pressed="true"] { background: var(--violet-wash); color: var(--text); }
.tf-mood button[aria-pressed="true"] small { color: #b9a6ff; }

/* ---------- zrzuty ---------- */
.tf-kindbox { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tf-kind button { height: 30px; padding: 0 10px; font-size: 13px; }
.tf-drop {
  position: relative; display: grid; justify-items: center; gap: 4px; padding: 22px 16px; cursor: pointer; text-align: center;
  border: 1px dashed var(--line-2); border-radius: var(--r-md); color: var(--fog); font-size: 14px;
  transition: border-color .15s, background .15s, color .15s;
}
.tf-drop:hover, .tf-drop.is-drop { border-color: rgba(141, 107, 255, .6); background: var(--violet-wash); color: var(--text); }
.tf-drop:focus-within { outline: 2px solid var(--violet-hi); outline-offset: 2px; }
.tf-drop small { font-size: 12px; color: var(--dim); }
.tf-drop-ico { width: 24px; height: 24px; margin-bottom: 2px; color: var(--violet-hi); }
.tf-drop-mob { display: none; }
@media (hover: none) {
  .tf-drop-desk { display: none; }
  .tf-drop-mob { display: inline; }
}
.tf-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.tf-shot { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px; border: 1px solid var(--line-2); background: #000; }
.tf-shot.is-new { border-color: rgba(141, 107, 255, .5); }
.tf-shot-img, .tf-shot-img img { display: block; width: 100%; height: 100%; }
.tf-shot-img img { object-fit: cover; }
.tf-shot-kind { position: absolute; left: 6px; bottom: 6px; border: 0; background: rgba(5, 6, 15, .82); color: var(--text); }
.tf-shot-cycle { cursor: pointer; }
.tf-shot-cycle::after { content: ''; position: absolute; inset: -9px -6px; } /* większe pole dotyku bez większej pigułki */
.tf-shot-cycle:hover { background: var(--violet); }
.tf-shot-del { position: absolute; top: 4px; right: 4px; width: 34px; height: 34px; background: rgba(5, 6, 15, .78); color: var(--text); }
.tf-shot-del:hover { background: var(--down); color: #fff; }
.tf-shot.is-removed img { opacity: .2; filter: grayscale(1); }
.tf-shot.is-removed .tf-shot-kind { display: none; }
.tf-shot-gone { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 6px; font-size: 12px; color: var(--fog); text-align: center; }
.tf-shot-gone .btn { height: 30px; background: rgba(5, 6, 15, .8); }

.tf-notes { gap: 16px; }

/* ---------- stopka ---------- */
.tf-foot { align-items: center; }
.tf-spacer { flex: 1; }
.tf-kbd { font-size: 12px; color: var(--dim); white-space: nowrap; }
.tf-save { min-width: 150px; }
.tf-del svg, .tf-save svg { width: 16px; height: 16px; }

.tf-empty { margin-top: 8px; }

/* ---------- telefon ---------- */
@media (max-width: 860px) {
  .tf-sheet .sheet-head { padding: 18px 16px 12px; }
  .tf-sheet .sheet-body { padding: 2px 16px 24px; }
  .tf-sheet .sheet-foot { gap: 8px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); }
  .tf-sheet .chip { height: 40px; padding: 0 14px; }
  .tf-foot .btn { height: 50px; }
  .tf-save { flex: 1 1 auto; min-width: 0; font-size: 16px; }
  .tf-kbd, .tf-spacer { display: none; }
  .tf-del { width: 50px; padding: 0; }
  .tf-del-label { display: none; }
  /* Pola dotyku co najmniej 40 px. */
  .tf-sheet .sheet-head .icon-btn { width: 40px; height: 40px; }
  .tf-status button, .tf-kind button { height: 40px; }
  .tf-check > .tf-sec-head { margin: 0 -16px; padding: 10px 16px; top: -2px; }
  .tf-must { height: 40px; }
  .tf-link { display: inline-flex; align-items: center; min-height: 40px; }
  .tf-shot-del { width: 40px; height: 40px; }
  .tf-shot-cycle { height: 28px; padding: 0 10px; }
  .tf-shot-gone .btn { height: 40px; }
  /* 16 px: iPhone nie powiększa strony przy fokusie. */
  .tf-notes .input, .tf-notes .textarea { font-size: 16px; }
}
@media (max-width: 560px) {
  .tf-row2 { grid-template-columns: 1fr; }
  .tf-cl-group { grid-template-columns: 1fr; gap: 6px; }
  .tf-cl-glabel { padding-top: 0; }
  .tf-tfs { grid-template-columns: 1fr; }
  .tf-prices { gap: 8px; }
  .tf-prices .input { padding: 0 10px; font-size: 18px; }
  .tf-res-usd { font-size: 18px; }
}
