/* ==========================================================================
   gtools.cz - Unified Design System (Derived from pptx.html / Gordic Navy)
   ========================================================================== */

:root {
  /* GORDIC / PPTX Theme Colors */
  --g-blue: #00376e;
  --g-blue-600: #002b57;
  --g-blue-50: rgba(0, 55, 110, 0.06);
  --g-blue-100: rgba(0, 55, 110, 0.12);
  --g-blue-200: rgba(0, 55, 110, 0.22);
  --g-red: #d2201e;
  --g-red-600: #b01917;
  --g-gray: #b9c3d2;
  --g-text: #222222;

  /* UI Tokens */
  --ui-bg: #eef1f6;
  --ui-panel: rgba(255, 255, 255, 0.88);
  --ui-solid: #ffffff;
  --ui-border: rgba(15, 30, 60, 0.10);
  --ui-border-strong: rgba(15, 30, 60, 0.18);
  --ui-text: #1b2230;
  --ui-muted: #5d6779;
  --ui-hover: rgba(0, 55, 110, 0.07);
  --sel: #1a73e8;
  --guide: #e5398f;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 8px 24px rgba(0, 25, 60, 0.10);
  --shadow-lg: 0 28px 70px rgba(0, 25, 60, 0.18), 0 2px 8px rgba(0, 25, 60, 0.08);
  --sidebar-w: 232px;

  /* Universal Mappings for Tools */
  --accent-blue: var(--g-blue);
  --accent-blue-hover: var(--g-blue-600);
  --accent-blue-active: #001f3f;
  --accent-blue-glow: rgba(0, 55, 110, 0.25);
  --accent: var(--g-blue);
  --accent-hover: var(--g-blue-600);
  --accent-light: var(--g-blue-100);

  --text-main: var(--ui-text);
  --text-secondary: var(--ui-muted);
  --text-muted: #8a94a6;

  --bg-color: var(--ui-bg);
  --surface-color: var(--ui-solid);

  --glass-card: var(--ui-panel);
  --glass-border: var(--ui-border);
  --glass-border-light: var(--ui-border-strong);
  --glass-shadow: var(--shadow-md);

  --danger-color: var(--g-red);
  --danger-hover: var(--g-red-600);
  --warning-color: #f59e0b;
  --success-color: #10b981;

  --console-bg: rgba(255, 255, 255, 0.92);
  --console-text: #00376e;

  /* Fuel Price Indicators */
  --green-cheap: #10b981;
  --green-cheap-bg: rgba(16, 185, 129, 0.12);
  --red-expensive: var(--g-red);
  --red-expensive-bg: rgba(210, 32, 30, 0.12);
  --amber-mid: #f59e0b;
  --amber-mid-bg: rgba(245, 158, 11, 0.12);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Atribut hidden musí skrýt prvek vždy – i když jeho třída nastavuje display (např. .control-row) */
[hidden] {
  display: none !important;
}

html {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--ui-bg);
  color: var(--ui-text);
  margin: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

/* Presentation Editor full-screen layout */
body.pptx-body {
  height: 100%;
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: var(--ui-text);
  background: var(--ui-bg);
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
  padding: 0;
}

.ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

kbd {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--ui-border-strong);
  border-bottom-width: 2px;
  background: #fff;
  color: var(--ui-muted);
}

/* Default centered layout for standalone tool pages */
body:not(.pptx-body):not(.ceny-body):not(.shop-body) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 30px 20px;
  overflow-x: hidden;
  position: relative;
}

/* Full-width dashboard layout for Ceny paliv */
body.ceny-body,
body:has(.ceny-container) {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 24px 20px;
  overflow-x: hidden;
  position: relative;
}

button, input, select, textarea {
  font-family: inherit;
}

/* Background animated canvas */
#bgCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   Navigation & Back Buttons
   ========================================================================== */

/* Floating round back button */
.back-button {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--ui-solid);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid var(--ui-border);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ui-muted);
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  z-index: 20;
}

.back-button:hover {
  transform: scale(1.06);
  color: var(--g-blue);
  background: #ffffff;
  border-color: var(--g-blue);
  box-shadow: var(--shadow-md);
}

.back-button svg {
  width: 20px;
  height: 20px;
}

/* Header link back button */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--g-blue);
  background: var(--ui-solid);
  border: 1px solid var(--ui-border);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 9px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.back-link:hover {
  background: #ffffff;
  border-color: var(--g-blue);
  color: var(--g-blue-600);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Containers & Layouts
   ========================================================================== */

.container {
  width: 100%;
  max-width: 460px;
  background: var(--glass-card);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
}

/* Dual Column Layout for QR Studio */
.container:has(.left-column),
.qr-container {
  max-width: 960px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  padding: 28px;
}

.left-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.right-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

/* App Layout for Video Tools with Side Console */
.app-layout {
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: flex-start;
  justify-content: center;
  max-width: 880px;
  width: 100%;
  position: relative;
  z-index: 10;
}

.app-layout .container {
  width: 430px;
  max-width: 100%;
}

.side-panel {
  display: flex;
  flex-direction: column;
  width: 430px;
  max-width: 100%;
  gap: 14px;
}

/* Privacy document container */
.container:has(.privacy-content),
.privacy-container {
  max-width: 680px;
  padding: 35px 40px;
}

/* Ceny paliv dashboard container */
.container.ceny-container,
.container:has(.content-grid) {
  max-width: 1440px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0 auto;
  gap: 18px;
  flex: 1;
}

/* Title Wrapper & Header for Index / Main Views */
.title-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
  position: relative;
  z-index: 10;
}

.header-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.3px;
  color: var(--g-blue);
  background: var(--ui-solid);
  padding: 8px 24px 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--ui-border);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

/* Značka Gordic (čtverec s červenou tečkou) – hlavička editoru i nadpis rozcestníku */
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fff;
  color: var(--g-blue);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  position: relative;
  flex-shrink: 0;
}

.brand-mark img {
  position: absolute;
  inset: 3px;
  width: 24px;
  height: 24px;
  background: #fff;
}

.brand-mark::after {
  content: '';
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--g-red);
}

.header-title .brand-mark {
  background: var(--g-blue-50);
  border: 1px solid var(--g-blue-100);
}

.footer-link {
  margin-top: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-muted);
  text-decoration: none;
  position: relative;
  z-index: 10;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--g-blue);
  text-decoration: underline;
}

hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ui-border-strong), transparent);
  margin: 0;
}

/* Informační poznámka (např. upozornění k prohlížeči) */
.note-box {
  width: 100%;
  padding: 12px 16px;
  background: var(--g-blue-50);
  border: 1px solid var(--g-blue-100);
  border-left: 3px solid var(--g-blue);
  border-radius: 10px;
  font-size: 11px;
  color: var(--ui-muted);
  line-height: 1.5;
}

.note-box strong {
  color: var(--g-blue);
}

/* Textové tlačítko pro odstranění */
.link-danger {
  background: none;
  border: none;
  padding: 0;
  color: var(--g-red);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.link-danger:hover {
  color: var(--g-red-600);
  text-decoration: underline;
}

/* ==========================================================================
   Drop Zone & File Upload
   ========================================================================== */

.drop-zone {
  position: relative;
  overflow: hidden;
  height: 130px;
  border: 1.5px dashed var(--glass-border-light);
  background: rgba(255, 255, 255, 0.6);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  padding: 0 15px;
  user-select: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-sizing: border-box;
}

.drop-zone:hover {
  background: #ffffff;
  border-color: var(--g-blue);
  box-shadow: var(--shadow-sm);
}

.drop-zone.dragover {
  border-color: var(--g-blue);
  background: var(--g-blue-50);
  box-shadow: 0 0 20px var(--accent-blue-glow);
}

.drop-zone svg,
.drop-zone svg.upload-icon {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  fill: var(--ui-muted);
  transition: transform 0.25s ease, fill 0.25s ease;
  pointer-events: none;
}

.drop-zone:hover svg,
.drop-zone:hover svg.upload-icon {
  transform: translateY(-2px);
  fill: var(--g-blue);
}

.drop-zone.has-file svg {
  fill: var(--success-color);
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.3));
}

.drop-zone.has-file svg.upload-icon {
  display: none;
}

.drop-text {
  position: relative;
  z-index: 2;
  font-size: 14px;
  font-weight: 600;
  color: var(--ui-text);
  letter-spacing: -0.2px;
  pointer-events: none;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#fileInput,
.file-input-hidden {
  display: none !important;
}

#bgPreviews {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.bg-preview-img {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 6px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  opacity: 0.65;
  object-fit: cover;
  transition: all 0.3s ease;
}

#imgPreview {
  position: relative;
  z-index: 2;
  display: none;
  max-height: 70px;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Form Controls, Inputs, Sliders, Selects
   ========================================================================== */

.controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 4px;
}

.control-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.control-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-muted);
}

.control-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--g-blue);
}

/* Range Slider */
input[type="range"] {
  width: 100%;
  margin-top: 6px;
  accent-color: var(--g-blue);
  cursor: pointer;
  height: 5px;
  background: rgba(0, 55, 110, 0.12);
  border-radius: 3px;
  outline: none;
}

