* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* Zakazat zoom cele stranky - zoom je povolen jen ve vieweru */
html, body { touch-action: pan-x pan-y; }
:root {
  --bg: #f5f0e8; --surface: #ffffff; --surface2: #f0ede6; --border: #e2ddd4; --border2: #ccc8be;
  --text: #1a1814; --text2: #6b6760; --text3: #9e9b95; --accent: #2980b9; --accent-light: #e8f6fd;
  --radius: 10px; --radius-lg: 16px; --shadow: 0 1px 3px rgba(0,0,0,0.07);
  --boy: #eef4fb; --boy-text: #2e5a88; --girl: #fdf2f8; --girl-text: #a64d79; --danger: #c62828;
  --unpaid: #d00000;
  --status-free: #2e7d32;
  --status-reserved: #ed6c02;
  --status-sold: #9e9e9e;
  /* Stat tile borders */
  --stat-blue: #2980b9; --stat-gold: #7d3c98; --stat-green: #7a5c3a;
  --stat-blue2: #d68910; --stat-red: #c0392b;
  /* Filter tabs */
  --tab-all-active: #1e8449; --tab-all-inactive: #78c39a;
  --tab-male-active: #2980b9; --tab-male-inactive: #7eb8d6;
  --tab-female-active: #7d3c98; --tab-female-inactive: #b39dbe;
  /* Finance badges */
  --pay-cash-bg: #dcfce7; --pay-cash-text: #15803d; --pay-cash-border: #86efac;
  --pay-transfer-bg: #dbeafe; --pay-transfer-text: #1d4ed8; --pay-transfer-border: #93c5fd;
  --pay-other-bg: #fef3c7; --pay-other-text: #b45309; --pay-other-border: #fcd34d;
  /* Mating section */
  --mating-bg: linear-gradient(135deg, #e8f4ff 0%, #dbeeff 100%);
  --mating-border: #90c4f0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16140f; --surface: #1f1d18; --surface2: #2a2820; --border: #353228; --text: #f0ede6; --text2: #a09d96;
    --boy: #1e2128; --girl: #221c20; --accent-light: #0d2a3a;
    --stat-blue: #4a7090; --stat-gold: #6b5a00; --stat-green: #2d6b30;
    --stat-blue2: #1565a0; --stat-red: #8b1a1a;
    --tab-all-active: #1a5c38; --tab-all-inactive: #2d6e4e;
    --tab-male-active: #1a5c8e; --tab-male-inactive: #2d8abf;
    --tab-female-active: #5a2a7a; --tab-female-inactive: #2d6e4e;
    --pay-cash-bg: #0d2b1a; --pay-cash-text: #4ade80; --pay-cash-border: #166534;
    --pay-transfer-bg: #0d1b2e; --pay-transfer-text: #60a5fa; --pay-transfer-border: #1e40af;
    --pay-other-bg: #2a1f05; --pay-other-text: #fbbf24; --pay-other-border: #92400e;
    --mating-bg: linear-gradient(135deg, #1a2a3a 0%, #152236 100%);
    --mating-border: #2e5a88;
  }
}
/* JS fallback pro Android WebView kde media query nespolehlivě funguje */
html.dark {
    --bg: #16140f; --surface: #1f1d18; --surface2: #2a2820; --border: #353228; --text: #f0ede6; --text2: #a09d96;
    --boy: #1e2128; --girl: #221c20; --accent-light: #0d2a3a;
    --stat-blue: #4a7090; --stat-gold: #6b5a00; --stat-green: #2d6b30;
    --stat-blue2: #1565a0; --stat-red: #8b1a1a;
    --tab-all-active: #1a5c38; --tab-all-inactive: #2d6e4e;
    --tab-male-active: #1a5c8e; --tab-male-inactive: #2d8abf;
    --tab-female-active: #5a2a7a; --tab-female-inactive: #2d6e4e;
    --pay-cash-bg: #0d2b1a; --pay-cash-text: #4ade80; --pay-cash-border: #166534;
    --pay-transfer-bg: #0d1b2e; --pay-transfer-text: #60a5fa; --pay-transfer-border: #1e40af;
    --pay-other-bg: #2a1f05; --pay-other-text: #fbbf24; --pay-other-border: #92400e;
    --mating-bg: linear-gradient(135deg, #1a2a3a 0%, #152236 100%);
    --mating-border: #2e5a88;
}
html {
    background: var(--bg);
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    /* Portrait: left/right 16px + safe area pro landscape (notch na boku) */
    padding-top: env(safe-area-inset-top, 20px);
    /* Tab bar výška (70px) + home indicator + 20px mezera */
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px) + 20px);
    padding-left: max(16px, env(safe-area-inset-left, 16px));
    padding-right: max(16px, env(safe-area-inset-right, 16px));
    min-height: 100vh;
}
.app { max-width: 860px; margin: 0 auto; }
header { padding: 20px 0 10px; border-bottom: 1px solid var(--border); margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 15px; min-width: 150px; }
.logo-text-wrapper { display: flex; flex-direction: column; }
.logo-icon { width: 55px; height: 55px; background: transparent; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 28px; color: white; cursor: pointer; overflow: hidden; border: none; flex-shrink: 0; }
.logo-icon img { width: 100%; height: 100%; object-fit: cover; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-bottom: 7px; }
.stat { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 10px 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; cursor: pointer; transition: transform 0.1s ease; min-height: 80px; width: 100%; }
.stat:active { transform: scale(0.96); }
.stat-c-blue:active   { background: rgba(41,128,185,0.14); }
.stat-c-gold:active   { background: rgba(125,60,152,0.13); }
.stat-c-green2:active { background: rgba( 74,168,216,0.13); }
.stat-c-green:active  { background: rgba(122, 92, 58,0.14); }
.stat-c-blue2:active  { background: rgba(214,137, 16,0.14); }
.stat-c-red:active    { background: rgba(192, 57, 43,0.14); }
.stat-finance { align-items: flex-start; text-align: left; padding: 10px; gap: 2px; }
.stat-val { font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 1.1em; color: var(--text); line-height: 1.2; }
.stat-label { font-size: 9px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.3px; font-weight: 700; margin-top: 2px; }

