:root {
  /* Warm teal primary — approachable, not clinical */
  --pico-primary: #2a9d8f;
  --pico-primary-hover: #238b7e;
  --pico-primary-focus: rgba(42, 157, 143, 0.25);
  --pico-primary-inverse: #fff;

  /* Warm off-white background */
  --pico-background-color: #faf7f2;
  --pico-card-background-color: #ffffff;
  --pico-card-sectioning-background-color: #f5f0e8;

  /* Warm dark gray text — not pure black */
  --pico-color: #2d3436;
  --pico-muted-color: #636e72;
  --pico-muted-border-color: #e0d8ce;

  /* Rounder elements */
  --pico-border-radius: 0.75rem;

  /* Project accent colors */
  --color-accent-warm: #e76f51;
  --color-accent-gold: #e9c46a;
  --color-accent-sand: #f4a261;
}

/* Body — comfortable reading */
body {
  font-size: 1.05rem;
  line-height: 1.7;
}

/* Nav — warm, no harsh borders */
nav {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  background-color: var(--pico-background-color);
}

nav .nav-brand {
  color: var(--pico-primary);
  text-decoration: none;
}

nav a {
  text-decoration: none;
}

/* Footer — muted, centered, small */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-top: 1px solid var(--pico-muted-border-color);
  text-align: center;
  color: var(--pico-muted-color);
}

footer small {
  font-size: 0.85rem;
}

/* Headings — slightly warmer weight */
h1, h2, h3 {
  color: #1a1a2e;
}

h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

/* Links — teal with smooth transitions */
a {
  transition: color 0.15s ease;
}

a:hover {
  color: var(--pico-primary-hover);
}

/* ==========================================================================
   Hero section
   ========================================================================== */