/* Number Input */
input[type="number"] {
  width: 70px;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
  background: #ffffff;
  color: var(--ui-text);
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

input[type="number"]:focus {
  border-color: var(--g-blue);
  box-shadow: 0 0 0 2px var(--g-blue-100);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Select & Text Controls */
.select-control,
.text-input-control,
select,
input[type="text"] {
  background: #ffffff;
  color: var(--ui-text);
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  outline: none;
  transition: all 0.15s ease;
  font-family: inherit;
}

.select-control:focus,
.text-input-control:focus,
select:focus,
input[type="text"]:focus {
  border-color: var(--g-blue);
  box-shadow: 0 0 0 3px var(--g-blue-100);
}

/* Segmented Control */
.segmented-control,
.segmented-btn-group {
  display: flex;
  background: rgba(0, 30, 60, 0.05);
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--ui-border);
}

.segmented-btn,
.seg-btn {
  background: transparent;
  border: none;
  color: var(--ui-muted);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
}

.segmented-btn.active,
.seg-btn.active {
  background: #ffffff;
  color: var(--g-blue);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* Checkbox container */
.checkbox-container {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ui-text);
  cursor: pointer;
  user-select: none;
}

.checkbox-container input {
  accent-color: var(--g-blue);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ==========================================================================
   Buttons (Primary, Secondary, Submit, Export)
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--ui-border);
  background: #ffffff;
  color: var(--ui-text);
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--ui-hover);
  border-color: var(--ui-border-strong);
  color: var(--g-blue);
}

.btn-primary {
  background: var(--g-blue);
  color: #ffffff;
  border: 1px solid var(--g-blue-600);
}

.btn-primary:hover {
  background: var(--g-blue-600);
  border-color: #001f3f;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 55, 110, 0.25);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 7px;
}

.btn-toggle {
  background: #ffffff;
}

.btn-toggle.active,
.btn-toggle.active:hover {
  background: var(--g-blue);
  color: #ffffff;
  border-color: var(--g-blue);
}

.btn-submit {
  background: linear-gradient(135deg, var(--g-blue), var(--g-blue-600));
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  height: 42px;
  padding: 0 24px;
  min-width: 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.1px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 55, 110, 0.22), inset 0 1px 1px rgba(255, 255, 255, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  user-select: none;
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 55, 110, 0.32), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  background: linear-gradient(135deg, var(--g-blue-600), #002244);
}

.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.right-column .btn-submit,
.btn-submit.btn-full {
  width: 100%;
}

.export-formats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.btn-export-secondary {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.btn-export-secondary:hover {
  background: var(--ui-hover);
  border-color: var(--g-blue);
  color: var(--g-blue);
}

/* ==========================================================================
   Advanced Accordion Panels
   ========================================================================== */

.advanced-panel {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 4px;
  transition: border-color 0.15s ease;
}

.advanced-panel:hover {
  border-color: var(--ui-border-strong);
  background: #ffffff;
}

.advanced-panel summary {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-text);
  cursor: pointer;
  user-select: none;
  outline: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.advanced-panel summary::-webkit-details-marker {
  display: none;
}

.advanced-panel summary::after {
  content: "+";
  font-size: 16px;
  font-weight: 600;
  color: var(--ui-muted);
  transition: transform 0.2s ease;
}

.advanced-panel[open] summary::after {
  transform: rotate(45deg);
}

.advanced-content {
  padding: 0 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid var(--ui-border);
  padding-top: 14px;
}

/* ==========================================================================
   Status & Progress
   ========================================================================== */

.status-container {
  height: 42px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.status-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--ui-muted);
  text-align: center;
}

.status-text.compressing {
  color: var(--warning-color);
  font-weight: 600;
}

progress {
  width: 100%;
  height: 6px;
  accent-color: var(--g-blue);
  border-radius: 3px;
  overflow: hidden;
}

.status-toast {
  position: fixed;
  bottom: 24px;
  background: var(--ui-solid);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--ui-border-strong);
  color: var(--ui-text);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  z-index: 100;
  display: none;
  animation: toastAnim 0.2s ease-out;
}

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

/* ==========================================================================
   Console Component
   ========================================================================== */

.console-container {
  width: 100%;
  background: var(--console-bg);
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.console-header {
  background: rgba(0, 55, 110, 0.04);
  padding: 8px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--ui-border);
}

.console-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--g-blue);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.console-clear-btn {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  color: var(--ui-muted);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.console-clear-btn:hover {
  color: var(--g-blue);
  border-color: var(--g-blue);
}

.console-log {
  height: 180px;
  padding: 12px;
  font-family: "SF Mono", "Fira Code", Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--g-blue-600);
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  margin: 0;
  line-height: 1.5;
}

.console-log .log-error {
  color: var(--danger-color);
}

.console-log .log-warn {
  color: var(--warning-color);
}

/* ==========================================================================
   Tool Specific: Index Hub (rozcestník)
   ========================================================================== */

.hub {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  z-index: 10;
}

/* Úvodní pás ve stylu hlavičky editoru prezentací */
.hub-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 22px 24px;
  background: var(--g-blue);
  color: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hub-hero::before {
  content: '';
  position: absolute;
  left: 24px;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--g-red);
}

.hub-hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.hub-hero .brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 24px;
}

.hub-hero .brand-mark::after {
  right: 7px;
  bottom: 7px;
  width: 8px;
  height: 8px;
}

.hub-heading {
  min-width: 0;
}

.hub-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.2;
}

.hub-subtitle {
  margin-top: 4px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.75);
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.hub-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--ui-solid);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  color: var(--ui-text);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
}

/* Červený akcent vlevo při najetí */
.hub-tile::before {
  content: '';
  position: absolute;
  left: 0;
  top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--g-red);
  opacity: 0;
  transform: scaleY(0.4);
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hub-tile:hover {
  transform: translateY(-2px);
  border-color: var(--g-blue-200);
  box-shadow: var(--shadow-md);
}

.hub-tile:hover::before {
  opacity: 1;
  transform: scaleY(1);
}

.hub-tile:focus-visible {
  outline: 2px solid var(--g-blue);
  outline-offset: 2px;
}

.hub-tile-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--g-blue-50);
  border: 1px solid var(--g-blue-100);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.hub-tile-icon svg {
  width: 24px;
  height: 24px;
  fill: var(--g-blue);
  transition: fill 0.2s ease;
}

.hub-tile:hover .hub-tile-icon {
  background: var(--g-blue);
  border-color: var(--g-blue);
}

.hub-tile:hover .hub-tile-icon svg {
  fill: #fff;
}

.hub-tile-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.hub-tile-title {
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.2px;
  color: var(--g-blue);
}

.hub-tile-desc {
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ui-muted);
}

.hub-tile-arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: var(--g-blue);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hub-tile:hover .hub-tile-arrow {
  opacity: 1;
  transform: none;
}

.hub-footer {
  display: flex;
  justify-content: center;
}

.hub-footer .footer-link {
  margin-top: 4px;
}

/* Dotykové displeje nemají hover – šipku ukázat trvale */
@media (hover: none) {
  .hub-tile-arrow {
    opacity: 0.5;
    transform: none;
  }
}

@media (max-width: 640px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }

  .hub-hero {
    padding: 18px;
  }

  .hub-title {
    font-size: 20px;
  }
}

/* ==========================================================================
   Tool Specific: Image Resizer & Cropper (Editimage)
   ========================================================================== */

.aspect-lock-btn {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ui-muted);
  transition: all 0.15s ease;
  padding: 0;
}

.aspect-lock-btn:hover {
  background: var(--ui-hover);
  border-color: var(--g-blue);
  color: var(--g-blue);
}

.aspect-lock-btn.active {
  background: var(--g-blue-100);
  color: var(--g-blue);
  border-color: var(--g-blue);
}

#cropPreview {
  width: 100%;
  height: 180px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid var(--ui-border);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.02);
}

.crop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.crop-grid label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ui-muted);
  display: block;
  margin-bottom: 2px;
}

.rotate-buttons {
  display: flex;
  gap: 6px;
}

.rotate-btn {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.rotate-btn:hover {
  background: var(--ui-hover);
  border-color: var(--g-blue);
  color: var(--g-blue);
}

.batch-notice {
  font-size: 11px;
  color: var(--warning-color);
  text-align: center;
  font-weight: 600;
  margin-top: -10px;
  display: none;
}

/* ==========================================================================
   Tool Specific: .ICO Converter (Editico)
   ========================================================================== */

.settings-panel {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sizes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.size-checkbox {
  display: none;
}

.size-lbl {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--ui-muted);
  user-select: none;
}

.size-lbl:hover {
  background: var(--ui-hover);
  color: var(--g-blue);
}

.size-checkbox:checked + .size-lbl {
  background: var(--g-blue);
  color: white;
  border-color: var(--g-blue);
  box-shadow: 0 4px 10px rgba(0, 55, 110, 0.2);
}

.preset-btn {
  background: none;
  border: none;
  color: var(--g-blue);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.2s;
}

.preset-btn:hover {
  opacity: 0.75;
  text-decoration: underline;
}

.presets-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  padding: 8px 12px;
}

.presets-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-text);
}

.preset-toggle-btn {
  background: #ffffff;
  color: var(--ui-muted);
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-toggle-btn:hover:not(:disabled) {
  background: var(--ui-hover);
  color: var(--g-blue);
}

.preset-toggle-btn.active {
  background: var(--g-blue);
  color: white;
  border-color: var(--g-blue);
  box-shadow: 0 4px 10px rgba(0, 55, 110, 0.2);
}

.preset-toggle-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==========================================================================
   Tool Specific: Video Trimmer
   ========================================================================== */

.video-preview-container {
  width: 100%;
  display: none;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  position: relative;
}

#previewVideo {
  width: 100%;
  max-height: 240px;
  display: block;
  object-fit: contain;
}

.trim-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 5px;
}

