/* Konwerter Excel do VCF — tylko to, czego nie ma w assets/css/tools.css.
   Kolory przez tokeny sub.css, więc jasny i ciemny motyw działają same. */

/* hidden wygrywa z display: grid / flex wspólnych klas */
.tool [hidden] { display: none !important; }

.vcf-block, .vcf-out { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.vcf-out { gap: 20px; }
.tool fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.tool legend { padding: 0; margin-bottom: 10px; }

/* przełącznik trybu: dwa duże pola wyboru, na telefonie jedno pod drugim */
.vcf-mode-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.vcf-mode-option { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); font-size: 16px; font-weight: 600; line-height: 1.35; cursor: pointer; }
.vcf-mode-option:hover { border-color: color-mix(in srgb, var(--fg) 30%, transparent); }
.vcf-mode-option:has(input:checked) { border-color: var(--accent); background: var(--chip); }
.vcf-mode-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.vcf-mode-option input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }

/* pola z danymi: kod i wklejka bez zawijania, przewijane w poziomie */
.vcf-textarea { min-height: 200px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 16px; white-space: pre; overflow-x: auto; tab-size: 4; }
.vcf-file { padding: 10px 12px; font-size: 16px; cursor: pointer; }
.vcf-file::file-selector-button { min-height: 32px; margin-right: 12px; padding: 4px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--chip); color: var(--fg); font: inherit; font-size: 15px; cursor: pointer; }
.vcf-file:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.vcf-file-info { overflow-wrap: anywhere; }
.tool-check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* przypisanie kolumn: etykieta nad listą, pełna szerokość */
.vcf-map-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px 16px; margin-top: 10px; }
.vcf-map-item { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.vcf-map-item label { font-size: 14px; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }

/* uwagi do wierszy */
.vcf-warnings { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.vcf-warnings li { padding: 8px 12px; border-left: 3px solid #e5a000; border-radius: 0 8px 8px 0; background: var(--chip); font-size: 15px; line-height: 1.5; color: var(--fg); overflow-wrap: anywhere; }
.vcf-warnings strong { font-weight: 600; }

/* karty podglądu: jak kontakt w telefonie */
.vcf-cards { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.vcf-card { display: flex; align-items: flex-start; gap: 14px; min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); }
.vcf-avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 22%, var(--chip)); color: var(--fg); font-weight: 600; font-size: 16px; }
.vcf-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.vcf-card-name { font-size: 17px; font-weight: 600; line-height: 1.35; color: var(--fg); overflow-wrap: anywhere; }
.vcf-card-sub { font-size: 14px; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.vcf-card-rows { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 0; }
.vcf-card-rows div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; font-size: 15px; line-height: 1.45; }
.vcf-card-rows dt { color: var(--muted); }
.vcf-card-rows dd { margin: 0; color: var(--fg); overflow-wrap: anywhere; white-space: pre-line; }
.vcf-flag { display: inline-block; padding: 0 8px; border: 1px solid #e5a000; border-radius: 999px; font-size: 13px; color: var(--fg); white-space: nowrap; }

/* zawartość pliku i tabela CSV: przewijane we własnym polu */
.vcf-pre { max-height: 340px; overflow: auto; font-size: 14px; white-space: pre; overflow-wrap: normal; }
.vcf-csv-table { max-width: 100%; }
.vcf-csv-table table { width: max-content; min-width: 100%; font-size: 15px; }
.vcf-csv-table td { white-space: pre-line; max-width: 280px; overflow-wrap: anywhere; }
.vcf-csv-table th { white-space: nowrap; }

/* rozwijane bloki: zawartość pliku i instrukcje importu */
.vcf-details { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.vcf-details summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 10px 16px; font-size: 16px; font-weight: 600; cursor: pointer; list-style: none; border-radius: 12px; }
.vcf-details summary::-webkit-details-marker { display: none; }
.vcf-details summary::after { content: "+"; flex: none; font-size: 22px; font-weight: 400; color: var(--accent); }
.vcf-details[open] summary::after { content: "–"; }
.vcf-details summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vcf-details > .tool-output, .vcf-details > .tool-note { margin: 0 12px 12px; width: calc(100% - 24px); }
.vcf-details ol { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0 16px 16px 36px; list-style: decimal; }
.vcf-details li { font-size: 15px; line-height: 1.55; color: var(--muted); }
.vcf-howto { gap: 10px; }

/* nieaktywne pobieranie */
.tool-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.tool-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

@media (max-width: 600px) {
  .vcf-mode-options { grid-template-columns: minmax(0, 1fr); }
  .vcf-map-list { grid-template-columns: minmax(0, 1fr); }
  .tool-actions .tool-btn { width: 100%; }
  .vcf-card { padding: 12px; gap: 12px; }
  /* wąska karta: etykieta nad wartością, żeby numer się nie łamał */
  .vcf-card-rows { gap: 8px; }
  .vcf-card-rows div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .vcf-card-rows dt { font-size: 13px; }
}