.hero {
  text-align: center;
  padding: 3rem 1rem 2.5rem;
  margin-bottom: 2rem;
  background: linear-gradient(180deg, #f0ebe3 0%, var(--pico-background-color) 100%);
  border-radius: var(--pico-border-radius);
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #1a1a2e;
}

.hero-text {
  font-size: 1.2rem;
  line-height: 1.8;
  max-width: 40rem;
  margin: 0 auto;
  color: var(--pico-muted-color);
}

/* ==========================================================================
   Domain tiles grid
   ========================================================================== */

.domains-section {
  margin-bottom: 3rem;
}

.domains-section h2 {
  text-align: center;
  margin-bottom: 1.5rem;
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.domain-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: var(--pico-border-radius);
  border: 1px solid var(--pico-muted-border-color);
  background: var(--pico-card-background-color);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.domain-tile--active {
  text-decoration: none;
  color: inherit;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.domain-tile--active:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(42, 157, 143, 0.15);
  border-color: var(--pico-primary);
  color: inherit;
}

.domain-tile--active:focus-visible {
  outline: 2px solid var(--pico-primary);
  outline-offset: 2px;
}

.domain-tile--active .domain-name {
  color: var(--pico-primary);
}

.domain-tile--coming {
  opacity: 0.55;
  background: var(--pico-card-sectioning-background-color);
  border-color: transparent;
}

.domain-emoji {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.domain-name {
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
  display: block;
}

.domain-desc {
  font-size: 0.85rem;
  color: var(--pico-muted-color);
  line-height: 1.4;
}

.domain-badge {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--pico-muted-color);
  background: var(--pico-muted-border-color);
  border-radius: 1rem;
}

/* ==========================================================================
   About section
   ========================================================================== */

.about-section {
  max-width: 40rem;
  margin: 0 auto 2rem;
}

.about-section h2 {
  text-align: center;
}

/* ==========================================================================
   Responsive — landing page
   ========================================================================== */

@media (max-width: 768px) {
  .domain-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero-text {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .domain-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero {
    padding: 2rem 0.75rem 1.5rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero-text {
    font-size: 1rem;
  }

  .domain-tile {
    padding: 1.25rem 0.75rem;
  }
}

/* ==========================================================================
   Domain guide styles
   ========================================================================== */

/* Back link */
.domain-header .back-link {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: var(--pico-muted-color);
  text-decoration: none;
}

.domain-header .back-link:hover {
  color: var(--pico-primary);
}

/* Guide description */
.domain-description {
  font-size: 1.15rem;
  color: var(--pico-muted-color);
  margin-bottom: 2rem;
}

/* Content area — readable width */
.domain-content {
  max-width: 72ch;
}

/* Section spacing */
.domain-content h2 {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--pico-muted-border-color);
}

.domain-content h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.domain-content h3 {
  margin-top: 2rem;
}

.domain-content h4 {
  margin-top: 1.5rem;
  color: #1a1a2e;
}

/* Blockquotes — testimonials and quotes */
.domain-content blockquote {
  border-left: 4px solid var(--pico-primary);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background-color: var(--pico-card-sectioning-background-color);
  border-radius: 0 var(--pico-border-radius) var(--pico-border-radius) 0;
  font-style: italic;
  color: var(--pico-color);
}

.domain-content blockquote p {
  margin-bottom: 0.5rem;
}

.domain-content blockquote p:last-child {
  margin-bottom: 0;
}

/* Lists — comfortable spacing */
.domain-content ul,
.domain-content ol {
  padding-left: 1.5rem;
}

.domain-content li {
  margin-bottom: 0.4rem;
}

/* Escalation ladder — numbered steps with visual progression */
.domain-content h3 {
  counter-reset: none;
}

/* Complaint templates — visually distinct sections */
.domain-content h3[id^="vzor"] ~ p,
.domain-content h3[id^="vzor"] ~ ul {
  /* Template content gets subtle background */
}

/* Template letter blocks — the actual complaint text areas */
.domain-content h3:is(
  [id*="vzor"],
  [id*="trenér"],
  [id*="klub"],
  [id*="sportovní-svaz"]
) + p {
  background-color: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 1.25rem;
  margin: 1rem 0;
}

/* Horizontal rules — subtle separator */
.domain-content hr {
  border: none;
  border-top: 1px solid var(--pico-muted-border-color);
  margin: 2.5rem 0;
}

/* Strong emphasis for key statements */
.domain-content > p > strong:first-child:last-child {
  display: block;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Tip blocks — informal callouts */
.domain-content p:has(> em:first-child) + p a,
.domain-content p > em:only-child {
  color: var(--pico-muted-color);
}

/* Mobile adjustments */
@media (max-width: 576px) {
  .domain-content {
    max-width: 100%;
  }

  .domain-content blockquote {
    margin-left: 0;
    margin-right: 0;
    padding: 0.5rem 1rem;
  }

  .domain-header h1 {
    font-size: 1.75rem;
  }

  .domain-content h2 {
    font-size: 1.4rem;
  }
}

/* ==========================================================================
   Crisis contacts banner
   ========================================================================== */

.crisis-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #2a9d8f;
  color: #fff;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  text-align: center;
}

.crisis-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.crisis-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.5rem;
  opacity: 0.85;
}

.crisis-banner a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.crisis-banner a:hover {
  color: #fff;
  opacity: 0.85;
}

.crisis-banner a + a::before {
  content: "\00b7";
  margin: 0 0.5rem;
  text-decoration: none;
  display: inline-block;
  opacity: 0.6;
}

/* ==========================================================================
   Exit button — quick escape
   ========================================================================== */

.exit-button {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  background: var(--color-accent-warm, #e76f51);
  color: #fff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--pico-border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.exit-button:hover {
  background: #d45a3a;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* ==========================================================================
   Template cards — complaint templates with copy-to-clipboard
   ========================================================================== */

.template-pair {
  margin: 2rem 0;
}

.template-card {
  background: var(--pico-card-background-color);
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.template-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--pico-muted-border-color);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
}

.template-header h4 {
  margin: 0;
  font-size: 1.05rem;
}

.copy-btn {
  background: var(--pico-primary);
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 0.5rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.15s ease;
  white-space: nowrap;
}

.copy-btn:hover {
  background: var(--pico-primary-hover);
}

.copy-btn.copied {
  background: #27ae60;
}

.copy-btn.failed {
  background: #e74c3c;
}

/* Override domain-content h3 styles inside template cards */
.template-body h3 {
  display: none;
}

.template-body h4 {
  margin-top: 0;
}

/* ==========================================================================
   Sensitive content disclosure
   ========================================================================== */

.sensitive-content {
  border-left: 3px solid var(--color-accent-warm);
  margin: 1.5rem 0;
  padding-left: 1rem;
}

.sensitive-content summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-accent-warm);
  padding: 0.5rem 0;
  list-style: none;
}

.sensitive-content summary::-webkit-details-marker {
  display: none;
}

.sensitive-content summary::before {
  content: "\25B6\00a0";
  font-size: 0.75em;
}

.sensitive-content[open] summary::before {
  content: "\25BC\00a0";
}

.sensitive-content summary:hover {
  text-decoration: underline;
}

.sensitive-content[open] {
  background: rgba(231, 111, 81, 0.05);
  padding: 1rem;
  border-radius: 0 var(--pico-border-radius) var(--pico-border-radius) 0;
}

/* ==========================================================================
   Print stylesheet
   ========================================================================== */

@media print {
  @page {
    margin: 2cm;
  }

  .crisis-bar,
  .crisis-banner,
  .exit-button,
  .copy-btn,
  nav,
  footer {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
  }

  .domain-content {
    max-width: 100%;
    font-size: 11pt;
  }

  /* Show all sensitive content in print */
  details.sensitive-content {
    display: block;
  }

  details.sensitive-content > summary {
    display: none;
  }

  details.sensitive-content > *:not(summary) {
    display: block;
  }

  .template-card {
    box-shadow: none;
    border: 1px solid #ccc;
    page-break-inside: avoid;
  }

  h2, h3 {
    page-break-after: avoid;
  }

  /* Show URLs for external links */
  a[href^="http"]:after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }

  /* But not for internal navigation */
  nav a[href]:after,
  .back-link:after {
    content: none;
  }
}