.range-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.time-displays {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ui-muted);
  font-weight: 600;
  margin-top: -5px;
}

.duration-badge {
  background: var(--g-blue-50);
  color: var(--g-blue);
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 700;
}

/* ==========================================================================
   Tool Specific: QR Code Studio
   ========================================================================== */

.color-tabs-group {
  display: flex;
  gap: 8px;
}

.color-tab-pill {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  color: var(--ui-text);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.color-tab-pill.active {
  background: var(--g-blue-100);
  color: var(--g-blue);
  border-color: var(--g-blue);
}

.color-input-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  padding: 4px 8px;
  border-radius: 8px;
}

.color-input-badge input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  padding: 0;
}

.color-input-badge input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-input-badge input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 5px;
}

.color-hex-text {
  width: 68px;
  border: none;
  background: transparent;
  font-family: monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--ui-text);
  text-transform: uppercase;
}

.logo-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 8px;
  margin-top: 6px;
}

.logo-preset-pill {
  width: 42px;
  height: 42px;
  border: 1px solid var(--ui-border);
  background: var(--ui-solid);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 6px;
}

.logo-preset-pill:hover {
  border-color: var(--g-blue);
  transform: scale(1.05);
  background: #ffffff;
}

.logo-preset-pill.active {
  border-color: var(--g-blue);
  background: var(--g-blue-100);
  box-shadow: 0 0 0 1px var(--g-blue);
}

.logo-preset-pill svg {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.shape-section-heading {
  font-size: 11px;
  font-weight: 700;
  color: var(--ui-muted);
  margin: 6px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.shapes-grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
}

.shape-btn-card {
  width: 48px;
  height: 48px;
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 6px;
}

.shape-btn-card:hover {
  border-color: var(--g-blue);
  background: #ffffff;
  transform: translateY(-1px);
}

.shape-btn-card.active {
  border: 2px solid var(--g-blue);
  background: var(--g-blue-50);
}

.shape-btn-card svg {
  width: 100%;
  height: 100%;
  fill: var(--ui-text);
}

.qr-preview-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid var(--ui-border);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#qrCanvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.quality-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ==========================================================================
   Tool Specific: Privacy Policy
   ========================================================================== */

.privacy-content {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ui-text);
}

.privacy-content h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--g-blue);
  margin: 26px 0 10px 0;
  letter-spacing: -0.2px;
}

.privacy-content h2:first-child {
  margin-top: 0;
}

.privacy-content p {
  margin: 0 0 16px 0;
  color: var(--ui-muted);
}

.privacy-content ul {
  margin: 0 0 24px 0;
  padding-left: 20px;
}

.privacy-content li {
  margin-bottom: 8px;
  color: var(--ui-muted);
}

.privacy-content strong {
  color: var(--ui-text);
  font-weight: 600;
}

.privacy-content a {
  color: var(--g-blue);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}

.privacy-content a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ==========================================================================
   Tool Specific: Fuel Prices (Ceny Paliv - ceny.html)
   ========================================================================== */

header.ceny-header,
.ceny-container header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  flex-wrap: wrap;
  gap: 12px;
}

.header-title-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-title-group h1 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--g-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-subtitle {
  font-size: 0.85rem;
  color: var(--ui-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--green-cheap-bg);
  color: var(--green-cheap);
  padding: 2px 8px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.75rem;
}

.live-dot {
  width: 6px;
  height: 6px;
  background: var(--green-cheap);
  border-radius: 50%;
  box-shadow: 0 0 6px var(--green-cheap);
  animation: pulse-dot 2s infinite;
}

.live-badge.offline {
  background: var(--red-expensive-bg);
  color: var(--red-expensive);
}

.live-badge.offline .live-dot {
  background: var(--red-expensive);
  box-shadow: none;
  animation: none;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

/* ERROR BANNER */
.error-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--red-expensive-bg);
  border: 1px solid rgba(210, 32, 30, 0.25);
  color: var(--g-red-600);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
}

.error-banner.visible {
  display: flex;
}

.error-banner-hint:not([hidden]) {
  display: block;
  margin-top: 2px;
  font-weight: 500;
}

/* TOOLBAR */
.toolbar {
  background: var(--ui-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.stat-card {
  background: var(--ui-solid);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stat-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
}

.stat-card.cheapest::before { background: var(--green-cheap); }
.stat-card.average::before { background: var(--g-blue); }
.stat-card.expensive::before { background: var(--g-red); }

.stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card.cheapest .stat-label { color: var(--green-cheap); }
.stat-card.average .stat-label { color: var(--g-blue); }
.stat-card.expensive .stat-label { color: var(--g-red); }

.stat-price {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--ui-text);
}

.stat-name {
  font-size: 0.78rem;
  color: var(--ui-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* CONTENT GRID (Map & Station List) */
.content-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  height: 580px;
}

@media (max-width: 960px) {
  .content-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .map-container, .list-container {
    height: 480px;
  }
}

.map-container {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid var(--ui-border);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-sm);
}

#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.list-container {
  background: var(--ui-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ui-text);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--ui-border);
  padding-bottom: 8px;
}

.list-header-hint {
  font-size: 0.75rem;
  color: var(--ui-muted);
  font-weight: 500;
}

.station-list {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
  flex: 1;
}

.station-item {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 11px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.station-item:hover {
  border-color: var(--g-blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.station-item.active {
  border-color: var(--g-blue);
  background: var(--g-blue-50);
}

.station-item-main {
  flex: 1;
  min-width: 0;
  padding-right: 8px;
}

.station-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.station-item-dist {
  font-size: 0.72rem;
  color: var(--ui-muted);
  font-weight: 600;
}

.station-item-name,
.station-item-addr {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-item-name {
  font-weight: 700;
  margin-top: 4px;
  font-size: 0.92rem;
  color: var(--ui-text);
}

.station-item-addr {
  font-size: 0.78rem;
  color: var(--ui-muted);
}

.station-item-prices {
  text-align: right;
  flex-shrink: 0;
}

.station-item-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--g-blue);
}

.station-item-secondary {
  font-size: 0.75rem;
  color: var(--ui-muted);
}

.empty-state {
  text-align: center;
  color: var(--ui-muted);
  padding: 40px 10px;
}

.empty-state-hint {
  font-size: 0.8rem;
  margin-top: 4px;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  color: #ffffff;
  display: inline-block;
  text-transform: uppercase;
  white-space: nowrap;
}

/* REGIONAL TABLE SECTION */
.table-section {
  background: var(--ui-panel);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.table-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.table-title {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ui-text);
}

.table-region-name {
  color: var(--g-blue);
}

.table-subtitle {
  font-size: 0.82rem;
  color: var(--ui-muted);
  margin-top: 2px;
}

.table-toolbar {
  background: #ffffff;
  border: 1px solid var(--ui-border);
  border-radius: 11px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.table-toolbar-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  flex: 1;
}

.table-toolbar-filters input[type="text"] {
  min-width: 260px;
}

@media (max-width: 600px) {
  .table-toolbar-filters input[type="text"] {
    min-width: 0;
    width: 100%;
  }
}

.table-toolbar-quick {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 11px;
  border: 1px solid var(--ui-border);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

table.station-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

table.station-table th {
  background: var(--g-blue-50);
  color: var(--ui-muted);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 12px 14px;
  border-bottom: 2px solid var(--ui-border);
  white-space: nowrap;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease;
}

table.station-table th.sortable {
  cursor: pointer;
}

table.station-table th.sortable:hover {
  background: var(--ui-hover);
  color: var(--g-blue);
}

table.station-table th.sortable::after {
  content: ' ↕';
  opacity: 0.4;
  font-size: 0.75rem;
}

table.station-table th.sorted-asc::after {
  content: ' ▲';
  opacity: 1;
  color: var(--g-blue);
}

table.station-table th.sorted-desc::after {
  content: ' ▼';
  opacity: 1;
  color: var(--g-blue);
}

table.station-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--ui-border);
  vertical-align: middle;
}

table.station-table tbody tr {
  transition: background 0.15s ease;
  cursor: pointer;
}

table.station-table tbody tr:hover {
  background: var(--g-blue-50);
}

table.station-table td.cell-index {
  font-weight: 700;
  color: var(--ui-muted);
}

table.station-table td.cell-name {
  font-weight: 700;
  color: var(--ui-text);
}

table.station-table td.cell-street {
  color: var(--ui-muted);
  font-size: 0.82rem;
}

table.station-table td.cell-dist {
  font-weight: 600;
  color: var(--ui-muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

table.station-table td.cell-empty {
  text-align: center;
  color: var(--ui-muted);
  padding: 34px;
  cursor: default;
}

.table-price-badge {
  display: inline-block;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.92rem;
  background: var(--ui-bg);
  color: var(--ui-text);
  white-space: nowrap;
}

.table-price-badge.lowest {
  background: var(--green-cheap-bg);
  color: var(--green-cheap);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.table-price-minor {
  color: var(--ui-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}

.btn-table-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--g-blue-100);
  color: var(--g-blue);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-table-nav:hover {
  background: var(--g-blue);
  color: #ffffff;
}

/* CUSTOM MAP PINS */
.custom-div-icon {
  background: none;
  border: none;
}

.custom-map-pin {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 20px;
  font-weight: 800;
  font-size: 11px;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  border: 2px solid #ffffff;
  text-align: center;
  padding: 2px 8px;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transition: transform 0.15s ease;
  cursor: pointer;
}

.custom-map-pin:hover {
  transform: translate(-50%, -50%) scale(1.15);
}

/* LOADING OVERLAY */
#loader {
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(4px);
  position: absolute;
  inset: 0;
  z-index: 1000;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ui-text);
  gap: 10px;
}

.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--g-blue-100);
  border-top-color: var(--g-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* POPUP STYLING */
.popup-content {
  padding: 6px;
  font-family: inherit;
}

.popup-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 2px;
  color: var(--ui-text);
}

.popup-addr {
  font-size: 0.78rem;
  color: var(--ui-muted);
  margin-bottom: 8px;
}

.popup-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.popup-price-box {
  background: var(--ui-bg);
  padding: 6px 8px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid transparent;
}

.popup-price-box.current {
  border-color: var(--g-blue);
  background: var(--g-blue-50);
}

.popup-price-lbl {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ui-muted);
  text-transform: uppercase;
}