/* Filter Bar - Perfect alignment with stats */
.filters {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-bottom: 8px;
}

/* Sex-filter chips — vlastní scrollovatelný řádek vně gridu */
.dog-sex-tabs-row {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding: 4px 0 6px;
    margin-bottom: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.dog-sex-tabs-row::-webkit-scrollbar { display: none; }

.filter-btn {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 5px;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    font-size: 9px;
    font-weight: 600;
    color: var(--text);
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    box-sizing: border-box;
    display: block;
}

.filter-btn:hover {
    background: var(--surface2);
    border-color: var(--accent);
}

.filter-btn:active {
    transform: scale(0.98);
}

.filter-btn:focus {
    outline: none;
    border-color: #7a5c3a;
    color: #7a5c3a;
}
.filter-btn.active-filter {
    border-color: #7a5c3a;
    color: #7a5c3a;
    background: #f5ebe0;
}


.filter-option {
    width: 100%;
    padding: 10px 12px;
    border: none;
    background: var(--bg);
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    margin-bottom: 6px;
    transition: all 0.2s ease;
}

.filter-option:last-child {
    margin-bottom: 0;
}

.filter-option:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.filter-option:active {
    transform: scale(0.98);
}

/* Paywall Styles */
#paywall-overlay .modal {
    border: 2px solid var(--accent);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

#paywall-overlay ul li {
    font-size: 14px;
    color: var(--text2);
}

