﻿:root {
      --bg-main: #f8f9fa;
      --bg-card: #ffffff;
      --bg-input: #f5f6f7;
      --border-subtle: #e1e4e8;
      --accent: #0969da;
      --accent-soft: rgba(9, 105, 218, 0.15);
      --accent-2: #8250df;
      --text-main: #24292f;
      --text-muted: #57606a;
      --danger: #d1242f;
      --radius-md: 8px;
      --radius-lg: 12px;
      --shadow-soft: 0 8px 24px rgba(140, 149, 159, 0.2);
      --transition-fast: 150ms ease-out;
    }

.dsl-app {
      width: 100%;
      max-width: 1100px;
      background: transparent;
      border-radius: 20px;
      padding: 0;
      box-shadow: none;
      color: var(--text-main);
    }

/* Center the entire tool section on the page */
.tool-section {
  display: flex;
  justify-content: center;
}

    .dsl-inner {
      background: #ffffff;
      border-radius: 20px;
      padding: 24px 24px 18px;
      border: 1px solid var(--border-subtle);
      box-shadow: 0 2px 8px rgba(140, 149, 159, 0.1);
    }

    .dsl-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 16px;
      margin-bottom: 20px;
    }

    .dsl-title-block h1 {
      margin: 0 0 4px;
      font-size: 1.4rem;
      letter-spacing: 0.03em;
    }

    .dsl-title-block p {
      margin: 0;
      font-size: 0.86rem;
      color: var(--text-muted);
    }

    .dsl-badge {
      font-size: 0.75rem;
      color: var(--accent);
      border-radius: 999px;
      padding: 6px 12px;
      background: linear-gradient(135deg, rgba(9, 105, 218, 0.1), rgba(9, 105, 218, 0.05));
      border: 1px solid rgba(9, 105, 218, 0.25);
      display: inline-flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
    }

    .dsl-badge-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: var(--accent);
      box-shadow: 0 0 0 5px rgba(9, 105, 218, 0.2);
    }

    .dsl-main {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .dsl-textarea-wrapper {
      position: relative;
    }

    .dsl-label {
      font-size: 0.8rem;
      color: var(--text-muted);
      margin-bottom: 6px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .dsl-textarea {
      width: 100%;
      min-height: 220px;
      resize: vertical;
      border-radius: 12px;
      padding: 14px 12px;
      border: 1px solid var(--border-subtle);
      background: #ffffff;
      color: #111827;
      caret-color: #111827;
      font-size: 0.95rem;
      line-height: 1.55;
      outline: none;
      transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
    }

    .dsl-textarea::placeholder {
      color: rgba(87, 96, 106, 0.85);
    }

    .dsl-textarea::selection {
      background: rgba(9, 105, 218, 0.22);
      color: #111827;
    }

    .dsl-textarea:focus {
      border-color: var(--accent);
      box-shadow: 0 0 0 4px rgba(9, 105, 218, 0.18), 0 4px 12px rgba(9, 105, 218, 0.12);
      background: #ffffff;
    }

    .dsl-button-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: 10px;
      margin-top: 10px;
    }

    /* Mobile select wrapper (appears on <=480px) - native <select> kept as a fallback for non-JS and accessibility */
    .dsl-mobile-controls {
      display: none;
      margin-top: 10px;
    }

    .dsl-action-select {
      width: 100%;
      padding: 12px 14px;
      background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
      color: var(--text-main);
      border-radius: 12px;
      border: 1px solid var(--border-subtle);
      font-size: 0.95rem;
      outline: none;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      position: relative;
      /* Custom arrow (data URI) for the native select — improves visibility on most mobile devices */
      background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2357606a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
      background-repeat: no-repeat;
      background-position: right 12px center;
      background-size: 18px 18px;
      box-shadow: 0 2px 6px rgba(140, 149, 159, 0.15);
      z-index: 6;
    }

     /* Custom dropdown UI for consistent styling and keyboard accessibility (mobile fallback). 
       We keep the native select for progressive enhancement; the custom list is shown on mobile. */
    .dsl-custom-select { display: none; position: relative; width: 100%; }
    .dsl-custom-toggle {
      width: 100%;
      text-align: left;
      padding: 12px 14px;
      background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
      border-radius: 12px;
      color: var(--text-main);
      border: 1px solid var(--border-subtle);
      cursor: pointer;
      font-size: 0.95rem;
      display: flex; align-items: center; justify-content: space-between;
      transition: all 150ms ease-out;
    }
    .dsl-custom-toggle:hover {
      background: linear-gradient(135deg, rgba(9, 105, 218, 0.05), rgba(130, 80, 223, 0.05));
      border-color: var(--accent);
      box-shadow: 0 2px 8px rgba(9, 105, 218, 0.15);
    }
    .dsl-custom-toggle::after { content: '\25BE'; margin-left: 12px; opacity: 0.9; }
    .dsl-custom-list {
      display: none;
      position: absolute;
      left: 0; right: 0; top: calc(100% + 8px);
      background: var(--bg-card);
      border-radius: 10px;
      box-shadow: 0 8px 20px rgba(140, 149, 159, 0.25);
      border: 1px solid var(--border-subtle);
      max-height: 260px; overflow-y: auto; z-index: 9999;
    }
    .dsl-custom-item {
      display: block; width: 100%; text-align: left; padding: 10px 14px;
      background: transparent; color: var(--text-main); border: none; font-size: 0.94rem; cursor: pointer;
      transition: all 150ms ease-out;
    }
    .dsl-custom-item:hover, .dsl-custom-item:focus { 
      background: linear-gradient(90deg, rgba(9, 105, 218, 0.15), rgba(130, 80, 223, 0.1)); 
      color: var(--accent);
      font-weight: 500;
    }
    .dsl-custom-item.selected { 
      background: linear-gradient(90deg, rgba(9, 105, 218, 0.2), rgba(130, 80, 223, 0.15)); 
      color: var(--accent); 
      font-weight: 600;
      border-left: 3px solid var(--accent);
    }
    .dsl-custom-item:active { background: rgba(9, 105, 218, 0.25); }

    /* Mobile-only small action buttons (Copy + Clear) shown under the dropdown for quick access */
    .dsl-mobile-actions { display: none; gap: 12px; margin-top: 8px; justify-content: center; align-items: center; width: 100%; }

    button.dsl-btn.small {
      min-width: 70px;
      min-height: 44px;
      padding: 8px 12px; 
      border-radius: 12px;
      font-size: 0.82rem;
      display: inline-flex; align-items: center; justify-content: center;
      box-shadow: none;
      text-align: center;
    }
    button.dsl-btn.small span.icon {
      width: 1.2em;
      height: 1.2em;
      font-size: 1.05rem;
      line-height: 1;
      display: inline-flex;
      align-items: center; justify-content: center;
    }

    /* Utility class to hide elements visually while keeping them accessible to screen readers */
    .visually-hidden {
      position: absolute !important;
      height: 1px; width: 1px;
      overflow: hidden;
      clip: rect(1px, 1px, 1px, 1px);
      white-space: nowrap; /* prevent label from affecting layout */
      border: 0; padding: 0; margin: -1px;
    }

    /* Styles for native select options where browsers support it */
    .dsl-action-select option {
      background: var(--bg-card);
      color: var(--text-main);
      padding: 8px 10px;
    }

    .dsl-action-select option[disabled], .dsl-action-select option[value=""] {
      color: rgba(87, 96, 106, 0.6);
    }

    /* ON FOCUS: raise z-index and show focus ring so the dropdown appears above page content */
    .dsl-action-select:focus {
      box-shadow: 0 4px 12px rgba(9, 105, 218, 0.2), 0 0 0 4px rgba(9, 105, 218, 0.15);
      border-color: var(--accent);
      background: linear-gradient(180deg, rgba(9, 105, 218, 0.03) 0%, #f8f9fa 100%);
      z-index: 9999;
    }

    /* Hide native arrow in IE/Edge to use a custom arrow */
    .dsl-action-select::-ms-expand { display: none; }

    button.dsl-btn {
      border-radius: 14px;
      /* Use solid gradient background to avoid background bleeding across rounded button borders */
      border: 1px solid var(--border-subtle);
      background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
      color: var(--text-main);
      /* Padding, min-width and min-height set to create consistent button sizes */
      font-size: 0.8rem;
      cursor: pointer;
      display: inline-flex;
      /* Stack icon + label vertically for icon-above-label layout on buttons */
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 6px;
      transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast), color var(--transition-fast);
      box-shadow: 0 2px 6px rgba(140, 149, 159, 0.12);
      /* Allow label to wrap to a second line for compact buttons */
      white-space: normal;
      /* Prevent tall glyphs from overflowing the rounded button corners */
      line-height: 1;
      overflow: hidden;
      /* Button sizing for consistent layout: min-width/min-height/padding */
      padding: 12px 14px;
      min-height: 68px;
      min-width: 140px;
      text-align: center;
    }

    button.dsl-btn span.icon {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 1.9em;
      height: 1.9em;
      font-size: 1.35rem;
      line-height: 1;
      opacity: 1;
      overflow: visible; /* allow emoji color fonts to render inside the icon box */
      transform: translateZ(0);
    }

    /* Inline SVG icon sizing: use inline SVGs for icons to ensure consistent rendering across devices */
    button.dsl-btn span.icon svg {
      width: 1.25em;
      height: 1.25em;
      display: block;
    }

    /* Stack label under icon and keep it on a clean line */
    button.dsl-btn > span.label {
      display: block;
      margin-top: 6px;
      font-size: 0.82rem;
      font-weight: 500;
      white-space: normal;
      text-align: center;
      max-width: 100%;
      overflow: visible;
      text-overflow: clip;
      line-height: 1.15;
    }

    /* Keep primary/danger buttons the same size as other buttons */
    button.dsl-btn.primary, button.dsl-btn.danger {
      min-width: 140px;
      padding: 12px 14px;
    }

    button.dsl-btn:hover, button.dsl-btn:focus {
      background: linear-gradient(135deg, rgba(9, 105, 218, 0.08), rgba(130, 80, 223, 0.08));
      border-color: var(--accent);
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(9, 105, 218, 0.25), 0 0 0 3px rgba(9, 105, 218, 0.1);
      color: var(--accent);
    }

    button.dsl-btn.primary {
      background: linear-gradient(135deg, var(--accent), var(--accent-2));
      border-color: transparent;
      color: #ffffff;
      font-weight: 600;
      box-shadow: 0 4px 12px rgba(9, 105, 218, 0.25);
    }

    button.dsl-btn.primary:hover {
      background: linear-gradient(135deg, #0969da, #8250df);
      transform: translateY(-2px);
      box-shadow: 0 8px 20px rgba(9, 105, 218, 0.4), 0 0 0 4px rgba(9, 105, 218, 0.15);
      filter: brightness(1.15) saturate(1.1);
    }

    button.dsl-btn.danger {
      border-color: rgba(209, 36, 47, 0.3);
      color: var(--danger);
    }

    button.dsl-btn.danger:hover {
      background: linear-gradient(135deg, rgba(209, 36, 47, 0.12), rgba(255, 75, 129, 0.12));
      border-color: var(--danger);
      transform: translateY(-2px);
      box-shadow: 0 6px 16px rgba(209, 36, 47, 0.25), 0 0 0 3px rgba(209, 36, 47, 0.1);
      color: #b91c1c;
    }

    .dsl-tool-footer {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      gap: 10px;
      padding-top: 12px;
      margin-top: 12px;
      border-top: 1px solid var(--border-subtle);
      font-size: 0.8rem;
      color: var(--text-muted);
      background: transparent;
    }

    .dsl-metrics {
      display: inline-flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .dsl-metric-pill {
      border-radius: 999px;
      padding: 4px 10px;
      background: rgba(240, 242, 245, 0.9);
      border: 1px solid var(--border-subtle);
      display: inline-flex;
      align-items: baseline;
      gap: 4px;
    }

    .dsl-metric-label {
      text-transform: uppercase;
      font-size: 0.7rem;
      letter-spacing: 0.09em;
      color: var(--text-muted);
    }

    .dsl-metric-value {
      font-variant-numeric: tabular-nums;
      color: var(--accent);
      font-size: 0.82rem;
    }

    .dsl-status {
      font-size: 0.75rem;
      opacity: 0.85;
    }

    .dsl-status strong {
      color: var(--accent-2);
      font-weight: 500;
    }

    @media (max-width: 480px) {
.dsl-inner {
        padding: 18px 14px 14px;
      }

      .dsl-header {
        flex-direction: column;
        align-items: flex-start;
      }

      .dsl-badge {
        align-self: flex-start;
      }

      .dsl-button-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }
      /* Show mobile controls and hide the button grid on narrow devices */
      .dsl-mobile-controls { display: block; }
      .dsl-mobile-actions { display: flex; }
      .dsl-button-grid { display: none; }
      /* Use the custom dropdown for consistent styling; hide native select in our custom mobile view */
      .dsl-action-select { display: none; }
      .dsl-custom-select { display: block; }
    }

    @media (max-width: 480px) {
      .dsl-button-grid {
        grid-template-columns: minmax(0, 1fr);
      }
    }

/* Remove the global container bottom gap for this tool page */
        .main > .container{
          margin-bottom: 0;
        }
/* --- Article container (match SERP Preview Tool sizing + typography) --- */
#caseTool *{box-sizing:border-box}

#caseTool .wrap{max-width:1360px;margin:0 auto;padding:0}

#caseTool .content-card{
  margin-top: 100px; /* gap after tool section (same as SERP page) */
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#caseTool .content-card h2{
  margin: 0 0 12px 0;
  color: black;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 700;
}

#caseTool .content-card h3{
  margin: 18px 0 8px;
  color: black;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 600;
}

#caseTool .content-card p{
  margin: 0 0 12px;
  color: black;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
}

#caseTool .content-card ol,
#caseTool .content-card ul{
  margin: 0 0 12px;
  padding-left: 26px;
  list-style-position: outside;
  color: black;
  line-height: 1.55;
}

#caseTool .content-card ul{ list-style: disc; }
#caseTool .content-card ol{ list-style: decimal; }

#caseTool .content-card li{
  margin: 0 0 8px;
  color: black;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  display: list-item;
  padding-left: 6px;
}