.popup-price-val {
  font-size: 1rem;
  font-weight: 800;
  color: var(--g-blue);
}

.popup-btn {
  display: block;
  text-align: center;
  background: var(--g-blue);
  color: white !important;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 7px;
  transition: background 0.15s ease;
}

.popup-btn:hover {
  background: var(--g-blue-600);
}

/* ==========================================================================
   Easter Egg (Cat background image)
   ========================================================================== */

#catBg {
  position: fixed;
  bottom: -20px;
  right: -20px;
  width: 245px;
  height: auto;
  border-radius: 30px;
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.8s ease-in-out, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.8s ease-in-out, bottom 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), right 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: -2;
  pointer-events: none;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  transform: scale(0.8) translate(30px, 30px);
}

#catBg.visible {
  opacity: 1;
  filter: blur(0px);
  transform: scale(1) translate(0, 0);
  bottom: 20px;
  right: 20px;
}


/* ==========================================================================
   Tool Specific: Presentation Editor (pptx.html / GORDIC)
   ========================================================================== */

/* ================= HEADER ================= */
        .app-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 8px 14px;
            background: var(--g-blue);
            color: #fff;
            z-index: 60;
        }

        .app-header .back-link {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: rgba(255, 255, 255, 0.85);
            text-decoration: none;
            font-weight: 600;
            font-size: 13px;
            padding: 6px 10px;
            border-radius: 8px;
            /* zrušit bílý vzhled ze společného .back-link */
            background: transparent;
            border: none;
            box-shadow: none;
            transition: background 0.15s;
        }

        .app-header .back-link:hover { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: transparent; box-shadow: none; transform: none; }

        .title-block { display: flex; flex-direction: column; min-width: 0; flex: 0 1 340px; }

        /* .app-header zvyšuje specificitu nad společné input[type="text"] */
        .app-header .pres-title-input {
            font-size: 15px;
            font-weight: 700;
            color: #fff;
            background: transparent;
            border: 1px solid transparent;
            border-radius: 6px;
            padding: 2px 6px;
            margin-left: -6px;
            width: 100%;
            min-width: 0;
            outline: none;
            transition: background 0.15s, border-color 0.15s;
        }

        .app-header .pres-title-input:hover { background: rgba(255, 255, 255, 0.08); }
        .app-header .pres-title-input:focus { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.35); box-shadow: none; }

        .save-status {
            font-size: 11.5px;
            color: rgba(255, 255, 255, 0.7);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .save-status::before {
            content: '';
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: #5ad08a;
        }

        .save-status.pending::before { background: #f5c451; }
        .save-status.error::before { background: #ff7b72; }

        .header-spacer { flex: 1; }

        .hbtn {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            height: 34px;
            padding: 0 14px;
            border-radius: 9px;
            border: 1px solid rgba(255, 255, 255, 0.22);
            background: rgba(255, 255, 255, 0.08);
            color: #fff;
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.15s, transform 0.1s;
        }

        .hbtn:hover { background: rgba(255, 255, 255, 0.18); }
        .hbtn:active { transform: translateY(1px); }
        .hbtn.white { background: #fff; color: var(--g-blue); border-color: #fff; }
        .hbtn.white:hover { background: #eef3f9; }
        .hbtn.red { background: var(--g-red); border-color: var(--g-red); }
        .hbtn.red:hover { background: var(--g-red-600); }

        /* ================= RIBBON ================= */
        .ribbon {
            background: var(--ui-solid);
            border-bottom: 1px solid var(--ui-border);
            box-shadow: var(--shadow-sm);
            z-index: 50;
            min-width: 0;
        }

        .tabs {
            display: flex;
            align-items: flex-end;
            gap: 2px;
            padding: 0 12px;
            height: 38px;
            background: linear-gradient(#f7f9fc, #fff);
            border-bottom: 1px solid var(--ui-border);
        }

        .tab {
            position: relative;
            height: 32px;
            padding: 0 14px;
            border: none;
            background: transparent;
            font-size: 13px;
            font-weight: 600;
            color: var(--ui-muted);
            border-radius: 8px 8px 0 0;
            cursor: pointer;
        }

        .tab:hover { color: var(--ui-text); background: var(--ui-hover); }
        .tab.active { color: var(--g-blue); }

        .tab.active::after {
            content: '';
            position: absolute;
            left: 10px;
            right: 10px;
            bottom: -1px;
            height: 3px;
            border-radius: 3px 3px 0 0;
            background: var(--g-red);
        }

        .tab.file { color: var(--g-blue); }

        .tabs-spacer { flex: 1; }

        .tab-tool {
            align-self: center;
            border: none;
            background: transparent;
            color: var(--ui-muted);
            width: 30px;
            height: 28px;
            border-radius: 7px;
            display: grid;
            place-items: center;
            cursor: pointer;
        }

        .tab-tool:hover { background: var(--ui-hover); color: var(--ui-text); }
        body.ribbon-collapsed .tab-tool .ico { transform: rotate(180deg); }

        .panels { height: 98px; }
        body.ribbon-collapsed .panels { display: none; }

        .panel {
            display: none;
            height: 100%;
            padding: 6px 6px 0;
            overflow-x: auto;
            overflow-y: hidden;
            scrollbar-width: thin;
        }

        .panel.active { display: flex; }

        .group {
            display: flex;
            flex-direction: column;
            padding: 0 10px;
            border-right: 1px solid var(--ui-border);
            flex-shrink: 0;
        }

        .group:last-child { border-right: none; }

        .group-body { flex: 1; display: flex; align-items: center; gap: 4px; }

        .group-label {
            font-size: 11px;
            font-weight: 500;
            color: var(--ui-muted);
            text-align: center;
            padding: 2px 0 6px;
            white-space: nowrap;
        }

        .col { display: flex; flex-direction: column; gap: 2px; }
        .row { display: flex; align-items: center; gap: 2px; }

        .rb {
            height: 30px;
            padding: 0 8px;
            border: 1px solid transparent;
            border-radius: 7px;
            background: transparent;
            color: var(--ui-text);
            font-size: 12.5px;
            font-weight: 500;
            display: inline-flex;
            align-items: center;
            gap: 6px;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.12s, color 0.12s;
        }

        .rb .ico { width: 17px; height: 17px; }
        .rb:hover:not(:disabled) { background: var(--ui-hover); }
        .rb:active:not(:disabled) { background: var(--g-blue-100); }
        .rb.on { background: var(--g-blue-100); color: var(--g-blue); border-color: var(--g-blue-200); }
        .rb:disabled { opacity: 0.35; cursor: default; }
        .rb.icon { width: 30px; padding: 0; justify-content: center; }
        .rb.danger { color: var(--g-red); }

        .rb.lg {
            flex-direction: column;
            justify-content: center;
            height: 66px;
            min-width: 66px;
            padding: 4px 8px;
            gap: 5px;
            font-size: 12px;
        }

        .rb.lg .ico { width: 26px; height: 26px; }
        .rb.lg.primary .ico { color: var(--g-red); }

        .rsel {
            height: 30px;
            border: 1px solid var(--ui-border-strong);
            border-radius: 7px;
            background: #fff;
            padding: 0 6px;
            font-size: 12.5px;
            color: var(--ui-text);
            outline: none;
            cursor: pointer;
        }

        .rsel:focus { border-color: var(--g-blue); box-shadow: 0 0 0 3px var(--g-blue-100); }
        .rsel:disabled { opacity: 0.4; }

        .swatches { display: flex; gap: 4px; align-items: center; }

        .swatch {
            width: 20px;
            height: 20px;
            border-radius: 6px;
            border: 1px solid rgba(0, 0, 0, 0.18);
            cursor: pointer;
            padding: 0;
            box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
            transition: transform 0.1s;
        }

        .swatch:hover:not(:disabled) { transform: scale(1.15); }
        .swatch:disabled { opacity: 0.3; cursor: default; }

        .swatch.custom {
            position: relative;
            background: conic-gradient(#d2201e, #f5c451, #5ad08a, #1a73e8, #00376e, #d2201e);
            overflow: hidden;
        }

        .swatch.custom input {
            position: absolute;
            inset: 0;
            opacity: 0;
            cursor: pointer;
            width: 100%;
            height: 100%;
        }

        .style-gallery {
            display: grid;
            grid-template-columns: repeat(4, auto);
            gap: 3px;
        }

        .style-chip {
            border: 1px solid var(--ui-border);
            background: #fff;
            border-radius: 6px;
            padding: 3px 9px;
            height: 27px;
            cursor: pointer;
            font-family: Arial, Helvetica, sans-serif;
            text-align: left;
            white-space: nowrap;
            transition: border-color 0.12s, background 0.12s;
        }

        .style-chip:hover:not(:disabled) { border-color: var(--g-blue); background: var(--g-blue-50); }
        .style-chip:disabled { opacity: 0.35; cursor: default; }

        .bg-btn {
            width: 46px;
            height: 22px;
            border-radius: 5px;
            border: 2px solid transparent;
            background-size: cover;
            background-position: center;
            cursor: pointer;
            padding: 0;
            box-shadow: 0 0 0 1px var(--ui-border-strong);
        }

        .bg-btn.on { border-color: var(--g-red); }
        .bg-btn:disabled { opacity: 0.3; cursor: default; }

        .template-note {
            font-size: 12px;
            line-height: 1.45;
            color: var(--ui-muted);
            max-width: 280px;
            white-space: normal;
        }

        .template-note b { color: var(--g-blue); }

        .palette-row { display: flex; gap: 4px; margin-top: 6px; }

        .palette-row span {
            width: 18px;
            height: 18px;
            border-radius: 5px;
            border: 1px solid rgba(0, 0, 0, 0.15);
        }

        /* ================= WORKSPACE ================= */
        .workspace {
            display: grid;
            grid-template-columns: var(--sidebar-w) 1fr;
            min-height: 0;
        }

        /* Sidebar */
        .sidebar {
            display: flex;
            flex-direction: column;
            min-height: 0;
            background: var(--ui-panel);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            border-right: 1px solid var(--ui-border);
        }

        .sidebar-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px 8px;
        }

        .sidebar-title {
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--ui-muted);
        }

        .counter-pill {
            font-size: 11.5px;
            font-weight: 700;
            color: var(--g-blue);
            background: var(--g-blue-50);
            padding: 2px 8px;
            border-radius: 20px;
        }

        .thumb-list {
            flex: 1;
            overflow-y: auto;
            padding: 4px 12px 8px 6px;
            scrollbar-width: thin;
            --ts: 0.1;
        }

        .thumb {
            display: flex;
            gap: 6px;
            padding: 6px 0;
            position: relative;
            cursor: pointer;
        }

        .thumb-num {
            width: 18px;
            flex-shrink: 0;
            text-align: right;
            font-size: 11.5px;
            font-weight: 700;
            color: var(--ui-muted);
            padding-top: 2px;
        }

        .thumb-canvas {
            flex: 1;
            aspect-ratio: 16 / 9;
            position: relative;
            overflow: hidden;
            border-radius: 6px;
            background: #fff;
            border: 1px solid var(--ui-border-strong);
            box-shadow: var(--shadow-sm);
            transition: box-shadow 0.15s, border-color 0.15s;
        }

        .thumb-canvas .slide { transform: scale(var(--ts)); pointer-events: none; }

        .thumb:hover .thumb-canvas { border-color: var(--g-blue-200); box-shadow: var(--shadow-md); }
        .thumb.active .thumb-num { color: var(--g-red); }

        .thumb.active .thumb-canvas {
            border-color: var(--g-blue);
            box-shadow: 0 0 0 2px var(--g-blue), var(--shadow-md);
        }

        .thumb.dragging { opacity: 0.4; }

        .thumb.drop-before::before,
        .thumb.drop-after::after {
            content: '';
            position: absolute;
            left: 24px;
            right: 0;
            height: 3px;
            border-radius: 3px;
            background: var(--g-red);
        }

        .thumb.drop-before::before { top: 0; }
        .thumb.drop-after::after { bottom: 0; }

        .thumb-actions {
            position: absolute;
            top: 10px;
            right: 4px;
            display: flex;
            gap: 3px;
            opacity: 0;
            transition: opacity 0.12s;
        }

        .thumb:hover .thumb-actions { opacity: 1; }

        .thumb-act {
            width: 24px;
            height: 24px;
            display: grid;
            place-items: center;
            border-radius: 6px;
            border: 1px solid var(--ui-border);
            background: rgba(255, 255, 255, 0.95);
            color: var(--ui-text);
            cursor: pointer;
            box-shadow: var(--shadow-sm);
        }

        .thumb-act .ico { width: 14px; height: 14px; }
        .thumb-act:hover { background: var(--g-blue); color: #fff; }
        .thumb-act.del:hover { background: var(--g-red); }

        .thumb-badge {
            position: absolute;
            left: 30px;
            bottom: 10px;
            font-size: 10px;
            font-weight: 700;
            color: var(--g-blue);
            background: rgba(255, 255, 255, 0.92);
            border: 1px solid var(--ui-border);
            border-radius: 4px;
            padding: 0 4px;
            display: flex;
            align-items: center;
            gap: 3px;
        }

        .thumb-badge .ico { width: 10px; height: 10px; }

        .add-slide-btn {
            margin: 6px 12px 12px;
            height: 38px;
            border-radius: 10px;
            border: 1.5px dashed var(--g-blue-200);
            background: var(--g-blue-50);
            color: var(--g-blue);
            font-weight: 700;
            font-size: 13px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            cursor: pointer;
            transition: background 0.15s, border-color 0.15s;
        }

        .add-slide-btn:hover { background: var(--g-blue-100); border-color: var(--g-blue); }

        /* Stage */
        .stage-col {
            display: flex;
            flex-direction: column;
            min-width: 0;
            min-height: 0;
        }

        .stage-scroll {
            flex: 1;
            overflow: auto;
            min-height: 0;
            position: relative;
        }

        .stage-inner {
            min-width: 100%;
            min-height: 100%;
            width: max-content;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 36px;
        }

        .slide-frame {
            position: relative;
            flex-shrink: 0;
            background: #fff;
            border-radius: 3px;
            box-shadow: var(--shadow-lg);
        }

        /* Notes */
        .notes-panel {
            border-top: 1px solid var(--ui-border);
            background: var(--ui-panel);
            backdrop-filter: blur(18px);
            -webkit-backdrop-filter: blur(18px);
            display: none;
            padding: 8px 14px 10px;
        }

        body.notes-open .notes-panel { display: block; }

        .notes-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--ui-muted);
            margin-bottom: 6px;
        }

        .notes-textarea {
            width: 100%;
            height: 84px;
            min-height: 48px;
            max-height: 40vh;
            resize: vertical;
            border: 1px solid var(--ui-border-strong);
            border-radius: 10px;
            background: #fff;
            padding: 10px 12px;
            font-size: 14px;
            line-height: 1.5;
            color: var(--ui-text);
            outline: none;
            user-select: text;
        }

        .notes-textarea:focus { border-color: var(--g-blue); box-shadow: 0 0 0 3px var(--g-blue-100); }

        /* ================= STATUS BAR ================= */
        .statusbar {
            display: flex;
            align-items: center;
            gap: 14px;
            height: 32px;
            padding: 0 12px;
            background: var(--ui-solid);
            border-top: 1px solid var(--ui-border);
            font-size: 12px;
            color: var(--ui-muted);
            z-index: 50;
        }

        .statusbar .sep { width: 1px; height: 16px; background: var(--ui-border-strong); }
        .status-strong { color: var(--g-blue); font-weight: 700; }
        .status-flex { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

        .sbtn {
            height: 24px;
            padding: 0 8px;
            border: none;
            background: transparent;
            border-radius: 6px;
            color: var(--ui-muted);
            font-size: 12px;
            display: inline-flex;
            align-items: center;
            gap: 5px;
            cursor: pointer;
        }

        .sbtn .ico { width: 15px; height: 15px; }
        .sbtn:hover { background: var(--ui-hover); color: var(--ui-text); }
        .sbtn.on { color: var(--g-blue); background: var(--g-blue-50); }

        .zoom-box { display: flex; align-items: center; gap: 4px; }

        .zoom-box input[type=range] {
            width: 110px;
            accent-color: var(--g-blue);
        }

        .zoom-label {
            min-width: 44px;
            text-align: center;
            font-variant-numeric: tabular-nums;
            font-weight: 600;
            color: var(--ui-text);
        }

        /* ================= SLIDE RENDERING (1920×1080) ================= */
        .slide {
            position: absolute;
            left: 0;
            top: 0;
            width: 1920px;
            height: 1080px;
            background: #fff;
            overflow: hidden;
            transform-origin: 0 0;
            font-family: Arial, Helvetica, sans-serif;
            color: var(--g-text);
            user-select: none;
        }

        .slide.editing { overflow: visible; }
        .slide, .slide * { font-family: Arial, Helvetica, sans-serif !important; }   /* šablona GORDIC = všude Arial */

        /* Vrstva šablony GORDIC (logo, web, pozadí) – pozice se nastavují z FRAMES */
        .brand-logo, .brand-footer, .brand-bg { position: absolute; pointer-events: none; }
        .brand-logo { object-fit: contain; }
        .brand-bg { object-fit: cover; display: block; }

        .brand-wordmark {
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 900;
            letter-spacing: 0.08em;
            color: var(--g-blue);
        }

        .brand-wordmark::after { content: '.'; color: var(--g-red); }

        .brand-footer {
            display: flex;
            align-items: center;
            padding: 7px 14px;
            font-size: 24px;
            line-height: 1;
            color: #b9c3d2;
            white-space: nowrap;
        }

        .shape { position: absolute; }

        .shape-body {
            width: 100%;
            height: 100%;
            padding: 7px 14px;
            line-height: 1.2;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            word-wrap: break-word;
            overflow-wrap: break-word;
        }

        .txt { outline: none; min-height: 1.2em; }
        .txt ul, .txt ol { margin: 0; padding-left: 1.18em; }
        .txt ul { list-style-type: disc; }
        .txt li { margin: 0.2em 0 0; padding-left: 0.1em; }
        .txt li::marker { color: var(--g-red); }
        .txt ul ul { font-size: 0.8333em; padding-left: 1.25em; }
        .txt ul ul li::marker { color: var(--g-blue); }
        .txt ul ul ul { font-size: 0.8em; }
        .txt ul ul ul li::marker { color: #bfbfbf; }
        .txt p { margin: 0; }

        .shape-shape .shape-body { justify-content: center; text-align: center; }

        .shape-image .shape-body,
        .shape-video .shape-body,
        .shape-table .shape-body { padding: 0; }

        .shape-image img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }

        .img-placeholder {
            width: 100%;
            height: 100%;
            border: 3px dashed var(--g-gray);
            border-radius: 12px;
            background: rgba(0, 55, 110, 0.035);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 18px;
            color: #8693a8;
            font-size: 32px;
        }

        .img-placeholder .ico { width: 110px; height: 110px; stroke-width: 1.2; }

        .video-box {
            position: relative;
            width: 100%;
            height: 100%;
            background: #0b1626;
            border-radius: 10px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
        }

        .video-box img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; }

        .video-play {
            position: relative;
            width: 150px;
            height: 106px;
            border-radius: 28px;
            background: var(--g-red);
            display: grid;
            place-items: center;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
        }

        .video-play::after {
            content: '';
            border-left: 46px solid #fff;
            border-top: 28px solid transparent;
            border-bottom: 28px solid transparent;
            margin-left: 10px;
        }

        .video-caption {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;
            padding: 18px 28px;
            font-size: 26px;
            background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .video-box iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

        .g-table {
            width: 100%;
            height: 100%;
            border-collapse: collapse;
            table-layout: fixed;
            font-size: inherit;
        }

        .g-table td {
            border: 3px solid #ffffff;
            padding: 7px 14px;
            vertical-align: middle;
            outline: none;
            overflow-wrap: break-word;
            color: #222222;
        }

        .g-table tr:nth-child(even) td { background: #f2f2f2; }
        .g-table td.th { background: #00376e; color: #fff; font-weight: bold; }

        /* ---- Editing affordances (only on main stage) ---- */
        #slideCanvas .shape { cursor: move; touch-action: none; }
        #slideCanvas .shape:hover { outline: calc(1.5px * var(--inv)) solid rgba(26, 115, 232, 0.45); }
        #slideCanvas .shape.selected:hover { outline: none; }
        #slideCanvas .shape.editing { cursor: text; }
        #slideCanvas .shape.editing .txt,
        #slideCanvas .shape.editing td { user-select: text; -webkit-user-select: text; cursor: text; }
        #slideCanvas .txt:empty::before { content: 'Dvojklikem začnete psát…'; color: #a3adbd; }
        #slideCanvas .shape-shape .txt:empty::before { color: inherit; opacity: 0.65; }
        #slideCanvas .g-table td:focus { box-shadow: inset 0 0 0 calc(3px * var(--inv)) var(--sel); }

        .sel-overlay {
            position: absolute;
            pointer-events: none;
            z-index: 9000;
            display: none;
        }

        .sel-overlay.show { display: block; }

        .sel-outline {
            position: absolute;
            inset: 0;
            border: calc(1.5px * var(--inv)) solid var(--sel);
        }

        .sel-overlay.editing .sel-outline { border-style: dashed; }

        .handle {
            position: absolute;
            width: calc(12px * var(--inv));
            height: calc(12px * var(--inv));
            margin: calc(-6px * var(--inv)) 0 0 calc(-6px * var(--inv));
            background: #fff;
            border: calc(1.5px * var(--inv)) solid var(--sel);
            border-radius: 50%;
            pointer-events: auto;
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
        }

        .handle.nw { left: 0; top: 0; cursor: nwse-resize; }
        .handle.n { left: 50%; top: 0; cursor: ns-resize; border-radius: 3px; }
        .handle.ne { left: 100%; top: 0; cursor: nesw-resize; }
        .handle.e { left: 100%; top: 50%; cursor: ew-resize; border-radius: 3px; }
        .handle.se { left: 100%; top: 100%; cursor: nwse-resize; }
        .handle.s { left: 50%; top: 100%; cursor: ns-resize; border-radius: 3px; }
        .handle.sw { left: 0; top: 100%; cursor: nesw-resize; }
        .handle.w { left: 0; top: 50%; cursor: ew-resize; border-radius: 3px; }

        .sel-badge {
            position: absolute;
            left: 50%;
            top: 100%;
            transform: translate(-50%, calc(14px * var(--inv)));
            background: var(--sel);
            color: #fff;
            font: 600 calc(12px * var(--inv)) / 1.6 -apple-system, "Segoe UI", sans-serif;
            padding: 0 calc(7px * var(--inv));
            border-radius: calc(5px * var(--inv));
            white-space: nowrap;
            display: none;
        }

        .sel-overlay.busy .sel-badge { display: block; }

        .guide {
            position: absolute;
            background: var(--guide);
            z-index: 8999;
            pointer-events: none;
            display: none;
        }

        .guide.v { top: -2000px; bottom: -2000px; width: calc(1px * var(--inv)); }
        .guide.h { left: -2000px; right: -2000px; height: calc(1px * var(--inv)); }

        /* ================= OVERLAYS ================= */
        .drop-overlay {
            position: fixed;
            inset: 0;
            z-index: 1000;
            background: rgba(0, 55, 110, 0.88);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            pointer-events: none;
        }

        .drop-overlay.active { display: flex; }

        .drop-card {
            border: 3px dashed rgba(255, 255, 255, 0.6);
            border-radius: 24px;
            padding: 48px 64px;
            text-align: center;
            color: #fff;
        }

        .drop-card .ico { width: 64px; height: 64px; margin-bottom: 12px; }
        .drop-title { font-size: 28px; font-weight: 800; margin-bottom: 6px; }
        .drop-sub { opacity: 0.8; font-size: 15px; }

        .loading {
            position: fixed;
            inset: 0;
            z-index: 2500;
            background: rgba(238, 241, 246, 0.8);
            backdrop-filter: blur(8px);
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 16px;
        }

        .loading.active { display: flex; }

        .loading .spinner {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            border: 4px solid var(--g-blue-100);
            border-top-color: var(--g-red);
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin { to { transform: rotate(360deg); } }

        .loading-text { font-weight: 700; color: var(--g-blue); font-size: 15px; }

        .toast {
            position: fixed;
            left: 50%;
            bottom: 48px;
            transform: translate(-50%, 30px);
            opacity: 0;
            z-index: 3000;
            background: #1b2230;
            color: #fff;
            padding: 10px 18px;
            border-radius: 10px;
            font-size: 13.5px;
            font-weight: 500;
            box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
            transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.2s;
            pointer-events: none;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .toast::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #5ad08a; }
        .toast.warn::before { background: #f5c451; }
        .toast.show { transform: translate(-50%, 0); opacity: 1; }

        /* Context menu */
        .ctx-menu {
            position: fixed;
            z-index: 4000;
            min-width: 220px;
            padding: 5px;
            background: rgba(255, 255, 255, 0.97);
            backdrop-filter: blur(20px);
            border: 1px solid var(--ui-border);
            border-radius: 12px;
            box-shadow: var(--shadow-lg);
            display: none;
        }

        .ctx-menu.show { display: block; }

        .ctx-item {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
            height: 32px;
            padding: 0 10px;
            border: none;
            background: transparent;
            border-radius: 7px;
            font-size: 13px;
            color: var(--ui-text);
            text-align: left;
            cursor: pointer;
        }

        .ctx-item .ico { width: 16px; height: 16px; color: var(--ui-muted); }
        .ctx-item span { flex: 1; }
        .ctx-item small { color: var(--ui-muted); font-size: 11.5px; }
        .ctx-item:hover:not(:disabled) { background: var(--g-blue); color: #fff; }
        .ctx-item:hover:not(:disabled) .ico, .ctx-item:hover:not(:disabled) small { color: #fff; }
        .ctx-item:disabled { opacity: 0.4; cursor: default; }
        .ctx-item.danger { color: var(--g-red); }
        .ctx-sep { height: 1px; background: var(--ui-border); margin: 4px 6px; }

        /* Dialogs */
        dialog {
            border: none;
            border-radius: 18px;
            padding: 0;
            box-shadow: var(--shadow-lg);
            color: var(--ui-text);
            max-width: calc(100vw - 32px);
            max-height: calc(100vh - 48px);
        }

        dialog::backdrop { background: rgba(10, 25, 50, 0.45); backdrop-filter: blur(3px); }

        .dlg-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 18px 22px 6px;
        }

        .dlg-head h3 { margin: 0; font-size: 18px; color: var(--g-blue); }
        .dlg-sub { padding: 0 22px 12px; color: var(--ui-muted); font-size: 13px; }

        .dlg-close {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: none;
            background: transparent;
            display: grid;
            place-items: center;
            cursor: pointer;
            color: var(--ui-muted);
        }

        .dlg-close:hover { background: var(--ui-hover); color: var(--ui-text); }

        .dlg-body { padding: 6px 22px 22px; overflow: auto; }

        .dlg-actions {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
            padding: 0 22px 20px;
        }

        .dlg-actions .btn {
            height: 36px;
            padding: 0 16px;
            border-radius: 9px;
            border: 1px solid var(--ui-border-strong);
            background: #fff;
            color: var(--ui-text);
            font-weight: 600;
            font-size: 13px;
            cursor: pointer;
        }

        /* Jen tlačítka v dialozích editoru – obecné .btn je ve společné části */
        .dlg-actions .btn:hover { background: #f4f6fa; }
        .dlg-actions .btn.primary { background: var(--g-blue); border-color: var(--g-blue); color: #fff; }
        .dlg-actions .btn.primary:hover { background: var(--g-blue-600); }

        .layout-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
            gap: 14px;
            width: min(880px, calc(100vw - 80px));
        }

        .lay-card {
            border: 1px solid var(--ui-border-strong);
            border-radius: 12px;
            background: #fff;
            padding: 8px;
            cursor: pointer;
            text-align: left;
            transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
        }

        .lay-card:hover, .lay-card:focus-visible {
            border-color: var(--g-blue);
            transform: translateY(-2px);
            box-shadow: var(--shadow-md);
            outline: none;
        }

        .lay-preview {
            width: 178px;
            height: 100px;
            position: relative;
            overflow: hidden;
            border-radius: 6px;
            border: 1px solid var(--ui-border);
            background: #fff;
        }

        .lay-name { font-size: 13px; font-weight: 600; margin: 8px 2px 2px; }

        .field-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ui-muted); margin-bottom: 6px; }

        .field-input {
            width: min(460px, calc(100vw - 90px));
            height: 40px;
            border-radius: 10px;
            border: 1px solid var(--ui-border-strong);
            padding: 0 12px;
            font-size: 14px;
            outline: none;
            user-select: text;
        }

        .field-input:focus { border-color: var(--g-blue); box-shadow: 0 0 0 3px var(--g-blue-100); }

        .shortcut-grid {
            display: grid;
            grid-template-columns: auto 1fr;
            gap: 8px 18px;
            align-items: center;
            font-size: 13px;
            width: min(520px, calc(100vw - 90px));
        }

        .shortcut-grid h4 {
            grid-column: 1 / -1;
            margin: 10px 0 0;
            font-size: 11px;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--g-blue);
        }

        .shortcut-grid div:nth-child(odd of :not(h4)) { white-space: nowrap; }

        /* ================= SLIDESHOW ================= */
        .slideshow {
            position: fixed;
            inset: 0;
            z-index: 5000;
            background: #000;
            display: none;
            cursor: none;
        }

        .slideshow.active { display: block; }
        .slideshow.cursor { cursor: default; }
        .show-stage { position: absolute; inset: 0; overflow: hidden; }
        .show-stage .slide { animation: showIn 0.35s ease; }

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

        .show-end {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: rgba(255, 255, 255, 0.6);
            font-size: 18px;
        }

        .show-progress {
            position: absolute;
            left: 0;
            bottom: 0;
            height: 4px;
            background: var(--g-red);
            transition: width 0.3s ease;
        }

        .show-bar {
            position: absolute;
            left: 50%;
            bottom: 24px;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px;
            border-radius: 14px;
            background: rgba(20, 28, 40, 0.75);
            backdrop-filter: blur(12px);
            color: #fff;
            opacity: 0;
            transition: opacity 0.25s;
        }

        .slideshow.cursor .show-bar { opacity: 1; }

        .show-bar button {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            border: none;
            background: transparent;
            color: #fff;
            display: grid;
            place-items: center;
            cursor: pointer;
        }

        .show-bar button:hover { background: rgba(255, 255, 255, 0.15); }
        .show-count { font-size: 13px; font-variant-numeric: tabular-nums; padding: 0 8px; }

        /* ================= PRINT ================= */
        #printArea { display: none; }

        /* Tisk slidů jen v editoru – ostatní stránky se tisknou normálně */
        @page pptx { size: 13.333in 7.5in; margin: 0; }
        body.pptx-body { page: pptx; }

        @media print {
            html:has(body.pptx-body), body.pptx-body { height: auto; overflow: visible; display: block; background: #fff; }
            body.pptx-body > *:not(#printArea) { display: none !important; }
            #printArea { display: block; }
            .print-page { width: 1280px; height: 720px; position: relative; overflow: hidden; break-after: page; }
            .print-page .slide { transform: scale(0.666667); }
        }

        /* ================= RESPONSIVE ================= */
        @media (max-width: 1280px) {
            .rb:not(.lg) .lbl { display: none; }
            .rb:not(.lg) { padding: 0 7px; }
        }

        @media (max-width: 900px) {
            :root { --sidebar-w: 150px; }
            .hbtn .lbl, .save-status, .app-header .back-link .lbl { display: none; }
            .hbtn { padding: 0 10px; }
            .app-header { gap: 8px; }
            .zoom-box input[type=range] { display: none; }
            .stage-inner { padding: 18px; }
        }

        @media (max-width: 600px) {
            :root { --sidebar-w: 0px; }
            .sidebar { display: none; }
            .status-flex { display: none; }
        }

/* ==========================================================================
   Tool Specific: MP3 ⇄ MP4 Converter (convert.html)
   ========================================================================== */

/* Přepínač směru převodu přes celou šířku karty */
.convert-mode {
  width: 100%;
}

.convert-mode .segmented-btn {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
}

.convert-image-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.convert-image-source {
  display: block;
  margin: 2px 0 8px;
  font-size: 12px;
  color: var(--ui-muted);
}

/* Náhled snímku videa (16:9) */
.convert-preview {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--ui-border);
  background: var(--g-blue);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Tool Specific: Interní e-shop s reklamními předměty (eshop/eshop.html)
   ========================================================================== */

body.shop-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Hlavička ve stylu editoru prezentací */
.shop-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--g-blue);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 25, 60, 0.18);
}

.shop-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.shop-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}

.shop-brand .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.shop-brand .brand-mark img {
  inset: 4px;
  width: 30px;
  height: 30px;
}

.shop-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.shop-brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.shop-brand-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.shop-search {
  flex: 1;
  max-width: 560px;
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
}

.shop-search .ico {
  position: absolute;
  left: 13px;
  color: var(--ui-muted);
  pointer-events: none;
}

.shop-header .shop-search input[type="text"] {
  width: 100%;
  height: 42px;
  padding: 0 14px 0 40px;
  border-radius: 10px;
  border: 2px solid transparent;
  font-size: 14px;
}

.shop-header .shop-search input[type="text"]:focus {
  border-color: var(--g-red);
  box-shadow: none;
}

.shop-main {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  flex: 1;
}

.shop-toolbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.shop-heading {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--g-blue);
}

.shop-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-muted);
}

.shop-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--ui-muted);
  background: var(--ui-solid);
  border: 1px solid var(--ui-border);
  border-radius: 14px;
}

/* Dlaždice ve stylu Alzy: fotka, název, skladem, cena */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

.shop-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--ui-solid);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  color: var(--ui-text);
  text-decoration: none;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.shop-card:hover {
  border-color: var(--g-blue-200);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.shop-card:focus-visible {
  outline: 2px solid var(--g-blue);
  outline-offset: 2px;
}

.shop-card-img {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.shop-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.shop-card:hover .shop-card-img img {
  transform: scale(1.04);
}

.shop-card-photos {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 55, 110, 0.85);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.shop-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--g-blue);
  /* max. 2 řádky, ať mají dlaždice stejnou výšku */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.35em);
}