.lang-select {
    min-width: 200px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 14px;
    cursor: pointer;
}
.section { display: none; } .section.active { display: block; }
.dog-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 16px; overflow: hidden; position: relative; transition: transform 0.1s ease, opacity 0.1s ease; cursor: pointer; transform: translateZ(0); will-change: transform; contain: layout style; }
.dog-card:active { transform: scale(0.97); opacity: 0.8; }
/* ZvĂ˝raznÄnĂ­ chovnĂ˝ch psĹŻ a fen */
.dog-card.breeding-male {
    border: 2px solid var(--stat-blue);
    box-shadow: 0 0 0 2px rgba(144, 184, 216, 0.2), 0 4px 12px rgba(0,0,0,0.1);
}
.dog-card.breeding-male .dog-header {
    background: linear-gradient(135deg, var(--surface) 0%, var(--boy) 100%);
}
.dog-card.breeding-female {
    border: 2px solid var(--girl-text);
    box-shadow: 0 0 0 2px rgba(232, 160, 184, 0.2), 0 4px 12px rgba(0,0,0,0.1);
}
.dog-card.breeding-female .dog-header {
    background: linear-gradient(135deg, var(--surface) 0%, var(--girl) 100%);
}
.dog-card.breeding-puppy {
    border: 2px solid var(--stat-gold);
    box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.15), 0 4px 12px rgba(0,0,0,0.1);
}
.dog-card.breeding-puppy .dog-header {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface2) 100%);
}
.dog-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dog-header.male { background: var(--boy); }
.dog-header.female { background: var(--girl); }
/* JemnĂŠ odliĹĄenĂ­ dospÄlĂ˝ / ĹĄtÄnÄ bez "pilulek" */
.pup-row { padding-left: 16px; }
.pup-row .avatar-col { width: 46px; }
.pup-row .sq-avatar { width: 40px; height: 40px; border-radius: 12px; }
.pup-row { border-left: none; }
.repro-info {
    background: var(--accent-light);
    padding: 12px 20px;
    min-height: 50px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-wrap: wrap;
    gap: 4px 0;
    line-height: 1.6;
}

/* Automatické zmenšení textu pro dlouhé texty */
@media (max-width: 768px) {
    .repro-info {
        font-size: 12px;
        padding: 10px 16px;
    }
}

