/* Word Counter — mobile app shell lock (high specificity) */
@media (max-width: 760px) {
  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-editor-root {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-areas: "toolbar" "editor" "stats" "footer" !important;
    gap: 0 !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .text-editor-toolbar {
    display: grid !important;
    grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
    grid-template-rows: 44px 44px 44px !important;
    grid-auto-flow: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 8px !important;
    padding: 10px !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0 !important;
    border-bottom: 1px solid #e5e7eb !important;
    background: #fff !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .text-editor-toolbar::before {
    content: "ToolsLuv / Word Counter" !important;
    grid-column: 1 / 5 !important;
    grid-row: 1 !important;
    display: flex !important;
    align-items: center !important;
    min-width: 0 !important;
    height: 44px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #172033 !important;
    -webkit-text-fill-color: #172033 !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .text-editor-count {
    grid-column: 5 / 7 !important;
    grid-row: 1 !important;
    width: auto !important;
    min-height: 44px !important;
    margin: 0 !important;
    padding-inline: 10px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
    background: #fff !important;
    border: 1px solid #dbe6f3 !important;
    border-radius: 12px !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .text-editor-toolbar [data-t1-action="paste"] { grid-column: 1 / 3 !important; grid-row: 2 !important; }
  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .text-editor-toolbar [data-t1-action="clear"] { grid-column: 3 / 5 !important; grid-row: 2 !important; }
  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .text-editor-toolbar [data-t1-action="copy"] { grid-column: 5 / 7 !important; grid-row: 2 !important; }
  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .text-editor-toolbar [data-t1-action="download"] { grid-column: 1 / 4 !important; grid-row: 3 !important; }
  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .text-editor-toolbar [data-t1-action="wrap"] { grid-column: 4 / 7 !important; grid-row: 3 !important; }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .text-editor-toolbar button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 44px !important;
    padding-inline: 8px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    gap: 6px !important;
    border: 1px solid #dbe6f3 !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
    white-space: nowrap !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .text-editor-toolbar button[aria-pressed="true"] {
    border-color: #bfdbfe !important;
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    -webkit-text-fill-color: #1d4ed8 !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] #textInput {
    grid-area: editor !important;
    min-height: 200px !important;
    height: 200px !important;
    max-height: 240px !important;
    padding: 16px !important;
    font-size: 16px !important;
    line-height: 1.55 !important;
    border: 0 !important;
    border-radius: 0 !important;
    resize: none !important;
    color: #172033 !important;
    -webkit-text-fill-color: #172033 !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-live-stats {
    grid-area: stats !important;
    display: grid !important;
    flex-direction: unset !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    min-height: 0 !important;
    padding: 14px !important;
    border-top: 1px solid #e5e7eb !important;
    border-left: 0 !important;
    background: #fff !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-live-stats::before {
    content: "Live Statistics" !important;
    grid-column: 1 / -1 !important;
    margin: 0 0 4px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #172033 !important;
    -webkit-text-fill-color: #172033 !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-stat-row,
  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-stat-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 4px !important;
    min-height: 72px !important;
    padding: 12px !important;
    border: 1px solid #e8eef5 !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%) !important;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.06) !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-stat-row span,
  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-stat-card span {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
    text-transform: uppercase !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-stat-row strong,
  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-stat-card strong {
    font-size: 18px !important;
    font-weight: 800 !important;
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    text-align: left !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .word-counter-footer-row {
    grid-area: footer !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px 14px 14px !important;
    border-top: 1px solid #e5e7eb !important;
    background: #fff !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .tool-workspace-note {
    flex-direction: column !important;
    align-items: stretch !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    border-radius: 16px !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .tool-workspace-note span {
    width: 100% !important;
    min-height: 44px !important;
    font-size: 14px !important;
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
  }

  /* Detailed analysis — premium card grid */
  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] #result.t1-detail-panel {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    overflow: visible !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-toggle {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 0 14px !important;
    border: 1px solid #dbe6f3 !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%) !important;
    color: #172033 !important;
    -webkit-text-fill-color: #172033 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06) !important;
    opacity: 1 !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-toggle[aria-expanded="true"] {
    border-color: #bfdbfe !important;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fbff 100%) !important;
    color: #1d4ed8 !important;
    -webkit-text-fill-color: #1d4ed8 !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-toggle svg {
    width: 18px !important;
    height: 18px !important;
    color: #2563eb !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s ease !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-toggle[aria-expanded="true"] svg {
    transform: rotate(180deg) !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-content {
    display: grid !important;
    grid-template-rows: 0fr !important;
    opacity: 0 !important;
    margin-top: 0 !important;
    overflow: hidden !important;
    transition: grid-template-rows 0.22s ease, opacity 0.18s ease, margin-top 0.22s ease !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-content.is-expanded {
    grid-template-rows: 1fr !important;
    opacity: 1 !important;
    margin-top: 10px !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-grid .result-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 72px !important;
    min-width: 0 !important;
    padding: 12px !important;
    border: 1px solid #e8eef5 !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 100%) !important;
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.06) !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-grid .result-item span {
    display: block !important;
    width: 100% !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: 0.03em !important;
    text-transform: uppercase !important;
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
    opacity: 1 !important;
    white-space: normal !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-grid .result-item strong {
    display: block !important;
    width: 100% !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    line-height: 1.35 !important;
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-grid .t1-detail-wide {
    grid-column: 1 / -1 !important;
    min-height: 0 !important;
  }

  html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-grid .t1-detail-wide strong {
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.45 !important;
    color: #172033 !important;
    -webkit-text-fill-color: #172033 !important;
  }

  html[data-theme="dark"] html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-toggle,
  html[data-theme="dark"] html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-grid .result-item {
    background: #fff !important;
    border-color: #e5e7eb !important;
    color: #172033 !important;
  }

  html[data-theme="dark"] html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-grid .result-item span {
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
  }

  html[data-theme="dark"] html[data-tl-mobile-v2="tool-v1"] body.flux-tool-text-tools main[data-tool="word-counter"] .t1-detail-grid .result-item strong {
    color: #2563eb !important;
    -webkit-text-fill-color: #2563eb !important;
  }
}