.shop-card:hover .shop-card-title {
  text-decoration: underline;
}

.shop-stock {
  font-size: 13px;
  font-weight: 700;
}

.shop-stock.in {
  color: #12924f;
}

.shop-stock.out {
  color: var(--g-red);
}

.shop-card-price {
  margin-top: auto;
  font-size: 19px;
  font-weight: 800;
  color: var(--g-red);
}

/* Detail produktu */
.shop-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--ui-muted);
}

.shop-breadcrumb a {
  color: var(--g-blue);
  font-weight: 600;
  text-decoration: none;
}

.shop-breadcrumb a:hover {
  text-decoration: underline;
}

.shop-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 32px;
  padding: 28px;
  background: var(--ui-solid);
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.shop-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.shop-gallery-main {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid var(--ui-border);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
}

.shop-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shop-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--ui-border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--g-blue);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.shop-gallery-nav:hover {
  background: #fff;
  box-shadow: var(--shadow-md);
}

.shop-gallery-nav.prev { left: 12px; }
.shop-gallery-nav.next { right: 12px; }

.shop-thumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.shop-thumb {
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid var(--ui-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.shop-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shop-thumb:hover {
  border-color: var(--g-blue-200);
}

.shop-thumb.active {
  border-color: var(--g-blue);
}

.shop-info {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}

.shop-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.2;
  color: var(--g-blue);
}

.shop-stock-row .shop-stock {
  font-size: 15px;
}

.shop-option {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shop-option-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ui-text);
}