@media (max-width: 480px) {
    .repro-info {
        font-size: 11px;
        padding: 10px 12px;
    }
}
.avatar-col { width: 50px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-right: 12px; }
.sq-avatar { width: 45px; height: 45px; border-radius: 12px; background: var(--surface2); border: 1.5px solid var(--border2); display: flex; align-items: center; justify-content: center; font-size: 22px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05); position: relative; }
.sq-avatar img { width: 100%; height: 100%; object-fit: cover; transform: translateZ(0); backface-visibility: hidden; }
.attachments-count { position: absolute; bottom: -2px; right: -2px; background: var(--accent); color: white; font-size: 9px; padding: 2px 4px; border-radius: 8px; font-weight: bold; }
.pup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.pup-row.male {
    background: var(--boy);
    border-bottom-color: rgba(46,90,136,0.18);
}
.pup-row.female {
    background: var(--girl);
    border-bottom-color: rgba(166,77,121,0.16);
}
.pup-status { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 10px; font-weight: bold; margin-left: 8px; }
.status-free { background: var(--status-free); color: white; }
.status-reserved { background: var(--status-reserved); color: white; }
.status-sold { background: var(--status-sold); color: white; }
.drag-handle-col { width: 44px; color: var(--text3); cursor: grab; flex-shrink: 0; touch-action: none; user-select: none; font-size: 24px; text-align: center; padding: 8px 0; }
.sex-badge { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; font-weight: bold; color: white; margin-left: 5px; vertical-align: middle; }
.sex-badge.m { background: var(--tab-male-active); }
.sex-badge.f { background: var(--tab-female-active); }
.price-container {
    text-align: right;
    width: 120px;
    flex-shrink: 0;
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
}
.price-paid-full { font-size: 11px; font-weight: 700; color: var(--accent); margin-top: 2px; }
.progress-bar-bg { width: 100%; height: 5px; background: var(--border2); border-radius: 3px; margin: 5px 0 0 0; overflow: hidden; }
.price-container .pup-status { display: block; margin-left: 0; text-align: right; }
.progress-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }
.quick-attachments { display: flex; flex-direction: row; flex-wrap: wrap; gap: 10px; margin-top: 10px; align-items: flex-start; }
.att-group { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; width: 55px; }
.att-name { font-size: 9px; color: var(--text2); font-weight: 600; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1; }
.mini-photo-link { 
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px; 
    height: 34px; 
    border-radius: 50%; 
    border: 2px solid #fff; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 0 0 1px var(--border); 
    overflow: hidden; 
    cursor: pointer; 
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}
.mini-photo-link .ei,
.mini-doc-link .ei {
    display: block;
    font-size: 16px;
    line-height: 1;
    transform: translateY(1px);
    -webkit-transform: translateY(1px);
}
.mini-photo-link .ei {
    transform: translateY(-1px);
    -webkit-transform: translateY(-1px);
}
.mini-doc-link .ei {
    transform: translateY(1px) translateX(1px);
    -webkit-transform: translateY(1px) translateX(1px);
}
.mini-photo-link:hover { 
    transform: scale(1.08); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.18), 0 0 0 2px var(--accent); 
}
.mini-photo-link img { width: 100%; height: 100%; object-fit: cover; }
.mini-doc-link { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    width: 34px; 
    height: 34px; 
    background: linear-gradient(135deg, #ffffff 0%, #f8f8f8 100%); 
    border-radius: 50%; 
    border: 2px solid #fff; 
    cursor: pointer; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.12), 0 0 0 1px var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mini-doc-link:hover { 
    transform: scale(1.08); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.18), 0 0 0 2px var(--accent); 
}
.btn { padding: 6px 12px; font-size: 13px; font-weight: 500; border: 1px solid var(--border2); border-radius: 8px; cursor: pointer; background: var(--surface); transition: transform 0.1s ease, opacity 0.1s ease; }
.btn:active { transform: scale(0.97); opacity: 0.8; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Validace formulářů — povinná pole */
.field-error {
    border-color: #e53935 !important;
    box-shadow: 0 0 0 2px rgba(229,57,53,0.25) !important;
    animation: fieldShake 0.35s ease;
}
@keyframes fieldShake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(3px); }
}
.field-required-label::after {
    content: " *";
    color: #e53935;
    font-weight: 700;
}
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200; align-items: center; justify-content: center; touch-action: none; overflow: hidden;
    /* Safe area na všech stranách — Dynamic Island, notch, home indicator */
    padding-top: max(10px, env(safe-area-inset-top, 10px));
    padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
    padding-left: max(10px, env(safe-area-inset-left, 10px));
    padding-right: max(10px, env(safe-area-inset-right, 10px));
}
/* Date picker musí být nad dynamickými modály (z-index 2000–3000) */
#datepicker-overlay { z-index: 100000; }

.overlay.open { display: flex; animation: fadeIn 0.2s ease-out; padding-bottom: max(10px, calc(env(safe-area-inset-bottom, 10px) + var(--keyboard-height, 0px) + 10px)); transition: padding-bottom 0.25s ease; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   MODAL - Jednoduchý design od nuly
   ======================================== */
.modal {
    position: relative;
    background: var(--surface);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.2s ease-out;
    will-change: opacity;
    backface-visibility: hidden;
    touch-action: pan-y;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 28px;
    cursor: pointer;
    color: var(--text2);
    background: none;
    border: none;
    line-height: 1;
    padding: 4px;
}

/* Sticky-footer modals — header scrolls, buttons stay fixed at bottom */
.modal.modal-sticky {
    padding: 0;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}
.modal-sticky .modal-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding: 20px;
}
/* Pojistka: obrázky v modalu nesmí přetékat do stran (jen vertikální scroll) */
.modal img, .modal-body img { max-width: 100%; height: auto; }
.modal-sticky .modal-footer {
    flex-shrink: 0;
    padding: 12px 20px;
    border-top: 1px solid var(--border);
    background: var(--surface);
    border-radius: 0 0 16px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========================================
   FIELD - Jednoduchý design: label nad inputem
   ======================================== */
.field {
    margin-bottom: 12px;
    width: 100%;
}

.field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Odsazení nadpisů sekcí (Zkoušky, Lov, Zdraví, …) od levého okraje */
.field:has(> .attachments-list) > label {
    padding: 8px 16px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border2);
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    box-sizing: border-box;
    font-family: 'DM Sans', sans-serif;
}