/* ==========================================================================
   Mobile — crisis banner adjustments
   ========================================================================== */

@media (max-width: 576px) {
  .crisis-bar {
    font-size: 0.78rem;
    padding: 0.35rem 0;
  }

  .crisis-label {
    font-size: 0.7rem;
    width: 100%;
    margin-right: 0;
    margin-bottom: 0.15rem;
  }
}

/* ==========================================================================
   Chat widget
   ========================================================================== */

.chat-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--pico-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.chat-toggle:hover {
  background: var(--pico-primary-hover);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

/* Shift chat bubble up when exit button is present */
body[data-exit-button] .chat-toggle {
  bottom: 5rem;
}

.chat-panel {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1001;
  width: 380px;
  height: 500px;
  background: #fff;
  border-radius: var(--pico-border-radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--pico-primary);
  color: #fff;
  padding: 0.75rem 1rem;
  flex-shrink: 0;
}

.chat-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.chat-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  opacity: 0.8;
  transition: opacity 0.15s ease;
}

.chat-close:hover {
  opacity: 1;
}

.chat-disclaimer {
  background: #fef9e7;
  padding: 0.3rem 0.75rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
  flex-shrink: 0;
}

.chat-disclaimer small {
  font-size: 0.7rem;
  color: var(--pico-muted-color);
  line-height: 1.3;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  max-width: 85%;
  padding: 0.6rem 0.9rem;
  border-radius: var(--pico-border-radius);
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message ul {
  margin: 0.25rem 0;
  padding-left: 1.25rem;
}

.chat-message li {
  margin-bottom: 0.15rem;
}

.chat-message.user {
  align-self: flex-end;
  background: var(--pico-primary);
  color: #fff;
}

.chat-message.bot {
  align-self: flex-start;
  background: #f0f0f0;
  color: var(--pico-color);
}

.chat-message.crisis {
  align-self: flex-start;
  background: #fff3f0;
  color: var(--pico-color);
  border-left: 3px solid var(--color-accent-warm);
  max-width: 90%;
}

.chat-sources {
  font-size: 0.75rem;
  color: var(--pico-muted-color);
  margin-top: 0.35rem;
}

.chat-form {
  display: flex;
  align-items: stretch;
  border-top: 1px solid var(--pico-muted-border-color);
  flex-shrink: 0;
  min-height: 48px;
}

.chat-input,
.chat-panel input[type="text"] {
  flex: 1;
  border: none !important;
  padding: 0.65rem 1rem !important;
  font-size: 0.9rem !important;
  outline: none !important;
  background: #fff !important;
  margin: 0 !important;
  border-radius: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
  color: var(--pico-color) !important;
}

.chat-input:focus,
.chat-panel input[type="text"]:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
  --pico-border-color: transparent;
}

.chat-input::placeholder {
  color: var(--pico-muted-color);
  opacity: 0.7;
}

.chat-send,
.chat-panel button[type="submit"] {
  background: var(--pico-primary) !important;
  color: #fff !important;
  border: none !important;
  padding: 0.65rem 1rem !important;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.15s ease;
  width: 48px !important;
  min-height: 0 !important;
  height: auto !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.chat-send:hover {
  background: var(--pico-primary-hover) !important;
}

/* Typing indicator */
.chat-typing .typing-dots span {
  animation: typingBounce 1.2s infinite;
  display: inline-block;
  font-size: 1.5rem;
  line-height: 1;
}

.chat-typing .typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing .typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

/* ==========================================================================
   Chat widget — mobile responsive
   ========================================================================== */

@media (max-width: 600px) {
  .chat-panel {
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    bottom: 0;
    right: 0;
  }

  .chat-close {
    font-size: 2rem;
    padding: 0 0.5rem;
  }
}

/* ==========================================================================
   Chat widget — print hide
   ========================================================================== */

@media print {
  .chat-widget {
    display: none !important;
  }
}