.shop-option-hint {
  font-weight: 500;
  color: var(--ui-muted);
}

.shop-option .segmented-control {
  align-self: flex-start;
}

.shop-option .segmented-btn {
  padding: 7px 18px;
  font-size: 13px;
}

.shop-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-size {
  min-width: 52px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 9px;
  background: #fff;
  color: var(--ui-text);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.shop-size:hover {
  border-color: var(--g-blue);
  color: var(--g-blue);
}

.shop-size.active {
  background: var(--g-blue);
  border-color: var(--g-blue);
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 55, 110, 0.2);
}

.shop-buybox {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 12px;
  background: var(--g-blue-50);
  border: 1px solid var(--g-blue-100);
}

.shop-price-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ui-muted);
}

.shop-price {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--g-red);
}

.shop-back {
  align-self: flex-start;
}

/* Tlačítko košíku v hlavičce */
.shop-cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid #fff;
  /* bílé jako "Prezentovat" v editoru – v tmavé hlavičce je dobře vidět */
  background: #fff;
  color: var(--g-blue);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.15s ease, transform 0.1s ease;
}

.shop-cart-btn:hover,
.shop-cart-btn.active {
  background: #eef3f9;
  color: var(--g-blue);
}

.shop-cart-btn:active {
  transform: translateY(1px);
}