.field textarea {
    min-height: 70px;
    resize: vertical;
}

.attach-box { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 15px 0; }
.attachments-list { border: 1px solid var(--border); border-radius: 8px; background: var(--bg); margin-top: 10px; }
.attachment-item { display: flex; align-items: center; justify-content: space-between; padding: 8px; border-bottom: 1px solid var(--border); }

/* ========================================
   iOS TAB BAR - Spodní navigace
   ======================================== */
.ios-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    height: calc(70px + env(safe-area-inset-bottom, 0px));
    background: var(--bg);
    border-top: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 8px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: calc(10px + env(safe-area-inset-left, 0px));
    padding-right: calc(10px + env(safe-area-inset-right, 0px));
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.tab-item {
    flex: 1;
    min-width: 0;
    max-width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.15s ease, transform 0.2s ease, filter 0.2s ease;
    opacity: 0.65;
}

.tab-item.active {
    opacity: 1;
}

.tab-item:active {
    transform: scale(0.88);
    opacity: 0.7;
}

/* Aktivní ikona — scale + stín */
.tab-item.active .tab-icon {
    transform: scale(1.22);
    filter: drop-shadow(0 3px 8px rgba(0,0,0,0.4)) brightness(0.85);
}

.tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 11px;
    overflow: visible;
    transition: transform 0.15s ease;
}

.tab-icon svg {
    display: block;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 11px;
    overflow: hidden;
}

/* tab-label odstraněn — text je uvnitř SVG */
.tab-label { display: none; }


#viewer-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.95); z-index: 5000; backdrop-filter: blur(8px); align-items: center; justify-content: center; flex-direction: column; touch-action: none; overflow: hidden; }
#viewer-overlay.open { display: flex; }
#viewer-content { position: relative; width: 100vw; height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; padding: 60px 0 40px; box-sizing: border-box; }
#viewer-img-wrap { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#viewer-img-wrap.grabbing { cursor: grabbing; }
#viewer-img-wrap img { max-width: 95vw; max-height: calc(100vh - 110px); border-radius: 8px; box-shadow: 0 0 30px rgba(0,0,0,0.5); border: 2px solid rgba(255,255,255,0.3); transform-origin: center center; user-select: none; -webkit-user-select: none; pointer-events: none; }
#viewer-content iframe { width: 95vw; height: 90vh; border: none; background: white; border-radius: 8px; }
.viewer-close-btn { position: fixed; top: max(env(safe-area-inset-top, 10px), 10px); right: 15px; background: rgba(180,0,0,0.85); color: white; border: none; padding: 12px 22px; border-radius: 10px; cursor: pointer; font-weight: bold; font-family: 'DM Sans', sans-serif; z-index: 5010; box-shadow: 0 4px 10px rgba(0,0,0,0.4); font-size: 15px; min-height: 48px; min-width: 120px; display: flex; align-items: center; justify-content: center; }
.viewer-share-btn { position: fixed; top: max(env(safe-area-inset-top, 10px), 10px); left: 15px; background: rgba(74, 168, 216, 0.90); color: white; border: none; padding: 12px 22px; border-radius: 10px; cursor: pointer; font-weight: bold; font-family: 'DM Sans', sans-serif; z-index: 5010; box-shadow: 0 4px 10px rgba(0,0,0,0.4); font-size: 15px; min-height: 48px; min-width: 120px; display: flex; align-items: center; justify-content: center; }
#export-preview { line-height: 1.5; color: #000; background: #fff; padding: 40px; border: 1px solid #ddd; }
.preview-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--accent); padding-bottom: 15px; margin-bottom: 20px; }
.preview-section { margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 10px; }
.preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.share-card { max-width: 500px; margin: 0 auto; }
.share-buttons { display: flex; gap: 10px; margin: 20px 0; justify-content: center; flex-wrap: wrap; }
@media print {
    body * { visibility: hidden; }
    #export-preview, #export-preview * { visibility: visible; }
    #export-preview { position: fixed; left: 0; top: 0; width: 100%; border: none; padding: 0; }
    .no-print { display: none !important; }
}
#crop-overlay { z-index: 3000; background: rgba(0,0,0,0.9); }
.crop-box { background: var(--surface); padding: 20px; border-radius: 20px; width: 320px; text-align: center; }
.crop-canvas-wrap { position: relative; width: 280px; height: 280px; margin: 10px auto; background: #000; border-radius: 12px; overflow: hidden; cursor: move; touch-action: none; border: 2px solid var(--accent); }
#crop-canvas { position: absolute; top: 0; left: 0; }
#repro-fields { background: transparent; border-radius: 8px; padding: 0; margin-bottom: 12px; }
#d-img-preview, #p-img-preview {
    width: 70px !important;
    height: 70px !important;
}
input[type="date"], input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    padding: 10px;
    text-align: left;
    font-size: 14px;
}

