/*
 * ZISKOVNA — etapa 70: sjednocující vrstva designového systému.
 * Načítá se globálně po existujících stylech; starší selektory zůstávají
 * kvůli zpětné kompatibilitě, toto jsou společná finální pravidla.
 */
:root {
  --zk-ui-bg: var(--zk-color-surface, #fff);
  --zk-ui-bg-soft: var(--zk-color-surface-soft, #f6f9fd);
  --zk-ui-text: var(--zk-color-ink, #111d38);
  --zk-ui-muted: var(--zk-color-muted, #61708b);
  --zk-ui-border: var(--zk-color-border, #e3e9f2);
  --zk-ui-radius: var(--zk-radius-md, 10px);
  --zk-ui-shadow: var(--zk-shadow-sm, 0 2px 8px rgba(24,47,83,.045));
  --zk-ui-space: 1rem;
}

/* Prevent child components and AJAX fragments from forcing page overflow. */
:where(.site, .site-main, main, .content-page--marketplace, .marketplace-container,
  .zk-account, .zk-dashboard, .zk-messages, .zk-message-thread, .zk-product-detail,
  .zk-listing-form, .zk-demand-form, .zk-account-panel, .zk-account-section) {
  min-width: 0;
}
:where(.zk-account, .zk-dashboard, .zk-messages, .zk-product-detail, .zk-demand,
  .zk-product-card, .zk-account-card, .zk-account-panel, .zk-account-section,
  .zk-message-thread, .zk-message-open, .zk-seller-card, .zk-demand-card) {
  color: var(--zk-ui-text);
}
:where(.zk-account, .zk-dashboard, .zk-messages, .zk-product-detail, .zk-demand,
  .zk-message-thread, .zk-message-open, .zk-account-panel, .zk-account-section,
  .zk-account-card, .zk-seller-card, .zk-demand-card) :where(p, li, td, th, label, small) {
  overflow-wrap: anywhere;
}

/* Unified fields, including plugin forms and forms rendered after AJAX. */
:where(.content-page--marketplace, .zk-account, .zk-dashboard, .zk-messages,
  .zk-listing-form, .zk-product-form, .zk-new-product-form, .zk-submission-form,
  .zk-demand-form, .zk-auth-card, .zk-account-form, .zk-message-form)
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  select, textarea) {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 44px;
  padding: .65rem .8rem;
  color: var(--zk-ui-text);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: var(--zk-ui-radius);
  font: inherit;
  line-height: 1.45;
}
:where(.content-page--marketplace, .zk-account, .zk-dashboard, .zk-messages,
  .zk-listing-form, .zk-product-form, .zk-new-product-form, .zk-submission-form,
  .zk-demand-form, .zk-auth-card, .zk-account-form, .zk-message-form)
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  select, textarea):focus-visible {
  outline: 3px solid rgba(18, 97, 245, .22);
  outline-offset: 1px;
  border-color: var(--zk-color-primary, #1261f5);
}
:where(.content-page--marketplace, .zk-account, .zk-dashboard, .zk-messages)
:where(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--zk-color-primary, #1261f5);
}
:where(.content-page--marketplace, .zk-account, .zk-dashboard, .zk-messages)
:where(label) { color: var(--zk-ui-text); font-weight: 650; }
:where(.content-page--marketplace, .zk-account, .zk-dashboard, .zk-messages)
:where(button, input[type="submit"], .button, .button-primary, .button-outline, .button-small) {
  min-height: 42px;
  max-width: 100%;
  border-radius: var(--zk-ui-radius);
  font: inherit;
  font-weight: 700;
  line-height: 1.25;
}
:where(.content-page--marketplace, .zk-account, .zk-dashboard, .zk-messages)
:where(button, input[type="submit"], .button, .button-primary, .button-outline, .button-small):focus-visible {
  outline: 3px solid rgba(18, 97, 245, .3);
  outline-offset: 2px;
}
:where(button, input[type="submit"], .button, .button-primary, .button-outline, .button-small)[disabled],
:where(button, input[type="submit"], .button, .button-primary, .button-outline, .button-small)[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .6;
  transform: none;
}

/* One visual language for cards and listing panels. */
:where(.zk-product-card, .zk-home-listing, .listing-card.zk-product-card,
  .zk-account-card, .zk-account-panel, .zk-account-section, .zk-account-stat,
  .zk-seller-card, .zk-demand-card, .zk-message-thread, .zk-message-open,
  .zk-review-card, .zk-moderation-card, .zk-auction-card) {
  border: 1px solid var(--zk-ui-border);
  border-radius: var(--zk-radius-lg, 14px);
  background: var(--zk-ui-bg);
  box-shadow: var(--zk-ui-shadow);
}
:where(.zk-product-card, .zk-home-listing, .listing-card.zk-product-card) {
  min-width: 0;
}
:where(.zk-product-card, .zk-home-listing, .listing-card.zk-product-card) :where(h2, h3, .price, .amount) {
  overflow-wrap: anywhere;
}
:where(.zk-product-grid, .zk-listings-grid, .zk-home-listings, .zk-demand-grid) > * {
  min-width: 0;
}

/* Tables stay readable; narrow screens may scroll the table, not the page. */
:where(.zk-account, .zk-dashboard, .zk-messages, .content-page--marketplace) table {
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--zk-ui-text);
  background: #fff;
}
:where(.zk-account, .zk-dashboard, .zk-messages, .content-page--marketplace) :where(th, td) {
  padding: .75rem .85rem;
  border-bottom: 1px solid var(--zk-ui-border);
  text-align: start;
  vertical-align: middle;
}
:where(.zk-account, .zk-dashboard, .zk-messages, .content-page--marketplace) th {
  color: #26344b;
  background: var(--zk-ui-bg-soft);
  font-weight: 750;
}
:where(.zk-account, .zk-dashboard, .zk-messages, .content-page--marketplace) :where(.table-responsive, .table-wrap, .wp-block-table) {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

/* Consistent feedback states, including common WordPress/plugin notices. */
:where(.zk-notice, .zk-alert, .notice-inline, .woocommerce-message,
  .woocommerce-error, .woocommerce-info, .wpforms-confirmation-container-full) {
  padding: .85rem 1rem;
  border: 1px solid var(--zk-ui-border);
  border-inline-start: 4px solid #64748b;
  border-radius: var(--zk-ui-radius);
  color: var(--zk-ui-text);
  background: var(--zk-ui-bg-soft);
  line-height: 1.55;
}
:where(.zk-notice--success, .zk-alert-success, .zk-success, .notice-success) {
  border-inline-start-color: #16845a;
  background: #eaf8f0;
  color: #145c40;
}
:where(.zk-notice--warning, .zk-alert-warning, .zk-warning, .notice-warning) {
  border-inline-start-color: #946200;
  background: #fff7df;
  color: #664600;
}
:where(.zk-notice--error, .zk-alert-error, .zk-error, .notice-error, .woocommerce-error) {
  border-inline-start-color: #b42332;
  background: #fff0f1;
  color: #8a1c28;
}
:where(.zk-empty-state, .zk-empty, .no-results, .zk-no-results) {
  display: grid;
  justify-items: center;
  gap: .5rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  border: 1px dashed #cbd5e1;
  border-radius: var(--zk-radius-lg, 14px);
  background: var(--zk-ui-bg-soft);
  color: var(--zk-ui-muted);
  text-align: center;
}
:where(.zk-empty-state, .zk-empty, .no-results, .zk-no-results) :where(h2, h3, p) { margin-block: 0; }
:where(.zk-empty-state, .zk-empty, .no-results, .zk-no-results) :where(a, .button) { margin-top: .5rem; }

/* AJAX-updated fragments inherit the same surfaces and spacing as initial HTML. */
:where([data-zk-ajax], .zk-ajax-results, .zk-search-results, .zk-filter-results,
  .zk-favorites-results, .zk-demand-results, .zk-message-results, .zk-pagination-fragment) {
  min-width: 0;
}
:where(.zk-ajax-results, .zk-search-results, .zk-filter-results,
  .zk-favorites-results, .zk-demand-results) :where(.zk-product-card, .zk-empty-state, .zk-notice) {
  box-sizing: border-box;
}
:where(.zk-loading, [aria-busy="true"]) { cursor: progress; }
:where(.zk-ajax-error, .zk-form-error, [role="alert"]) { overflow-wrap: anywhere; }

/* Avoid awkward long strings and ensure visible keyboard focus. */
:where(.zk-account, .zk-dashboard, .zk-messages, .zk-product-detail, .zk-product-card)
:where(a, button, input, select, textarea) { scroll-margin-block: 1rem; }
:where(a, button, input, select, textarea, summary):focus-visible {
  outline-color: var(--zk-color-primary, #1261f5);
}
@media (prefers-reduced-motion: reduce) {
  :where(.zk-product-card, .zk-home-listing, .button, button, a) {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
@media (max-width: 700px) {
  :where(.zk-account, .zk-dashboard, .zk-messages, .content-page--marketplace) :where(table) {
    font-size: .9rem;
  }
  :where(.zk-account, .zk-dashboard, .zk-messages, .content-page--marketplace) :where(th, td) {
    padding: .65rem;
  }
  :where(.zk-account, .zk-dashboard, .zk-messages) :where(.button, .button-primary, .button-outline, button, input[type="submit"]) {
    min-height: 44px;
  }
}

/* Etapa 71: sjednocený seznam oznámení */
.zk-notifications{width:100%;min-width:0}
.zk-notifications__header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:1rem}
.zk-notifications__count{font-size:.875rem;color:var(--zk-muted,#626b75)}
.zk-notifications__list{list-style:none;margin:0;padding:0;display:grid;gap:.75rem}
.zk-notification{display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;padding:1rem;border:1px solid var(--zk-border,#dfe3e8);border-radius:var(--zk-radius-md,12px);background:var(--zk-surface,#fff);min-width:0}
.zk-notification.is-unread{border-inline-start:4px solid var(--zk-accent,#ff6b00);background:var(--zk-surface-soft,#fffaf5)}
.zk-notification__content{min-width:0;overflow-wrap:anywhere}
.zk-notification__content p{margin:.35rem 0}
.zk-notification__content time{display:block;color:var(--zk-muted,#626b75);font-size:.8125rem;margin-top:.5rem}
.zk-notification__actions{display:flex;gap:.5rem;flex-wrap:wrap;align-items:center}
.zk-notification__actions form{margin:0}
.zk-notifications__empty{padding:1.25rem;border:1px dashed var(--zk-border,#dfe3e8);border-radius:12px;color:var(--zk-muted,#626b75)}
@media(max-width:640px){.zk-notification{display:block}.zk-notification__actions{margin-top:.75rem}.zk-notification__actions .button,.zk-notification__actions form,.zk-notification__actions form button{max-width:100%;width:100%}}