.shop-cart-btn .ico {
  width: 20px;
  height: 20px;
}

.shop-cart-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--g-red);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: grid;
  place-items: center;
  border: 2px solid var(--g-blue);
}

.shop-cart-badge[hidden] {
  display: none;
}

/* Nákupní box v detailu */
.shop-buybox {
  flex-direction: column;
  align-items: stretch;
}

.shop-buybox-price {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.shop-buy-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.shop-qty {
  display: inline-flex;
  align-items: stretch;
  height: 44px;
  border: 1px solid var(--ui-border-strong);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.shop-qty button {
  width: 38px;
  border: none;
  background: transparent;
  color: var(--g-blue);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.shop-qty button:hover {
  background: var(--ui-hover);
}

.shop-qty input[type="number"] {
  width: 48px;
  height: 100%;
  border: none;
  border-left: 1px solid var(--ui-border);
  border-right: 1px solid var(--ui-border);
  border-radius: 0;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
  box-shadow: none;
}

.shop-add-btn {
  flex: 1;
  min-width: 180px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  background: var(--g-red);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(210, 32, 30, 0.25);
  transition: background 0.15s ease, transform 0.1s ease;
}

.shop-add-btn:hover:not(:disabled) {
  background: var(--g-red-600);
}

.shop-add-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.shop-add-btn:disabled {
  background: var(--g-gray);
  box-shadow: none;
  cursor: not-allowed;
}

.shop-add-btn .ico {
  width: 20px;
  height: 20px;
}

.shop-buy-error {
  font-size: 13px;
  font-weight: 600;
  color: var(--g-red);
}

.shop-sizes-error .shop-size {
  border-color: var(--g-red);
  animation: shopShake 0.3s ease;
}

@keyframes shopShake {
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* Oznámení „Přidáno do košíku" */
.shop-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 12px;
  background: var(--g-blue);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: toastAnim 0.2s ease-out;
}

.shop-toast[hidden] {
  display: none;
}

.shop-toast a {
  margin-left: 10px;
  color: #fff;
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
}

/* Stránka košíku */
.shop-cart {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}

.shop-cart-panel {
  background: var(--ui-solid);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.shop-cart-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--ui-border);
}

.shop-cart-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--g-blue);
}