/* Date Picker */
.dp-wrap {
    position: relative;
    height: 176px;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid var(--border2);
    background: var(--bg);
}
/* Horni a dolni fade efekt */
.dp-wrap::before, .dp-wrap::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 55px;
    z-index: 2;
    pointer-events: none;
}
.dp-wrap::before { top: 0; background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%); }
.dp-wrap::after  { bottom: 0; background: linear-gradient(to top, var(--bg) 0%, transparent 100%); }
/* Zvyrazneni vybrane polozky */
.dp-selector {
    position: absolute;
    top: 50%;
    left: 4px; right: 4px;
    height: 40px;
    margin-top: -20px;
    background: rgba(74, 168, 216, 0.08);
    border: 1px solid var(--border);
    border-radius: 8px;
    z-index: 1;
    pointer-events: none;
}
.dp-scroll {
    height: 176px;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 0;
}
.dp-scroll::-webkit-scrollbar { display: none; }
.dp-spacer { height: 68px; flex-shrink: 0; }
.dp-item {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--text2);
    scroll-snap-align: center;
    cursor: pointer;
    transition: color 0.15s, font-size 0.15s;
    padding: 0 4px;
}
.dp-item.selected {
    color: var(--accent);
    font-weight: 700;
    font-size: 17px;
    background: var(--accent-light);
    border-radius: 8px;
}

/* Věk štěněte na jednom řádku */
.pup-age {
    white-space: nowrap;
}

/* Legal links hover effect */
#tab-nastaveni a:hover {
    color: var(--accent);
}

/* ==================== NOTES ==================== */
/* ==================== LITTER CARDS ==================== */
.litter-card {
    border: 2px solid #e8a0b8;
    box-shadow: 0 0 0 2px rgba(232, 160, 184, 0.15), 0 4px 12px rgba(0,0,0,0.08);
    border-radius: var(--radius-lg);
}

/* ==================== FINANCE CARDS ==================== */
.finance-item {
    border: 2px solid #4aa8d8;
    box-shadow: 0 0 0 2px rgba(74, 168, 216, 0.15), 0 4px 12px rgba(0,0,0,0.06);
    border-radius: var(--radius);
}

/* ==================== NOTES ==================== */
.note-item {
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 10px;
    background: var(--bg);
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.2s ease;
}
.note-item:active {
    transform: scale(0.98);
}
.note-item:hover {
    border-color: var(--accent);
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 400px;
    pointer-events: all;
    animation: toastSlideIn 0.3s ease-out;
    border-left: 4px solid var(--accent);
}

.toast.success {
    border-left-color: #4caf50;
}

.toast.error {
    border-left-color: #f44336;
}

.toast.warning {
    border-left-color: #ff9800;
}

.toast.info {
    border-left-color: #2196f3;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text);
}

.toast-message {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text3);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--surface);
}

@keyframes toastSlideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes toastSlideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast.removing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

/* Undo toast */
.toast.undo {
    border-left-color: #9c27b0;
    flex-wrap: wrap;
    padding-bottom: 10px;
}
.toast-undo-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 5px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.15s;
}
.toast-undo-btn:active { opacity: 0.75; }
.toast-progress {
    width: 100%;
    height: 3px;
    background: var(--surface2);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.toast-progress-bar {
    height: 100%;
    width: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: none;
}

@media (max-width: 768px) {
    .toast-container {
        top: auto;
        bottom: 80px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* ==================== SKELETON LOADING ==================== */
@keyframes skeleton-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--surface2) 25%, var(--border) 50%, var(--surface2) 75%);
    background-size: 800px 100%;
    animation: skeleton-shimmer 1.4s infinite linear;
    border-radius: 6px;
}
.skeleton-card {
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-bottom: 12px;
    overflow: hidden;
}
.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.skeleton-avatar {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
}
.skeleton-line {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 6px;
}
.skeleton-line.short { width: 40%; }
.skeleton-line.medium { width: 65%; }
.skeleton-line.long { width: 85%; }
.skeleton-line.full { width: 100%; }
.skeleton-badge {
    width: 60px;
    height: 20px;
    border-radius: 999px;
}