.shop-cart-pill {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--g-blue-50);
  border: 1px solid var(--g-blue-100);
  font-size: 12px;
  font-weight: 700;
  color: var(--g-blue);
}

/* Textové tlačítko s ikonou (Odebrat, Vyprázdnit) */
.shop-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  margin: -4px -6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ui-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.shop-text-btn .ico {
  width: 15px;
  height: 15px;
}

.shop-text-btn:hover {
  color: var(--g-red);
  background: var(--red-expensive-bg);
}

.shop-cart-list {
  list-style: none;
}

.shop-cart-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto 120px;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  transition: background 0.15s ease;
}

.shop-cart-item + .shop-cart-item {
  border-top: 1px solid var(--ui-border);
}

.shop-cart-item:hover {
  background: rgba(0, 55, 110, 0.025);
}

.shop-cart-img {
  width: 96px;
  height: 96px;
  padding: 6px;
  border: 1px solid var(--ui-border);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.shop-cart-img:hover {
  border-color: var(--g-blue-200);
}

.shop-cart-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.shop-cart-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
}

.shop-cart-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--g-blue);
  text-decoration: none;
}

.shop-cart-name:hover {
  text-decoration: underline;
}

.shop-cart-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.shop-chip {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--ui-bg);
  border: 1px solid var(--ui-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--ui-text);
}

.shop-cart-meta .shop-stock {
  font-size: 12.5px;
}

.shop-cart-item .shop-qty {
  height: 40px;
}

.shop-cart-item .shop-qty button {
  width: 34px;
}

.shop-cart-item .shop-qty input[type="number"] {
  width: 44px;
}

.shop-cart-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  white-space: nowrap;
}

.shop-cart-price strong {
  font-size: 18px;
  font-weight: 800;
  color: var(--ui-text);
}

.shop-cart-price span {
  font-size: 12px;
  color: var(--ui-muted);
}

.shop-cart-panel-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--ui-border);
  background: rgba(0, 55, 110, 0.025);
}

/* Shrnutí – záhlaví jako hlavička editoru prezentací */
.shop-cart-summary {
  position: sticky;
  top: 86px;
  background: var(--ui-solid);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.shop-cart-summary-head {
  position: relative;
  padding: 16px 20px;
  background: var(--g-blue);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.shop-cart-summary-head::after {
  content: '';
  position: absolute;
  left: 20px;
  bottom: 0;
  width: 40px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--g-red);
}

.shop-cart-summary-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px 20px;
}

.shop-cart-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  color: var(--ui-muted);
}

.shop-cart-row strong {
  color: var(--ui-text);
  font-weight: 700;
}

.shop-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px dashed var(--ui-border-strong);
  font-size: 15px;
  font-weight: 700;
  color: var(--ui-text);
}

.shop-cart-total strong {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--g-red);
}

.shop-cart-summary .shop-add-btn {
  flex: none;
  width: 100%;
  height: 50px;
  margin-top: 4px;
  font-size: 16px;
}

.shop-cart-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--g-blue-50);
  border: 1px solid var(--g-blue-100);
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ui-muted);
}

.shop-cart-note .ico {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--g-blue);
}

/* Prázdný košík */
.shop-cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 56px 20px;
  text-align: center;
  background: var(--ui-solid);
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.shop-cart-empty-icon {
  width: 76px;
  height: 76px;
  margin-bottom: 6px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--g-blue-50);
  border: 1px solid var(--g-blue-100);
  color: var(--g-blue);
}

.shop-cart-empty-icon .ico {
  width: 34px;
  height: 34px;
  stroke-width: 1.6;
}

.shop-cart-empty-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--g-blue);
}

.shop-cart-empty-text {
  font-size: 14px;
  color: var(--ui-muted);
}

.shop-cart-empty .btn {
  margin-top: 10px;
  padding: 10px 22px;
  font-size: 14px;
}

@media (max-width: 960px) {
  .shop-cart {
    grid-template-columns: 1fr;
  }

  .shop-cart-summary {
    position: static;
  }
}

@media (max-width: 640px) {
  .shop-cart-label {
    display: none;
  }

  .shop-cart-btn {
    padding: 0 12px;
    margin-left: auto;
  }

  /* Košík na první řádek vedle značky, vyhledávání pod ním přes celou šířku */
  .shop-search {
    order: 3;
  }

  .shop-cart-panel-head,
  .shop-cart-panel-foot {
    padding-left: 14px;
    padding-right: 14px;
  }

  .shop-cart-item {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    grid-template-areas:
      "img info info"
      "img qty price";
    gap: 10px 12px;
    padding: 14px;
  }

  .shop-cart-img { grid-area: img; width: 72px; height: 72px; align-self: start; }
  .shop-cart-info { grid-area: info; }
  .shop-cart-item .shop-qty { grid-area: qty; justify-self: start; height: 36px; }
  .shop-cart-price { grid-area: price; }

  .shop-cart-name {
    font-size: 15px;
  }
}

@media (max-width: 860px) {
  .shop-detail {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 18px;
  }
}

@media (max-width: 640px) {
  .shop-header-inner {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 14px;
  }

  .shop-search {
    max-width: none;
    flex-basis: 100%;
  }

  .shop-main {
    padding: 16px 12px 32px;
  }

  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .shop-card {
    padding: 10px;
  }

  .shop-card-price {
    font-size: 16px;
  }

  .shop-title {
    font-size: 21px;
  }
}

/* ==========================================================================
   Tool Specific: Audio Transcriber (transcriber.html)
   ========================================================================== */

.media-preview {
  display: none;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--ui-border);
  border-radius: 12px;
}

.media-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.media-preview-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--g-blue);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

#previewAudio {
  width: 100%;
  height: 40px;
  display: block;
}

.model-hint {
  font-size: 11px;
  color: var(--ui-muted);
  line-height: 1.5;
  margin-top: -6px;
}

.segmented-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.transcript-meta {
  font-size: 10px;
  font-weight: 600;
  color: var(--ui-muted);
}

.transcript-text {
  width: 100%;
  height: 300px;
  padding: 12px 14px;
  border: none;
  outline: none;
  resize: vertical;
  background: transparent;
  color: var(--ui-text);
  font-size: 13px;
  line-height: 1.6;
  font-family: inherit;
}

.transcript-text::placeholder {
  color: var(--text-muted);
}

.console-log.console-log-sm {
  height: 120px;
}

.export-formats-row.export-formats-row-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
    align-items: center;
  }
}

@media (max-width: 860px) {
  .container:has(.left-column),
  .qr-container {
    grid-template-columns: 1fr;
    max-width: 480px;
  }
}

@media (max-width: 480px) {
  body:not(.pptx-body):not(.ceny-body):not(.shop-body) {
    padding: 20px 12px;
  }

  body.ceny-body,
  body:has(.ceny-container) {
    padding: 16px 12px;
  }

  .container {
    padding: 18px;
    border-radius: 16px;
  }

  .back-button {
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
  }

  .btn-submit {
    width: 100%;
  }
}