/* ==================== EMPTY STATES ==================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 56px 24px 40px;
    color: var(--text2);
}
.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    line-height: 1;
    filter: grayscale(0.2);
}
.empty-state-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.3;
}
.empty-state-text {
    font-size: 14px;
    color: var(--text2);
    margin-bottom: 24px;
    max-width: 280px;
    line-height: 1.5;
}
.empty-state-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
    text-align: left;
    width: 100%;
    max-width: 260px;
}
.empty-state-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text2);
}
.empty-state-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ==================== ONBOARDING 2.0 ==================== */
.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}
.onboarding-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border2);
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.onboarding-dot.active {
    background: var(--accent);
    width: 24px;
    border-radius: 4px;
}
@keyframes onboardFadeIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}
.onboarding-step {
    animation: onboardFadeIn 0.25s ease;
}
.onboarding-feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 14px 0;
}
.onboarding-feature-item {
    background: var(--surface2);
    border-radius: 12px;
    padding: 12px 8px;
    text-align: center;
    font-size: 12px;
    color: var(--text2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.onboarding-feature-icon {
    font-size: 26px;
    margin-bottom: 2px;
}
.onboarding-notif-demo {
    background: var(--surface);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 14px 0;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.onboarding-wow-box {
    background: var(--accent-light);
    border: 1px solid var(--accent);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 14px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

/* ==================== FINANCE PERIOD TOGGLE ==================== */
.finance-period-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.finance-period-btn {
    flex: 1;
    padding: 10px 5px;
    font-size: 9px;
    font-weight: 600;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.finance-period-btn:active { transform: scale(0.98); }
.finance-period-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ==================== ADDED DATE BADGE ==================== */
.dog-added-date {
    font-size: 10px;
    color: var(--text3);
    margin-top: 2px;
    font-weight: 400;
}

/* Currency dropdown */
.cur-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
}
.cur-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s;
}
.cur-dropdown-btn:active { border-color: var(--accent); }
.cur-dropdown-arrow {
    font-size: 12px;
    color: var(--text2);
    transition: transform 0.2s;
}
.cur-dropdown.open .cur-dropdown-arrow { transform: rotate(180deg); }
.cur-dropdown-list {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 120px;
    background: var(--surface);
    border: 2px solid var(--accent);
    border-radius: 10px;
    overflow: hidden;
    z-index: 200;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.cur-dropdown.open .cur-dropdown-list { display: block; }
.cur-dropdown-list button {
    display: block;
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.cur-dropdown-list button:last-child { border-bottom: none; }
.cur-dropdown-list button:active { background: var(--accent-light); }
.cur-dropdown-list button.active {
    color: var(--accent);
    font-weight: 700;
    background: var(--accent-light);
}

/* Close button — blue variant */
.btn-close {
    background: #dbeafe;
    color: #185FA5;
    border-color: #93c5fd;
}
.btn-close:active {
    background: #bfdbfe;
}

/* Danger button — red, for delete actions */
.btn-danger {
    background: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}
.btn-danger:active {
    background: #fecaca;
}

/* Purchase agreement button — amber/yellow */
.btn-pa {
    background: #fef3c7;
    color: #854F0B;
    border-color: #fcd34d;
}
.btn-pa:active {
    background: #fde68a;
}

/* Reservation agreement button — blue */
.btn-ra {
    background: #dbeafe;
    color: #1e40af;
    border-color: #93c5fd;
}
.btn-ra:active {
    background: #bfdbfe;
}

/* ─── BreedTrack License System ───────────────────────── */
.bt-trial-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99999;
  background: #2d6e4e;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 16px;
  letter-spacing: 0.01em;
}
.bt-paywall {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.bt-paywall-card {
  background: var(--surface, #fff);
  border-radius: 24px;
  padding: 32px 28px 28px;
  max-width: 380px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25);
}
.bt-paywall-icon {
  font-size: 48px;
  line-height: 1;
}
.bt-paywall-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text, #0D1F15);
  text-align: center;
}
.bt-paywall-sub {
  font-size: 14px;
  color: var(--text-muted, #7A9080);
  text-align: center;
  line-height: 1.5;
}
.bt-key-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border, #e2ddd4);
  border-radius: 12px;
  font-size: 15px;
  font-family: monospace;
  text-align: center;
  letter-spacing: 0.08em;
  background: var(--bg, #f5f0e8);
  color: var(--text, #0D1F15);
  outline: none;
  margin-top: 4px;
}
.bt-key-input:focus {
  border-color: #4aa8d8;
}
.bt-key-error {
  font-size: 13px;
  color: #c0392b;
  text-align: center;
  line-height: 1.4;
}
.bt-activate-btn {
  width: 100%;
  padding: 14px;
  background: #2d6e4e;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.bt-activate-btn:hover { background: #1a5a3a; }
.bt-activate-btn:disabled { background: #7abcd4; cursor: default; }
.bt-buy-link {
  font-size: 14px;
  color: #4aa8d8;
  text-decoration: none;
  font-weight: 500;
}
.bt-buy-link:hover { text-decoration: underline; }
.bt-paywall-contact {
  font-size: 12px;
  color: var(--text-muted, #7A9080);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}
.bt-paywall-contact a {
  color: #4aa8d8;
  text-decoration: none;
}

/* Velikost písma — in-app nastavení */
html.font-small  { zoom: 0.88; }
html.font-large  { zoom: 1.18; }

/* Při velkém písmu (zoom 1.18) modal přeroste viewport — kompenzace:
   72vh × 1.18 ≈ 85vh efektivní výška, modal se vejde na obrazovku */
html.font-large .modal {
    max-height: 72vh;
}
/* Footer tlačítka zmenšit aby se nezalamovala na druhý řádek */
html.font-large .modal-sticky .modal-footer {
    padding: 8px 16px;
    gap: 6px;
}
html.font-large .modal-sticky .modal-footer .btn {
    font-size: 11px;
    padding: 5px 8px;
}



/* ==== Backup karty — chipy (varianta C) ==== */
.bk-chip {
    padding: 5px 11px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-radius: 999px;
    border: 1.5px solid var(--border2);
    background: var(--surface);
    font-size: 11px;
    color: var(--text2);
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
}
.bk-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 500; }
